From b618a74ec09ea15461750f98a1e681aa9aeb9c0e Mon Sep 17 00:00:00 2001 From: Billy Vong Date: Fri, 3 Mar 2023 16:55:10 -0500 Subject: [PATCH] TEMP: run 100x --- .github/workflows/build.yml | 2 +- .../suites/replay/privacyInput/test.ts | 184 +++++++++--------- .../suites/replay/privacyInputMaskAll/test.ts | 152 ++++++++------- 3 files changed, 171 insertions(+), 167 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 981133613300..4bb297e94e0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -481,7 +481,7 @@ jobs: needs: [job_get_metadata, job_build] if: needs.job_get_metadata.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request' runs-on: ubuntu-20.04 - timeout-minutes: 15 + timeout-minutes: 25 strategy: fail-fast: false matrix: diff --git a/packages/integration-tests/suites/replay/privacyInput/test.ts b/packages/integration-tests/suites/replay/privacyInput/test.ts index 02b18c42b15b..3784858a37da 100644 --- a/packages/integration-tests/suites/replay/privacyInput/test.ts +++ b/packages/integration-tests/suites/replay/privacyInput/test.ts @@ -13,96 +13,98 @@ function isInputMutation(snap: incrementalData): snap is inputData { return snap.source == IncrementalSource.Input; } -sentryTest( - 'should mask input initial value and its changes', - async ({ browserName, forceFlushReplay, getLocalTestPath, page }) => { - // TODO(replay): This is flakey on firefox where we do not always get the latest mutation. - if (shouldSkipReplayTest() || browserName === 'firefox') { - sentryTest.skip(); - } - - const reqPromise0 = waitForReplayRequest(page, 0); - const reqPromise1 = waitForReplayRequest(page, 1); - const reqPromise2 = waitForReplayRequest(page, 2); - const reqPromise3 = waitForReplayRequest(page, 3); - - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), +for (let i = 0; i < 100; i++) { + sentryTest( + 'should mask input initial value and its changes', + async ({ browserName, forceFlushReplay, getLocalTestPath, page }) => { + // TODO(replay): This is flakey on firefox where we do not always get the latest mutation. + if (shouldSkipReplayTest() || browserName === 'firefox') { + sentryTest.skip(); + } + + const reqPromise0 = waitForReplayRequest(page, 0); + const reqPromise1 = waitForReplayRequest(page, 1); + const reqPromise2 = waitForReplayRequest(page, 2); + const reqPromise3 = waitForReplayRequest(page, 3); + + 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 getLocalTestPath({ testDir: __dirname }); - - await page.goto(url); - - await reqPromise0; - - const text = 'this is test text'; - - await page.locator('#input').type(text); - await forceFlushReplay(); - const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation); - const lastSnapshot = snapshots[snapshots.length - 1]; - expect(lastSnapshot.text).toBe(text); - - await page.locator('#input-masked').type(text); - await forceFlushReplay(); - const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation); - const lastSnapshot2 = snapshots2[snapshots2.length - 1]; - expect(lastSnapshot2.text).toBe('*'.repeat(text.length)); - - await page.locator('#input-ignore').type(text); - await forceFlushReplay(); - const snapshots3 = getIncrementalRecordingSnapshots(await reqPromise3).filter(isInputMutation); - expect(snapshots3.length).toBe(0); - }, -); - -sentryTest( - 'should mask textarea initial value and its changes', - async ({ browserName, forceFlushReplay, getLocalTestPath, page }) => { - // TODO(replay): This is flakey on firefox where we do not always get the latest mutation. - if (shouldSkipReplayTest() || browserName === 'firefox') { - sentryTest.skip(); - } - - const reqPromise0 = waitForReplayRequest(page, 0); - const reqPromise1 = waitForReplayRequest(page, 1); - const reqPromise2 = waitForReplayRequest(page, 2); - const reqPromise3 = waitForReplayRequest(page, 3); - - 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 getLocalTestPath({ testDir: __dirname }); + + await page.goto(url); + + await reqPromise0; + + const text = 'this is test text'; + + await page.locator('#input').type(text); + await forceFlushReplay(); + const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation); + const lastSnapshot = snapshots[snapshots.length - 1]; + expect(lastSnapshot.text).toBe(text); + + await page.locator('#input-masked').type(text); + await forceFlushReplay(); + const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation); + const lastSnapshot2 = snapshots2[snapshots2.length - 1]; + expect(lastSnapshot2.text).toBe('*'.repeat(text.length)); + + await page.locator('#input-ignore').type(text); + await forceFlushReplay(); + const snapshots3 = getIncrementalRecordingSnapshots(await reqPromise3).filter(isInputMutation); + expect(snapshots3.length).toBe(0); + }, + ); + + sentryTest( + 'should mask textarea initial value and its changes', + async ({ browserName, forceFlushReplay, getLocalTestPath, page }) => { + // TODO(replay): This is flakey on firefox where we do not always get the latest mutation. + if (shouldSkipReplayTest() || browserName === 'firefox') { + sentryTest.skip(); + } + + const reqPromise0 = waitForReplayRequest(page, 0); + const reqPromise1 = waitForReplayRequest(page, 1); + const reqPromise2 = waitForReplayRequest(page, 2); + const reqPromise3 = waitForReplayRequest(page, 3); + + 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 getLocalTestPath({ testDir: __dirname }); - - await page.goto(url); - await reqPromise0; - - const text = 'this is test text'; - await page.locator('#textarea').type(text); - await forceFlushReplay(); - const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation); - const lastSnapshot = snapshots[snapshots.length - 1]; - expect(lastSnapshot.text).toBe(text); - - await page.locator('#textarea-masked').type(text); - await forceFlushReplay(); - const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation); - const lastSnapshot2 = snapshots2[snapshots2.length - 1]; - expect(lastSnapshot2.text).toBe('*'.repeat(text.length)); - - await page.locator('#textarea-ignore').type(text); - await forceFlushReplay(); - const snapshots3 = getIncrementalRecordingSnapshots(await reqPromise3).filter(isInputMutation); - expect(snapshots3.length).toBe(0); - }, -); + + const url = await getLocalTestPath({ testDir: __dirname }); + + await page.goto(url); + await reqPromise0; + + const text = 'this is test text'; + await page.locator('#textarea').type(text); + await forceFlushReplay(); + const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation); + const lastSnapshot = snapshots[snapshots.length - 1]; + expect(lastSnapshot.text).toBe(text); + + await page.locator('#textarea-masked').type(text); + await forceFlushReplay(); + const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation); + const lastSnapshot2 = snapshots2[snapshots2.length - 1]; + expect(lastSnapshot2.text).toBe('*'.repeat(text.length)); + + await page.locator('#textarea-ignore').type(text); + await forceFlushReplay(); + const snapshots3 = getIncrementalRecordingSnapshots(await reqPromise3).filter(isInputMutation); + expect(snapshots3.length).toBe(0); + }, + ); +} diff --git a/packages/integration-tests/suites/replay/privacyInputMaskAll/test.ts b/packages/integration-tests/suites/replay/privacyInputMaskAll/test.ts index 6415260d1531..efb624ba8c82 100644 --- a/packages/integration-tests/suites/replay/privacyInputMaskAll/test.ts +++ b/packages/integration-tests/suites/replay/privacyInputMaskAll/test.ts @@ -13,86 +13,88 @@ function isInputMutation(snap: incrementalData): snap is inputData { return snap.source == IncrementalSource.Input; } -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 where we do not always get the latest mutation. - if (shouldSkipReplayTest() || browserName === 'firefox') { - sentryTest.skip(); - } - - const reqPromise0 = waitForReplayRequest(page, 0); - const reqPromise1 = waitForReplayRequest(page, 1); - const reqPromise2 = waitForReplayRequest(page, 2); - - await page.route('https://dsn.ingest.sentry.io/**/*', route => { - return route.fulfill({ - status: 200, - contentType: 'application/json', - body: JSON.stringify({ id: 'test-id' }), +for (let i = 0; i < 100; i++) { + 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 where we do not always get the latest mutation. + if (shouldSkipReplayTest() || browserName === 'firefox') { + sentryTest.skip(); + } + + const reqPromise0 = waitForReplayRequest(page, 0); + const reqPromise1 = waitForReplayRequest(page, 1); + const reqPromise2 = waitForReplayRequest(page, 2); + + 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 getLocalTestPath({ testDir: __dirname }); - - await page.goto(url); - - await reqPromise0; - - const text = 'this is test text'; - - await page.locator('#input').type(text); - await forceFlushReplay(); - const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation); - const lastSnapshot = snapshots[snapshots.length - 1]; - expect(lastSnapshot.text).toBe('*'.repeat(text.length)); - - await page.locator('#input-unmasked').type(text); - await forceFlushReplay(); - const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation); - const lastSnapshot2 = snapshots2[snapshots2.length - 1]; - expect(lastSnapshot2.text).toBe(text); - }, -); - -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 where we do not always get the latest mutation. - if (shouldSkipReplayTest() || browserName === 'firefox') { - sentryTest.skip(); - } - - const reqPromise0 = waitForReplayRequest(page, 0); - const reqPromise1 = waitForReplayRequest(page, 1); - const reqPromise2 = waitForReplayRequest(page, 2); - - 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 getLocalTestPath({ testDir: __dirname }); + + await page.goto(url); + + await reqPromise0; + + const text = 'this is test text'; + + await page.locator('#input').type(text); + await forceFlushReplay(); + const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation); + const lastSnapshot = snapshots[snapshots.length - 1]; + expect(lastSnapshot.text).toBe('*'.repeat(text.length)); + + await page.locator('#input-unmasked').type(text); + await forceFlushReplay(); + const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation); + const lastSnapshot2 = snapshots2[snapshots2.length - 1]; + expect(lastSnapshot2.text).toBe(text); + }, + ); + + 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 where we do not always get the latest mutation. + if (shouldSkipReplayTest() || browserName === 'firefox') { + sentryTest.skip(); + } + + const reqPromise0 = waitForReplayRequest(page, 0); + const reqPromise1 = waitForReplayRequest(page, 1); + const reqPromise2 = waitForReplayRequest(page, 2); + + 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 getLocalTestPath({ testDir: __dirname }); + const url = await getLocalTestPath({ testDir: __dirname }); - await page.goto(url); + await page.goto(url); - await reqPromise0; + await reqPromise0; - const text = 'this is test text'; + const text = 'this is test text'; - await page.locator('#textarea').type(text); - await forceFlushReplay(); - const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation); - const lastSnapshot = snapshots[snapshots.length - 1]; - expect(lastSnapshot.text).toBe('*'.repeat(text.length)); + await page.locator('#textarea').type(text); + await forceFlushReplay(); + const snapshots = getIncrementalRecordingSnapshots(await reqPromise1).filter(isInputMutation); + const lastSnapshot = snapshots[snapshots.length - 1]; + expect(lastSnapshot.text).toBe('*'.repeat(text.length)); - await page.locator('#textarea-unmasked').type(text); - await forceFlushReplay(); - const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation); - const lastSnapshot2 = snapshots2[snapshots2.length - 1]; - expect(lastSnapshot2.text).toBe(text); - }, -); + await page.locator('#textarea-unmasked').type(text); + await forceFlushReplay(); + const snapshots2 = getIncrementalRecordingSnapshots(await reqPromise2).filter(isInputMutation); + const lastSnapshot2 = snapshots2[snapshots2.length - 1]; + expect(lastSnapshot2.text).toBe(text); + }, + ); +}