Skip to content

Commit 157ff7b

Browse files
committed
use Promise.all in xhr test
1 parent a6a586c commit 157ff7b

File tree

1 file changed

+11
-7
lines changed
  • packages/integration-tests/suites/replay/requests

1 file changed

+11
-7
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,17 @@ for (let i = 0; i < 25; i++) {
6969

7070
const url = await getLocalTestPath({ testDir: __dirname });
7171

72-
await page.goto(url);
73-
await page.click('#go-background');
74-
const { performanceSpans: spans0 } = getReplayRecordingContent(await reqPromise0);
75-
76-
await page.click('#xhr');
77-
await page.click('#go-background');
78-
const { performanceSpans: spans1 } = getReplayRecordingContent(await reqPromise1);
72+
const [, , { performanceSpans: spans0 }] = await Promise.all([
73+
page.goto(url),
74+
page.click('#go-background'),
75+
getReplayRecordingContent(await reqPromise0),
76+
]);
77+
78+
const [, , { performanceSpans: spans1 }] = await Promise.all([
79+
page.click('#xhr'),
80+
page.click('#go-background'),
81+
getReplayRecordingContent(await reqPromise1),
82+
]);
7983

8084
const performanceSpans = [...spans0, ...spans1];
8185

0 commit comments

Comments
 (0)