playwright-webext
playwright-webext is a set of Playwright fixtures and helpers that make testing browser extensions easier.
Features
- Access your extension’s APIs with the built-in extension fixture.
- Open popup, options, and side panel pages.
- Read and write extension storage directly from test.
- Trigger extension actions by emulating browser events.
- Prepare browser state before extension installation.
- Check internationalization (i18n) without changing your system language.
- Verify data migration between extension versions.
- Test the behavior when extension is uninstalled or disabled.
See the complete example: a TypeScript extension tested with playwright-webext.
Motivation
Playwright's extension guide shows how to launch a browser with an extension, wait for its service worker, and find its ID. You then need to maintain that setup and write helpers for extension tasks.
Playwright-webext handles browser setup and extension installation, so you can focus on testing your extension's functionality using familiar Playwright pages, locators, and assertions.
Proceed to Getting started.