plugins/smedjen/skills/playwright-testing/SKILL.md
Playwright locators, assertions, fixtures, visual comparison, trace viewer, and CI setup.
npx skillsauth add hjemmesidekongen/ai playwright-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Playwright provides auto-waiting, multi-browser support, and a rich toolchain. Use its built-in patterns — don't work around them.
getByRole — semantic, resilient, accessiblegetByLabel — form inputsgetByPlaceholder — inputs without labelsgetByText — text-only elements (be specific, not partial)getByTestId — fallback when semantics aren't enoughChain locators to narrow scope: page.getByRole('dialog').getByRole('button', { name: 'Submit' }).
Use expect(locator) — all Playwright assertions auto-wait. Never assert on .textContent() values directly.
Key assertions: toBeVisible, toHaveText, toHaveValue, toHaveURL, toHaveCount, toBeChecked.
Soft assertions let a test continue after failure: expect.soft(locator).toBeVisible(). Check expect(page).toHaveURL() for navigation confirmation.
Extend test with test.extend<{}>() to inject reusable page wrappers and auth state. Keep fixtures in fixtures/ and re-export a custom test object. Auth state goes in storageState — run auth once, reuse across tests.
Run with --workers=4 or --shard=1/4 for parallel execution. Retry flaky tests with retries: 2 in playwright.config.ts. Always store traces and screenshots as artifacts on failure. Use reporter: [['html'], ['github']] for GitHub Actions native annotations.
See references/process.md for full implementation detail: locators, assertions, fixtures, visual comparison, network mocking, API testing, trace viewer, sharding, debugging, and anti-patterns.
development
Creates a brand from scratch through market research and interactive sparring. Runs competitive research via Perplexity, then guides the user through positioning, audience, voice, values, and content pillars. Produces the full brand guideline set at .ai/brand/{name}/. Use when building a new brand, defining brand strategy for a product, or when /våbenskjold:create is invoked.
testing
Loads brand guidelines from .ai/brand/{name}/ and makes them available to the current context. Progressive disclosure: L1 confirms brand exists, L2 loads summary, L3 loads specific files on demand. Use when a downstream skill or user needs brand context, or when /våbenskjold:apply is invoked.
documentation
Guided reinvention of an existing brand guideline. Loads current brand from .ai/brand/{name}/, identifies what to keep vs change, and walks the user through targeted evolution. Preserves brand equity while updating positioning, voice, or values. Use when refreshing a brand or when /våbenskjold:evolve is invoked.
development
Codifies an existing brand from materials, samples, and references. Analyzes provided content to extract voice patterns, values, and positioning. Produces the same guideline format as brand-strategy. Use when a brand already exists but isn't documented, or when /våbenskjold:audit is invoked.