File tree 2 files changed +13
-6
lines changed
2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * This is public information - create a environment.local.ts file and use admin account there
3
+ */
4
+ export const environment = {
5
+ baseUrl : 'https://demo.kavitareader.com/' ,
6
+ username : 'demouser' ,
7
+ password : 'Demouser64' ,
8
+ } ;
Original file line number Diff line number Diff line change 1
1
import { test , expect } from '@playwright/test' ;
2
2
import { LoginPage } from 'e2e-tests/pages/login-page' ;
3
+ import { environment } from "../../environment" ;
3
4
4
5
5
- const url = 'https://demo.kavitareader.com/' ;
6
-
7
6
test ( 'has title' , async ( { page } ) => {
8
- await page . goto ( url ) ;
7
+ await page . goto ( environment . baseUrl ) ;
9
8
10
9
// Expect a title "to contain" a substring.
11
10
await expect ( page ) . toHaveTitle ( / K a v i t a / ) ;
12
11
} ) ;
13
12
14
13
test ( 'login functionality' , async ( { page } ) => {
15
14
// Navigate to the login page
16
- await page . goto ( url ) ;
15
+ await page . goto ( environment . baseUrl ) ;
17
16
18
17
// Verify the page title
19
18
await expect ( page ) . toHaveTitle ( / K a v i t a / ) ;
20
19
21
20
const loginPage = new LoginPage ( page ) ;
22
- await loginPage . navigate ( ) ;
23
- await loginPage . login ( 'demouser' , 'Demouser64' ) ;
21
+ // await loginPage.navigate();
22
+ await loginPage . login ( environment . username , environment . password ) ;
24
23
25
24
// Verify successful login by checking for Home on side nav
26
25
await expect ( page . locator ( '#null' ) ) . toBeVisible ( ) ;
You can’t perform that action at this time.
0 commit comments