Skip to content

Commit cac212e

Browse files
committed
test adjustments
1 parent 1af377c commit cac212e

File tree

14 files changed

+69
-333
lines changed

14 files changed

+69
-333
lines changed

dev-packages/e2e-tests/test-applications/node-express-send-to-sentry/playwright.config.mjs

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

3-
// Fix urls not resolving to localhost on Node v17+
4-
// See: https://github.com/axios/axios/issues/3821#issuecomment-1413727575
5-
import { setDefaultResultOrder } from 'dns';
6-
setDefaultResultOrder('ipv4first');
7-
83
const expressPort = 3030;
94

105
/**

dev-packages/e2e-tests/test-applications/react-create-hash-router/tests/transactions.test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,6 @@ test('Captures a pageload transaction', async ({ page }) => {
5050
trace_id: expect.any(String),
5151
origin: 'auto.ui.browser.metrics',
5252
});
53-
expect(transactionEvent.spans).toContainEqual({
54-
data: {
55-
'sentry.origin': 'auto.ui.browser.metrics',
56-
'sentry.op': 'browser',
57-
},
58-
description: 'loadEvent',
59-
op: 'browser',
60-
parent_span_id: expect.any(String),
61-
span_id: expect.any(String),
62-
start_timestamp: expect.any(Number),
63-
timestamp: expect.any(Number),
64-
trace_id: expect.any(String),
65-
origin: 'auto.ui.browser.metrics',
66-
});
6753
expect(transactionEvent.spans).toContainEqual({
6854
data: {
6955
'sentry.origin': 'auto.ui.browser.metrics',

dev-packages/e2e-tests/test-applications/react-send-to-sentry/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
},
4949
"devDependencies": {
5050
"@playwright/test": "^1.44.1",
51-
"axios": "1.6.0",
5251
"serve": "14.0.1"
5352
},
5453
"volta": {
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { devices } from '@playwright/test';
2+
3+
/**
4+
* See https://playwright.dev/docs/test-configuration.
5+
*/
6+
const config = {
7+
testDir: './tests',
8+
/* Maximum time one test can run for. */
9+
timeout: 150_000,
10+
expect: {
11+
/**
12+
* Maximum time expect() should wait for the condition to be met.
13+
* For example in `await expect(locator).toHaveText();`
14+
*/
15+
timeout: 5000,
16+
},
17+
/* Run tests in files in parallel */
18+
fullyParallel: true,
19+
/* Fail the build on CI if you accidentally left test.only in the source code. */
20+
forbidOnly: !!process.env.CI,
21+
/* Retry on CI only */
22+
retries: 0,
23+
/* Opt out of parallel tests on CI. */
24+
workers: 1,
25+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
26+
reporter: 'list',
27+
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
28+
use: {
29+
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
30+
actionTimeout: 0,
31+
32+
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
33+
trace: 'on-first-retry',
34+
},
35+
36+
/* Configure projects for major browsers */
37+
projects: [
38+
{
39+
name: 'chromium',
40+
use: {
41+
...devices['Desktop Chrome'],
42+
},
43+
},
44+
// For now we only test Chrome!
45+
// {
46+
// name: 'firefox',
47+
// use: {
48+
// ...devices['Desktop Firefox'],
49+
// },
50+
// },
51+
// {
52+
// name: 'webkit',
53+
// use: {
54+
// ...devices['Desktop Safari'],
55+
// },
56+
// },
57+
],
58+
59+
/* Run your local dev server before starting the tests */
60+
webServer: {
61+
command: 'pnpm start',
62+
port: 3030,
63+
env: {
64+
PORT: '3030',
65+
},
66+
},
67+
};
68+
69+
export default config;

dev-packages/e2e-tests/test-applications/standard-frontend-react/src/index.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ Sentry.init({
3838
replaysOnErrorSampleRate: 0.0,
3939
});
4040

41-
Object.defineProperty(window, 'sentryReplayId', {
42-
get() {
43-
return replay['_replay'].session.id;
44-
},
45-
});
46-
4741
Sentry.addEventProcessor(event => {
4842
if (
4943
event.type === 'transaction' &&

dev-packages/e2e-tests/test-applications/standard-frontend-react/tests/behaviour-test.spec.ts

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { expect, test } from '@playwright/test';
2-
import { ReplayRecordingData } from './fixtures/ReplayRecordingData';
32

43
const EVENT_POLLING_TIMEOUT = 90_000;
54

@@ -139,62 +138,3 @@ test('Sends a navigation transaction to Sentry', async ({ page }) => {
139138

140139
expect(hadPageNavigationTransaction).toBe(true);
141140
});
142-
143-
test('Sends a Replay recording to Sentry', async ({ browser }) => {
144-
const context = await browser.newContext();
145-
const page = await context.newPage();
146-
147-
await page.goto('/');
148-
149-
const replayId = await page.waitForFunction(() => {
150-
return window.sentryReplayId;
151-
});
152-
153-
// Keypress event ensures LCP is finished
154-
await page.type('body', 'Y');
155-
156-
// Wait for replay to be sent
157-
158-
if (replayId === undefined) {
159-
throw new Error("Application didn't set a replayId");
160-
}
161-
162-
console.log(`Polling for replay with ID: ${replayId}`);
163-
164-
await expect
165-
.poll(
166-
async () => {
167-
const response = await fetch(
168-
`https://sentry.io/api/0/projects/${sentryTestOrgSlug}/${sentryTestProject}/replays/${replayId}/`,
169-
{ headers: { Authorization: `Bearer ${authToken}` } },
170-
);
171-
return response.status;
172-
},
173-
{
174-
timeout: EVENT_POLLING_TIMEOUT,
175-
},
176-
)
177-
.toBe(200);
178-
179-
// now fetch the first recording segment
180-
await expect
181-
.poll(
182-
async () => {
183-
const response = await fetch(
184-
`https://sentry.io/api/0/projects/${sentryTestOrgSlug}/${sentryTestProject}/replays/${replayId}/recording-segments/?cursor=100%3A0%3A1`,
185-
{ headers: { Authorization: `Bearer ${authToken}` } },
186-
);
187-
188-
if (response.ok) {
189-
const data = await response.json();
190-
return data[0];
191-
}
192-
193-
return response.status;
194-
},
195-
{
196-
timeout: EVENT_POLLING_TIMEOUT,
197-
},
198-
)
199-
.toEqual(ReplayRecordingData);
200-
});

0 commit comments

Comments
 (0)