Skip to content

Commit 951937e

Browse files
Add logging and methods for setting Lynch invitation rates; create CommunicationTypeByGpPracticePage
1 parent bba1d60 commit 951937e

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

pages/lynch_surveillance/set_lynch_invitation_rates_page.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from playwright.sync_api import Page, expect
1+
import logging
2+
from playwright.sync_api import Page, expect, Locator
23
from pages.base_page import BasePage
34

45

@@ -15,3 +16,19 @@ def verify_set_lynch_invitation_rates_title(self) -> None:
1516
self.bowel_cancer_screening_page_title_contains_text(
1617
"Set Lynch Surveillance Invitation Rates"
1718
)
19+
20+
def get_lynch_invitation_rate(self, screening_centre_id: str) -> Locator:
21+
return self.page.locator(f'[id="{screening_centre_id}"]')
22+
23+
def set_lynch_invitation_rate(self, screening_centre_id: str, rate: str) -> None:
24+
"""
25+
set lynch invitation rate
26+
"""
27+
self.get_lynch_invitation_rate(screening_centre_id).fill(rate)
28+
29+
logging.info(f"input {rate } for screening centre id {screening_centre_id} ")
30+
31+
def click_set_rates(self) -> None:
32+
self.page.get_by_role("button", name="Set Rates").click()
33+
expect(self.page.locator("#alert")).to_contain_text("×Successfully updated")
34+
logging.info("click set rates")
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import logging
2+
from playwright.sync_api import Page, expect
3+
4+
class CommunicationTypeByGpPracticePage:
5+
6+
def __init__(self,page:Page):
7+
self.page=page
8+
9+
def select_screening_centre(self,screening_centre:str) -> None:
10+
"""
11+
selects a screening centre and verifies the report has been generated
12+
"""
13+
14+
self.page.get_by_label("Screening Centre").select_option(screening_centre)
15+
logging.info(f"{screening_centre} selected")
16+
expect(self.page.locator("#ntshPageTitle")).to_contain_text("Communication Type for GP Practices")
17+
expect(self.page.locator("#displayInputParameters")).to_contain_text("Report generated on:")
18+
19+

pages/screening_subject_search/subject_screening_search_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def search_subject_with_args(
244244
# Only click search if at least one field was filled
245245
if any([surname, forename, screening_status, episode_status]):
246246
self.click(self.search_button)
247-
self.click(self.back_link)
247+
248248

249249

250250
class ScreeningStatusSearchOptions(Enum):

0 commit comments

Comments
 (0)