Skip to content

Commit a27652f

Browse files
authored
chore(deps): Update playwright to 1.50.0 (#15164)
Also align to use the same version everywhere, tilde-restricted.
1 parent 76b5c33 commit a27652f

File tree

108 files changed

+148
-1226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+148
-1226
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ jobs:
600600
env:
601601
PW_BUNDLE: ${{ matrix.bundle }}
602602
working-directory: dev-packages/browser-integration-tests
603-
run: yarn test:ci${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard && format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
603+
run: yarn test:all${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard && format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
604604

605605
- name: Upload Playwright Traces
606606
uses: actions/upload-artifact@v4

dev-packages/browser-integration-tests/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@
3535
"test:loader:replay_buffer": "PW_BUNDLE=loader_replay_buffer yarn test:loader",
3636
"test:loader:full": "PW_BUNDLE=loader_tracing_replay yarn test:loader",
3737
"test:loader:debug": "PW_BUNDLE=loader_debug yarn test:loader",
38-
"test:ci": "yarn test:all",
3938
"test:update-snapshots": "yarn test:all --update-snapshots",
4039
"test:detect-flaky": "ts-node scripts/detectFlakyTests.ts"
4140
},
4241
"dependencies": {
4342
"@babel/preset-typescript": "^7.16.7",
44-
"@playwright/test": "^1.44.1",
43+
"@playwright/test": "~1.50.0",
4544
"@sentry-internal/rrweb": "2.31.0",
4645
"@sentry/browser": "9.0.0-alpha.0",
4746
"axios": "1.7.7",

dev-packages/browser-integration-tests/scripts/detectFlakyTests.ts

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ import * as path from 'path';
44
import * as glob from 'glob';
55

66
/**
7-
* The number of browsers we run the tests in.
7+
* Assume that each test runs for 3s.
88
*/
9-
const NUM_BROWSERS = 3;
10-
11-
/**
12-
* Assume that each test runs for 2s.
13-
*/
14-
const ASSUMED_TEST_DURATION_SECONDS = 2;
9+
const ASSUMED_TEST_DURATION_SECONDS = 3;
1510

1611
/**
1712
* We keep the runtime of the detector if possible under 30min.
@@ -51,22 +46,12 @@ ${changedPaths.join('\n')}
5146
try {
5247
await new Promise<void>((resolve, reject) => {
5348
const cp = childProcess.spawn(
54-
`npx playwright test ${
55-
testPaths.length ? testPaths.join(' ') : './suites'
56-
} --reporter='line' --repeat-each ${repeatEachCount}`,
57-
{ shell: true, cwd },
49+
`npx playwright test ${testPaths.length ? testPaths.join(' ') : './suites'} --repeat-each ${repeatEachCount}`,
50+
{ shell: true, cwd, stdio: 'inherit' },
5851
);
5952

6053
let error: Error | undefined;
6154

62-
cp.stdout.on('data', data => {
63-
console.log(data ? (data as object).toString() : '');
64-
});
65-
66-
cp.stderr.on('data', data => {
67-
console.log(data ? (data as object).toString() : '');
68-
});
69-
7055
cp.on('error', e => {
7156
console.error(e);
7257
error = e;
@@ -107,15 +92,16 @@ function getPerTestRunCount(testPaths: string[]) {
10792
const estimatedNumberOfTests = testPaths.map(getApproximateNumberOfTests).reduce((a, b) => a + b);
10893
console.log(`Estimated number of tests: ${estimatedNumberOfTests}`);
10994

110-
// tests are usually run against all browsers we test with, so let's assume this
111-
const testRunCount = estimatedNumberOfTests * NUM_BROWSERS;
95+
const testRunCount = estimatedNumberOfTests;
11296
console.log(`Estimated test runs for one round: ${testRunCount}`);
11397

11498
const estimatedTestRuntime = testRunCount * ASSUMED_TEST_DURATION_SECONDS;
11599
console.log(`Estimated test runtime: ${estimatedTestRuntime}s`);
116100

117101
const expectedPerTestRunCount = Math.floor(MAX_TARGET_TEST_RUNTIME_SECONDS / estimatedTestRuntime);
118-
console.log(`Expected per-test run count: ${expectedPerTestRunCount}`);
102+
console.log(
103+
`Calculated # of repetitions: ${expectedPerTestRunCount} (min ${MIN_PER_TEST_RUN_COUNT}, max ${MAX_PER_TEST_RUN_COUNT})`,
104+
);
119105

120106
return Math.min(MAX_PER_TEST_RUN_COUNT, Math.max(expectedPerTestRunCount, MIN_PER_TEST_RUN_COUNT));
121107
}
@@ -128,22 +114,7 @@ function getTestPaths(): string[] {
128114
cwd: path.join(__dirname, '../'),
129115
});
130116

131-
return paths.map(p => path.dirname(p));
132-
}
133-
134-
function logError(error: unknown) {
135-
if (process.env.CI) {
136-
console.log('::group::Test failed');
137-
} else {
138-
console.error(' ⚠️ Test failed:');
139-
}
140-
141-
console.log((error as any).stdout);
142-
console.log((error as any).stderr);
143-
144-
if (process.env.CI) {
145-
console.log('::endgroup::');
146-
}
117+
return paths.map(p => `${path.dirname(p)}/`);
147118
}
148119

149120
/**
@@ -156,7 +127,7 @@ function logError(error: unknown) {
156127
function getApproximateNumberOfTests(testPath: string): number {
157128
try {
158129
const content = fs.readFileSync(path.join(process.cwd(), testPath, 'test.ts'), 'utf-8');
159-
const matches = content.match(/it\(|test\(|sentryTest\(/g);
130+
const matches = content.match(/sentryTest\(/g);
160131
return Math.max(matches ? matches.length : 1, 1);
161132
} catch (e) {
162133
console.error(`Could not read file ${testPath}`);

dev-packages/browser-integration-tests/suites/public-api/instrumentation/onError/syntax-errors/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ sentryTest('should catch syntax errors', async ({ getLocalTestUrl, page, browser
2727
expect(eventData.exception?.values).toHaveLength(1);
2828
expect(eventData.exception?.values?.[0]).toMatchObject({
2929
type: 'SyntaxError',
30-
value: "Unexpected token '{'",
30+
value: "Failed to execute 'appendChild' on 'Node': Unexpected token '{'",
3131
mechanism: {
3232
type: 'onerror',
3333
handled: false,

dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-0-snap-full

Lines changed: 0 additions & 113 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-1-snap-incremental

Lines changed: 0 additions & 45 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts-snapshots/seg-1-snap-incremental-chromium

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": 1,
77
"id": 9,
88
"x": 41.810001373291016,
9-
"y": 18.479999542236328
9+
"y": 18.5
1010
},
1111
"timestamp": [timestamp]
1212
},
@@ -26,7 +26,7 @@
2626
"type": 0,
2727
"id": 9,
2828
"x": 41.810001373291016,
29-
"y": 18.479999542236328
29+
"y": 18.5
3030
},
3131
"timestamp": [timestamp]
3232
},

0 commit comments

Comments
 (0)