Skip to content

Commit

Permalink
Reduce test flakiness by awaiting all test navigations
Browse files Browse the repository at this point in the history
  • Loading branch information
airhorns committed Nov 2, 2023
1 parent 2d6cb1c commit 7e05cc5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ describe('navigation details', () => {
await page.click('#home-link')

const testCalls: any[] = await page.evaluate('window.test')

await page.waitForFunction(() => window.test.length === 2)

expect(testCalls).toBeDefined()
expect(testCalls).toHaveLength(2)
expect(testCalls[0].isNavigating).toBe(false)
Expand All @@ -31,6 +34,8 @@ describe('navigation details', () => {

await page.click('#section-link')

await page.waitForFunction(() => window.test.length === 3)

const testCalls: any[] = await page.evaluate('window.test')
expect(testCalls).toBeDefined()
expect(testCalls[0].isNavigating).toBe(false)
Expand Down

0 comments on commit 7e05cc5

Please sign in to comment.