(browser: Playwright)
| 17 | import { Playwright } from 'next-webdriver' |
| 18 | |
| 19 | export async function waitForHydration(browser: Playwright) { |
| 20 | await browser.eval(() => { |
| 21 | return new Promise<void>((resolve) => { |
| 22 | if ((window as any).__NEXT_HYDRATED) { |
| 23 | resolve() |
| 24 | } else { |
| 25 | var timeout = setTimeout(resolve, 30 * 1000) |
| 26 | ;(window as any).__NEXT_HYDRATED_CB = function () { |
| 27 | clearTimeout(timeout) |
| 28 | resolve() |
| 29 | } |
| 30 | } |
| 31 | }) |
| 32 | }) |
| 33 | } |
| 34 | |
| 35 | export async function createSandbox( |
| 36 | next: NextInstance, |
no test coverage detected