Unverified Commit 7f8ba2dc authored by Josh Story's avatar Josh Story Committed by GitHub

Fix flake in rewrites-manual-href-as test (#92948)

CI is failing on a modal not showing up after navigation. It looks like
a timing bug. This adds retry to wait for the UI to show up
parent 1931877c
......@@ -8,6 +8,7 @@ import {
launchApp,
nextBuild,
nextStart,
retry,
} from 'next-test-utils'
import webdriver from 'next-webdriver'
......@@ -26,8 +27,10 @@ const runTests = () => {
await browser.elementByCss('#to-modal').click()
await retry(async () => {
expect(await browser.hasElementByCssSelector('#modal')).toBeTruthy()
})
expect(await browser.elementByCss('#index').text()).toBe('index page')
expect(await browser.hasElementByCssSelector('#modal')).toBeTruthy()
expect(await browser.eval('window.beforeNav')).toBe(1)
expect(JSON.parse(await browser.elementByCss('#query').text())).toEqual({
imageId: '123',
......@@ -86,8 +89,10 @@ const runTests = () => {
.click()
.waitForElementByCss('#index')
await retry(async () => {
expect(await browser.hasElementByCssSelector('#modal')).toBeTruthy()
})
expect(await browser.elementByCss('#index').text()).toBe('index page')
expect(await browser.hasElementByCssSelector('#modal')).toBeTruthy()
expect(await browser.eval('window.beforeNav')).toBe(1)
expect(JSON.parse(await browser.elementByCss('#query').text())).toEqual({
imageId: '123',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment