mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What? Migrate remaining direct `next-webdriver` test callers that have a `NextInstance` to `next.browser()`, and expose the shared `Playwright` browser type from `e2e-utils`. ### Why? `NextInstance.browser` should be the supported browser-opening interface for test fixtures, with `next-webdriver` kept as the private implementation detail. ### How? Updated affected development, e2e, and production tests to call `next.browser()` directly, passing `baseUrl` where tests intentionally target a manually spawned or proxied server. Shared helpers now receive browser callbacks from the test context, and browser types import `Playwright` from `e2e-utils` instead of deriving from `next.browser` or importing from private paths. <!-- NEXT_JS_LLM_PR -->
27 lines
741 B
TypeScript
27 lines
741 B
TypeScript
import { FileRef, nextTestSetup } from 'e2e-utils'
|
|
import { waitFor } from 'next-test-utils'
|
|
import path from 'path'
|
|
|
|
describe('next-image-forward-ref', () => {
|
|
const appDir = path.join(__dirname, 'app')
|
|
|
|
const { next } = nextTestSetup({
|
|
files: new FileRef(appDir),
|
|
dependencies: {
|
|
'framer-motion': '7.6.9',
|
|
},
|
|
})
|
|
|
|
it('allows framer-motion to animate opacity', async () => {
|
|
const browser = await next.browser('/framer-motion')
|
|
expect(
|
|
Number(await browser.elementById('img').getComputedCss('opacity'))
|
|
).toBeCloseTo(1)
|
|
browser.elementById('img').click()
|
|
await waitFor(1000)
|
|
expect(
|
|
Number(await browser.elementById('img').getComputedCss('opacity'))
|
|
).toBeCloseTo(0)
|
|
})
|
|
})
|