Files
next.js/test/e2e/app-dir/view-transitions/view-transitions.test.ts
Sebastian "Sebbie" SilbermannGitHubVercel <vercel[bot]@users.noreply.github.com>Cursor Agent
296e180036 Add transitionTypes prop to next/link (#90701)
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <[email protected]>
2026-03-03 18:46:19 +00:00

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)
})
})