Skip to content

Commit 0ec91e1

Browse files
committed
run test 100x
1 parent 89a359d commit 0ec91e1

File tree

2 files changed

+40
-36
lines changed

2 files changed

+40
-36
lines changed

packages/browser-integration-tests/suites/replay/fileInput/template.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
</head>
66
<body>
77
<input id="file-input" type="file" />
8+
<button id="button">Test button</button>
89
</body>
910
</html>

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

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

19-
sentryTest('should not capture file input mutations', async ({ forceFlushReplay, getLocalTestPath, page }) => {
20-
if (shouldSkipReplayTest()) {
21-
sentryTest.skip();
22-
}
23-
24-
const reqPromise0 = waitForReplayRequest(page, 0);
25-
const reqPromise1 = waitForReplayRequest(page, 1);
26-
27-
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
28-
return route.fulfill({
29-
status: 200,
30-
contentType: 'application/json',
31-
body: JSON.stringify({ id: 'test-id' }),
32-
});
33-
});
34-
35-
const url = await getLocalTestPath({ testDir: __dirname });
36-
37-
await page.goto(url);
38-
39-
await reqPromise0;
40-
41-
await page.setInputFiles('#file-input', {
42-
name: 'file.csv',
43-
mimeType: 'text/csv',
44-
buffer: Buffer.from('this,is,test'),
45-
});
46-
47-
await forceFlushReplay();
48-
49-
const res1 = await reqPromise1;
50-
51-
const snapshots = getIncrementalRecordingSnapshots(res1).filter(isInputMutation);
52-
53-
expect(snapshots).toEqual([]);
54-
});
19+
for (let i = 0; i < 100; i++) {
20+
sentryTest(
21+
`should not capture file input mutations RUN ${i}`,
22+
async ({ forceFlushReplay, getLocalTestPath, page }) => {
23+
if (shouldSkipReplayTest()) {
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' }),
35+
});
36+
});
37+
38+
const url = await getLocalTestPath({ testDir: __dirname });
39+
await page.goto(url);
40+
await reqPromise0;
41+
42+
await page.setInputFiles('#file-input', {
43+
name: 'file.csv',
44+
mimeType: 'text/csv',
45+
buffer: Buffer.from('this,is,test'),
46+
});
47+
await page.click('#button');
48+
await forceFlushReplay();
49+
50+
const res1 = await reqPromise1;
51+
52+
const snapshots = getIncrementalRecordingSnapshots(res1).filter(isInputMutation);
53+
54+
expect(snapshots).toEqual([]);
55+
},
56+
);
57+
}

0 commit comments

Comments
 (0)