Skip to content

Commit eb74f26

Browse files
committed
Rollback fixture hosting to stable custom server
1 parent 88338ae commit eb74f26

4 files changed

Lines changed: 11 additions & 9 deletions

File tree

.cursor/skills/e2e-playwright-extension/SKILL.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ Aligned with [WXT’s Playwright E2E example](https://github.com/wxt-dev/example
1212
- Tests in [e2e/tests/](e2e/tests/) — main suite [e2e/tests/extension.spec.ts](e2e/tests/extension.spec.ts) with describe blocks: **Popup**, **Content injection**, **Per-domain activation**
1313
- Shared fixture in [e2e/fixtures.ts](e2e/fixtures.ts)
1414
- Page helpers in [e2e/pages/](e2e/pages/) (e.g. [e2e/pages/popup.ts](e2e/pages/popup.ts))
15-
- Fixture page served locally via Playwright `webServer`:
15+
- Fixture page served via Playwright `webServer` + custom static server:
1616
- `e2e/serve-fixtures.mjs`
17-
- `e2e/constants.ts` (`STABLE_TEST_PAGE_URL` + derived host keying)
18-
- `playwright.config.ts` (points `webServer.url` at `inspector-playground.html`)
17+
- `playwright.config.ts` points `webServer.url` at `http://localhost:51234/inspector-playground.html`
18+
- `use.baseURL` is `http://localhost:51234`
19+
- Tests navigate with relative paths like `/inspector-playground.html`
1920

2021
## Fixture
2122

@@ -38,6 +39,6 @@ Navigate to `chrome-extension://${extensionId}/popup.html`. Use helpers like `op
3839

3940
## Note
4041

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

4344
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.

e2e/pages/web.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function enableDomainInStorage(context: BrowserContext, domain: str
3333
}
3434

3535
export async function enableStableDomainInStorage(context: BrowserContext) {
36-
const domain = "127.0.0.1:51234";
36+
const domain = "localhost:51234";
3737
await enableDomainInStorage(context, domain);
3838
}
3939

e2e/serve-fixtures.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const server = http.createServer((req, res) => {
6060
res.end(body);
6161
});
6262

63-
server.listen(port, "127.0.0.1", () => {
64-
console.log(`fixtures server listening on http://127.0.0.1:${port}`);
63+
server.listen(port, "localhost", () => {
64+
console.log(`fixtures server listening on http://localhost:${port}`);
6565
});
66+

playwright.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default defineConfig({
2727
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
2828
use: {
2929
/* Base URL to use in actions like `await page.goto('/')`. */
30-
baseURL: "http://127.0.0.1:51234",
30+
baseURL: "http://localhost:51234",
3131

3232
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
3333
trace: "on-first-retry",
@@ -64,7 +64,7 @@ export default defineConfig({
6464
timeout: process.env.CI ? 30_000 : 5_000,
6565
webServer: {
6666
command: "node e2e/serve-fixtures.mjs 51234",
67-
url: "http://127.0.0.1:51234/inspector-playground.html",
67+
url: "http://localhost:51234/inspector-playground.html",
6868
reuseExistingServer: true,
6969
timeout: 60_000,
7070
},

0 commit comments

Comments
 (0)