Skip to content

Commit 1efad2c

Browse files
committed
Addressing the PR comments
1 parent 3614ef8 commit 1efad2c

File tree

10 files changed

+58
-54
lines changed

10 files changed

+58
-54
lines changed

pages/organisations/create_organisation.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class CreateOrganisation(BasePage):
88

99
def __init__(self, page: Page):
1010
super().__init__(page)
11-
self.page = page
1211

1312
# Create Organisation links
1413
self.organisation_code = self.page.get_by_label("Organisation Code*")
@@ -23,47 +22,43 @@ def __init__(self, page: Page):
2322
def fill_organisation_code(self, text: str) -> None:
2423
"""
2524
This method is designed to fill in the Organisation Code field on the Create Organisation page.
26-
Returns:
27-
None
25+
Args:
26+
text (str): The organisation code to be entered. Example: "Z9Z1S"
2827
"""
2928
logging.info("Filling Organisation Code on Create Organisation page")
3029
self.organisation_code.fill(text)
3130

3231
def fill_organisation_name(self, text: str) -> None:
3332
"""
3433
This method is designed to fill in the Organisation Name field on the Create Organisation page.
35-
Returns:
36-
None
34+
Args:
35+
text (str): The organisation name to be entered. Example: "Test ANANA ICB"
3736
"""
3837
logging.info("Filling Organisation Name on Create Organisation page")
3938
self.organisation_name.fill(text)
4039

4140
def click_start_date_calendar(self) -> None:
4241
"""
4342
This method is designed to click the Start Date Calendar button on the Create Organisation page.
44-
Returns:
45-
None
4643
"""
4744
logging.info("Clicking Start Date Calendar on Create Organisation page")
48-
self.start_date_calendar.click()
45+
self.click(self.start_date_calendar)
4946

5047
def fill_audit_reason(self, text: str) -> None:
5148
"""
5249
This method is designed to fill in the Audit Reason field on the Create Organisation page.
53-
Returns:
54-
None
50+
Args:
51+
text (str): The audit reason to be entered. Example: "Automated ANANA Test"
5552
"""
5653
logging.info("Filling Audit Reason on Create Organisation page")
5754
self.audit_reason.fill(text)
5855

5956
def click_save_button(self) -> None:
6057
"""
6158
This method is designed to click the Save button on the Create Organisation page.
62-
Returns:
63-
None
6459
"""
6560
logging.info("Clicking Save button on Create Organisation page")
66-
self.save_button.click()
61+
self.click(self.save_button)
6762

6863
def verify_success_message(self) -> None:
6964
"""Verifies that the success message is displayed after saving the organisation."""

pages/organisations/create_site.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class CreateSite(BasePage):
88

99
def __init__(self, page: Page):
1010
super().__init__(page)
11-
self.page = page
1211

1312
# Create Site links
1413
self.site_code = self.page.get_by_label("Site Code*")
@@ -20,44 +19,41 @@ def __init__(self, page: Page):
2019
def fill_site_code(self, text: str) -> None:
2120
"""
2221
This method is designed to fill in the site Code field on the Create site page.
23-
Returns:
24-
None
22+
Args:
23+
text (str): The site code to be entered. Example: "Z9Z1X"
2524
"""
26-
logging.info("Filling Site Code on Create Organisation page")
25+
logging.info("Filling Site Code on Create site page")
2726
self.site_code.fill(text)
2827

2928
def fill_site_name(self, text: str) -> None:
3029
"""
3130
This method is designed to fill in the Site Name field on the Create Site page.
32-
Returns:
33-
None
31+
Args:
32+
text (str): The site name to be entered. Example: "TEST ANANA NHS TRUST SITE"
3433
"""
3534
logging.info("Filling Site Name on Create Site page")
3635
self.site_name.fill(text)
3736

3837
def click_start_date_calendar(self) -> None:
3938
"""
4039
This method is designed to click the Start Date Calendar button on the Create Site page.
41-
Returns:
42-
None
4340
"""
4441
logging.info("Clicking Start Date Calendar on Create Site page")
4542
self.start_date_calendar.click()
4643

