Skip to content

Commit 7a332e4

Browse files
authored
Merge pull request #7096 from getsentry/lms-replay-pw-add-bundles
test(replay): Test against full and errors+replay CDN bundles
2 parents ee301c3 + 7bec22f commit 7a332e4

File tree

12 files changed

+54
-44
lines changed

12 files changed

+54
-44
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,8 @@ jobs:
533533
- bundle_es5_min
534534
- bundle_es6
535535
- bundle_es6_min
536+
- bundle_replay_es6
537+
- bundle_replay_es6_min
536538
tracing_only:
537539
- true
538540
- false

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import type { ReplayEvent } from '@sentry/types';
44

55
import { sentryTest } from '../../../utils/fixtures';
66
import { envelopeRequestParser } from '../../../utils/helpers';
7-
import { waitForReplayRequest } from '../../../utils/replayHelpers';
7+
import { shouldSkipReplayTest, waitForReplayRequest } from '../../../utils/replayHelpers';
88

99
sentryTest('should capture replays', async ({ getLocalTestPath, page }) => {
10-
// Replay bundles are es6 only
11-
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_es5')) {
10+
if (shouldSkipReplayTest()) {
1211
sentryTest.skip();
1312
}
1413

packages/integration-tests/suites/replay/compression/init.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Replay } from '@sentry/replay';
32

43
window.Sentry = Sentry;
5-
window.Replay = new Replay({
4+
window.Replay = new Sentry.Replay({
65
flushMinDelay: 500,
76
flushMaxDelay: 500,
87
useCompression: true,

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ import { expect } from '@playwright/test';
22

33
import { sentryTest } from '../../../utils/fixtures';
44
import { getExpectedReplayEvent } from '../../../utils/replayEventTemplates';
5-
import { getFullRecordingSnapshots, getReplayEvent, waitForReplayRequest } from '../../../utils/replayHelpers';
5+
import {
6+
getFullRecordingSnapshots,
7+
getReplayEvent,
8+
shouldSkipReplayTest,
9+
waitForReplayRequest,
10+
} from '../../../utils/replayHelpers';
611

712
sentryTest('replay recording should be compressed by default', async ({ getLocalTestPath, page }) => {
8-
// Replay bundles are es6 only
9-
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_es5')) {
13+
if (shouldSkipReplayTest()) {
1014
sentryTest.skip();
1115
}
1216

packages/integration-tests/suites/replay/customEvents/init.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Replay } from '@sentry/replay';
32

43
window.Sentry = Sentry;
5-
window.Replay = new Replay({
4+
window.Replay = new Sentry.Replay({
65
flushMinDelay: 500,
76
flushMaxDelay: 500,
87
useCompression: false,

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,19 @@ import {
1010
expectedNavigationPerformanceSpan,
1111
getExpectedReplayEvent,
1212
} from '../../../utils/replayEventTemplates';
13-
import { getCustomRecordingEvents, getReplayEvent, waitForReplayRequest } from '../../../utils/replayHelpers';
13+
import {
14+
getCustomRecordingEvents,
15+
getReplayEvent,
16+
shouldSkipReplayTest,
17+
waitForReplayRequest,
18+
} from '../../../utils/replayHelpers';
1419

1520
sentryTest(
1621
'replay recording should contain default performance spans',
1722
async ({ getLocalTestPath, page, browserName }) => {
18-
// Replay bundles are es6 only and most performance entries are only available in chromium
19-
if ((process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_es5')) || browserName !== 'chromium') {
23+
// We only test this against the NPM package and replay bundles
24+
// and only on chromium as most performance entries are only available in chromium
25+
if (shouldSkipReplayTest() || browserName !== 'chromium') {
2026
sentryTest.skip();
2127
}
2228

@@ -68,8 +74,7 @@ sentryTest(
6874
sentryTest(
6975
'replay recording should contain a click breadcrumb when a button is clicked',
7076
async ({ getLocalTestPath, page }) => {
71-
// Replay bundles are es6 only
72-
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_es5')) {
77+
if (shouldSkipReplayTest()) {
7378
sentryTest.skip();
7479
}
7580

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

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

33
import { sentryTest } from '../../../utils/fixtures';
4-
import { getReplaySnapshot, REPLAY_DEFAULT_FLUSH_MAX_DELAY, waitForReplayRequest } from '../../../utils/replayHelpers';
4+
import {
5+
getReplaySnapshot,
6+
REPLAY_DEFAULT_FLUSH_MAX_DELAY,
7+
shouldSkipReplayTest,
8+
waitForReplayRequest,
9+
} from '../../../utils/replayHelpers';
510

611
sentryTest('should stop recording after receiving an error response', async ({ getLocalTestPath, page }) => {
7-
// Currently bundle tests are not supported for replay
8-
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_es5')) {
12+
if (shouldSkipReplayTest()) {
913
sentryTest.skip();
1014
}
11-
1215
let called = 0;
1316

1417
await page.route('https://dsn.ingest.sentry.io/**/*', route => {

packages/integration-tests/suites/replay/init.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Replay } from '@sentry/replay';
32

43
window.Sentry = Sentry;
5-
window.Replay = new Replay({
4+
window.Replay = new Sentry.Replay({
65
flushMinDelay: 200,
76
flushMaxDelay: 200,
87
});

packages/integration-tests/suites/replay/sampling/init.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Replay } from '@sentry/replay';
32

43
window.Sentry = Sentry;
5-
window.Replay = new Replay({
4+
window.Replay = new Sentry.Replay({
65
flushMinDelay: 200,
76
flushMaxDelay: 200,
87
});

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { expect } from '@playwright/test';
22

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

66
sentryTest('should not send replays if both sample rates are 0', async ({ getLocalTestPath, page }) => {
7-
// Replay bundles are es6 only
8-
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_es5')) {
7+
if (shouldSkipReplayTest()) {
98
sentryTest.skip();
109
}
1110

0 commit comments

Comments
 (0)