@bigbinary/neeto-team-members-playwright

中文文档
1.0.5发布于 2026/10/29Apache-2.0TypeScriptES Module零依赖近 30 天下载 8203

Playwright helpers for the neeto team members nano.

原始使用文档
文档目录6 节
  1. Usage
  2. Member helpers
  3. Role helpers
  4. Selector changes (breaking)
  5. Local development
  6. Releasing

Team members Playwright helpers

@bigbinary/neeto-team-members-playwright contains the team member and role POMs, selectors, and types owned by this nano. It is versioned and published independently of @bigbinary/neeto-team-members-frontend.

Generic helpers stay in @bigbinary/neeto-playwright-commons. These POMs use commons for page commands, common selectors, filters, and exampleEmail.

Usage

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

yarn add -D @bigbinary/neeto-team-members-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": {
  "@neetoteammembers": [
    "./node_modules/@bigbinary/neeto-team-members-playwright"
  ]
}
import {
  MEMBER_SELECTORS,
  Member,
  MemberApis,
  ROLES_SELECTORS,
  RoleApis,
  RolesPage,
  TeamMembers,
} from "@neetoteammembers";
  • Construct TeamMembers with { page, neetoPlaywrightUtilities }. It drives the neeto-atoms sheet UI: radios, menuitem bulk actions, and column menus opened from the column header's button.
  • searchMemberByEmail(email) lowercases the address, then searches and verifies the row.
  • new Member(neetoPlaywrightUtilities) creates and updates members through the nano's REST API. Create sends user (emails, organization_role, app_roles). Update sends team (active, first_name, last_name, organization_role, email, and optional profile). Bulk update sends users (organization_role, active, emails).
  • Construct RolesPage with (page, neetoPlaywrightUtilities). It checks permissions by label. new RoleApis(neetoPlaywrightUtilities) sends organization_role (name, kind, description, permission_ids) and delete new_role_id.
  • The host's i18next fixture must load the nano translations before a POM is created.

Member helpers

  • MemberApis.fetchByEmail(email) queries active members using the server-side neeto_filters email condition and a lowercased email. fetch(params = {}) remains available for other scopes and pagination.
  • Member.getUserIdViaAPI(email) polls that filtered request for up to 60 seconds, matches case-insensitively, and returns the member id. It fails if no active member becomes available.
  • Member.addMemberViaRequest({ email, appName, ... }) waits for the creation job to finish, then returns the member id using that lookup.
  • Member.editMemberViaRequest, deactivateMemberViaRequest, and updateEmailViaAPI update profiles, deactivate members, and change email. generateRandomTeamMembers({ count, role }) creates test-data objects.
  • MemberApis.create, jobStatus, fetchPermissions, update, and bulkUpdate expose member creation, job polling, permission listing, and member updates.
  • TeamMembers.pageTitle is the members page title from the nano's taxonomyDefaultLabels.member.plural translation. Use it in page-title assertions instead of hard-coding the text.
  • TeamMembers.openMemberShowPage(email) searches by email, opens the matching name cell, and verifies the member page heading.
  • TeamMembers.navigateToTeamMembers, openMemberPane, fillMemberForm, submit, addMemberViaUI, editMemberViaUI, and removeMemberViaUI drive the members table and V2 member sheet.
  • searchAndVerifyMemberByEmail({ email }) and searchMemberByEmail(email) search and verify a row; getMemberRowByName(name) returns its row locator.
  • openFilterPane, filterMembersByMultiSelect, and filterMembers set member filters. takeActionOnMembers performs bulk actions; performColumnAction and toggleMemberColumns control table columns.
  • verifyMemberInTable({ name, email }) checks the row details; verifyNoDataTitle(email) verifies an empty search result; exportDetails(fileType, adminEmail) requests a member export.

