@bigbinary/neeto-webhooks-playwright

中文文档
1.0.3发布于 2026/10/28Apache-2.0TypeScriptES Module零依赖近 30 天下载 5038

Playwright helpers for the neeto webhooks nano.

原始使用文档
文档目录3 节
  1. Usage
  2. Local development
  3. Releasing

Webhooks Playwright helpers

@bigbinary/neeto-webhooks-playwright contains the webhook POM, selectors, and types owned by this nano. It is versioned and published independently of @bigbinary/neeto-webhooks-frontend.

The generic webhook.site API (WebhookSiteApi) and constants (DEFAULT_WEBHOOKS_RESPONSE_TEXT) stay in @bigbinary/neeto-playwright-commons; WebhooksPage uses commons' WebhookSiteApi.

Usage

Install it in the consuming product's playwright-tests/ directory:

yarn add -D @bigbinary/neeto-webhooks-playwright

The product supplies the peer dependencies listed in package.json, including @bigbinary/neeto-playwright-commons. The frontend package is not required.

Like commons, the package is ES-module only, and Playwright loads specs as CommonJS. Add a path alias next to @neetoplaywright in the product's playwright-tests/tsconfig.json, and import through it.

"paths": {
  "@neetowebhooks": ["./node_modules/@bigbinary/neeto-webhooks-playwright"]
}
import {
  WebhooksApi,
  WebhooksPage,
  WEBHOOK_HEADERS,
  WEBHOOK_SELECTORS,
} from "@neetowebhooks";
  • Construct WebhooksPage with { page, neetoPlaywrightUtilities }, as before. The secret menu and delivery details helpers target the /v2 Sheet UI.
  • addWebhook({ webhookSiteURL, event }) checks the event with that label, or the first listed event when event is omitted, and saves.
  • performTableAction(endpoint, "edit" | "delete") and performLinkAction("regenerate" | "delete") open a webhook's row or secret menu actions.
  • openMatchingDelivery<Payload>({ matches }) opens deliveries until matches(payload, headerText) returns true. Pass the product's payload type.
  • verifyHeaders() checks the WEBHOOK_HEADERS signature headers, and verifyResponse() checks the delivery's response body.
  • getTokenViaAPI() returns { webhookToken, webhookSiteURL }, and verifyLatestWebhookResponse({ webhookToken, callback }) checks the latest request webhook.site received.
  • new WebhooksApi(neetoPlaywrightUtilities) wraps the nano's REST API: fetch, create({ entityType, entityId, endpoint, events }), delete, fetchDeliveries, showDelivery, and redeliver(webhookId, deliveryId). Delivery methods take webhook and delivery sid values; delete takes the webhook's database id. redeliver posts to the delivery's /redeliver route.
  • getWebhookIdViaRequest({ entityId, endpoint }) returns the matching webhook's database id, or undefined if it is absent.
  • deleteWebhookViaRequest({ entityId, endpoint }) deletes the matching webhook; an absent endpoint is a no-op.
  • deleteWebhookViaUI(endpoint) deletes a row on the current webhook page, confirms the alert, verifies the toast, and waits for the row to disappear.
  • setWebhookEvents(endpoint, events) edits a webhook so only the supplied event labels are checked, saves changes, and verifies the row. If those events are already selected, it closes the unchanged sheet.
  • findDeliveryViaRequest(webhookId, predicate) reads the listed deliveries in order and returns the first WebhookDelivery whose parsed request_body satisfies the predicate, or undefined. It skips deliveries with no body and passes the full parsed body to the predicate. Use the returned sid for API requests and identifier for the delivery's UI link.
  • verifyWebhookDeliveries({ callback, ...fields }) verifies a successful delivery and passes its parsed webhook payload to the callback.
  • verifyWebhookDeliveryByEvent({ event, callbackToVerifyDeliveries, ...fields }) opens an event's delivery and runs that payload verification.
  • The host's i18next fixture must load the nano translations before a POM is created.

The package explicitly exports FindWebhookParams, WebhookRecord, and WebhookDelivery along with its existing argument and callback types.

Local development

To try unreleased changes in a product, publish with yalc from this directory, then add the package in the product's playwright-tests/ directory. Remove the yalc link before committing so the product's manifest and lockfile stay unchanged:

yarn build && yalc publish
cd path/to/product/playwright-tests
yalc add --dev @bigbinary/neeto-webhooks-playwright

After the first publish, yalc push from playwright/ updates every product that added the package. Remove it with yalc remove @bigbinary/neeto-webhooks-playwright.

Releasing

Merge a PR with the playwright label and a patch, minor, or major label. The existing NeetoCI bump workflow publishes this package and opens the Bump version PR.

版本与发布记录

@bigbinary/neeto-webhooks-playwright 共发布 4 个版本,首次发布于 2026/10/15;过去 12 个月发布了 4 个版本。

版本发布日期距今
1.0.3latest2026/10/2811 天前
1.0.22026/10/1623 天前
1.0.12026/10/1523 天前
0.0.0-stage2026/10/1523 天前

关于 @bigbinary/neeto-webhooks-playwright 的常见问题

@bigbinary/neeto-webhooks-playwright 是什么?

Playwright helpers for the neeto webhooks nano.

如何安装 @bigbinary/neeto-webhooks-playwright?

在项目目录运行 npm install @bigbinary/neeto-webhooks-playwright,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@playwright/test(1.63.0)、@bigbinary/neeto-cist(1.0.17)、playwright-i18next-fixture(1.0.0)、@bigbinary/neeto-playwright-commons(^5.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@bigbinary/neeto-webhooks-playwright 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@bigbinary/neeto-webhooks-playwright 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@bigbinary/neeto-webhooks-playwright 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.13。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bigbinary/neeto-webhooks-playwright 可以商用吗?

@bigbinary/neeto-webhooks-playwright 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@bigbinary/neeto-webhooks-playwright 的下载量有多少?

根据 npm 官方下载统计,@bigbinary/neeto-webhooks-playwright 在 2026/10/08 – 2026/11/06 这 30 天内被下载 5,038 次,日均约 168 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bigbinary/neeto-webhooks-playwright 还在维护吗?

最新版本 1.0.3 发布于 2026/10/28(11 天前);至今共发布 4 个版本,其中过去 12 个月发布了 4 个;首次发布于 2026/10/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。