4744
def fill_audit_reason(self, text: str) -> None:
4845
"""
4946
This method is designed to fill in the Audit Reason field on the Create Site page.
50-
Returns:
51-
None
47+
Args:
48+
text (str): The audit reason to be entered. Example: "Automated ANANA Test"
5249
"""
5350
logging.info("Filling Audit Reason on Create Site page")
5451
self.audit_reason.fill(text)
5552

5653
def click_save_button(self) -> None:
5754
"""
5855
This method is designed to click the Save button on the Create Site page.
59-
Returns:
60-
None
56+
6157
"""
6258
logging.info("Clicking Save button on Create Site page")
6359
self.save_button.click()

pages/organisations/list_all_organisations.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class ListAllOrganisations(BasePage):
1010

1111
def __init__(self, page: Page):
1212
super().__init__(page)
13-
self.page = page
1413
# Initialize TableUtils for the table with id="displayRS"
1514
self.list_all_org_table = TableUtils(page, "#listAllOrgsTable")
1615

@@ -24,8 +23,6 @@ def select_organisation_type_option(self, option: str) -> None:
2423
This method is designed to select a specific organisation type from the List All Organisations page.
2524
Args:
2625
option (str): The organisation type option to be selected. This should be a string that matches one of the available options in the dropdown menu.
27-
Returns:
28-
None
2926
"""
3027
logging.info(f"Selecting Organisation Type: {option}")
3128
self.select_organisation_type.select_option(option)
@@ -47,15 +44,16 @@ def search_organisation_code(self, org_code: str) -> None:
4744
This method is designed to search for an organisation by its code.
4845
Args:
4946
org_code (str): The organisation code to search for.
50-
Returns:
51-
None
5247
"""
5348
logging.info(f"Searching for Organisation with code: {org_code}")
5449
self.search_org_code.fill(org_code)
5550
self.search_org_code.press("Enter")
5651

57-
def verify_no_organisation_record_found(self, text: str) -> None:
58-
"""Verifies that no organisation record is found."""
52+
def verify_no_organisation_record_found(self, text: str) -> None:
53+
"""Verifies that no organisation record is found.
54+
Args:
55+
text (str): The text to verify is present indicating no records found. Example: "No organisation record found"
56+
"""
5957
logging.info("Verifying that no organisation record is found")
6058
expect(self.page.locator('form[name="frm"]')).to_contain_text(text)
6159

pages/organisations/list_all_sites.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ class ListAllSites(BasePage):
1010

1111
def __init__(self, page: Page):
1212
super().__init__(page)
13-
self.page = page
14-
# Initialize TableUtils for the table with id="displayRS"
13+
# Initialize TableUtils for the table with id="listAllOrgsTable"
1514
self.list_all_org_table = TableUtils(page, "#listAllOrgsTable")
1615

1716
# List All Site links
@@ -26,14 +25,14 @@ def select_site_type_option(self, option: str) -> None:
2625
self.select_site_type.select_option(option)
2726

2827
def click_create_new_site(self) -> None:
29-
"""Clicks the 'Create New Org' button."""
28+
"""Clicks the 'Create New Site' button."""
3029
self.create_new_site.click()
3130

3231
def search_site_code(self, site_code: str) -> None:
3332
"""
3433
This method is designed to search for an site by its code.
3534
Args:
36-
org_code (str): The site code to search for.
35+
site_code (str): The site code to search for.
3736
Returns:
3837
None
3938
"""

pages/organisations/organisations_and_site_details.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ class OrganisationsAndSiteDetails(BasePage):
88

99
def __init__(self, page: Page):
1010
super().__init__(page)
11-
self.page = page
1211

1312
# Organisations And Site Details Page links
1413
self.my_organisation = self.page.get_by_role("link", name="My Organisation")

pages/organisations/organisations_page.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class OrganisationsPage(BasePage):
77

88
def __init__(self, page: Page):
99
super().__init__(page)
10-
self.page = page
1110

