mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
296e180036
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com> Co-authored-by: Cursor Agent <[email protected]>
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import * as path from 'path'
|
|
import { nextTestSetup } from 'e2e-utils'
|
|
import { Playwright } from 'next-webdriver'
|
|
|
|
async function assertNoConsoleErrors(browser: Playwright) {
|
|
const logs = await browser.log()
|
|
const warningsAndErrors = logs.filter((log) => {
|
|
return log.source === 'warning' || log.source === 'error'
|
|
})
|
|
|
|
expect(warningsAndErrors).toEqual([])
|
|
}
|
|
|
|
describe('view-transitions', () => {
|
|
const { next } = nextTestSetup({
|
|
files: path.join(__dirname, 'fixtures/default'),
|
|
})
|
|
|
|
it('smoketest', async () => {
|
|
const browser = await next.browser('/basic')
|
|
|
|
await assertNoConsoleErrors(browser)
|
|
})
|
|
|
|
it('transitionTypes smoketest', async () => {
|
|
const browser = await next.browser('/transition-types')
|
|
|
|
await assertNoConsoleErrors(browser)
|
|
|
|
// Click the link to navigate to page two
|
|
// The first link causes a sliding transition
|
|
// The second link causes a default transition (cross-fade)
|
|
await browser.elementByCss('a[href="/transition-types/page-two"]').click()
|
|
|
|
await assertNoConsoleErrors(browser)
|
|
})
|
|
})
|