test: wait for navigation in redirect test

This commit is contained in:
Daniel Roe 2024-06-06 18:02:10 +01:00
parent 1eb08d1ba4
commit e747156061
No known key found for this signature in database
GPG Key ID: 3714AB03996F442B

View File

@ -259,11 +259,11 @@ describe('basic browser', () => {
// New page for redirecting to external link.
const page = await browser.page(url('/'))
await page.nuxt.navigate('/redirect-external', false)
await page.waitForFunction(
() => window.location.href === 'https://example.com/test/'
)
await Promise.all([
page.nuxt.navigate('/redirect-external', false),
page.waitForNavigation()
])
await page.waitForFunction(() => window.location.href === 'https://example.com/test/')
await page.close()
})