File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ /* eslint-disable @typescript-eslint/no-empty-object-type */
2+
3+ import { test as base , expect } from '@playwright/test' ;
4+
5+ import { SetupPage } from '../pages/setup.page' ;
6+
7+ type TestArgs = {
8+ setupPage : SetupPage ;
9+ } ;
10+
11+ export const test = base . extend < TestArgs , { } > ( {
12+ setupPage : async ( { page } , use ) => {
13+ const setupPage = new SetupPage ( page ) ;
14+ await setupPage . goto ( ) ;
15+ return use ( setupPage ) ;
16+ }
17+ } ) ;
18+
19+ export { expect } ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import type { Page } from '@playwright/test';
33
44export abstract class RootPage {
55 protected readonly $ref : Page ;
6+ protected abstract readonly defaultUrl : string ;
67
78 constructor ( page : Page ) {
89 this . $ref = page ;
@@ -11,4 +12,8 @@ export abstract class RootPage {
1112 get expect ( ) {
1213 return expect ( this . $ref ) ;
1314 }
15+
16+ async goto ( ) {
17+ await this . $ref . goto ( this . defaultUrl ) ;
18+ }
1419}
You can’t perform that action at this time.
0 commit comments