Skip to content

Commit e318b0b

Browse files
committed
Doc strings added for all tests
1 parent e9639d2 commit e318b0b

14 files changed

+265
-0
lines changed

tests/test_bowel_scope_page.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,22 @@
77

88
@pytest.fixture(scope="function", autouse=True)
99
def before_each(page: Page):
10+
"""
11+
Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the bowel scope page
12+
"""
1013
# Log in to BCSS
1114
BcssLoginPage(page).login_as_user_bcss401()
1215

1316
# Go to bowel scope page
1417
MainMenu(page).go_to_bowel_scope_page()
1518

19+
1620
@pytest.mark.smoke
1721
def test_bowel_scope_page_navigation(page: Page) -> None:
22+
"""
23+
Confirms that the bowel scope appointments page loads, the appointments calendar is displayed and the
24+
main menu button returns the user to the main menu
25+
"""
1826
# Bowel scope appointments page loads as expected
1927
page.get_by_role("link", name="View Bowel Scope Appointments").click()
2028
expect(page.locator("#ntshPageTitle")).to_contain_text("Appointment Calendar")

tests/test_call_and_recall_page.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
@pytest.fixture(scope="function", autouse=True)
99
def before_each(page: Page):
10+
"""
11+
Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the call and recall page
12+
"""
1013
# Log in to BCSS
1114
BcssLoginPage(page).login_as_user_bcss401()
1215

@@ -16,6 +19,9 @@ def before_each(page: Page):
1619

1720
@pytest.mark.smoke
1821
def test_call_and_recall_page_navigation(page: Page) -> None:
22+
"""
23+
Confirms that the Call and Recall menu displays all menu options and confirms they load the correct pages
24+
"""
1925
# Planning and monitoring page loads as expected
2026
page.get_by_role("link", name="Planning and Monitoring").click()
2127
expect(page.locator("#page-title")).to_contain_text("Invitations Monitoring - Screening Centre")
@@ -47,6 +53,9 @@ def test_call_and_recall_page_navigation(page: Page) -> None:
4753

4854

4955
def test_view_an_invitation_plan(page: Page) -> None:
56+
"""
57+
Confirms that an invitation plan can be viewed via a screening centre from the planning ad monitoring page
58+
"""
5059
# Go to planning and monitoring page
5160
page.get_by_role("link", name="Planning and Monitoring").click()
5261

tests/test_communications_production_page.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,23 @@
66

77
@pytest.fixture(scope="function", autouse=True)
88
def before_each(page: Page):
9+
"""
10+
Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the communications
11+
production page
12+
"""
913
# Log in to BCSS
1014
BcssLoginPage(page).login_as_user_bcss401()
1115

1216
# Go to communications production page
1317
MainMenu(page).go_to_communications_production_page()
1418

19+
1520
@pytest.mark.smoke
1621
def test_communications_production_page_navigation(page: Page) -> None:
22+
"""
23+
Confirms all menu items are displayed on the communications production page, and that the relevant pages
24+
are loaded when the links are clicked
25+
"""
1726
# Active batch list page loads as expected
1827
page.get_by_role("link", name="Active Batch List").click()
1928
expect(page.locator("#page-title")).to_contain_text("Active Batch List")

tests/test_contacts_list_page.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
@pytest.fixture(scope="function", autouse=True)
99
def before_each(page: Page):
10+
"""
11+
Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the contacts list page
12+
"""
1013
# Log in to BCSS
1114
BcssLoginPage(page).login_as_user_bcss401()
1215

@@ -16,6 +19,10 @@ def before_each(page: Page):
1619

1720
@pytest.mark.smoke
1821
def test_contacts_list_page_navigation(page: Page) -> None:
22+
"""
23+
Confirms all menu items are displayed on the contacts list page, and that the relevant pages
24+
are loaded when the links are clicked
25+
"""
1926
# View contacts page loads as expected
2027
page.get_by_role("link", name="View Contacts").click()
2128
expect(page.locator("#ntshPageTitle")).to_contain_text("View Contacts")

tests/test_download_page.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
@pytest.fixture(scope="function", autouse=True)
99
def before_each(page: Page):
10+
"""
11+
Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the download page
12+
"""
1013
# Log in to BCSS
1114
BcssLoginPage(page).login_as_user_bcss401()
1215

@@ -16,6 +19,11 @@ def before_each(page: Page):
1619

1720
@pytest.mark.smoke
1821
def test_download_facility_page_navigation(page: Page) -> None:
22+
"""
23+
Confirms all menu items are displayed on the downloads page, and that the relevant pages
24+
are loaded when the links are clicked. Also confirms that the warning header messages are displayed
25+
on the relevant pages
26+
"""
1927
# Individual download request and retrieval page loads as expected
2028
page.get_by_role("link", name="Individual Download Request").click()
2129
expect(page.locator("#ntshPageTitle")).to_contain_text("Individual Download Request and Retrieval")

tests/test_fit_test_kits_page.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
@pytest.fixture(scope="function", autouse=True)
99
def before_each(page: Page):
10+
"""
11+
Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the
12+
fit test kits page
13+
"""
1014
# Log in to BCSS
1115
BcssLoginPage(page).login_as_user_bcss401()
1216

@@ -16,6 +20,10 @@ def before_each(page: Page):
1620

