Skip to content

Commit c52ae27

Browse files
Feature/bcss 21765 repo documentation (#146)
<!-- markdownlint-disable-next-line first-line-heading --> ## Description <!-- Describe your changes in detail. --> Creating a new document to log what is available in the BCSS playwright repository. Also making changes to some POMs so that they follow the contribution guidelines. ## Context <!-- Why is this change required? What problem does it solve? --> Creating a new document to log what is available in the BCSS playwright repository. Also making changes to some POMs so that they follow the contribution guidelines. ## Type of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. --> - [x] Refactoring (non-breaking change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would change existing functionality) - [ ] Bug fix (non-breaking change which fixes an issue) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I am familiar with the [contributing guidelines](https://github.com/nhs-england-tools/playwright-python-blueprint/blob/main/CONTRIBUTING.md) - [x] I have followed the code style of the project - [ ] I have added tests to cover my changes (where appropriate) - [x] I have updated the documentation accordingly - [ ] This PR is a result of pair or mob programming --- ## Sensitive Information Declaration To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including [PII (Personal Identifiable Information) / PID (Personal Identifiable Data)](https://digital.nhs.uk/data-and-information/keeping-data-safe-and-benefitting-the-public) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter. - [x] I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.
1 parent be5a32d commit c52ae27

16 files changed

+770
-130
lines changed

docs/RepositoryGuide.md

Lines changed: 640 additions & 0 deletions
Large diffs are not rendered by default.

pages/alerts/alerts_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ def click_refresh_alerts(self) -> None:
1111
"""Clicks the 'Refresh Alerts' link to trigger an update of alert messages."""
1212
self.refresh_alerts_link.click()
1313

14-
def is_refresh_alerts_visible(self, timeout=5000) -> bool:
14+
def is_refresh_alerts_visible(self, timeout: int = 5000) -> bool:
1515
"""Returns True if the 'Refresh Alerts' link is visible within the given timeout."""
1616
return self.refresh_alerts_link.is_visible(timeout=timeout)

pages/base_page.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ def __init__(self, page: Page):
4545
self.screening_subject_search_page = self.page.get_by_role(
4646
"link", name="Screening Subject Search"
4747
)
48+
self.log_in_page = self.page.get_by_role("button", name="Log in")
4849
# Bowel Cancer Screening System header
4950
self.bowel_cancer_screening_system_header = self.page.locator("#ntshAppTitle")
5051
# Bowel Cancer Screening Page header
5152
self.bowel_cancer_screening_page_title = self.page.locator("#page-title")
5253
self.bowel_cancer_screening_ntsh_page_title = self.page.locator(
5354
"#ntshPageTitle"
5455
)
55-
self.main_menu__header = self.page.locator("#ntshPageTitle")
56-
self.log_in_page = self.page.get_by_role("button", name="Log in")
56+
self.main_menu_header = self.page.locator("#ntshPageTitle")
5757

5858
def click_main_menu_link(self) -> None:
5959
"""Click the Base Page 'Main Menu' link if it is visible."""
@@ -64,8 +64,8 @@ def click_main_menu_link(self) -> None:
6464
if self.main_menu_link.is_visible():
6565
self.click(self.main_menu_link)
6666
try:
67-
if self.main_menu__header.is_visible():
68-
text = self.main_menu__header.text_content()
67+
if self.main_menu_header.is_visible():
68+
text = self.main_menu_header.text_content()
6969
else:
7070
text = None
7171
except Exception as e:
@@ -132,7 +132,7 @@ def main_menu_header_is_displayed(self) -> None:
132132
Asserts that the Main Menu header is displayed.
133133
self.main_menu_string contains the string 'Main Menu'
134134
"""
135-
expect(self.main_menu__header).to_contain_text(self.main_menu_string)
135+
expect(self.main_menu_header).to_contain_text(self.main_menu_string)
136136

137137
def bowel_cancer_screening_page_title_contains_text(self, text: str) -> None:
138138
"""Asserts that the page title contains the specified text.

pages/organisations/create_organisation.py renamed to pages/organisations/create_organisation_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pages.base_page import BasePage
44

55

6-
class CreateOrganisation(BasePage):
6+
class CreateOrganisationPage(BasePage):
77
"""Create Organisation Page locators, and methods for interacting with the page."""
88

99
def __init__(self, page: Page):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pages.base_page import BasePage
44

55

6-
class CreateSite(BasePage):
6+
class CreateSitePage(BasePage):
77
"""Create Site Page locators, and methods for interacting with the page."""
88

99
def __init__(self, page: Page):

pages/organisations/list_all_organisations.py renamed to pages/organisations/list_all_organisations_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from utils.table_util import TableUtils
66

77

8-
class ListAllOrganisations(BasePage):
8+
class ListAllOrganisationsPage(BasePage):
99
"""Organisations And Site Details Page locators, and methods for interacting with the page."""
1010

1111
def __init__(self, page: Page):

pages/organisations/list_all_sites.py renamed to pages/organisations/list_all_sites_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from utils.table_util import TableUtils
66

77

8-
class ListAllSites(BasePage):
8+
class ListAllSitesPage(BasePage):
99
"""List All Sites Page locators, and methods for interacting with the page."""
1010

1111
def __init__(self, page: Page):

pages/organisations/organisations_and_site_details.py renamed to pages/organisations/organisations_and_site_details_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pages.base_page import BasePage
44

55

6-
class OrganisationsAndSiteDetails(BasePage):
6+
class OrganisationsAndSiteDetailsPage(BasePage):
77
"""Organisations And Site Details Page locators, and methods for interacting with the page."""
88

99
def __init__(self, page: Page):

pages/organisations/view_organisation.py renamed to pages/organisations/view_organisation_page.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pages.base_page import BasePage
44

55

6-
class ViewOrganisation(BasePage):
6+
class ViewOrganisationPage(BasePage):
77
"""View Organisation Page locators, and methods for interacting with the page."""
88

99
def __init__(self, page: Page):
@@ -16,12 +16,12 @@ def verify_page_title(self) -> None:
1616
logging.info("Verifying page title for View Organisation")
1717
expect(self.page.locator("#ntshPageTitle")).to_contain_text("View Organisation")
1818

19-
def verify_organisation_code_details(self,text:str) -> None:
19+
def verify_organisation_code_details(self, text: str) -> None:
2020
"""Verifies that the organisation code details are displayed correctly."""
2121
logging.info("Verifying organisation code details on View Organisation page")
2222
expect(self.page.locator('form[name="frm"]')).to_contain_text(text)
2323

24-
def verify_organisation_type_details(self,text:str) -> None:
24+
def verify_organisation_type_details(self, text: str) -> None:
2525
"""Verifies that the organisation type details are displayed correctly."""
2626
logging.info("Verifying organisation type details on View Organisation page")
2727
expect(self.page.locator('form[name="frm"]')).to_contain_text(text)

pages/screening_subject_search/subject_events_notes.py renamed to pages/screening_subject_search/subject_events_notes_page.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
from playwright.sync_api import Page, Locator
1+
from playwright.sync_api import Page
22
from pages.base_page import BasePage
33
from enum import StrEnum
44
import logging
5-
import pytest
65
from utils.table_util import TableUtils
76

87

9-
class SubjectEventsNotes(BasePage):
8+
class SubjectEventsNotesPage(BasePage):
109
"""Subject Events Notes Page locators, and methods for interacting with the page."""
1110

1211
def __init__(self, page: Page):

0 commit comments

Comments
 (0)