Unverified Commit f5c8b428 authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Stabilize test for Windows (#13050)

parent 5cdb408e
...@@ -387,8 +387,13 @@ const runTests = (dev = false) => { ...@@ -387,8 +387,13 @@ const runTests = (dev = false) => {
await waitFor(500) await waitFor(500)
await browser.eval('window.beforeClick = "abc"') await browser.eval('window.beforeClick = "abc"')
await browser.elementByCss('#broken-post').click() await browser.elementByCss('#broken-post').click()
await waitFor(1000) expect(
expect(await browser.eval('window.beforeClick')).not.toBe('abc') await check(() => browser.eval('window.beforeClick'), {
test(v) {
return v !== 'abc'
},
})
).toBe(true)
}) })
it('should always call getServerSideProps without caching', async () => { it('should always call getServerSideProps without caching', async () => {
......
...@@ -382,8 +382,13 @@ const runTests = (dev = false, looseMode = false) => { ...@@ -382,8 +382,13 @@ const runTests = (dev = false, looseMode = false) => {
const browser = await webdriver(appPort, '/') const browser = await webdriver(appPort, '/')
await browser.eval('window.beforeClick = "abc"') await browser.eval('window.beforeClick = "abc"')
await browser.elementByCss('#broken-post').click() await browser.elementByCss('#broken-post').click()
await waitFor(1000) expect(
expect(await browser.eval('window.beforeClick')).not.toBe('abc') await check(() => browser.eval('window.beforeClick'), {
test(v) {
return v !== 'abc'
},
})
).toBe(true)
}) })
// TODO: dev currently renders this page as blocking, meaning it shows the // TODO: dev currently renders this page as blocking, meaning it shows the
...@@ -393,8 +398,13 @@ const runTests = (dev = false, looseMode = false) => { ...@@ -393,8 +398,13 @@ const runTests = (dev = false, looseMode = false) => {
const browser = await webdriver(appPort, '/') const browser = await webdriver(appPort, '/')
await browser.eval('window.beforeClick = "abc"') await browser.eval('window.beforeClick = "abc"')
await browser.elementByCss('#broken-at-first-post').click() await browser.elementByCss('#broken-at-first-post').click()
await waitFor(3000) expect(
expect(await browser.eval('window.beforeClick')).not.toBe('abc') await check(() => browser.eval('window.beforeClick'), {
test(v) {
return v !== 'abc'
},
})
).toBe(true)
const text = await browser.elementByCss('#params').text() const text = await browser.elementByCss('#params').text()
expect(text).toMatch(/post.*?post-999/) expect(text).toMatch(/post.*?post-999/)
......
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