1721
@pytest.mark.smoke
1822
def test_fit_test_kits_page_navigation(page: Page) -> None:
23+
"""
24+
Confirms all menu items are displayed on the fit test kits page, and that the relevant pages
25+
are loaded when the links are clicked
26+
"""
1927
# Verify FIT rollout summary page opens as expected
2028
page.get_by_role("link", name="FIT Rollout Summary").click()
2129
expect(page.locator("body")).to_contain_text("FIT Rollout Summary")

tests/test_gfobt_test_kits_page.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
@pytest.fixture(scope="function", autouse=True)
99
def before_each(page: Page):
10+
"""
11+
Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the
12+
gfob test kits page
13+
"""
1014
# Log in to BCSS
1115
BcssLoginPage(page).login_as_user_bcss401()
1216

@@ -16,6 +20,10 @@ def before_each(page: Page):
1620

1721
@pytest.mark.smoke
1822
def test_gfob_test_kit_page_navigation(page: Page) -> None:
23+
"""
24+
Confirms all menu items are displayed on the gfob test kits page, and that the relevant pages
25+
are loaded when the links are clicked
26+
"""
1927
# Test kit logging page opens as expected
2028
page.get_by_role("link", name="Test Kit Logging").click()
2129
expect(page.locator("#ntshPageTitle")).to_contain_text("Test Kit Logging")
@@ -41,6 +49,9 @@ def test_gfob_test_kit_page_navigation(page: Page) -> None:
4149

4250

4351
def test_create_a_qc_kit(page: Page) -> None:
52+
"""
53+
Confirms that a qc test kit can be created and that each of the dropdowns has an option set available for selection
54+
"""
4455
# Navigate to create QC kit page
4556
page.get_by_role("link", name="Create QC Kit").click()
4657

tests/test_home_page_links.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@
77

88
@pytest.fixture(scope="function", autouse=True)
99
def before_each(page: Page):
10+
"""
11+
Before every test is executed, this fixture logs in to BCSS as a test user and results in the home page
12+
being displayed
13+
"""
1014
# Log in to BCSS
1115
BcssLoginPage(page).login_as_user_bcss401()
1216

1317

1418
@pytest.mark.smoke
1519
def test_home_page_links_navigation(page: Page) -> None:
20+
"""
21+
Confirms that homepage links are visible and clickable, and the expected pages open when clicking the links
22+
"""
1623
homepage = BcssHomePage(page)
1724

1825
# Click 'show sub menu' link

tests/test_login_to_bcss.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,44 @@
33

44

55
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
610
BcssLoginPage(page).login_as_user_bcss401()
11+
# Confirm user has successfully signed in and is viewing the bcss homepage
712
expect(page.locator("#ntshAppTitle")).to_contain_text("Bowel Cancer Screening System")
813

914

1015
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
1120
username = "BCSSZZZ"
1221
password = "changeme"
1322
BcssLoginPage(page).login(username, password)
23+
# Confirm error message is displayed
1424
expect(page.locator("body")).to_contain_text("Incorrect username or password.")
1525

1626

1727
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
1832
username = "BCSS401"
1933
password = "zzzzzz"
2034
BcssLoginPage(page).login(username, password)
35+
# Confirm error message is displayed
2136
expect(page.locator("body")).to_contain_text("Incorrect username or password.")
2237

2338

2439
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
2544
username = ""
2645
password = ""
2746
BcssLoginPage(page).login(username, password)

tests/test_lynch_surveillance_page.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
@pytest.fixture(scope="function", autouse=True)
99
def before_each(page: Page):
10+
"""
11+
Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the
12+
lynch surveillance page
13+
"""
1014
# Log in to BCSS
1115
BcssLoginPage(page).login_as_user_bcss401()
1216

@@ -16,6 +20,10 @@ def before_each(page: Page):
1620

1721
@pytest.mark.smoke
1822
def test_lynch_surveillance_page_navigation(page: Page) -> None:
23+
"""
24+
Confirms that the 'set lynch invitation rates' link is visible and clickable, and navigates to the
25+
expected page when clicked
26+
"""
1927
# 'Set lynch invitation rates' page loads as expected
2028
page.get_by_role("link", name="Set Lynch Invitation Rates").click()
2129
expect(page.locator("#page-title")).to_contain_text("Set Lynch Surveillance Invitation Rates")

tests/test_organisations_page.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
@pytest.fixture(scope="function", autouse=True)
99
def before_each(page: Page):
10+
"""
11+
Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the
12+
organisations page
13+
"""
1014
# Log in to BCSS
1115
BcssLoginPage(page).login_as_user_bcss401()
1216

@@ -16,6 +20,10 @@ def before_each(page: Page):
1620

1721
@pytest.mark.smoke
1822
def test_organisations_page_navigation(page: Page) -> None:
23+
"""
24+
Confirms all menu items are displayed on the organisations page, and that the relevant pages
25+
are loaded when the links are clicked
26+
"""
1927
# Screening centre parameters page loads as expected
2028
page.get_by_role("link", name="Screening Centre Parameters").click()
2129
expect(page.locator("#ntshPageTitle")).to_contain_text("Screening Centre Parameters")
@@ -45,6 +53,9 @@ def test_organisations_page_navigation(page: Page) -> None:
4553

4654

4755
def test_view_an_organisations_system_parameters(page: Page) -> None:
56+
"""
57+
Confirms that an organisation's system parameters can be accessed and viewed
58+
"""
4859
# Go to screening centre parameters page
4960
page.get_by_role("link", name="Screening Centre Parameters").click()
5061

0 commit comments

Comments
 (0)