Skip to content

Commit

Permalink
unflake??
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed May 10, 2023
1 parent 271e9d6 commit 0dd6ed8
Showing 1 changed file with 22 additions and 4 deletions.
Expand Up @@ -58,14 +58,24 @@ sentryTest(
},
10_000,
);
const reqPromise1breadcrumbs = waitForReplayRequest(
page,
(_event, res) => {
const { breadcrumbs } = getCustomRecordingEvents(res);

return breadcrumbs.some(breadcrumb => breadcrumb.category === 'replay.throttled');
},
10_000,
);

await page.click('[data-network]');
await page.click('[data-fetch]');

await page.waitForFunction('window.__isLoaded()');
await forceFlushReplay();

const { performanceSpans, breadcrumbs } = getCustomRecordingEvents(await reqPromise1);
const { performanceSpans } = getCustomRecordingEvents(await reqPromise1);
const { breadcrumbs } = getCustomRecordingEvents(await reqPromise1breadcrumbs);

// All assets have been _loaded_
expect(scriptsLoaded).toBe(COUNT);
Expand All @@ -91,15 +101,23 @@ sentryTest(
},
10_000,
);
const reqPromise2breadcrumbs = waitForReplayRequest(
page,
(_event, res) => {
const { breadcrumbs } = getCustomRecordingEvents(res);

return breadcrumbs.some(breadcrumb => breadcrumb.category === 'replay.throttled');
},
10_000,
);

await page.click('[data-network]');
await page.click('[data-fetch]');

await forceFlushReplay();

const { performanceSpans: performanceSpans2, breadcrumbs: breadcrumbs2 } = getCustomRecordingEvents(
await reqPromise2,
);
const { performanceSpans: performanceSpans2 } = getCustomRecordingEvents(await reqPromise2);
const { breadcrumbs: breadcrumbs2 } = getCustomRecordingEvents(await reqPromise2breadcrumbs);

// All assets have been _loaded_
expect(scriptsLoaded).toBe(COUNT * 2);
Expand Down

0 comments on commit 0dd6ed8

Please sign in to comment.