This repository contains a demo browser extension with end-to-end tests. It is part of the XtremeJS 2024 talk "End to End Testing for Browser Extensions" by Nick Taylor. You can find the full schedule here.
To test this extension in a browser, you need to load it unpacked. Below are the instructions for Google Chrome and Firefox. For other Chromium-based browsers, the process is similar.
- Open Chrome and navigate to
chrome://extensions/
. - Enable "Developer mode" by toggling the switch in the top right corner.
- Click on the "Load unpacked" button.
- Select the
src
directory of this repository.
- Open Firefox and navigate to
about:debugging#/runtime/this-firefox
. - Click on the "Load Temporary Add-on..." button.
- Select any file in the
src
directory of this repository (e.g.,manifest.json
).
To run the end-to-end tests, you do not need to load the extension in a browser. Simply use the following commands:
npm install
npm playwright install
npm run e2e
or if you prefer to run the tests in headful mode (Playwright GUI), run:
npm install
npm playwright install
npm run e2e:ui