Testers who understand quality — who can spot a bug from a mile away and reason about user flows, edge cases, and risk — are routinely told to “learn to code” when they want that judgment turned into automation. Most of them can. The actual barrier is that automation frameworks are written by developers for developers: opaque selectors, no explanation of why a given assertion exists, no guidance on what’s worth testing in the first place. Writing the test is the easy part. Deciding what deserves coverage is the part that takes judgment.
When this skill runs, both parts are your job: pick the right coverage categories for the scenario described, then write the test so a non-developer tester reading it later can follow — and learn from — every step.
Not every category applies to every scenario — a balanced suite covers the categories that are actually relevant, not all nine reflexively. Weigh each one against what was described:
If a category is relevant but needs tooling outside what’s in the repo (a load-testing harness, a Lighthouse run), don’t fake its output. Keep the executable Playwright code to what can actually run, and leave a comment noting the follow-up work that would need separate tooling.
@playwright/test (test, expect) — nothing else.getByRole, getByLabel,
getByPlaceholder, getByText — over CSS selectors. CSS selectors
couple the test to implementation details that change without the
user-visible behavior changing.test.describe blocks named after each area (e.g.
test.describe('Accessibility', ...)), so the categories stay legible
in the output rather than interleaved.TODO stubs — if something can’t be
implemented for real, leave it out and note why in a comment rather
than stubbing it.Description given to the skill:
Test the login page at https://example.com/login. There’s an email field, a password field, and a “Sign in” button. On success the user is redirected to /dashboard which shows a welcome heading. On invalid credentials, an inline error message appears without navigating away. The page should also work well on mobile.
Reading that against the category list in step 1: this is a login form with a stated success/failure outcome (Functional — clearly in scope) and an explicit mobile-layout requirement (Responsive/mobile — clearly in scope). Nothing in the description touches performance, security, accessibility, usability, SEO, cookies, or persistence, so those categories are left out rather than added reflexively — each of the two describe blocks below maps to preconditions, inputs, and expected results for its cases, the same shape ISTQB uses for a test case: a known starting state, what’s entered or done, and what should be observably true afterward.
Resulting test file:
import { test, expect } from '@playwright/test';
const BASE_URL = 'https://example.com';
test.describe('Functional', () => {
test('user can sign in with valid credentials and lands on the dashboard', async ({ page }) => {
// Go to the login page
await page.goto(`${BASE_URL}/login`);
// Fill in valid credentials
await page.getByLabel('Email').fill('test.user@example.com');
await page.getByLabel('Password').fill('correct-horse-battery-staple');
// Submit the form
await page.getByRole('button', { name: 'Sign in' }).click();
// The user should land on the dashboard and see a welcome heading
await expect(page).toHaveURL(`${BASE_URL}/dashboard`);
await expect(page.getByRole('heading', { name: /welcome/i })).toBeVisible();
});
test('invalid credentials show an inline error without navigating away', async ({ page }) => {
await page.goto(`${BASE_URL}/login`);
await page.getByLabel('Email').fill('test.user@example.com');
await page.getByLabel('Password').fill('wrong-password');
await page.getByRole('button', { name: 'Sign in' }).click();
// An inline error appears, and the user stays on the login page
await expect(page.getByText(/invalid|incorrect/i)).toBeVisible();
await expect(page).toHaveURL(`${BASE_URL}/login`);
});
});
test.describe('Responsive/mobile', () => {
const viewports = [
{ name: 'phone', width: 375, height: 667 },
{ name: 'tablet', width: 768, height: 1024 },
{ name: 'desktop', width: 1440, height: 900 },
];
for (const viewport of viewports) {
test(`login form is usable at ${viewport.name} size`, async ({ page }) => {
await page.setViewportSize({ width: viewport.width, height: viewport.height });
await page.goto(`${BASE_URL}/login`);
// The core form controls stay visible and usable at every size
await expect(page.getByLabel('Email')).toBeVisible();
await expect(page.getByLabel('Password')).toBeVisible();
await expect(page.getByRole('button', { name: 'Sign in' })).toBeVisible();
});
}
});