agentleFS
mejbaurbaharmejbaurbahar/software-tester-skills/skills/test-automation/SKILL.md

test-automation

Skill1 starsChanged 54 days 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

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 2

    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. Very specific:

    Put each check at the lowest level that can catch the bug (test-architect): many unit, a healthy layer of API/integration, few UI journeys.

    line 22
  2. Distinctive:

    Prefer the language your developers already use so they can own and fix the tests.

    line 34
  3. Very specific:

    Waits: never hard sleep(); use auto-wait and explicit conditions (expect(locator).toBeVisible(), wait_for_selector, poll-until with …

    line 38
  4. Distinctive:

    Assert outcomes,: not implementation or intermediate loading states.

    line 41
  5. Very specific:

    Do not retry-until-green. Reproduce (--repeat-each), classify the cause, fix the root cause, and quarantine with an owner and deadline …

    line 75
  6. Very specific:

    Run tiers: smoke on every PR (< 5 min), targeted regression per PR, full nightly (regression-testing, cicd-testing).

    line 78

“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

Automation is software: it needs design, review, and maintenance. Automate to get fast, trustworthy feedback, not to hit a count.

What to automate (and what not)

AutomateDelay or avoid
Repeated, regression-prone flows (login, checkout, core CRUD)One-off exploratory checks
Release gates (smoke)Highly visual/subjective polish (use screenshots + review, visual-testing)
API/contract checks: cheap, fast, high signalFlows still changing weekly (maintenance drag)
Data-heavy rule matrices (parametrized)Anything you cannot make deterministic yet
Put each check at the lowest level that can catch the bug (test-architect): many unit, a healthy layer of API/integration, few UI journeys.

Choose the framework

NeedGood options
Modern web E2EPlaywright (multi-browser, auto-wait, tracing), Cypress
Legacy/grid/enterpriseSelenium WebDriver (+ Selenide, WebDriverIO)
APIpytest + requests/httpx, REST Assured, Karate, Hurl, supertest
Unitpytest, Jest/Vitest, JUnit 5, Go testing, xUnit/NUnit
MobileAppium, Maestro, Detox, XCUITest, Espresso (mobile-testing)
BDDCucumber, Behave, Reqnroll (bdd-gherkin-testing)
VisualPlaywright screenshots, Percy, Chromatic, Applitools
Prefer the language your developers already use so they can own and fix the tests.

Design rules that keep suites healthy

  • Locators: role/label/text/test-id over CSS/XPath; add data-testid if you own the app.
  • Waits: never hard sleep(); use auto-wait and explicit conditions (expect(locator).toBeVisible(), wait_for_selector, poll-until with timeout).
  • Isolation: each test creates its own data (API/fixtures), never depends on order or another test's leftovers; unique IDs per worker.
  • Fast login: authenticate once via API and reuse storage state instead of driving the login UI every test.
  • Assert outcomes, not implementation or intermediate loading states; one behavior per test; meaningful names.
  • Page Object / component objects / fixtures: encapsulate locators and actions so tests read like user stories; keep assertions in tests, not page objects.
  • Test data: builders/factories, not shared static rows (test-data-engineering). Reset state cheaply (transaction rollback, DB template, API teardown).
  • Determinism: freeze time and seed randomness (date-time-timezone-testing); stub 3rd parties (test-environment-management).
  • Independent of environment: base URL and credentials via env vars/secret store, never hard-coded.

Examples

// Playwright: fixture + role locators + web-first assertions
import { test as base, expect } from '@playwright/test';
const test = base.extend<{ cart: CartPage }>({ cart: async ({ page }, use) => { await use(new CartPage(page)); } });
test('applies coupon once', async ({ page, cart }) => {
  await cart.open(); await cart.applyCoupon('WELCOME10');
  await expect(page.getByRole('status')).toHaveText(/10% off applied/);
  await expect(cart.total).toHaveText('$90.00');
});
# pytest: fixtures + parametrization + markers
@pytest.fixture
def api(base_url): return Api(base_url, token=make_token(role="user"))

@pytest.mark.parametrize("qty,ok", [(0, False), (1, True), (99, True), (100, False)])
@pytest.mark.api
def test_quantity_limits(api, qty, ok):
    assert (api.add_to_cart("A-1", qty).status_code == 200) == ok
pytest -m "not e2e" -x --tb=short -q          # fast tier while developing
pytest -n auto --maxfail=5 -ra                # parallel CI run (pytest-xdist)
npx playwright test --workers=4 --retries=1 --trace=on-first-retry

Flaky tests are bugs

Do not retry-until-green. Reproduce (--repeat-each), classify the cause, fix the root cause, and quarantine with an owner and deadline (flaky-test-management). A real race condition in the app is a product bug: report it.

CI integration

Run tiers: smoke on every PR (< 5 min), targeted regression per PR, full nightly (regression-testing, cicd-testing). Shard and parallelize; publish JUnit/HTML reports, screenshots, traces and videos on failure; fail the build on real failures, not on infrastructure noise. Track duration and flake rate (test-metrics-reporting).

Maintainability checklist

Naming conventions · code review for tests · no copy-paste (extract helpers) · delete obsolete tests · lint tests (no .only, no sleep) · dependency updates automated · README for running locally in one command.

Related

e2e-testing, unit-testing, api-testing, flaky-test-management, cicd-testing, test-environment-management

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.