File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1- const { test , expect } = require ( '@playwright/test' ) ;
1+ import { Page , expect , test } from '@playwright/test' ;
22
33import AxeBuilder from '@axe-core/playwright' ;
44
5+ type PlaywrightTestParams = {
6+ page : Page ;
7+ } ;
8+
59test . describe ( 'Generic Webpage Tests' , ( ) => {
6- test ( 'should load the webpage successfully' , async ( { page } ) => {
10+ test ( 'should load the webpage successfully' , async ( { page } : PlaywrightTestParams ) => {
711 const response = await page . goto ( '/' ) ;
12+ if ( ! response ) {
13+ throw new Error ( 'Failed to navigate' ) ;
14+ }
15+
816 const title = await page . title ( ) ;
917 await expect ( response . status ( ) ) . toBe ( 200 ) ;
1018 } ) ;
1119
12- test ( 'should take a screenshot of the webpage' , async ( { page } ) => {
20+ test ( 'should take a screenshot of the webpage' , async ( { page } : PlaywrightTestParams ) => {
1321 await page . goto ( '/' ) ;
1422 await page . screenshot ( { path : 'example-screenshot.png' , fullPage : true } ) ;
1523 } ) ;
You can’t perform that action at this time.
0 commit comments