1211
# Organisations page links
1312
self.screening_centre_parameters_page = self.page.get_by_role(

pages/organisations/view_organisation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import logging
2-
from click import option
32
from playwright.sync_api import Page, expect
43
from pages.base_page import BasePage
54

@@ -9,7 +8,6 @@ class ViewOrganisation(BasePage):
98

109
def __init__(self, page: Page):
1110
super().__init__(page)
12-
self.page = page
1311
# View Organisation links
1412
self.edit_button = self.page.get_by_role("button", name="Edit")
1513

tests/regression/organisation/test_organisation_and_site_details.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from ast import List, Or
2-
from re import L
31
import pytest
42
from playwright.sync_api import Page, expect
53
from pages.base_page import BasePage
@@ -32,12 +30,17 @@ def before_each(page: Page):
3230
Before every test is executed, this fixture logs in to BCSS as a test user and navigates to the call and recall page
3331
"""
3432
# Log in to BCSS
35-
UserTools.user_login(page, "Bureau Staff")
33+
UserTools.user_login(page, "BCSS Bureau Staff")
3634

3735
# Go to call and recall page
3836
BasePage(page).go_to_organisations_page()
3937

4038

39+
# Define constants for repeated values
40+
ICB_ORGANISATION_CODE = "Z9Z1S"
41+
NHS_TRUST_SITE_CODE = "Z9Z1X"
42+
43+
@pytest.mark.wip
4144
@pytest.mark.regression
4245
@pytest.mark.organisations_users_and_contacts_tests
4346
@pytest.mark.organisations_and_contacts_build_level_tests
@@ -52,6 +55,7 @@ def test_check_list_all_organisations_page(page) -> None:
5255
ViewOrganisation(page).verify_page_title()
5356

5457

58+
@pytest.mark.wip
5559
@pytest.mark.regression
5660
@pytest.mark.organisations_users_and_contacts_tests
5761
@pytest.mark.organisations_and_contacts_develop_level_tests
@@ -63,7 +67,7 @@ def test_create_new_icb_z9z1s_using_create_new_org(page) -> None:
6367
OrganisationsAndSiteDetails(page).go_to_list_all_organisations()
6468
ListAllOrganisations(page).select_organisation_type_option(OrganisationType.ICB)
6569
ListAllOrganisations(page).click_create_new_org()
66-
CreateOrganisation(page).organisation_code.fill("Z9Z1S")
70+
CreateOrganisation(page).organisation_code.fill(ICB_ORGANISATION_CODE)
6771
CreateOrganisation(page).organisation_name.fill("Test ANANA ICB")
6872
CreateOrganisation(page).click_start_date_calendar()
6973
CalendarPicker(page).select_day(datetime.today())
@@ -72,18 +76,19 @@ def test_create_new_icb_z9z1s_using_create_new_org(page) -> None:
7276
CreateOrganisation(page).verify_success_message()
7377

7478

79+
@pytest.mark.wip
7580
@pytest.mark.regression
7681
@pytest.mark.organisations_users_and_contacts_tests
7782
@pytest.mark.organisations_and_contacts_develop_level_tests
78-
def test_create_new_nhs_trust_site_z9z1x_using_ccreate_site(page) -> None:
83+
def test_create_new_nhs_trust_site_z9z1x_using_create_site(page) -> None:
7984
"""
8085
Verifies that the 'Create New Site' functionality works correctly for creating a new NHS Trust site.
8186
"""
8287
OrganisationsPage(page).go_to_organisations_and_site_details_page()
8388
OrganisationsAndSiteDetails(page).go_to_list_all_sites()
8489
ListAllSites(page).select_site_type_option(SiteType.NHS_TRUST_SITE)
8590
ListAllSites(page).click_create_new_site()
86-
CreateSite(page).fill_site_code("Z9Z1X")
91+
CreateSite(page).fill_site_code(NHS_TRUST_SITE_CODE)
8792
CreateSite(page).fill_site_name("TEST ANANA NHS TRUST SITE")
8893
CreateSite(page).click_start_date_calendar()
8994
CalendarPicker(page).select_day(datetime.today())
@@ -92,6 +97,7 @@ def test_create_new_nhs_trust_site_z9z1x_using_ccreate_site(page) -> None:
9297
CreateSite(page).verify_success_message()
9398

9499

100+
@pytest.mark.wip
95101
@pytest.mark.regression
96102
@pytest.mark.organisations_users_and_contacts_tests
97103
@pytest.mark.organisations_and_contacts_develop_level_tests
@@ -102,15 +108,16 @@ def test_view_and_edit_organisation_values_z9z1s(page) -> None:
102108
OrganisationsPage(page).go_to_organisations_and_site_details_page()
103109
OrganisationsAndSiteDetails(page).go_to_list_all_organisations()
104110
ListAllOrganisations(page).select_organisation_type_option(OrganisationType.ICB)
105-
ListAllOrganisations(page).search_organisation_code("Z9Z1S")
111+
ListAllOrganisations(page).search_organisation_code(ICB_ORGANISATION_CODE)
106112
ListAllOrganisations(page).click_first_link_in_table()
107-
ViewOrganisation(page).verify_organisation_type_details("Z9Z1S")
113+
ViewOrganisation(page).verify_organisation_type_details(ICB_ORGANISATION_CODE)
108114
ViewOrganisation(page).verify_organisation_code_details("ICB")
109115
ViewOrganisation(page).click_edit_button()
110-
ViewOrganisation(page).verify_organisation_type_details("Z9Z1S")
116+
ViewOrganisation(page).verify_organisation_type_details(ICB_ORGANISATION_CODE)
111117
ViewOrganisation(page).verify_organisation_code_details("ICB")
112118

113119

120+
@pytest.mark.wip
114121
@pytest.mark.regression
115122
@pytest.mark.organisations_users_and_contacts_tests
116123
@pytest.mark.organisations_and_contacts_develop_level_tests
@@ -119,15 +126,16 @@ def test_remove_all_created_organisation(page) -> None:
119126
Verifies that the 'Remove All Created Organisation' functionality works correctly
120127
"""
121128
OrganisationsPage(page).go_to_organisations_and_site_details_page()
122-
delete_organisations_created_for_test(["Z9Z1S"])
129+
delete_organisations_created_for_test([ICB_ORGANISATION_CODE])
123130
OrganisationsAndSiteDetails(page).go_to_list_all_organisations()
124131
ListAllOrganisations(page).select_organisation_type_option(OrganisationType.CCG)
125-
ListAllOrganisations(page).search_organisation_code("Z9Z1X")
132+
ListAllOrganisations(page).search_organisation_code(NHS_TRUST_SITE_CODE)
126133
ListAllOrganisations(page).verify_no_organisation_record_found(
127134
"Sorry, no records match your search criteria. Please refine your search and try again."
128135
)
129136

130137

138+
@pytest.mark.wip
131139
@pytest.mark.regression
132140
@pytest.mark.organisations_users_and_contacts_tests
133141
@pytest.mark.organisations_and_contacts_develop_level_tests
@@ -137,10 +145,10 @@ def test_remove_all_created_sites(page) -> None:
137145
Verifies that the 'Remove All Created Sites' functionality works correctly
138146
"""
139147
OrganisationsPage(page).go_to_organisations_and_site_details_page()
140-
delete_sites_created_for_test(["Z9Z1X"])
148+
delete_sites_created_for_test([NHS_TRUST_SITE_CODE])
141149
OrganisationsAndSiteDetails(page).go_to_list_all_sites()
142150
ListAllSites(page).select_site_type_option(SiteType.NHS_TRUST_SITE)
143-
ListAllSites(page).search_site_code("Z9Z1X")
151+
ListAllSites(page).search_site_code(NHS_TRUST_SITE_CODE)
144152
ListAllSites(page).verify_no_site_record_found(
145153
"Sorry, no records match your search criteria. Please refine your search and try again."
146154
)

users.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
"Hub Manager, Southern Bowel Cancer Screening Programme Hub"
5757
]
5858
},
59-
"Bureau Staff": {
59+
"BCSS Bureau Staff": {
6060
"username": "BCSS33",
61+
"role_id": 5042,
62+
"org_code": "X26",
6163
"roles": [
6264
"BCSS Bureau Staff"
6365
]

0 commit comments

Comments
 (0)