Role helpers

  • RolesPage.pageTitle is the roles page title from the nano's neetoTeamMembers.common.role translation (plural). Use it in page-title assertions instead of hard-coding "Roles".

  • fetchSortedPermissions() returns permissions in numeric sequence order.

  • getPermissionIdsByName(names) verifies every requested name exists and returns its ids in sequence order. getPermissionDescriptionsByName(names) returns matching descriptions in the same order.

  • addCustomRoleByPermissionNamesViaRequest(roleName, names) creates a role with permissions selected by their internal names.

  • grantPermissionsByNameViaRequest(roleName, names) replaces the role's permissions and verifies the requested ids were granted. Its request contains id, kind, name, and permission_ids, without organization_id.

  • getRolePermissionCheckboxes(roleName, category) returns the category's permission checkboxes, excluding its first, category-level checkbox.

  • getTableCheckboxBesidePermission(roleName, description) returns the checkbox aligned with a permission description, excluding category-level rows.

  • verifyRolePermissionCheckboxStates({ roleName, checkedPermissionNames }) verifies checked and unchecked permissions across the expanded, unfiltered table. verifyAddRolePanePermissionStates(checkedPermissionNames) verifies the open role sheet using each permission's internal name.

  • getPermissionIds(targetPermissions, isGranularPermission) looks up permission ids by category, or by description when the second argument is true.

  • getRoleIdAndOrganizationId(roleName) resolves a role's identifiers. addCustomRoleViaRequest, editRoleViaRequest, and deleteRoleViaRequest create, edit, and delete roles through the API.

  • addRoleViaUI, editRoleViaUI, selectAndSubmitPermissions, and deleteRoleViaUI drive the role sheet and table actions.

  • verifyAddAndDeleteRole({ route, roleName }) opens the roles page, then adds and deletes a role with no permissions through the UI. route defaults to commons' ROUTES.adminPanel.roles, and roleName to a random 8-character name. Production health tests pass it to commons' health.verifyAppIsLive(customSteps), which no longer checks roles itself:

    test("should verify application is live", ({
      health,
      page,
      neetoPlaywrightUtilities,
    }) =>
      health.verifyAppIsLive(() =>
        test.step("3: Verify adding & removing roles", () =>
          new RolesPage(page, neetoPlaywrightUtilities).verifyAddAndDeleteRole())
      ));
    

    Products whose roles page is elsewhere pass route: CRM uses /admin/admin-panel/manageUsers/roles, Planner /admin-panel/general/roles, and Code, Runner, CI, Git, Tower, and Quiz /admin/admin-panel/roles.

  • verifyPermissions checks element visibility for a permission set; verifyRoleSpecificLinkAccess checks access to product-supplied routes.

  • RoleApis.fetch, addRole, editRole, and deleteRole expose the underlying member/permission/role listing and role mutation requests.

VerifyRolePermissionCheckboxStatesParams is explicitly exported alongside the existing public argument and response types.

Selector changes (breaking)

Added MEMBER_SELECTORS.manageRolesButton, changeRoleButton, rolesSearchInput, changeRoleOption(role), and filteredMembersCount from V2's action block. Added ROLES_SELECTORS.tablePermissionCard(category), tableCategoryTitle, and emptyCategoryRow from the V2 roles table.

Removed selectors with no literal or generated counterpart in the nano:

  • MEMBER_SELECTORS.deactivatedAgentsButton
  • MEMBER_SELECTORS.activatedMembersButton
  • MEMBER_SELECTORS.menuBarHeading
  • MEMBER_SELECTORS.statusTag
  • MEMBER_SELECTORS.subscriptionPlanTag
  • ROLES_SELECTORS.searchTextField

These removals require a minor release. The existing sheet selectors ROLES_SELECTORS.permissionCard, permissionCategoryTitle, and permissionCheckbox(name) remain distinct from the table selectors.

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-team-members-playwright

After the first publish, yalc push from playwright/ updates every product that added the package. Remove it with yalc remove @bigbinary/neeto-team-members-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-team-members-playwright 共发布 6 个版本,首次发布于 2026/10/16;过去 12 个月发布了 6 个版本。

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

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

@bigbinary/neeto-team-members-playwright 是什么?

Playwright helpers for the neeto team members nano.

如何安装 @bigbinary/neeto-team-members-playwright?

在项目目录运行 npm install @bigbinary/neeto-team-members-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-team-members-playwright 支持 TypeScript 吗?

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

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

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

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

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

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

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

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

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

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

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