Skip to content

Commit d348b29

Browse files
authored
chore(integration-tests): Update Playwright to 1.27.1 (#6511)
1 parent b7eaf3e commit d348b29

File tree

33 files changed

+100
-221
lines changed

33 files changed

+100
-221
lines changed

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"karma-typescript-es6-transform": "^4.0.0",
3939
"karma-webkit-launcher": "^1.0.2",
4040
"node-fetch": "^2.6.0",
41-
"playwright": "^1.17.1",
41+
"playwright": "^1.27.1",
4242
"sinon": "^7.3.2",
4343
"webpack": "^4.30.0"
4444
},

packages/integration-tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
},
2727
"dependencies": {
2828
"@babel/preset-typescript": "^7.16.7",
29-
"@playwright/test": "^1.17.0",
29+
"@playwright/test": "^1.27.1",
3030
"babel-loader": "^8.2.2",
3131
"html-webpack-plugin": "^5.5.0",
32-
"playwright": "^1.17.1",
32+
"playwright": "^1.27.1",
3333
"typescript": "^4.5.2",
3434
"webpack": "^5.52.0"
3535
},

packages/integration-tests/suites/public-api/startTransaction/basic_usage/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ sentryTest('should report finished spans as children of the root transaction', a
1616
const url = await getLocalTestPath({ testDir: __dirname });
1717
const transaction = await getFirstSentryEnvelopeRequest<Event>(page, url);
1818

19-
const rootSpanId = transaction?.contexts?.trace.spanId;
19+
const rootSpanId = transaction?.contexts?.trace?.spanId;
2020

2121
expect(transaction.spans).toHaveLength(3);
2222

packages/integration-tests/suites/sessions/start-session/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/sessions/update-session/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/stacktraces/protocol_containing_fn_identifiers/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sentryTest(
2020
{ function: 'readFile' },
2121
{ function: 'httpsCall' },
2222
{ function: 'webpackDevServer' },
23-
{ function: 'Function.httpCode' },
23+
{ function: 'Response.httpCode' },
2424
]);
2525
});
2626

packages/integration-tests/suites/stacktraces/protocol_fn_identifiers/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sentryTest(
2020
{ function: 'file' },
2121
{ function: 'https' },
2222
{ function: 'webpack' },
23-
{ function: 'Function.http' },
23+
{ function: 'File.http' },
2424
]);
2525
});
2626

packages/integration-tests/suites/stacktraces/regular_fn_identifiers/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ sentryTest(
2121
{ function: '?' },
2222
{ function: 'foo' },
2323
{ function: 'bar' },
24-
{ function: 'Function.baz' },
24+
{ function: 'Test.baz' },
2525
]);
2626
});
2727

packages/integration-tests/suites/stacktraces/template.hbs

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

packages/integration-tests/suites/public-api/init/template.hbs renamed to packages/integration-tests/suites/stacktraces/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<title></title>
6-
<script src="{{htmlWebpackPlugin.options.initialization}}"></script>
6+
<script src="{{htmlWebpackPlugin.options.initialization}}"></script>
77
</head>
88
<body>
99
<script src="{{htmlWebpackPlugin.options.subject}}"></script>

