agentleFS
mejbaurbaharmejbaurbahar/fagun/skills/test-automation/SKILL.md

test-automation

Skill1 starsChanged 4 months agoMITView on GitHub

Use when writing, structuring, or debugging automated tests — Playwright/Selenium E2E suites, pytest test design, page object models, CI test integration, and deciding what's worth automating.

5 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use exploratory-testing.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • testified-ossSkill

    exploratory-testing

    Guide exploratory testing sessions including charter creation, session-based testing, heuristics application, and finding documentation. Use when planning exploratory testing, conducting test sessions, or documenting discoveries.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Don't automate (or automate last):

    line 19
  2. Very specific:

    Locators: prefer role/text/testid locators over CSS/XPath — they survive markup churn.

    line 26
  3. Very specific:

    Waits: never use hard sleep(). Use Playwright's auto-waiting or explicit wait_for_selector / wait_for_load_state("networkidle").

    line 27
  4. Very specific:

    Use pytest -x --tb=short while iterating.

    line 35
  5. Very specific:

    Run it 5–10x locally (pytest --count=10 or a loop) to confirm flakiness vs.

    line 39
  6. Distinctive:

    Check for hard waits/timing assumptions, unseeded random data, shared state between tests, animation transitions not waited on.

    line 40
  7. Distinctive:

    If it's revealing a real race condition in the app, that's a product bug — report it, don't just harden the test to hide it.

    line 41
  8. Distinctive:

    Keep smoke suite under a few minutes.

    line 45

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “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
SKILL.md

Test Automation

Environment (this machine)

  • Python venv: ~/qa-agent/.venv/bin/python — has pytest, playwright, requests, locust.
  • Dispatcher: qa CLI (qa test, qa smoke, qa regression, qa security, qa report).
  • Chrome MCP tools are available for live-browser automation/inspection alongside scripted Playwright.

What to automate (and what not to)

Automate:

  • Regression-prone flows run repeatedly (login, checkout, core CRUD).
  • Anything that gates a release (smoke suite).
  • API contract checks — cheap to write, fast to run, high signal.

Don't automate (or automate last):

  • One-off exploratory checks.
  • Highly visual/subjective UI polish — use screenshots + manual review instead.
  • Flows still actively changing week to week (automation will just be a maintenance drag).

Playwright test structure

  • Page Object Model: one class per page/component encapsulating locators + actions. Tests read like user stories, not selector soup.
  • Locators: prefer role/text/testid locators over CSS/XPath — they survive markup churn. Add data-testid to the app if none exist and you own the code.
  • Waits: never use hard sleep(). Use Playwright's auto-waiting or explicit wait_for_selector / wait_for_load_state("networkidle").
  • Isolation: each test should set up its own data (via API/fixtures) and not depend on execution order or another test's leftover state.
  • Assertions: assert on the outcome (DB state, API response, final DOM state), not intermediate loading states.

pytest conventions

  • One fixture per external dependency (auth session, seeded user, API client) — compose via fixture injection, not copy-paste setup.
  • Parametrize equivalence-class/boundary cases with @pytest.mark.parametrize instead of near-duplicate test functions.
  • Mark slow/E2E tests (@pytest.mark.e2e) separately from fast unit/API tests so CI can run tiers independently.
  • Use pytest -x --tb=short while iterating; full traceback + -ra summary for CI runs.

Flaky test triage

A test that fails intermittently is a bug in the test (or a real race condition) — don't just retry-until-green:

  1. Run it 5–10x locally (pytest --count=10 or a loop) to confirm flakiness vs. one-off environment issue.
  2. Check for hard waits/timing assumptions, unseeded random data, shared state between tests, animation transitions not waited on.
  3. If it's revealing a real race condition in the app, that's a product bug — report it, don't just harden the test to hide it.

CI integration

  • Fail the build on any Blocker/Critical-severity assertion failure (see [[bug-reporting]] severity scale).
  • Keep smoke suite under a few minutes; push full regression to a separate longer-running job.
  • Persist screenshots/traces/videos on failure (~/qa-agent/reports/) — a failing assertion without evidence wastes the next debugging session.

Load/perf scripts

For scripted load testing use locust from the same venv — see [[performance-testing]] for methodology.

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.