Skip to content

Commit 19226e7

Browse files
committed
test run 100x
1 parent 68a56d2 commit 19226e7

File tree

1 file changed

+33
-31
lines changed
  • packages/browser-integration-tests/suites/replay/fileInput

1 file changed

+33
-31
lines changed

packages/browser-integration-tests/suites/replay/fileInput/test.ts

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,45 @@ function isInputMutation(
1616
return snap.data.source == IncrementalSource.Input;
1717
}
1818

19-
sentryTest(
20-
'should not capture file input mutations',
21-
async ({ forceFlushReplay, getLocalTestPath, page, browserName }) => {
22-
// This seems to be flaky on webkit, so skipping there
23-
if (shouldSkipReplayTest() || browserName === 'webkit') {
24-
sentryTest.skip();
25-
}
26-
27-
const reqPromise0 = waitForReplayRequest(page, 0);
28-
const reqPromise1 = waitForReplayRequest(page, 1);
29-
30-
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
31-
return route.fulfill({
32-
status: 200,
33-
contentType: 'application/json',
34-
body: JSON.stringify({ id: 'test-id' }),
19+
for (let i = 0; i < 100; i++) {
20+
sentryTest(
21+
`should not capture file input mutations RUN ${i}`,
22+
async ({ forceFlushReplay, getLocalTestPath, page, browserName }) => {
23+
// This seems to be flaky on webkit, so skipping there
24+
if (shouldSkipReplayTest() || browserName === 'webkit') {
25+
sentryTest.skip();
26+
}
27+
28+
const reqPromise0 = waitForReplayRequest(page, 0);
29+
const reqPromise1 = waitForReplayRequest(page, 1);
30+
31+
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
32+
return route.fulfill({
33+
status: 200,
34+
contentType: 'application/json',
35+
body: JSON.stringify({ id: 'test-id' }),
36+
});
3537
});
36-
});
3738

38-
const url = await getLocalTestPath({ testDir: __dirname });
39+
const url = await getLocalTestPath({ testDir: __dirname });
3940

40-
await page.goto(url);
41+
await page.goto(url);
4142

42-
await reqPromise0;
43+
await reqPromise0;
4344

44-
await page.setInputFiles('#file-input', {
45-
name: 'file.csv',
46-
mimeType: 'text/csv',
47-
buffer: Buffer.from('this,is,test'),
48-
});
45+
await page.setInputFiles('#file-input', {
46+
name: 'file.csv',
47+
mimeType: 'text/csv',
48+
buffer: Buffer.from('this,is,test'),
49+
});
4950

50-
await forceFlushReplay();
51+
await forceFlushReplay();
5152

52-
const res1 = await reqPromise1;
53+
const res1 = await reqPromise1;
5354

54-
const snapshots = getIncrementalRecordingSnapshots(res1).filter(isInputMutation);
55+
const snapshots = getIncrementalRecordingSnapshots(res1).filter(isInputMutation);
5556

56-
expect(snapshots).toEqual([]);
57-
},
58-
);
57+
expect(snapshots).toEqual([]);
58+
},
59+
);
60+
}

0 commit comments

Comments
 (0)