Skip to content

Commit 8f5257f

Browse files
committed
wait for replay request
1 parent 90c5d19 commit 8f5257f

File tree

2 files changed

+8
-2
lines changed
  • dev-packages/browser-integration-tests/suites/replay/canvas

2 files changed

+8
-2
lines changed

dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationFirst/test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { expect } from '@playwright/test';
22

33
import { sentryTest } from '../../../../utils/fixtures';
4-
import { getReplaySnapshot, shouldSkipReplayTest } from '../../../../utils/replayHelpers';
4+
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRequest } from '../../../../utils/replayHelpers';
55

66
sentryTest('sets up canvas when adding ReplayCanvas integration first', async ({ getLocalTestUrl, page }) => {
77
if (shouldSkipReplayTest()) {
88
sentryTest.skip();
99
}
1010

11+
const reqPromise0 = waitForReplayRequest(page, 0);
12+
1113
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
1214
return route.fulfill({
1315
status: 200,
@@ -19,6 +21,7 @@ sentryTest('sets up canvas when adding ReplayCanvas integration first', async ({
1921
const url = await getLocalTestUrl({ testDir: __dirname });
2022

2123
await page.goto(url);
24+
await reqPromise0;
2225

2326
const replay = await getReplaySnapshot(page);
2427
const canvasOptions = replay._canvas;

dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationSecond/test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { expect } from '@playwright/test';
22

33
import { sentryTest } from '../../../../utils/fixtures';
4-
import { getReplaySnapshot, shouldSkipReplayTest } from '../../../../utils/replayHelpers';
4+
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRequest } from '../../../../utils/replayHelpers';
55

66
sentryTest('sets up canvas when adding ReplayCanvas integration after Replay', async ({ getLocalTestUrl, page }) => {
77
if (shouldSkipReplayTest()) {
88
sentryTest.skip();
99
}
1010

11+
const reqPromise0 = waitForReplayRequest(page, 0);
12+
1113
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
1214
return route.fulfill({
1315
status: 200,
@@ -19,6 +21,7 @@ sentryTest('sets up canvas when adding ReplayCanvas integration after Replay', a
1921
const url = await getLocalTestUrl({ testDir: __dirname });
2022

2123
await page.goto(url);
24+
await reqPromise0;
2225

2326
const replay = await getReplaySnapshot(page);
2427
const canvasOptions = replay._canvas;

0 commit comments

Comments
 (0)