File tree 3 files changed +12
-16
lines changed
3 files changed +12
-16
lines changed Original file line number Diff line number Diff line change 1
1
import { Page } from "@playwright/test"
2
2
3
3
export abstract class BasePom {
4
- abstract get url ( ) : string
4
+ protected readonly baseURL : string | undefined
5
+ protected readonly path : string
6
+ protected readonly page : Page
5
7
6
- protected page : Page
7
- protected baseURL : string | undefined
8
-
9
- constructor ( baseURL : string | undefined , page : Page ) {
10
- this . page = page
8
+ constructor ( baseURL : string | undefined , path : string , page : Page ) {
11
9
this . baseURL = baseURL
10
+ this . path = path
11
+ this . page = page
12
+ }
13
+
14
+ get url ( ) : string {
15
+ return this . baseURL + this . path
12
16
}
13
17
}
Original file line number Diff line number Diff line change @@ -2,11 +2,7 @@ import { Page } from "@playwright/test"
2
2
import { BasePom } from "./BasePom"
3
3
4
4
export class ProjectsPage extends BasePom {
5
- public get url ( ) : string {
6
- return this . baseURL + "/projects"
7
- }
8
-
9
5
constructor ( baseURL : string | undefined , page : Page ) {
10
- super ( baseURL , page )
6
+ super ( baseURL , "/projects" , page )
11
7
}
12
8
}
Original file line number Diff line number Diff line change @@ -2,12 +2,8 @@ import { Page } from "@playwright/test"
2
2
import { BasePom } from "./BasePom"
3
3
4
4
export class SignInPage extends BasePom {
5
- public get url ( ) : string {
6
- return this . baseURL + "/login"
7
- }
8
-
9
5
constructor ( baseURL : string | undefined , page : Page ) {
10
- super ( baseURL , page )
6
+ super ( baseURL , "/login" , page )
11
7
}
12
8
13
9
async submitBuiltInAuthentication ( email : string , password : string ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments