File tree Expand file tree Collapse file tree 3 files changed +78
-7
lines changed
tests/regression/organisation Expand file tree Collapse file tree 3 files changed +78
-7
lines changed Original file line number Diff line number Diff line change 1+ from playwright .sync_api import Page
2+ from pages .base_page import BasePage
3+ from enum import StrEnum
4+
5+ class ListAllOrganisations (BasePage ):
6+ """Organisations And Site Details Page locators, and methods for interacting with the page."""
7+
8+ def __init__ (self , page : Page ):
9+ super ().__init__ (page )
10+ self .page = page
11+
12+ # List All Organisations links
13+ self .select_organisation_type = self .page .locator ("#organisationType" )
14+
15+ def select_organisation_type_option (self , option : str ) -> None :
16+ """
17+ This method is designed to select a specific organisation type from the List All Organisations page.
18+ Args:
19+ 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.
20+ Returns:
21+ None
22+ """
23+ self .select_organisation_type .select_option (option )
24+
25+
26+ class OrganisationType (StrEnum ):
27+ BCS_PROGRAMME_HUB = "1002"
28+ BCS_QA_TEAM = "202189"
29+ BCS_SCREENING_CENTRE = "1003"
30+ BCSS_SERVICE_MANAGER = "1036"
31+ CCG = "1006"
32+ CARE_TRUST = "1007"
33+ GP_PRACTICE = "1009"
34+ ICB = "1004"
35+ IT_CLUSTER = "1001"
36+ NHS_BOWEL_CANCER_SCREENING_PROGRAMME = "1000"
37+ NHS_TRUST = "1005"
38+ PUBLIC_HEALTH_ENGLAND = "202130"
Original file line number Diff line number Diff line change 1+ from playwright .sync_api import Page
2+ from pages .base_page import BasePage
3+
4+ class OrganisationsAndSiteDetails (BasePage ):
5+ """Organisations And Site Details Page locators, and methods for interacting with the page."""
6+
7+ def __init__ (self , page : Page ):
8+ super ().__init__ (page )
9+ self .page = page
10+
11+ # Organisations And Site Details Page links
12+ self .my_organisation = self .page .get_by_role (
13+ "link" , name = "My Organisation"
14+ )
15+ self .list_all_organisations = self .page .get_by_role (
16+ "link" , name = "List All Organisations"
17+ )
18+ self .list_all_sites = self .page .get_by_role (
19+ "link" , name = "List All Sites"
20+ )
21+
22+ def go_to_my_organisation (self ) -> None :
23+ """Clicks the 'my organisation' link"""
24+ self .click (self .my_organisation )
25+
26+ def go_to_list_all_organisations (self ) -> None :
27+ """Clicks the 'list all organisations' link"""
28+ self .click (self .list_all_organisations )
29+
30+ def go_to_list_all_sites (self ) -> None :
31+ """Clicks the 'go to list all sites' link."""
32+ self .click (self .list_all_sites )
Original file line number Diff line number Diff line change 1+ from ast import Or
12import pytest
23from playwright .sync_api import Page
3- from classes .organisation import Organisation
4- from pages import organisations
54from pages .base_page import BasePage
6- from pages .call_and_recall .call_and_recall_page import CallAndRecallPage
7- from pages .call_and_recall .invitations_monitoring_page import InvitationsMonitoringPage
8- from pages .call_and_recall .invitations_plans_page import InvitationsPlansPage
9- from pages .call_and_recall .create_a_plan_page import CreateAPlanPage
5+ from pages .organisations import organisations_and_site_details
106from pages .organisations .organisations_page import OrganisationsPage
7+ from pages .organisations .organisations_and_site_details import OrganisationsAndSiteDetails
8+ from pages .organisations .list_all_organisations import ListAllOrganisations , OrganisationType
119from utils .user_tools import UserTools
1210
1311
@@ -30,4 +28,7 @@ def test_check_list_all_organisations_page(page) -> None:
3028 """
3129 Verifies that the 'List All Organisations' page displays correctly and contains expected elements.
3230 """
33- OrganisationsPage (page ).go_to_organisations_and_site_details_page ()
31+ OrganisationsPage (page ).go_to_organisations_and_site_details_page ()
32+ OrganisationsAndSiteDetails (page ).go_to_list_all_organisations ()
33+ ListAllOrganisations (page ).select_organisation_type_option (OrganisationType .ICB )
34+
You can’t perform that action at this time.
0 commit comments