mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
ci: retry flaky test when running in Windows with Webpack (#25536)
This commit is contained in:
parent
d7226f5ad0
commit
f3c1c3e381
@ -591,29 +591,33 @@ describe('nuxt links', () => {
|
|||||||
await page.close()
|
await page.close()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('expect scroll to top on routes with same component', async () => {
|
it('expect scroll to top on routes with same component',
|
||||||
// #22402
|
async () => {
|
||||||
const page = await createPage('/big-page-1', {
|
// #22402
|
||||||
viewport: {
|
const page = await createPage('/big-page-1', {
|
||||||
width: 1000,
|
viewport: {
|
||||||
height: 1000
|
width: 1000,
|
||||||
}
|
height: 1000
|
||||||
})
|
}
|
||||||
await page.waitForFunction(() => window.useNuxtApp?.()._route.fullPath === '/big-page-1')
|
})
|
||||||
|
await page.waitForFunction(() => window.useNuxtApp?.()._route.fullPath === '/big-page-1')
|
||||||
|
|
||||||
await page.locator('#big-page-2').scrollIntoViewIfNeeded()
|
await page.locator('#big-page-2').scrollIntoViewIfNeeded()
|
||||||
expect(await page.evaluate(() => window.scrollY)).toBeGreaterThan(0)
|
expect(await page.evaluate(() => window.scrollY)).toBeGreaterThan(0)
|
||||||
await page.locator('#big-page-2').click()
|
await page.locator('#big-page-2').click()
|
||||||
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, `/big-page-2`)
|
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, `/big-page-2`)
|
||||||
expect(await page.evaluate(() => window.scrollY)).toBe(0)
|
expect(await page.evaluate(() => window.scrollY)).toBe(0)
|
||||||
|
|
||||||
await page.locator('#big-page-1').scrollIntoViewIfNeeded()
|
await page.locator('#big-page-1').scrollIntoViewIfNeeded()
|
||||||
expect(await page.evaluate(() => window.scrollY)).toBeGreaterThan(0)
|
expect(await page.evaluate(() => window.scrollY)).toBeGreaterThan(0)
|
||||||
await page.locator('#big-page-1').click()
|
await page.locator('#big-page-1').click()
|
||||||
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, `/big-page-1`)
|
await page.waitForFunction(path => window.useNuxtApp?.()._route.fullPath === path, `/big-page-1`)
|
||||||
expect(await page.evaluate(() => window.scrollY)).toBe(0)
|
expect(await page.evaluate(() => window.scrollY)).toBe(0)
|
||||||
await page.close()
|
await page.close()
|
||||||
})
|
},
|
||||||
|
// Flaky when run on windows + webpack
|
||||||
|
{ retry: isWebpack && isWindows ? 10 : 0 }
|
||||||
|
)
|
||||||
|
|
||||||
it('expect scroll to top on nested pages', async () => {
|
it('expect scroll to top on nested pages', async () => {
|
||||||
// #20523
|
// #20523
|
||||||
|
Loading…
Reference in New Issue
Block a user