|
3 | 3 |
|
4 | 4 |
|
5 | 5 | def test_successful_login_to_bcss(page: Page) -> None: |
| 6 | + """ |
| 7 | + Confirms that a user with valid credentials can log in to bcss |
| 8 | + """ |
| 9 | + # Enter a valid username and password and click 'sign in' button |
6 | 10 | BcssLoginPage(page).login_as_user_bcss401() |
| 11 | + # Confirm user has successfully signed in and is viewing the bcss homepage |
7 | 12 | expect(page.locator("#ntshAppTitle")).to_contain_text("Bowel Cancer Screening System") |
8 | 13 |
|
9 | 14 |
|
10 | 15 | def test_login_to_bcss_with_invalid_username(page: Page) -> None: |
| 16 | + """ |
| 17 | + Confirms that a user with a valid password, and invalid username, can NOT log in to bcss |
| 18 | + """ |
| 19 | + # Enter a valid password with an invalid username and click 'sign in' button |
11 | 20 | username = "BCSSZZZ" |
12 | 21 | password = "changeme" |
13 | 22 | BcssLoginPage(page).login(username, password) |
| 23 | + # Confirm error message is displayed |
14 | 24 | expect(page.locator("body")).to_contain_text("Incorrect username or password.") |
15 | 25 |
|
16 | 26 |
|
17 | 27 | def test_login_to_bcss_with_invalid_password(page: Page) -> None: |
| 28 | + """ |
| 29 | + Confirms that a user with a valid username, and invalid password, can NOT log in to bcss |
| 30 | + """ |
| 31 | + # Enter a valid username with an invalid password and click 'sign in' button |
18 | 32 | username = "BCSS401" |
19 | 33 | password = "zzzzzz" |
20 | 34 | BcssLoginPage(page).login(username, password) |
| 35 | + # Confirm error message is displayed |
21 | 36 | expect(page.locator("body")).to_contain_text("Incorrect username or password.") |
22 | 37 |
|
23 | 38 |
|
24 | 39 | def test_login_to_bcss_with_no_username_or_password(page: Page) -> None: |
| 40 | + """ |
| 41 | + Confirms that a user can NOT log in to bcss if no credentials are entered in the log in form |
| 42 | + """ |
| 43 | + # At the login screen, leave the fields empty and click 'sign in' button |
25 | 44 | username = "" |
26 | 45 | password = "" |
27 | 46 | BcssLoginPage(page).login(username, password) |
|
0 commit comments