E2e playwright extension

From sm17p/amfig · View interactive version

E2e playwright extension is an AI agent skill from the GitHub repository sm17p/amfig. Adds or updates extension E2E tests using the project Playwright setup and fixture (load unpacked extension, popup/background). Use when adding e2e for a feature, fixing failing e2e, or when changing popup/options/background flows.

How to use this skill

Skill file

E2E with Playwright (extension)

Aligned with WXT’s Playwright E2E example: Chromium only, extension loaded from dist/chrome-mv3.

Layout

Fixture

The fixture extends Playwright with:

Use context and extensionId in tests. Import the extended test and expect from the fixture.

Popup

Navigate to chrome-extension://${extensionId}/popup.html. Use helpers like openPopup(page, extensionId) from e2e/pages/popup.ts for consistent setup. Tests: "popup opens and shows active toggle" (Popup), "inspector root and app load on supported page" (Content injection), "when domain is enabled in storage, inspector is active on page load" (Per-domain activation).

Run

Note

playwright-webextext is in devDependencies for potential future use; current tests use the custom extension fixture in fixtures.ts.

When a test needs deterministic inspector target setup (distances/side panel), prefer triggering the inspector via a synthetic mouseover on a known element (see toolbar-distances.spec.ts) rather than relying on hit-testing/hover in the presence of the overlay.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.