diff --git a/packages/browser-integration-tests/README.md b/packages/browser-integration-tests/README.md index 075163a4b9dc..6024b98a8085 100644 --- a/packages/browser-integration-tests/README.md +++ b/packages/browser-integration-tests/README.md @@ -47,12 +47,12 @@ Tests can be run locally using the latest version of Chromium with: To run tests with a different browser such as `firefox` or `webkit`: -`yarn test --browser='firefox'` -`yarn test --browser='webkit'` +`yarn test --project='firefox'` +`yarn test --project='webkit'` Or to run on all three browsers: -`yarn test --browser='all'` +`yarn test:all` To filter tests by their title: diff --git a/packages/browser-integration-tests/package.json b/packages/browser-integration-tests/package.json index 29355db6c034..74ee2fe69778 100644 --- a/packages/browser-integration-tests/package.json +++ b/packages/browser-integration-tests/package.json @@ -18,7 +18,8 @@ "fix:prettier": "prettier --write \"{suites,utils}/**/*.ts\"", "type-check": "tsc", "pretest": "yarn clean && yarn type-check", - "test": "playwright test ./suites", + "test": "playwright test ./suites --project='chromium'", + "test:all": "playwright test ./suites", "test:bundle:es5": "PW_BUNDLE=bundle_es5 yarn test", "test:bundle:es5:min": "PW_BUNDLE=bundle_es5_min yarn test", "test:bundle:es6": "PW_BUNDLE=bundle_es6 yarn test", @@ -33,15 +34,15 @@ "test:bundle:tracing:replay:es6:min": "PW_BUNDLE=bundle_tracing_replay_es6_min yarn test", "test:cjs": "PW_BUNDLE=cjs yarn test", "test:esm": "PW_BUNDLE=esm yarn test", - "test:loader": "playwright test ./loader-suites", + "test:loader": "playwright test ./loader-suites --project='chromium'", "test:loader:base": "PW_BUNDLE=loader_base yarn test:loader", "test:loader:eager": "PW_BUNDLE=loader_eager yarn test:loader", "test:loader:tracing": "PW_BUNDLE=loader_tracing yarn test:loader", "test:loader:replay": "PW_BUNDLE=loader_replay yarn test:loader", "test:loader:full": "PW_BUNDLE=loader_tracing_replay yarn test:loader", "test:loader:debug": "PW_BUNDLE=loader_debug yarn test:loader", - "test:ci": "playwright test ./suites --browser='all' --reporter='line'", - "test:update-snapshots": "yarn test --update-snapshots --browser='all' && yarn test --update-snapshots", + "test:ci": "playwright test ./suites --reporter='line'", + "test:update-snapshots": "yarn test:all --update-snapshots", "test:detect-flaky": "ts-node scripts/detectFlakyTests.ts", "validate:es5": "es-check es5 'fixtures/loader.js'" }, diff --git a/packages/browser-integration-tests/playwright.config.ts b/packages/browser-integration-tests/playwright.config.ts index 8b85d4a83f4f..05d0ada178ae 100644 --- a/packages/browser-integration-tests/playwright.config.ts +++ b/packages/browser-integration-tests/playwright.config.ts @@ -1,4 +1,5 @@ import type { PlaywrightTestConfig } from '@playwright/test'; +import { devices } from '@playwright/test'; const config: PlaywrightTestConfig = { retries: 0, @@ -8,6 +9,22 @@ const config: PlaywrightTestConfig = { // Note that 3 is a random number selected to work well with our CI setup workers: process.env.CI ? 3 : undefined, + projects: [ + { + name: 'chromium', + use: devices['Desktop Chrome'], + }, + { + name: 'webkit', + use: devices['Desktop Safari'], + }, + { + name: 'firefox', + grep: /@firefox/i, + use: devices['Desktop Firefox'], + }, + ], + globalSetup: require.resolve('./playwright.setup.ts'), }; diff --git a/packages/browser-integration-tests/scripts/detectFlakyTests.ts b/packages/browser-integration-tests/scripts/detectFlakyTests.ts index 11eb04e651e4..12d83f30af5b 100644 --- a/packages/browser-integration-tests/scripts/detectFlakyTests.ts +++ b/packages/browser-integration-tests/scripts/detectFlakyTests.ts @@ -46,7 +46,7 @@ ${changedPaths.join('\n')} const cp = childProcess.spawn( `yarn playwright test ${ testPaths.length ? testPaths.join(' ') : './suites' - } --browser='all' --reporter='line' --repeat-each ${runCount}`, + } --reporter='line' --repeat-each ${runCount}`, { shell: true, cwd }, ); diff --git a/packages/browser-integration-tests/suites/public-api/captureException/errorEvent/test.ts b/packages/browser-integration-tests/suites/public-api/captureException/errorEvent/test.ts index dbcaaf24a1cf..9c09ba374e78 100644 --- a/packages/browser-integration-tests/suites/public-api/captureException/errorEvent/test.ts +++ b/packages/browser-integration-tests/suites/public-api/captureException/errorEvent/test.ts @@ -4,11 +4,7 @@ import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../../utils/helpers'; -sentryTest('should capture an ErrorEvent', async ({ getLocalTestPath, page, browserName }) => { - // On Firefox, the ErrorEvent has the `error` property and thus is handled separately - if (browserName === 'firefox') { - sentryTest.skip(); - } +sentryTest('should capture an ErrorEvent', async ({ getLocalTestPath, page }) => { const url = await getLocalTestPath({ testDir: __dirname }); const eventData = await getFirstSentryEnvelopeRequest(page, url); diff --git a/packages/browser-integration-tests/suites/replay/bufferMode/test.ts b/packages/browser-integration-tests/suites/replay/bufferMode/test.ts index 4785c1a5b158..5b9c0da33899 100644 --- a/packages/browser-integration-tests/suites/replay/bufferMode/test.ts +++ b/packages/browser-integration-tests/suites/replay/bufferMode/test.ts @@ -16,8 +16,8 @@ import { sentryTest( '[buffer-mode] manually start buffer mode and capture buffer', async ({ getLocalTestPath, page, browserName }) => { - // This was sometimes flaky on firefox/webkit, so skipping for now - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + // This was sometimes flaky on webkit, so skipping for now + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } @@ -159,8 +159,8 @@ sentryTest( sentryTest( '[buffer-mode] manually start buffer mode and capture buffer, but do not continue as session', async ({ getLocalTestPath, page, browserName }) => { - // This was sometimes flaky on firefox/webkit, so skipping for now - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + // This was sometimes flaky on webkit, so skipping for now + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } @@ -287,8 +287,7 @@ sentryTest( sentryTest( '[buffer-mode] can sample on each error event', async ({ getLocalTestPath, page, browserName, enableConsole }) => { - // This was sometimes flaky on firefox/webkit, so skipping for now - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/customEvents/test.ts b/packages/browser-integration-tests/suites/replay/customEvents/test.ts index 92bcd081ea8f..d8d6750f9dcb 100644 --- a/packages/browser-integration-tests/suites/replay/customEvents/test.ts +++ b/packages/browser-integration-tests/suites/replay/customEvents/test.ts @@ -81,8 +81,8 @@ sentryTest( sentryTest( 'replay recording should contain a click breadcrumb when a button is clicked', async ({ forceFlushReplay, getLocalTestPath, page, browserName }) => { - // TODO(replay): This is flakey on firefox and webkit where clicks are flakey - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + // TODO(replay): This is flakey on webkit where clicks are flakey + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } @@ -177,8 +177,8 @@ sentryTest( sentryTest( 'replay recording should contain an "options" breadcrumb for Replay SDK configuration', async ({ forceFlushReplay, getLocalTestPath, page, browserName }) => { - // TODO(replay): This is flakey on firefox and webkit where clicks are flakey - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + // TODO(replay): This is flakey on webkit where clicks are flakey + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/errors/errorMode/test.ts b/packages/browser-integration-tests/suites/replay/errors/errorMode/test.ts index aa452cdd9307..15e9ab60dc3c 100644 --- a/packages/browser-integration-tests/suites/replay/errors/errorMode/test.ts +++ b/packages/browser-integration-tests/suites/replay/errors/errorMode/test.ts @@ -18,8 +18,8 @@ import { sentryTest( '[error-mode] should start recording and switch to session mode once an error is thrown', async ({ getLocalTestPath, page, browserName }) => { - // This was sometimes flaky on firefox/webkit, so skipping for now - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + // This was sometimes flaky on webkit, so skipping for now + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/errors/errorsInSession/test.ts b/packages/browser-integration-tests/suites/replay/errors/errorsInSession/test.ts index 9385e044a75c..603758c95409 100644 --- a/packages/browser-integration-tests/suites/replay/errors/errorsInSession/test.ts +++ b/packages/browser-integration-tests/suites/replay/errors/errorsInSession/test.ts @@ -13,8 +13,8 @@ import { sentryTest( '[session-mode] replay event should contain an error id of an error that occurred during session recording', async ({ getLocalTestPath, page, browserName, forceFlushReplay }) => { - // Skipping this in firefox/webkit because it is flakey there - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + // Skipping this in webkit because it is flakey there + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } @@ -86,8 +86,8 @@ sentryTest( sentryTest( '[session-mode] replay event should not contain an error id of a dropped error while recording', async ({ getLocalTestPath, page, forceFlushReplay, browserName }) => { - // Skipping this in firefox/webkit because it is flakey there - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + // Skipping this in webkit because it is flakey there + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/largeMutations/defaultOptions/test.ts b/packages/browser-integration-tests/suites/replay/largeMutations/defaultOptions/test.ts index c0d8e8234da8..b7d0e558b844 100644 --- a/packages/browser-integration-tests/suites/replay/largeMutations/defaultOptions/test.ts +++ b/packages/browser-integration-tests/suites/replay/largeMutations/defaultOptions/test.ts @@ -6,7 +6,7 @@ import { getReplayRecordingContent, shouldSkipReplayTest, waitForReplayRequest } sentryTest( 'handles large mutations with default options', async ({ getLocalTestPath, page, forceFlushReplay, browserName }) => { - if (shouldSkipReplayTest() || ['webkit', 'firefox'].includes(browserName)) { + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/largeMutations/mutationLimit/test.ts b/packages/browser-integration-tests/suites/replay/largeMutations/mutationLimit/test.ts index b826daafe6b4..eb144fa012ef 100644 --- a/packages/browser-integration-tests/suites/replay/largeMutations/mutationLimit/test.ts +++ b/packages/browser-integration-tests/suites/replay/largeMutations/mutationLimit/test.ts @@ -11,7 +11,7 @@ import { sentryTest( 'handles large mutations by stopping replay when `mutationLimit` configured', async ({ getLocalTestPath, page, forceFlushReplay, browserName }) => { - if (shouldSkipReplayTest() || ['webkit', 'firefox'].includes(browserName)) { + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/privacyInput/test.ts b/packages/browser-integration-tests/suites/replay/privacyInput/test.ts index dc071b9bf487..71f6bd77ae67 100644 --- a/packages/browser-integration-tests/suites/replay/privacyInput/test.ts +++ b/packages/browser-integration-tests/suites/replay/privacyInput/test.ts @@ -19,8 +19,8 @@ function isInputMutation( sentryTest( 'should mask input initial value and its changes', async ({ browserName, forceFlushReplay, getLocalTestPath, page }) => { - // TODO(replay): This is flakey on firefox and webkit (~1%) where we do not always get the latest mutation. - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + // TODO(replay): This is flakey on webkit (~1%) where we do not always get the latest mutation. + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } @@ -91,8 +91,8 @@ sentryTest( sentryTest( 'should mask textarea initial value and its changes', async ({ browserName, forceFlushReplay, getLocalTestPath, page }) => { - // TODO(replay): This is flakey on firefox and webkit (~1%) where we do not always get the latest mutation. - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + // TODO(replay): This is flakey on webkit (~1%) where we do not always get the latest mutation. + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/privacyInputMaskAll/test.ts b/packages/browser-integration-tests/suites/replay/privacyInputMaskAll/test.ts index 9b4470118422..cbcf29f4ec6f 100644 --- a/packages/browser-integration-tests/suites/replay/privacyInputMaskAll/test.ts +++ b/packages/browser-integration-tests/suites/replay/privacyInputMaskAll/test.ts @@ -19,8 +19,8 @@ function isInputMutation( sentryTest( 'should mask input initial value and its changes from `maskAllInputs` and allow unmasked selector', async ({ browserName, forceFlushReplay, getLocalTestPath, page }) => { - // TODO(replay): This is flakey on firefox and webkit (~1%) where we do not always get the latest mutation. - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + // TODO(replay): This is flakey on webkit (~1%) where we do not always get the latest mutation. + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } @@ -78,8 +78,8 @@ sentryTest( sentryTest( 'should mask textarea initial value and its changes from `maskAllInputs` and allow unmasked selector', async ({ browserName, forceFlushReplay, getLocalTestPath, page }) => { - // TODO(replay): This is flakey on firefox and webkit (~1%) where we do not always get the latest mutation. - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + // TODO(replay): This is flakey on webkit (~1%) where we do not always get the latest mutation. + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/requests/test.ts b/packages/browser-integration-tests/suites/replay/requests/test.ts index de879a920b0e..ba1d6ec5d0a2 100644 --- a/packages/browser-integration-tests/suites/replay/requests/test.ts +++ b/packages/browser-integration-tests/suites/replay/requests/test.ts @@ -5,10 +5,8 @@ import { expectedFetchPerformanceSpan, expectedXHRPerformanceSpan } from '../../ import { getReplayRecordingContent, shouldSkipReplayTest, waitForReplayRequest } from '../../../utils/replayHelpers'; sentryTest('replay recording should contain fetch request span', async ({ getLocalTestPath, page, browserName }) => { - // For some reason, observing and waiting for requests in firefox/webkit is extremely flaky. - // We therefore skip this test for firefox and only test on chromium. // Possibly related: https://github.com/microsoft/playwright/issues/11390 - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } @@ -48,9 +46,7 @@ sentryTest('replay recording should contain fetch request span', async ({ getLoc }); sentryTest('replay recording should contain XHR request span', async ({ getLocalTestPath, page, browserName }) => { - // For some reason, observing and waiting for requests in firefox/webkit is extremely flaky. - // We therefore skip this test for firefox and only test on chromium. - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts b/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts index bd303c9e68c3..f1765b2a3c22 100644 --- a/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts +++ b/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts @@ -14,9 +14,8 @@ import { // Session should expire after 2s - keep in sync with init.js const SESSION_TIMEOUT = 2000; -sentryTest('handles an expired session', async ({ browserName, getLocalTestPath, page }) => { - // This test seems to only be flakey on firefox - if (shouldSkipReplayTest() || ['firefox'].includes(browserName)) { +sentryTest('handles an expired session', async ({ getLocalTestPath, page }) => { + if (shouldSkipReplayTest()) { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-0-firefox.json b/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-0-firefox.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-0-firefox.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-0.json b/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-0.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-0.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-2-firefox.json b/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-2-firefox.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-2-firefox.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-2.json b/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-2.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionExpiry/test.ts-snapshots/snapshot-2.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-0-firefox.json b/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-0-firefox.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-0-firefox.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-0.json b/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-0.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-0.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-1-firefox.json b/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-1-firefox.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-1-firefox.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-1.json b/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-1.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionInactive/test.ts-snapshots/snapshot-1.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-0-firefox.json b/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-0-firefox.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-0-firefox.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-0.json b/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-0.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-0.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-2-firefox.json b/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-2-firefox.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-2-firefox.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-2.json b/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-2.json deleted file mode 100644 index d510b410a343..000000000000 --- a/packages/browser-integration-tests/suites/replay/sessionMaxAge/test.ts-snapshots/snapshot-2.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "type": 2, - "data": { - "node": { - "type": 0, - "childNodes": [ - { - "type": 1, - "name": "html", - "publicId": "", - "systemId": "", - "id": 2 - }, - { - "type": 2, - "tagName": "html", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "head", - "attributes": {}, - "childNodes": [ - { - "type": 2, - "tagName": "meta", - "attributes": { - "charset": "utf-8" - }, - "childNodes": [], - "id": 5 - } - ], - "id": 4 - }, - { - "type": 3, - "textContent": "\n ", - "id": 6 - }, - { - "type": 2, - "tagName": "body", - "attributes": {}, - "childNodes": [ - { - "type": 3, - "textContent": "\n ", - "id": 8 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 1')", - "id": "button1" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 10 - } - ], - "id": 9 - }, - { - "type": 3, - "textContent": "\n ", - "id": 11 - }, - { - "type": 2, - "tagName": "button", - "attributes": { - "onclick": "console.log('Test log 2')", - "id": "button2" - }, - "childNodes": [ - { - "type": 3, - "textContent": "***** **", - "id": 13 - } - ], - "id": 12 - }, - { - "type": 3, - "textContent": "\n ", - "id": 14 - }, - { - "type": 3, - "textContent": "\n\n", - "id": 15 - } - ], - "id": 7 - } - ], - "id": 3 - } - ], - "id": 1 - }, - "initialOffset": { - "left": 0, - "top": 0 - } - }, - "timestamp": [timestamp] -} \ No newline at end of file diff --git a/packages/browser-integration-tests/suites/replay/slowClick/init.js b/packages/browser-integration-tests/suites/replay/slowClick/init.js index 030b2722d236..575e490b2927 100644 --- a/packages/browser-integration-tests/suites/replay/slowClick/init.js +++ b/packages/browser-integration-tests/suites/replay/slowClick/init.js @@ -5,7 +5,7 @@ window.Replay = new Sentry.Replay({ flushMinDelay: 200, flushMaxDelay: 200, minReplayDuration: 0, - slowClickTimeout: 3100, + slowClickTimeout: 3500, slowClickIgnoreSelectors: ['.ignore-class', '[ignore-attribute]'], }); diff --git a/packages/browser-integration-tests/suites/replay/slowClick/multiClick/test.ts b/packages/browser-integration-tests/suites/replay/slowClick/multiClick/test.ts index 370db54777f3..cdb099d82a18 100644 --- a/packages/browser-integration-tests/suites/replay/slowClick/multiClick/test.ts +++ b/packages/browser-integration-tests/suites/replay/slowClick/multiClick/test.ts @@ -102,8 +102,7 @@ sentryTest('captures multi click when not detecting slow click', async ({ getLoc }); sentryTest('captures multiple multi clicks', async ({ getLocalTestUrl, page, forceFlushReplay, browserName }) => { - // This test seems to only be flakey on firefox and webkit - if (shouldSkipReplayTest() || ['firefox', 'webkit'].includes(browserName)) { + if (shouldSkipReplayTest() || browserName === 'webkit') { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/slowClick/mutation/test.ts b/packages/browser-integration-tests/suites/replay/slowClick/mutation/test.ts index bab50e12938c..cb5b9160d13b 100644 --- a/packages/browser-integration-tests/suites/replay/slowClick/mutation/test.ts +++ b/packages/browser-integration-tests/suites/replay/slowClick/mutation/test.ts @@ -61,7 +61,7 @@ sentryTest('mutation after threshold results in slow click', async ({ forceFlush ]); expect(slowClickBreadcrumbs[0]?.data?.timeAfterClickMs).toBeGreaterThan(3000); - expect(slowClickBreadcrumbs[0]?.data?.timeAfterClickMs).toBeLessThan(3100); + expect(slowClickBreadcrumbs[0]?.data?.timeAfterClickMs).toBeLessThan(3500); }); sentryTest('multiple clicks are counted', async ({ getLocalTestUrl, page }) => { @@ -123,64 +123,60 @@ sentryTest('multiple clicks are counted', async ({ getLocalTestUrl, page }) => { expect(multiClickBreadcrumbs.length).toEqual(0); expect(slowClickBreadcrumbs[0]?.data?.timeAfterClickMs).toBeGreaterThan(3000); - expect(slowClickBreadcrumbs[0]?.data?.timeAfterClickMs).toBeLessThan(3100); + expect(slowClickBreadcrumbs[0]?.data?.timeAfterClickMs).toBeLessThan(3500); }); -sentryTest( - 'immediate mutation does not trigger slow click', - async ({ forceFlushReplay, browserName, getLocalTestUrl, page }) => { - // This test seems to only be flakey on firefox - if (shouldSkipReplayTest() || ['firefox'].includes(browserName)) { - sentryTest.skip(); - } - - const reqPromise0 = waitForReplayRequest(page, 0); - - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), - }); +sentryTest('immediate mutation does not trigger slow click', async ({ forceFlushReplay, getLocalTestUrl, page }) => { + if (shouldSkipReplayTest()) { + sentryTest.skip(); + } + + const reqPromise0 = waitForReplayRequest(page, 0); + + await page.route('https://dsn.ingest.sentry.io/**/*', route => { + return route.fulfill({ + status: 200, + contentType: 'application/json', + body: JSON.stringify({ id: 'test-id' }), }); + }); - const url = await getLocalTestUrl({ testDir: __dirname }); + const url = await getLocalTestUrl({ testDir: __dirname }); - await page.goto(url); - await forceFlushReplay(); - await reqPromise0; + await page.goto(url); + await forceFlushReplay(); + await reqPromise0; - const reqPromise1 = waitForReplayRequest(page, (event, res) => { - const { breadcrumbs } = getCustomRecordingEvents(res); + const reqPromise1 = waitForReplayRequest(page, (event, res) => { + const { breadcrumbs } = getCustomRecordingEvents(res); - return breadcrumbs.some(breadcrumb => breadcrumb.category === 'ui.click'); - }); + return breadcrumbs.some(breadcrumb => breadcrumb.category === 'ui.click'); + }); + + await page.click('#mutationButtonImmediately'); - await page.click('#mutationButtonImmediately'); - - const { breadcrumbs } = getCustomRecordingEvents(await reqPromise1); - - expect(breadcrumbs).toEqual([ - { - category: 'ui.click', - data: { - node: { - attributes: { - id: 'mutationButtonImmediately', - }, - id: expect.any(Number), - tagName: 'button', - textContent: '******* ******** ***********', + const { breadcrumbs } = getCustomRecordingEvents(await reqPromise1); + + expect(breadcrumbs).toEqual([ + { + category: 'ui.click', + data: { + node: { + attributes: { + id: 'mutationButtonImmediately', }, - nodeId: expect.any(Number), + id: expect.any(Number), + tagName: 'button', + textContent: '******* ******** ***********', }, - message: 'body > button#mutationButtonImmediately', - timestamp: expect.any(Number), - type: 'default', + nodeId: expect.any(Number), }, - ]); - }, -); + message: 'body > button#mutationButtonImmediately', + timestamp: expect.any(Number), + type: 'default', + }, + ]); +}); sentryTest('inline click handler does not trigger slow click', async ({ forceFlushReplay, getLocalTestUrl, page }) => { if (shouldSkipReplayTest()) { @@ -234,9 +230,8 @@ sentryTest('inline click handler does not trigger slow click', async ({ forceFlu ]); }); -sentryTest('mouseDown events are considered', async ({ browserName, getLocalTestUrl, page }) => { - // This test seems to only be flakey on firefox - if (shouldSkipReplayTest() || ['firefox'].includes(browserName)) { +sentryTest('mouseDown events are considered', async ({ getLocalTestUrl, page }) => { + if (shouldSkipReplayTest()) { sentryTest.skip(); } diff --git a/packages/browser-integration-tests/suites/replay/slowClick/template.html b/packages/browser-integration-tests/suites/replay/slowClick/template.html index 19bd283db90e..45cc78aef02e 100644 --- a/packages/browser-integration-tests/suites/replay/slowClick/template.html +++ b/packages/browser-integration-tests/suites/replay/slowClick/template.html @@ -53,7 +53,7 @@

Bottom

document.getElementById('mutationButtonLate').addEventListener('click', () => { setTimeout(() => { document.getElementById('out').innerHTML += 'mutationButtonLate clicked
'; - }, 3101); + }, 3501); }); document.getElementById('mutationButtonImmediately').addEventListener('click', () => { document.getElementById('out').innerHTML += 'mutationButtonImmediately clicked
'; diff --git a/packages/browser-integration-tests/suites/replay/slowClick/timeout/test.ts b/packages/browser-integration-tests/suites/replay/slowClick/timeout/test.ts index 7e94e0b68f15..ed53bc2d5fb4 100644 --- a/packages/browser-integration-tests/suites/replay/slowClick/timeout/test.ts +++ b/packages/browser-integration-tests/suites/replay/slowClick/timeout/test.ts @@ -51,7 +51,7 @@ sentryTest('mutation after timeout results in slow click', async ({ getLocalTest textContent: '******* ******** ****', }, nodeId: expect.any(Number), - timeAfterClickMs: 3100, + timeAfterClickMs: 3500, url: 'http://sentry-test.io/index.html', }, message: 'body > button#mutationButtonLate', @@ -108,7 +108,7 @@ sentryTest('console.log results in slow click', async ({ getLocalTestUrl, page } textContent: '******* ******* ***', }, nodeId: expect.any(Number), - timeAfterClickMs: 3100, + timeAfterClickMs: 3500, url: 'http://sentry-test.io/index.html', }, message: 'body > button#consoleLogButton', diff --git a/packages/browser-integration-tests/suites/stacktraces/protocol_containing_fn_identifiers/test.ts b/packages/browser-integration-tests/suites/stacktraces/protocol_containing_fn_identifiers/test.ts index cd79799df328..4650c6b94f3c 100644 --- a/packages/browser-integration-tests/suites/stacktraces/protocol_containing_fn_identifiers/test.ts +++ b/packages/browser-integration-tests/suites/stacktraces/protocol_containing_fn_identifiers/test.ts @@ -5,7 +5,7 @@ import { sentryTest } from '../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers'; sentryTest( - 'should parse function identifiers that contain protocol names correctly', + 'should parse function identifiers that contain protocol names correctly @firefox', async ({ getLocalTestPath, page, runInChromium, runInFirefox, runInWebkit }) => { const url = await getLocalTestPath({ testDir: __dirname }); diff --git a/packages/browser-integration-tests/suites/stacktraces/protocol_fn_identifiers/test.ts b/packages/browser-integration-tests/suites/stacktraces/protocol_fn_identifiers/test.ts index c4ef75913334..c0c813058128 100644 --- a/packages/browser-integration-tests/suites/stacktraces/protocol_fn_identifiers/test.ts +++ b/packages/browser-integration-tests/suites/stacktraces/protocol_fn_identifiers/test.ts @@ -5,7 +5,7 @@ import { sentryTest } from '../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers'; sentryTest( - 'should parse function identifiers that are protocol names correctly', + 'should parse function identifiers that are protocol names correctly @firefox', async ({ getLocalTestPath, page, runInChromium, runInFirefox, runInWebkit }) => { const url = await getLocalTestPath({ testDir: __dirname }); diff --git a/packages/browser-integration-tests/suites/stacktraces/regular_fn_identifiers/test.ts b/packages/browser-integration-tests/suites/stacktraces/regular_fn_identifiers/test.ts index e7a9f452fe6a..66f8286a4b5e 100644 --- a/packages/browser-integration-tests/suites/stacktraces/regular_fn_identifiers/test.ts +++ b/packages/browser-integration-tests/suites/stacktraces/regular_fn_identifiers/test.ts @@ -5,7 +5,7 @@ import { sentryTest } from '../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest } from '../../../utils/helpers'; sentryTest( - 'should parse function identifiers correctly', + 'should parse function identifiers correctly @firefox', async ({ getLocalTestPath, page, runInChromium, runInFirefox, runInWebkit }) => { const url = await getLocalTestPath({ testDir: __dirname }); diff --git a/packages/browser-integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/test.ts b/packages/browser-integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/test.ts index 17f5920c57de..485d50d12641 100644 --- a/packages/browser-integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/test.ts +++ b/packages/browser-integration-tests/suites/tracing/browsertracing/backgroundtab-pageload/test.ts @@ -4,24 +4,20 @@ import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers'; -sentryTest( - 'should finish pageload transaction when the page goes background', - async ({ browserName, getLocalTestPath, page }) => { - // TODO: This is flakey on firefox... trace.status is sometimes undefined - if (shouldSkipTracingTest() || ['firefox'].includes(browserName)) { - sentryTest.skip(); - } - const url = await getLocalTestPath({ testDir: __dirname }); +sentryTest('should finish pageload transaction when the page goes background', async ({ getLocalTestPath, page }) => { + if (shouldSkipTracingTest()) { + sentryTest.skip(); + } + const url = await getLocalTestPath({ testDir: __dirname }); - await page.goto(url); - await page.click('#go-background'); + await page.goto(url); + await page.click('#go-background'); - const pageloadTransaction = await getFirstSentryEnvelopeRequest(page); + const pageloadTransaction = await getFirstSentryEnvelopeRequest(page); - expect(pageloadTransaction.contexts?.trace?.op).toBe('pageload'); - expect(pageloadTransaction.contexts?.trace?.status).toBe('cancelled'); - expect(pageloadTransaction.contexts?.trace?.tags).toMatchObject({ - visibilitychange: 'document.hidden', - }); - }, -); + expect(pageloadTransaction.contexts?.trace?.op).toBe('pageload'); + expect(pageloadTransaction.contexts?.trace?.status).toBe('cancelled'); + expect(pageloadTransaction.contexts?.trace?.tags).toMatchObject({ + visibilitychange: 'document.hidden', + }); +}); diff --git a/packages/browser-integration-tests/suites/tracing/browsertracing/http-timings/test.ts b/packages/browser-integration-tests/suites/tracing/browsertracing/http-timings/test.ts index 566c14297897..a8e7f9eec335 100644 --- a/packages/browser-integration-tests/suites/tracing/browsertracing/http-timings/test.ts +++ b/packages/browser-integration-tests/suites/tracing/browsertracing/http-timings/test.ts @@ -4,7 +4,7 @@ import type { Event } from '@sentry/types'; import { sentryTest } from '../../../../utils/fixtures'; import { getMultipleSentryEnvelopeRequests, shouldSkipTracingTest } from '../../../../utils/helpers'; -sentryTest('should create fetch spans with http timing', async ({ browserName, getLocalTestPath, page }) => { +sentryTest('should create fetch spans with http timing @firefox', async ({ browserName, getLocalTestPath, page }) => { const supportedBrowsers = ['chromium', 'firefox']; if (shouldSkipTracingTest() || !supportedBrowsers.includes(browserName)) { diff --git a/packages/browser-integration-tests/suites/tracing/browsertracing/interactions/test.ts b/packages/browser-integration-tests/suites/tracing/browsertracing/interactions/test.ts index 9b161699b9c0..e79b724ec91a 100644 --- a/packages/browser-integration-tests/suites/tracing/browsertracing/interactions/test.ts +++ b/packages/browser-integration-tests/suites/tracing/browsertracing/interactions/test.ts @@ -18,7 +18,7 @@ type TransactionJSON = ReturnType & { const wait = (time: number) => new Promise(res => setTimeout(res, time)); -sentryTest('should capture interaction transaction.', async ({ browserName, getLocalTestPath, page }) => { +sentryTest('should capture interaction transaction. @firefox', async ({ browserName, getLocalTestPath, page }) => { const supportedBrowsers = ['chromium', 'firefox']; if (shouldSkipTracingTest() || !supportedBrowsers.includes(browserName)) { @@ -55,23 +55,28 @@ sentryTest('should capture interaction transaction.', async ({ browserName, getL expect(interactionSpanDuration).toBeLessThan(200); }); -sentryTest('should create only one transaction per interaction', async ({ browserName, getLocalTestPath, page }) => { - const supportedBrowsers = ['chromium', 'firefox']; - - if (shouldSkipTracingTest() || !supportedBrowsers.includes(browserName)) { - sentryTest.skip(); - } - - await page.route('**/path/to/script.js', (route: Route) => route.fulfill({ path: `${__dirname}/assets/script.js` })); - - const url = await getLocalTestPath({ testDir: __dirname }); - await page.goto(url); - await getFirstSentryEnvelopeRequest(page); - - for (let i = 0; i < 4; i++) { - await wait(100); - await page.locator('[data-test-id=interaction-button]').click(); - const envelope = await getMultipleSentryEnvelopeRequests(page, 1); - expect(envelope[0].spans).toHaveLength(1); - } -}); +sentryTest( + 'should create only one transaction per interaction @firefox', + async ({ browserName, getLocalTestPath, page }) => { + const supportedBrowsers = ['chromium', 'firefox']; + + if (shouldSkipTracingTest() || !supportedBrowsers.includes(browserName)) { + sentryTest.skip(); + } + + await page.route('**/path/to/script.js', (route: Route) => + route.fulfill({ path: `${__dirname}/assets/script.js` }), + ); + + const url = await getLocalTestPath({ testDir: __dirname }); + await page.goto(url); + await getFirstSentryEnvelopeRequest(page); + + for (let i = 0; i < 4; i++) { + await wait(100); + await page.locator('[data-test-id=interaction-button]').click(); + const envelope = await getMultipleSentryEnvelopeRequests(page, 1); + expect(envelope[0].spans).toHaveLength(1); + } + }, +);