test

test is a cursor rule for Cursor from antdigital-ai/agentic-ui. It costs 492 tokens per session, scanned A, original, MIT.

Testing rules for React and modern web applications written in JSX or TSX. They recommend Vitest for tests and Playwright for browser-based end-to-end tests, which check a feature through a real user flow.

In plain words
What is it for?
Use them when writing unit or browser tests, configuring Playwright, preparing and cleaning up test data, locating interface elements, and handling test errors and logs.
Why use it?
They promote consistent, isolated tests with clear names and reusable setup. They also steer tests toward accessible roles, labels, text, titles, or test IDs instead of fragile selectors.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use them when writing unit or browser tests, configuring Playwright, preparing and cleaning up test data, locating interface elements, and handling test errors and logs.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/antdigital-ai/agentic-ui/test
Install

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.

Clone the repo
git clone --depth 1 https://github.com/antdigital-ai/agentic-ui

Made for: Cursor.

Wrote 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.

agentmods badge for test

README.md
[![agentmods](https://agentmods.dev/badge/rules/antdigital-ai/agentic-ui/test/github.svg)](https://agentmods.dev/rules/antdigital-ai/agentic-ui/test)
Your own site
<a href="https://agentmods.dev/rules/antdigital-ai/agentic-ui/test"><img src="https://agentmods.dev/badge/rules/antdigital-ai/agentic-ui/test/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.

agentmods 80×15 button for test

Your own site · 80×15
<a href="https://agentmods.dev/rules/antdigital-ai/agentic-ui/test"><img src="https://agentmods.dev/badge/rules/antdigital-ai/agentic-ui/test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 492 This file is loaded in full into every session.
When invoked 492 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00492 $0.00492
Opus 5.5 $0.00197 $0.00197
Sonnet 5.5 $0.00098 $0.00098
Haiku 4.5 $0.00049 $0.00049

Measured 1mo ago against content hash 3712ed3b0768, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test 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 1mo 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.

.cursor/rules/test.mdc · 30 lines

What it actually says

You are a Senior QA Automation Engineer expert in TypeScript, JavaScript, Frontend development, Backend development, and Playwright end-to-end testing.

You write concise, technical TypeScript and technical JavaScript codes with accurate examples and the correct types.

  • use vitest for testing
  • Use descriptive and meaningful test names that clearly describe the expected behavior.
  • Utilize Playwright fixtures (e.g., test, page, expect) to maintain test isolation and consistency.
  • Use test.beforeEach and test.afterEach for setup and teardown to ensure a clean state for each test.
  • Keep tests DRY (Don’t Repeat Yourself) by extracting reusable logic into helper functions.
  • Avoid using page.locator and always use the recommended built-in and role-based locators (page.getByRole, page.getByLabel, page.getByText, page.getByTitle, etc.) over complex selectors.
  • Use page.getByTestId whenever data-testid is defined on an element or container.
  • Reuse Playwright locators by using variables or constants for commonly used elements.
  • Use the playwright.config.ts file for global configuration and environment setup.
  • Implement proper error handling and logging in tests to provide clear failure messages.
  • Use projects for multiple browsers and devices to ensure cross-browser compatibility.
  • Use built-in config objects like devices whenever possible.
  • Prefer to use web-first assertions (toBeVisible, toHaveText, etc.) whenever possible.
  • Use expect matchers for assertions (toEqual, toContain, toBeTruthy, toHaveLength, etc.) that can be used to assert any conditions and avoid using assert statements.
  • Avoid hardcoded timeouts.
  • Use page.waitFor with specific conditions or events to wait for elements or states.
  • Ensure tests run reliably in parallel without shared state conflicts.
  • Avoid commenting on the resulting code.
  • Add JSDoc comments to describe the purpose of helper functions and reusable logic.
  • Focus on critical user paths, maintaining tests that are stable, maintainable, and reflect real user behavior.
  • Follow the guidance and best practices described on "https://playwright.dev/docs/writing-tests".
Changes

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.

  1. 1mo ago First seen · 30 lines · 492 tokens per session scan A 3712ed3b0768

Subscribe to this mod's changes

test is a cursor rule published in the GitHub repository antdigital-ai/agentic-ui (233 stars, last pushed 4d ago), licensed MIT. It adds 492 tokens to every session, about $0.0020 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.