@bigbinary/neeto-tags-playwright

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

Playwright helpers for the neeto tags nano.

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

Tags Playwright helpers

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

Usage

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

yarn add -D @bigbinary/neeto-tags-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": {
  "@neetotags": ["./node_modules/@bigbinary/neeto-tags-playwright"]
}
import {
  MERGE_TAGS_SELECTORS,
  TAGS_SELECTORS,
  TagsApi,
  TagsPage,
} from "@neetotags";
  • Construct TagsPage with (page, neetoPlaywrightUtilities, tagsRequestUrl?). It drives the nano's /v2 dashboard, merge flow, and entity tag picker UI. Pass tagsRequestUrl when the host serves the tags API somewhere other than ${BASE_URL}/admin/tags (/api/v1/admin/tags), for example ${BASE_URL}/desk/tags in neetoDesk.
  • addTagViaUI({ tagName, description, addTagsLabel }), fillTagDetails, editTagViaUI, verifyTag, deleteTagViaUI, attemptDeleteTagViaUIAndExpectError, searchAndVerifyTags, and filterTagsViaUI drive the tags dashboard and form sheet. getTagRow(tagName) returns the matching dashboard row locator.
  • addTagViaRequest({ name, description, style }) creates a tag through the API and returns it. deleteTagViaRequest(tagId) deletes one. deleteTagsByNameViaRequest(names) fetches tags from the configured URL and deletes every returned tag whose name exactly matches an entry in names. It does nothing when no names match.
  • navigateToMergeTagsPage() opens the merge page. Call it before mergeTags({ sourceTags, destinationTag }) or mergeAndVerifyTagsViaUI, then use verifyMergedTags to check the result. searchAndSelect({ selector, tagName, rowSelector }) searches and selects a source or destination tag in the merge form.
  • assignTag({ tagName, pickerTestId, create }) and removeAssignedTag({ tagName }) drive the entity TagsComponent picker and selected tag badges. By default, assignTag finds the V2 popover's combobox by its translated search placeholder. Pass pickerTestId for a host-specific input, including an inline picker.
  • verifyTagOption(tagName, { visible = true } = {}) opens the V2 popover, searches for the name, checks the matching option's visibility, and closes the picker. Use { visible: false } for a missing or already assigned tag. Its options type is exported as VerifyTagOptionProps.
  • new TagsApi(neetoPlaywrightUtilities, tagsRequestUrl?) wraps the nano's REST endpoints: fetch(params), create({ name, description, style }), update({ id, ... }), delete(id), and merge({ primaryId, secondaryId }).
  • The host's i18next fixture must load the nano translations before a POM is created.

Breaking selector removals

The following TAGS_SELECTORS keys were removed because V2 does not render them:

  • deleteTagButton and tagContainer: use COMMON_SELECTORS.badgeCloseButton and COMMON_SELECTORS.badgeContainer for V2 badges.
  • metaDataBlock, tagItemsCountButton, and metaDataCard: V1-only IDs.
  • tagSearchField: neither the nano nor neeto-atoms generates select-tag-container. The V2 popover uses an optional host-supplied test ID; the inline Select generates <prefix>-select-input. Use assignTag's default popover lookup or pass the host's actual input ID as pickerTestId.

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-tags-playwright

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

Releasing

Add playwright and exactly one of patch, minor, or major, then add release last to enter the NeetoTower release gate described in the root README. Removing public selectors requires minor. After the gate merges the PR, the NeetoCI bump workflow publishes this package and opens the Bump version PR.

版本与发布记录

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

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

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

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

Playwright helpers for the neeto tags nano.

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

在项目目录运行 npm install @bigbinary/neeto-tags-playwright,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@faker-js/faker(10.5.0)、@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-tags-playwright 支持 TypeScript 吗?

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

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

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

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

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

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

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

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

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

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

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