agentleFS
QadrillionQadrillion/qadrillion-agent/.cursor/rules/test-automation.mdc

qadrillion-agent / rules

Cursor rule3 starsChanged 2 months agoMITView on GitHub

Test design and evidence rules for automation, fixtures, locators and collections in any runner. Apply when writing or reviewing tests.

The file

We split this test-automation.mdc into the rules it gives an agent

9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Observed locators: Prefer semantic role/name or accessible identifiers and explicit test IDs supported by the product.

    line 14
  2. Distinctive:

    Prefer the lowest effective layer, retain real integration/end-to-end paths, and state what stubs/mocks cannot establish.

    line 23
  3. Distinctive:

    Condition-based synchronization: Wait on observable state with a timeout and actionable diagnostic.

    line 25
  4. Distinctive:

    Isolated non-production targets: Verify target identity before mutation.

    line 28
  5. Distinctive:

    Use least-privilege test identities, run-specific data and task-owned cleanup.

    line 29
  6. Distinctive:

    Never derive a safety claim from an environment's label alone.

    line 30
  7. Distinctive:

    Preserve failures: No rerun-until-green. One diagnostic rerun at most for an explicit hypothesis.

    line 31
  8. Distinctive:

    Verify what exists: Run the repository's actual documented checks.

    line 41
  9. Distinctive:

    Keep evidence safe and useful: Do not hide failed checks, weaken assertions, copy credentials/customer data into logs, or upload artifacts …

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
test-automation.mdc
---
description: Test design and evidence rules for automation, fixtures, locators and collections in any runner. Apply when writing or reviewing tests.
globs:
  - "automation/**/*"
alwaysApply: false
---

# Test automation contract

1. **Independent state and oracle.** Each test declares setup and cleanup through
   the runner's fixture conventions. No ordering dependence or shared mutable
   account. Test login through UI when login is the subject; other tests may use
   safe API/session setup. Signup tests may create disposable accounts.
2. **Observed locators.** Prefer semantic role/name or accessible identifiers and
   explicit test IDs supported by the product. Prove uniqueness and behavior in
   the tested DOM/accessibility tree/build; record source provenance when source
   exists. Text is valid when it is the intended observable contract, with locale
   controlled. Avoid brittle positional selectors. Never invent identifiers or
   pretend source inspection proves the installed build. A locator registry is
   optional; missing IDs alone do not block usable semantic UI automation.
3. **Risk before volume.** Link each test to a criterion or failure risk; assert
   observable outcomes, not the implementation's own calculation repeated back.
   Prefer the lowest effective layer, retain real integration/end-to-end paths,
   and state what stubs/mocks cannot establish.
4. **Condition-based synchronization.** Wait on observable state with a timeout
   and actionable diagnostic. Do not add arbitrary sleeps or increase timeouts to
   hide failures. Timing may be an input when testing timing behavior itself.
5. **Isolated non-production targets.** Verify target identity before mutation.
   Use least-privilege test identities, run-specific data and task-owned cleanup.
   Never derive a safety claim from an environment's label alone.
6. **Preserve failures.** No rerun-until-green. One diagnostic rerun at most for
   an explicit hypothesis; retain both outputs. Assertion, product, fixture,
   locator and infrastructure classifications require evidence.
7. **Expected failures stay visible.** A quarantine/xfail needs a linked defect,
   owner, reason and review date. Use strict unexpected-pass behavior if supported;
   otherwise inspect/report it separately. Do not silently enable runner retries
   that mask first failures or claim known-broken criteria passed.
8. **Respect the source of truth.** Git-managed tests/collections are edited in
   Git. Cloud-managed collections are edited through the authorized service and
   synced. Determine ownership first; neither model is universal.
9. **Verify what exists.** Run the repository's actual documented checks. Record
   command, cwd, target/build and exit status with redacted artifacts. Zero tests,
   skipped-only runs and collection parsing are not a testing Pass.
10. **Keep evidence safe and useful.** Do not hide failed checks, weaken assertions,
    copy credentials/customer data into logs, or upload artifacts outside approved
    storage. Retain full redacted output outside the prompt; quote decisive lines.
    Artifact creation or extraction is not inspection. Name which contents were
    actually reviewed and the resulting observation; do not invent visual review
    or reorder the action history in a report.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.