Skip to content

Commit d8d18aa

Browse files
stefanhuberCopilot
andauthored
Update test/specs/offline/service-worker.spec.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4f29543 commit d8d18aa

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

test/specs/offline/service-worker.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ describe('Service Worker Offline Support', () => {
4444
// Reset hash router state and reload so the SW intercepts all requests
4545
await sw.freshReload();
4646
await languagePage.waitForPage();
47-
await browser.pause(2000);
47+
await browser.waitUntil(
48+
async () => await sw.isCached('data.json'),
49+
{
50+
timeout: 30000,
51+
timeoutMsg: 'data.json was not cached by the service worker within 30s',
52+
}
53+
);
4854
});
4955

5056
it('caches data.json after SW-controlled load', async () => {

0 commit comments

Comments
 (0)