module import type { Page } from 'playwright' ; import { goto } from './playwright-helpers' ; import { imagesMatch } from './playwright-images' ; /**
 * If this test fails for the server then something is wrong with the setup or
 * the build process.
 */ export function smokeTest ( url = '/' ) { test ( `can navigate to '${ url }'` , async ( ) => { await goto ( url ) ; } ) ; } param description param url export function ssrTest ( description , url ) { test ( `ssr - ${ description }` , async ( ) => { let currentPage ; currentPage = await browser . newPage ( { javaScriptEnabled : false } ) ; await goto ( url ) ; const ssrImage = await currentPage . screenshot ( ) ; await currentPage . close ( ) ; currentPage = await browser . newPage ( { javaScriptEnabled : true } ) ; await goto ( url ) ; const domImage = await currentPage . screenshot ( ) ; await currentPage . close ( ) ; await expect ( imagesMatch ( ssrImage , domImage ) ) . resolves . toBeTrue ( ) ; } ) ; }