You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integration-test/README.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,11 +12,18 @@ We use [Playwright](https://playwright.dev/) as a test runner. Tests are defined
12
12
13
13
Playwright tests can be run with the following npm commands:
14
14
-`npm run playwright` to test the Chrome MV3 extension
15
-
-`npm run playwright-mv2` to test the Chrome MV2 extension (closest thing to testing Firefox MV2 extension we have until Playwright adds support for testing Firefox extensions)
15
+
-`npm run playwright-mv2` to test the Chrome MV2 extension
16
16
17
17
If you want to re-run tests without rebuilding the extension, you can subsequently run:
18
18
-`npx playwright test` to run all tests
19
-
-`npx playright test integration-test/<file>.spec.js` to just run tests in a single file.
19
+
-`npx playwright test integration-test/<file>.spec.js` to just run tests in a single file.
20
+
21
+
### Firefox Testing (Experimental)
22
+
23
+
Firefox integration tests are available for a subset of tests. The Firefox harness uses the
24
+
Remote Debugging Protocol (RDP) to install the extension and evaluate code in its background page.
25
+
So far many tests can't run because request interception is not working correctly.
-`manifestVersion`: `2` or `3`. Allows you to check which version of the extension is being tested.
42
49
-`page`: A [Page](https://playwright.dev/docs/api/class-page) instance for loading web pages.
43
-
-`backgroundPage`: The extension's background page, which is a `Page` for MV2, or `Worker` for MV3. Use `backgroundPage.evaluate` to run code in the extension's background context.
50
+
-`backgroundPage`: The extension's background page. For Chrome MV2, this is a `Page`. For Chrome MV3, this is a `Worker`. For Firefox, this is a `FirefoxBackgroundPage` wrapper that supports `evaluate()` via RDP. Use `backgroundPage.evaluate()` to run code in the extension's background context.
44
51
-`backgroundNetworkContext`: A context for listening to and intercepting requests from the extension's background context with Playwright's [Network](https://playwright.dev/docs/network) APIs.
45
52
-`context`: The [BrowserContext](https://playwright.dev/docs/api/class-browsercontext) for the test run.
46
53
47
54
Static files for tests are in the `data` directory:
48
55
-`har` - [HAR files](./data/har/README.md) for offline tests.
49
-
-`staticcdn` - Mocked CDN resources to used when the extension loads.
56
+
-`staticcdn` - Mocked CDN resources to used when the extension loads.
0 commit comments