Skip to content

Commit f5f35ec

Browse files
committed
wait for replay requests
1 parent 9214bed commit f5f35ec

File tree

1 file changed

+16
-2
lines changed
  • packages/integration-tests/suites/replay/captureReplay

1 file changed

+16
-2
lines changed

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,25 @@ sentryTest('captureReplay', async ({ getLocalTestPath, page }) => {
2121

2222
const url = await getLocalTestPath({ testDir: __dirname });
2323

24-
const reqPromise = page.waitForRequest('https://dsn.ingest.sentry.io/**/*');
24+
const reqPromise = page.waitForRequest(req => {
25+
const postData = req.postData();
26+
if (!postData) {
27+
return false;
28+
}
29+
return postData.includes('replay_event');
30+
});
31+
2532
await page.goto(url);
2633
await reqPromise;
2734

28-
const reqPromise2 = page.waitForRequest('https://dsn.ingest.sentry.io/**/*');
35+
const reqPromise2 = page.waitForRequest(req => {
36+
const postData = req.postData();
37+
if (!postData) {
38+
return false;
39+
}
40+
return postData.includes('replay_event');
41+
});
42+
2943
await page.click('button');
3044
await reqPromise2;
3145

0 commit comments

Comments
 (0)