Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

test: unflake a launcher test in driver mode (#27518)

Dmitry Gozman40ba5ebc1d8d
diff --git a/tests/library/chromium/launcher.spec.ts b/tests/library/chromium/launcher.spec.ts
index 81893c69f5..eb0fc997ad 100644
--- a/tests/library/chromium/launcher.spec.ts
+++ b/tests/library/chromium/launcher.spec.ts
@@ -119,16 +119,16 @@ it('should support request/response events when using backgroundPage()', async (
? backgroundPages[0]
: await context.waitForEvent('backgroundpage');
await backgroundPage.waitForURL(/chrome-extension\:\/\/.*/);
- const [, request, response, contextRequest, contextResponse] = await Promise.all([
+ const [request, response, contextRequest, contextResponse] = await Promise.all([
+ backgroundPage.waitForEvent('request'),
+ backgroundPage.waitForEvent('response'),
+ context.waitForEvent('request'),
+ context.waitForEvent('response'),
backgroundPage.evaluate(url => fetch(url, {
method: 'POST',
body: 'foobar',
headers: { 'X-FOOBAR': 'KEKBAR' }
}), server.EMPTY_PAGE),
- backgroundPage.waitForEvent('request'),
- backgroundPage.waitForEvent('response'),
- context.waitForEvent('request'),
- context.waitForEvent('response'),
]);
expect(request).toBe(contextRequest);
expect(response).toBe(contextResponse);