|
1 | 1 | /** |
2 | | - * Service Worker Tests |
3 | | - * Validates service worker registration, caching, and offline fallbacks. |
| 2 | + * Service Worker Tests - Must be QA'd manually |
| 3 | + * |
| 4 | + * Note: Automated testing of service workers is not feasible in this E2E test suite |
| 5 | + * due to limitations with the Astro build process and Vercel adapter. |
4 | 6 | */ |
5 | 7 |
|
6 | | -import { expect, test } from '@test/e2e/helpers' |
7 | | -import { PwaPage } from '@test/e2e/helpers/pageObjectModels/PwaPage' |
| 8 | +import { test } from '@test/e2e/helpers' |
8 | 9 |
|
9 | 10 | test.describe('Service Worker', () => { |
10 | | - test.skip('@ready service worker registers and activates', async ({ page: playwrightPage }) => { |
11 | | - const pwaPage: PwaPage = await PwaPage.init(playwrightPage) |
12 | | - await pwaPage.navigateToHomeAndWaitForSW() |
13 | | - |
14 | | - await pwaPage.expectServiceWorkerRegistered() |
15 | | - await pwaPage.expectServiceWorkerActivated() |
16 | | - }) |
17 | | - |
18 | | - test.skip('@ready service worker populates caches after first run', async ({ page: playwrightPage }) => { |
19 | | - const pwaPage: PwaPage = await PwaPage.init(playwrightPage) |
20 | | - await pwaPage.navigateToHomeAndWaitForSW() |
21 | | - |
22 | | - const cachedAssets = await pwaPage.getCachedAssetsCount() |
23 | | - expect(cachedAssets).toBeGreaterThan(0) |
24 | | - await pwaPage.expectCacheVersioning() |
25 | | - }) |
26 | | - |
27 | | - test.skip('@ready offline navigation falls back to 404 page', async ({ page: playwrightPage, context, browserName }) => { |
28 | | - test.skip(browserName === 'webkit', 'Playwright WebKit cannot perform navigation requests while offline') |
29 | | - |
30 | | - const pwaPage: PwaPage = await PwaPage.init(playwrightPage) |
31 | | - await pwaPage.navigateToHomeAndWaitForSW() |
32 | | - |
33 | | - await pwaPage.goOffline(context) |
34 | | - try { |
35 | | - const response = await pwaPage.goto('/definitely-not-real') |
36 | | - expect(response).not.toBeNull() |
37 | | - await pwaPage.expectNotFoundFallback() |
38 | | - } finally { |
39 | | - await pwaPage.goOnline(context) |
40 | | - } |
41 | | - }) |
| 11 | + test.fixme('@ready service worker cannot be tested in automated E2E tests and must be QAed manually, because the @vite-pwa/astro integration that generates sw.js runs on the astro:build:done so that it has access to all generated build artifacts. The Vercel adapter for Astro is incompatible with astro serve, so it is not possible to test against a built environment.', async () => {}) |
42 | 12 | }) |
43 | | - |
0 commit comments