1 parent 400eb9b commit cea1e2eCopy full SHA for cea1e2e
1 file changed
test/e2e/helpers/pageObjectModels/PwaPage.ts
@@ -11,8 +11,22 @@ export class PwaPage extends BasePage {
11
super(page)
12
}
13
14
+ private static async enableServiceWorkerForE2E(page: Page): Promise<void> {
15
+ const enableScript = () => {
16
+ window.__disableServiceWorkerForE2E = false
17
+ }
18
+
19
+ await page.addInitScript(enableScript)
20
+ try {
21
+ await page.evaluate(enableScript)
22
+ } catch {
23
+ // ignore: evaluate can fail on about:blank in some browsers before first navigation
24
25
26
27
static override async init(page: Page): Promise<PwaPage> {
28
await this.setupPlaywrightGlobals(page)
29
+ await this.enableServiceWorkerForE2E(page)
30
const instance = new PwaPage(page)
31
await instance.onInit()
32
return instance
0 commit comments