Skip to content

Commit

Permalink
TEMP: run 100x
Browse files Browse the repository at this point in the history
  • Loading branch information
billyvg committed Mar 3, 2023
1 parent 3683461 commit b618a74
Show file tree
Hide file tree
Showing 3 changed files with 171 additions and 167 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
184 changes: 93 additions & 91 deletions packages/integration-tests/suites/replay/privacyInput/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
);
}
152 changes: 77 additions & 75 deletions packages/integration-tests/suites/replay/privacyInputMaskAll/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
);
}

0 comments on commit b618a74

Please sign in to comment.