Skip to content

Commit c6bd979

Browse files
committed
simplify waitForResponse
1 parent ca80615 commit c6bd979

File tree

1 file changed

+5
-8
lines changed
  • packages/integration-tests/suites/replay/requests

1 file changed

+5
-8
lines changed

packages/integration-tests/suites/replay/requests/test.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ for (let i = 0; i < 25; i++) {
3535
await page.click('#go-background');
3636
const { performanceSpans: spans0 } = getReplayRecordingContent(await reqPromise0);
3737

38-
const receivedResponse = page.waitForResponse(res => {
39-
return res.url().includes('example.com');
40-
});
38+
const receivedResponse = page.waitForResponse('https://example.com');
39+
4140
await page.click('#fetch');
4241
await receivedResponse;
4342

44-
await page.click('#go-background');
43+
// await page.click('#go-background');
4544
const { performanceSpans: spans1 } = getReplayRecordingContent(await reqPromise1);
4645

4746
const performanceSpans = [...spans0, ...spans1];
@@ -78,13 +77,11 @@ for (let i = 0; i < 25; i++) {
7877
await page.click('#go-background');
7978
const { performanceSpans: spans0 } = getReplayRecordingContent(await reqPromise0);
8079

81-
const receivedResponse = page.waitForResponse(res => {
82-
return res.url().includes('example.com');
83-
});
80+
const receivedResponse = page.waitForResponse('https://example.com');
8481
await page.click('#xhr');
8582
await receivedResponse;
8683

87-
await page.click('#go-background');
84+
// await page.click('#go-background');
8885
const { performanceSpans: spans1 } = getReplayRecordingContent(await reqPromise1);
8986

9087
const performanceSpans = [...spans0, ...spans1];

0 commit comments

Comments
 (0)