packages/integration-tests/suites/tracing/browsertracing/backgroundtab-custom/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ sentryTest('should finish pageload transaction when the page goes background', a
1313

1414
const pageloadTransaction = await getFirstSentryEnvelopeRequest<Event>(page);
1515

16-
expect(pageloadTransaction.contexts?.trace.op).toBe('pageload');
17-
expect(pageloadTransaction.contexts?.trace.status).toBe('cancelled');
18-
expect(pageloadTransaction.contexts?.trace.tags).toMatchObject({
16+
expect(pageloadTransaction.contexts?.trace?.op).toBe('pageload');
17+
expect(pageloadTransaction.contexts?.trace?.status).toBe('cancelled');
18+
expect(pageloadTransaction.contexts?.trace?.tags).toMatchObject({
1919
visibilitychange: 'document.hidden',
2020
});
2121
});

packages/integration-tests/suites/tracing/browsertracing/interactions/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/browsertracing/long-tasks-disabled/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/browsertracing/long-tasks-enabled/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/browsertracing/long-tasks-enabled/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ sentryTest('should capture long task.', async ({ browserName, getLocalTestPath,
2424
expect.objectContaining({
2525
op: 'ui.long-task',
2626
description: 'Main UI thread blocked',
27-
parent_span_id: eventData.contexts?.trace.span_id,
27+
parent_span_id: eventData.contexts?.trace?.span_id,
2828
}),
2929
);
30-
const start = firstUISpan['start_timestamp'] ?? 0;
31-
const end = firstUISpan['timestamp'] ?? 0;
30+
const start = (firstUISpan as Event)['start_timestamp'] ?? 0;
31+
const end = (firstUISpan as Event)['timestamp'] ?? 0;
3232
const duration = end - start;
3333

3434
expect(duration).toBeGreaterThanOrEqual(0.1);

packages/integration-tests/suites/tracing/browsertracing/meta/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/browsertracing/meta/test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ sentryTest(
5252
trace_id: '12312012123120121231201212312012',
5353
});
5454

55-
expect(navigationRequest.contexts?.trace.op).toBe('navigation');
56-
expect(navigationRequest.contexts?.trace.trace_id).toBeDefined();
57-
expect(navigationRequest.contexts?.trace.trace_id).not.toBe(pageloadRequest.contexts?.trace.trace_id);
55+
expect(navigationRequest.contexts?.trace?.op).toBe('navigation');
56+
expect(navigationRequest.contexts?.trace?.trace_id).toBeDefined();
57+
expect(navigationRequest.contexts?.trace?.trace_id).not.toBe(pageloadRequest.contexts?.trace?.trace_id);
5858

5959
const pageloadSpans = pageloadRequest.spans;
6060
const navigationSpans = navigationRequest.spans;
6161

62-
const pageloadSpanId = pageloadRequest.contexts?.trace.span_id;
63-
const navigationSpanId = navigationRequest.contexts?.trace.span_id;
62+
const pageloadSpanId = pageloadRequest.contexts?.trace?.span_id;
63+
const navigationSpanId = navigationRequest.contexts?.trace?.span_id;
6464

6565
expect(pageloadSpanId).toBeDefined();
6666
expect(navigationSpanId).toBeDefined();

packages/integration-tests/suites/tracing/browsertracing/navigation/test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ sentryTest('should create a navigation transaction on page navigation', async ({
1010
const pageloadRequest = await getFirstSentryEnvelopeRequest<Event>(page, url);
1111
const navigationRequest = await getFirstSentryEnvelopeRequest<Event>(page, `${url}#foo`);
1212

13-
expect(pageloadRequest.contexts?.trace.op).toBe('pageload');
14-
expect(navigationRequest.contexts?.trace.op).toBe('navigation');
13+
expect(pageloadRequest.contexts?.trace?.op).toBe('pageload');
14+
expect(navigationRequest.contexts?.trace?.op).toBe('navigation');
1515

1616
expect(navigationRequest.transaction_info?.source).toEqual('url');
1717

18-
const pageloadTraceId = pageloadRequest.contexts?.trace.trace_id;
19-
const navigationTraceId = navigationRequest.contexts?.trace.trace_id;
18+
const pageloadTraceId = pageloadRequest.contexts?.trace?.trace_id;
19+
const navigationTraceId = navigationRequest.contexts?.trace?.trace_id;
2020

2121
expect(pageloadTraceId).toBeDefined();
2222
expect(navigationTraceId).toBeDefined();
@@ -25,8 +25,8 @@ sentryTest('should create a navigation transaction on page navigation', async ({
2525
const pageloadSpans = pageloadRequest.spans;
2626
const navigationSpans = navigationRequest.spans;
2727

28-
const pageloadSpanId = pageloadRequest.contexts?.trace.span_id;
29-
const navigationSpanId = navigationRequest.contexts?.trace.span_id;
28+
const pageloadSpanId = pageloadRequest.contexts?.trace?.span_id;
29+
const navigationSpanId = navigationRequest.contexts?.trace?.span_id;
3030

3131
expect(pageloadSpanId).toBeDefined();
3232
expect(navigationSpanId).toBeDefined();

packages/integration-tests/suites/tracing/metrics/connection-rtt/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/metrics/pageload-browser-spans/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sentryTest('should add browser-related spans to pageload transaction', async ({
1717
expect(browserSpans).toContainEqual(
1818
expect.objectContaining({
1919
description: eventDesc,
20-
parent_span_id: eventData.contexts?.trace.span_id,
20+
parent_span_id: eventData.contexts?.trace?.span_id,
2121
}),
2222
),
2323
);

packages/integration-tests/suites/tracing/metrics/pageload-resource-spans/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/metrics/pageload-resource-spans/test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Event } from '@sentry/types';
44
import { sentryTest } from '../../../../utils/fixtures';
55
import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers';
66

7-
sentryTest('should add resource spans to pageload transaction', async ({ getLocalTestPath, page }) => {
7+
sentryTest('should add resource spans to pageload transaction', async ({ getLocalTestPath, page, browser }) => {
88
// Intercepting asset requests to avoid network-related flakiness and random retries (on Firefox).
99
await page.route('**/path/to/image.svg', (route: Route) => route.fulfill({ path: `${__dirname}/assets/image.svg` }));
1010
await page.route('**/path/to/script.js', (route: Route) => route.fulfill({ path: `${__dirname}/assets/script.js` }));
@@ -15,13 +15,19 @@ sentryTest('should add resource spans to pageload transaction', async ({ getLoca
1515
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
1616
const resourceSpans = eventData.spans?.filter(({ op }) => op?.startsWith('resource'));
1717

18-
expect(resourceSpans?.length).toBe(3);
18+
// Webkit 16.0 (which is linked to Playwright 1.27.1) consistently creates 2 consectutive spans for `css`,
19+
// so we need to check for 3 or 4 spans.
20+
if (browser.browserType().name() === 'webkit') {
21+
expect(resourceSpans?.length).toBeGreaterThanOrEqual(3);
22+
} else {
23+
expect(resourceSpans?.length).toBe(3);
24+
}
1925

2026
['resource.img', 'resource.script', 'resource.link'].forEach(op =>
2127
expect(resourceSpans).toContainEqual(
2228
expect.objectContaining({
2329
op: op,
24-
parent_span_id: eventData.contexts?.trace.span_id,
30+
parent_span_id: eventData.contexts?.trace?.span_id,
2531
}),
2632
),
2733
);

packages/integration-tests/suites/tracing/metrics/web-vitals-cls/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/metrics/web-vitals-fid/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/metrics/web-vitals-fp-fcp/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/metrics/web-vitals-lcp/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/metrics/web-vitals-ttfb/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

packages/integration-tests/suites/tracing/request/fetch/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ sentryTest('should create spans for multiple fetch requests', async ({ getLocalT
2727
requestSpans?.forEach((span, index) =>
2828
expect(span).toMatchObject({
2929
description: `GET http://example.com/${index}`,
30-
parent_span_id: tracingEvent.contexts?.trace.span_id,
30+
parent_span_id: tracingEvent.contexts?.trace?.span_id,
3131
span_id: expect.any(String),
3232
start_timestamp: expect.any(Number),
3333
timestamp: expect.any(Number),
34-
trace_id: tracingEvent.contexts?.trace.trace_id,
34+
trace_id: tracingEvent.contexts?.trace?.trace_id,
3535
}),
3636
);
3737
});

packages/integration-tests/suites/tracing/request/xhr/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ sentryTest('should create spans for multiple XHR requests', async ({ getLocalTes
1515
requestSpans?.forEach((span, index) =>
1616
expect(span).toMatchObject({
1717
description: `GET http://example.com/${index}`,
18-
parent_span_id: eventData.contexts?.trace.span_id,
18+
parent_span_id: eventData.contexts?.trace?.span_id,
1919
span_id: expect.any(String),
2020
start_timestamp: expect.any(Number),
2121
timestamp: expect.any(Number),
22-
trace_id: eventData.contexts?.trace.trace_id,
22+
trace_id: eventData.contexts?.trace?.trace_id,
2323
}),
2424
);
2525
});

packages/integration-tests/utils/defaults/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<meta charset="utf-8" />

0 commit comments

Comments
 (0)