Skip to content

Commit 5022f2f

Browse files
authored
test(browser-integration): Attempt to improve potentially flakey slowClick -> windowOpen test (#10538)
Maybe closes #10377
1 parent b6954f9 commit 5022f2f

File tree

1 file changed

+6
-5
lines changed
  • dev-packages/browser-integration-tests/suites/replay/slowClick/windowOpen

1 file changed

+6
-5
lines changed

dev-packages/browser-integration-tests/suites/replay/slowClick/windowOpen/test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,14 @@ sentryTest('window.open() is considered for slow click', async ({ getLocalTestUr
2828

2929
// Ensure window.open() still works as expected
3030
const context = browser.contexts()[0];
31-
const waitForNewPage = context.waitForEvent('page');
3231

33-
await page.locator('#windowOpenButton').click();
32+
const [reqResponse1] = await Promise.all([
33+
reqPromise1,
34+
context.waitForEvent('page'),
35+
page.locator('#windowOpenButton').click(),
36+
]);
3437

35-
const { breadcrumbs } = getCustomRecordingEvents(await reqPromise1);
38+
const { breadcrumbs } = getCustomRecordingEvents(reqResponse1);
3639

3740
// Filter out potential blur breadcrumb, as otherwise this can be flaky
3841
const filteredBreadcrumb = breadcrumbs.filter(breadcrumb => breadcrumb.category !== 'ui.blur');
@@ -57,8 +60,6 @@ sentryTest('window.open() is considered for slow click', async ({ getLocalTestUr
5760
},
5861
]);
5962

60-
await waitForNewPage;
61-
6263
const pages = context.pages();
6364

6465
expect(pages.length).toBe(2);

0 commit comments

Comments
 (0)