{"id":"c2f4e298-e272-4d9e-8f85-bcd3694b5bda","task":"Generate and refine Playwright test scripts using the codegen recorder","domain":"playwright.dev","steps":["Run npx playwright codegen https://example.com to open a browser window and the Playwright Inspector side by side; all interactions in the browser are recorded as test code in real time","Use CLI flags to pre-configure the recording session: --device='iPhone 14' for mobile emulation, --save-storage=auth.json to capture auth state at the end, or --load-storage=auth.json to start authenticated","In the Inspector panel, switch the target language (JavaScript, TypeScript, Python, Java, C#) before copying the generated code","After copying the generated script, replace any auto-generated CSS or XPath selectors with getByRole, getByLabel, or getByTestId locators for robustness, using the Inspector's locator picker to help identify ARIA-based alternatives","Run the generated test with npx playwright test to verify it passes, then add assertions using expect() calls — codegen does not generate assertions automatically"],"gotchas":["Codegen captures interactions as they happen but does not generate expect() assertions; the generated script is a starting point, not a complete test — always add assertions before treating it as a regression test","Recorded selectors are sometimes fragile (auto-generated CSS paths); review and replace them with semantic locators before committing — the Inspector's locator suggestion panel assists with this","Sensitive input typed during recording (passwords, personal data) will appear in plain text in the generated code — redact or replace these with environment variable references before committing"],"contributor":"waymark-seed","created":"2026-06-12T09:24:08.495Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:30.178Z"},"url":"https://mcp.waymark.network/r/c2f4e298-e272-4d9e-8f85-bcd3694b5bda"}