Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/antdigital-ai/agentic-uiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/antdigital-ai/agentic-ui/playwright)<a href="https://agentmods.dev/rules/antdigital-ai/agentic-ui/playwright"><img src="https://agentmods.dev/badge/rules/antdigital-ai/agentic-ui/playwright/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/antdigital-ai/agentic-ui/playwright"><img src="https://agentmods.dev/badge/rules/antdigital-ai/agentic-ui/playwright.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02559 | $0.02559 |
| Opus 5.5 | $0.01024 | $0.01024 |
| Sonnet 5.5 | $0.00512 | $0.00512 |
| Haiku 4.5 | $0.00256 | $0.00256 |
Grade A, and why
playwright scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 236 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Playwright 自动化测试编写规范:构建高稳定性(Flaky-Free)的测试体系
1. 核心原则:为何测试会失败?
在制定规范前,需明确 Playwright 测试失败的三大核心根因。编写"高成功率"测试的本质,就是通过规范消除这三个变量:
竞态条件 (Race Conditions)
脚本执行速度快于页面渲染速度(如点击了尚未绑定事件的按钮)。
DOM 易变性 (DOM Volatility)
页面结构或样式变化导致选择器失效。
环境不确定性 (Environmental Flakiness)
网络延迟、API 500 错误或第三方服务宕机。
本规范将围绕**"确定性执行 (Deterministic Execution)"**这一目标展开。
2. 目录结构与命名规范 (TypeScript)
采用**领域驱动(Domain-Driven)**结构,将测试与业务逻辑解耦。推荐使用 TypeScript 以获得强类型支持,这直接关联到代码维护的稳定性。
2.1 推荐目录结构
tests/
├── e2e/
│ ├── auth.setup.ts # 全局认证设置(生成 storageState)
│ ├── checkout/ # 业务模块目录
│ │ ├── guest-checkout.spec.ts
│ │ └── payment-flow.spec.ts
│ └── dashboard/
│ └── analytics.spec.ts
├── fixtures/ # 自定义测试夹具 (Dependency Injection)
│ ├── db-fixture.ts # 数据库操作封装
│ └── page-fixture.ts # Page Object 自动注入
├── pages/ # Page Object Models (POM)
│ ├── CheckoutPage.ts
│ └── components/ # 可复用组件 (如 DatePicker, Modal)
├── test-data/ # 静态测试数据
├── playwright.config.ts # 全局配置
└── .eslintrc.json # 强制代码规范配置
2.2 命名规范
- 文件命名:使用 kebab-case,后缀为
.spec.ts。例如user-login.spec.ts。 - 类命名 (POM):使用 PascalCase。例如
LoginPage,ShoppingCartPage。 - 测试标题:必须表达业务价值而非操作细节。
- ❌
test('click button and check div') - ✅
test('should display order confirmation after successful payment')
- ❌
3. 高稳定性选择器策略 (Selector Strategy)
稳定性黄金法则:测试应当像用户一样通过"视觉"和"内容"来寻找元素,严禁依赖页面内部实现(CSS 类名、XPath)。
3.1 优先级金字塔
请严格按照以下顺序选用 Locator:
page.getByRole() (最高优先级)
理由:它是最稳定的选择器。它模拟用户和辅助技术(Screen Readers)的交互。如果页面样式变了但功能没变(例如"登录"按钮变成了一个图标但 ARIA 角色还是 button),测试依然通过。
示例:
await page.getByRole('button', { name: 'Submit' }).click();
page.getByText()
理由:适用于非交互性文本内容的验证。
示例:
await expect(page.getByText('Welcome, User')).toBeVisible();
page.getByTestId() (特定场景)
理由:当元素没有任何语义(如纯 div 容器)且必须定位时使用。需在前端代码中添加 data-testid 属性。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 236 lines · 2,559 tokens per session scan A b3ee73bf5cec
playwright is a cursor rule published in the GitHub repository antdigital-ai/agentic-ui (237 stars, last pushed 1mo ago), licensed MIT. It adds 2,559 tokens to every session, about $0.0102 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
playwright compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| playwrightantdigital-ai/agentic-ui | Cursor rule | 237 | 1mo ago | MIT | A | 2,559 | Cursor |
| puppeteersanjeed5/awesome-cursor-rules-mdc | Cursor rule | 3.6k | 8d ago | CC0-1.0 | A | 1,826 | Cursor |
| playwright-rulesbeel-collab/presets.dev | Cursor rule | 3 | 8d ago | MIT | A | 0 | Cursor |
| vasu-playwright-utilsvasu31dev/playwright-ts-lib | Cursor rule | 25 | 8mo ago | MIT | A | 14 | Cursor |
| qa-script-executorazam-sdet/10xquality | Cursor rule | 2 | 8mo ago | MIT | A | 0 | Cursor |
| playwrightTideTree/awesome-cursor-rules-mdc-zh | Cursor rule | 14 | 8mo ago | none | A | 0 | Cursor |
| playwrightnedcodes-ok/cursor-doctor | Cursor rule | 10 | 8mo ago | MIT | A | 643 | Cursor |