Skip to content

Commit b6d2f2c

Browse files
committed
Fix CI timeouts for extension service worker
1 parent 5c97518 commit b6d2f2c

9 files changed

Lines changed: 43 additions & 26 deletions

e2e/fixtures-pages/inspector-playground.html

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,28 @@
2121
}
2222
body {
2323
margin: 0;
24-
background: radial-gradient(1200px 800px at 20% 10%, rgba(187, 244, 81, 0.18), transparent 60%),
25-
radial-gradient(900px 700px at 80% 20%, rgba(59, 130, 246, 0.14), transparent 55%),
24+
background:
25+
radial-gradient(
26+
1200px 800px at 20% 10%,
27+
rgba(187, 244, 81, 0.18),
28+
transparent 60%
29+
),
30+
radial-gradient(
31+
900px 700px at 80% 20%,
32+
rgba(59, 130, 246, 0.14),
33+
transparent 55%
34+
),
2635
var(--bg);
2736
color: var(--fg);
28-
font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
37+
font-family:
38+
ui-sans-serif,
39+
system-ui,
40+
-apple-system,
41+
Segoe UI,
42+
Roboto,
43+
Helvetica,
44+
Arial,
45+
"Apple Color Emoji",
2946
"Segoe UI Emoji";
3047
line-height: 1.4;
3148
padding: 24px;
@@ -79,7 +96,11 @@
7996
height: 64px;
8097
border-radius: 12px;
8198
border: 1px solid rgba(255, 255, 255, 0.14);
82-
background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
99+
background: linear-gradient(
100+
180deg,
101+
rgba(255, 255, 255, 0.08),
102+
rgba(255, 255, 255, 0.02)
103+
);
83104
}
84105
.flexRow {
85106
display: flex;
@@ -195,22 +216,22 @@ <h2>Layer stack</h2>
195216
<section data-testid="color-lab">
196217
<h2>Color lab</h2>
197218
<div class="swatches" data-testid="swatches">
198-
<div class="swatch" style="background:#ffffff" data-testid="swatch-1"></div>
199-
<div class="swatch" style="background:#0ea5e9" data-testid="swatch-2"></div>
200-
<div class="swatch" style="background:#22c55e" data-testid="swatch-3"></div>
201-
<div class="swatch" style="background:#e11d48" data-testid="swatch-4"></div>
202-
<div class="swatch" style="background:#f59e0b" data-testid="swatch-5"></div>
203-
<div class="swatch" style="background:#111827" data-testid="swatch-6"></div>
219+
<div class="swatch" style="background: #ffffff" data-testid="swatch-1"></div>
220+
<div class="swatch" style="background: #0ea5e9" data-testid="swatch-2"></div>
221+
<div class="swatch" style="background: #22c55e" data-testid="swatch-3"></div>
222+
<div class="swatch" style="background: #e11d48" data-testid="swatch-4"></div>
223+
<div class="swatch" style="background: #f59e0b" data-testid="swatch-5"></div>
224+
<div class="swatch" style="background: #111827" data-testid="swatch-6"></div>
204225
</div>
205226
</section>
206227

207228
<section data-testid="typography-lab">
208229
<h2>Typography</h2>
209230
<p data-testid="editable-paragraph">
210-
This paragraph is intended for design mode testing. It contains enough text to verify editing.
231+
This paragraph is intended for design mode testing. It contains enough text to
232+
verify editing.
211233
</p>
212234
</section>
213235
</main>
214236
</body>
215237
</html>
216-

e2e/fixtures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const test = base.extend<{
3838
extensionId: async ({ context }, use) => {
3939
let [background] = context.serviceWorkers();
4040
if (!background) {
41-
background = await context.waitForEvent("serviceworker");
41+
background = await context.waitForEvent("serviceworker", { timeout: 30_000 });
4242
}
4343
const extensionId = background.url().split("/")[2];
4444
await use(extensionId);

e2e/pages/popup.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ export async function openPopup(page: Page, extensionId: string) {
55
await page.waitForLoadState("domcontentloaded");
66
return page;
77
}
8-

e2e/serve-fixtures.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import http from "http";
21
import fs from "fs";
2+
import http from "http";
33
import path from "path";
44

55
const port = Number(process.argv[2] ?? 51234);
@@ -63,4 +63,3 @@ const server = http.createServer((req, res) => {
6363
server.listen(port, "127.0.0.1", () => {
6464
console.log(`fixtures server listening on http://127.0.0.1:${port}`);
6565
});
66-

e2e/tests/sidepanel.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ import {
88
} from "../pages/web";
99

1010
test.describe("Side panel", () => {
11-
test("side panel can be shown from toolbar", async ({ context, extensionId: _extensionId, page }) => {
11+
test("side panel can be shown from toolbar", async ({
12+
context,
13+
extensionId: _extensionId,
14+
page,
15+
}) => {
1216
await enableStableDomainInStorage(context);
1317
await openStableTestPage(page);
1418
await expect(getExtensionRoot(page)).toHaveCount(1);
@@ -20,4 +24,3 @@ test.describe("Side panel", () => {
2024
await expect(page.getByRole("heading", { name: "Element Inspector" })).toBeVisible();
2125
});
2226
});
23-

e2e/tests/toolbar-distances.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,3 @@ test.describe("Toolbar distances", () => {
3535
await expect(distanceLines.first()).toHaveAttribute("stroke-dasharray", "none");
3636
});
3737
});
38-

e2e/tests/toolbar-overlays.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,3 @@ test.describe("Toolbar overlays", () => {
3939
await expect(rulerGroup).toBeVisible();
4040
});
4141
});
42-

e2e/tests/toolbar-settings.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ test.describe("Toolbar settings menu", () => {
2020

2121
await openToolbarSettings(page);
2222

23-
const featureVoting = page
24-
.getByRole("group", { name: "Feature Voting" })
25-
.first();
23+
const featureVoting = page.getByRole("group", { name: "Feature Voting" }).first();
2624
await expect(featureVoting).toBeVisible();
2725

2826
const toolbarAutoHideItem = page.locator('[id*="toolbar-auto-hide"]').first();
@@ -41,4 +39,3 @@ test.describe("Toolbar settings menu", () => {
4139
}
4240
});
4341
});
44-

playwright.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ export default defineConfig({
6161
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
6262
// },
6363
],
64-
timeout: 5_000,
64+
timeout: process.env.CI ? 60_000 : 5_000,
6565
webServer: {
6666
command: "node e2e/serve-fixtures.mjs 51234",
67-
url: "http://localhost:51234/inspector-playground.html",
67+
url: "http://127.0.0.1:51234/inspector-playground.html",
6868
reuseExistingServer: true,
6969
timeout: 60_000,
7070
},

0 commit comments

Comments
 (0)