1- from ast import List , Or
2- from re import L
31import pytest
42from playwright .sync_api import Page , expect
53from 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 )
0 commit comments