Skip to content

Commit ca9e858

Browse files
fixes (#32)
1 parent 78f28fd commit ca9e858

27 files changed

+145
-99
lines changed

conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ def start_mavis(start_exe_session, start_playwright):
3535
close_browser(browser=_browser, page=ce.page)
3636

3737

38+
# @pytest.fixture
39+
# def start_consent_workflow(start_exe_session, start_playwright):
40+
# _browser, _context = start_browser(pw=start_playwright, browser_or_device=ce.current_browser_name)
41+
# ce.page = _context.new_page()
42+
# ce.page.goto(url=ce.parental_consent_url)
43+
# yield
44+
# close_browser(browser=_browser, page=ce.page)
45+
46+
3847
@pytest.fixture
3948
def start_consent_workflow(start_exe_session, start_playwright):
4049
_browser, _context = start_browser(pw=start_playwright, browser_or_device=ce.current_browser_name)

libs/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
class object_properties:
55
TEXT: Final[str] = "text"
66
VISIBILITY: Final[str] = "visibility"
7+
HREF: Final[str] = "href"
78

89

910
class actions:

libs/playwright_ops.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ def get_object_property(self, locator: str, property: str, by_test_id: bool = Fa
6767
else:
6868
elem = self.ce.page.get_by_role(locator).nth(0)
6969
return elem.is_visible()
70+
case object_properties.HREF:
71+
elem = self.ce.page.get_by_role("link", name=locator).nth(0)
72+
return elem.get_attribute(object_properties.HREF)
7073

7174
def perform_action(self, locator, action, value=None, exact: bool = False) -> None:
7275
self.capture_screenshot(identifier=locator, action=f"before-{action}")

pages/pg_login.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,10 @@ def perform_invalid_login(self, user: str, pwd: str, expected_message: str) -> s
4646

4747
def perform_logout(self):
4848
self.po.perform_action(locator=self.BTN_LOGOUT, action=actions.CLICK_BUTTON)
49+
50+
def go_to_url(self, url: str) -> None:
51+
_full_url = f"{self.ce.service_url.replace("/start","")}{url}" if url.startswith("/") else url
52+
self.ce.page.goto(_full_url)
53+
54+
def go_to_login_page(self) -> None:
55+
self.ce.page.goto(self.ce.service_url)

pages/pg_sessions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class pg_sessions:
5959
LBL_CHILD_NOT_COMPETENT = "Child assessed as not Gillick competent"
6060
LNK_EDIT_GILLICK_COMPETENCE = "Edit Gillick competence"
6161
BTN_UPDATE_GILLICK_ASSESSMENT = "Update your assessment"
62+
LNK_CONSENT_FORM = "View parental consent form ("
6263

6364
def __get_display_formatted_date(self, date_to_format: str) -> str:
6465
_parsed_date = datetime.strptime(date_to_format, "%Y%m%d")
@@ -333,3 +334,6 @@ def set_gillick_competence_for_student(self):
333334
self.add_gillick_competence(is_competent=True, competence_details="Gillick competent")
334335
self.click_edit_gillick_competence()
335336
self.edit_gillick_competence(is_competent=False, competence_details="Not Gillick competent")
337+
338+
def get_consent_url(self) -> str:
339+
return self.po.get_object_property(locator=self.LNK_CONSENT_FORM, property=object_properties.HREF)

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ markers =
2323
childlist
2424
vaccsbatch
2525
rav
26+
bugs

test_data/ParentalConsent.xlsx

-19 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
The file is missing the following headers: ["CHILD_DATE_OF_BIRTH", "CHILD_FIRST_NAME", "CHILD_LAST_NAME", "CHILD_POSTCODE", "CHILD_SCHOOL_URN"]
1+
The file is missing the following headers: CHILD_DATE_OF_BIRTH, CHILD_FIRST_NAME, CHILD_LAST_NAME, CHILD_POSTCODE, CHILD_SCHOOL_URN

test_data/child/o_negative.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Records could not be imported
77
The records cannot be uploaded due to errors in the CSV file. When fixing these errors, note that the header does not count as a row.
88
Row 1 CHILD_FIRST_NAME: is required but missing
99
Row 2 CHILD_LAST_NAME: is required but missing
10-
Row 3 CHILD_SCHOOL_URN: is not included in the list
10+
Row 3 CHILD_SCHOOL_URN: The school URN is not recognised. If you’ve checked the URN, and you believe it’s valid, contact our support organisation.
1111
Row 4 CHILD_DATE_OF_BIRTH: is required but missing
1212
Row 5 CHILD_NHS_NUMBER: is the wrong length (should be 10 characters)
1313
Row 6 CHILD_NHS_NUMBER: is the wrong length (should be 10 characters)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
The file is missing the following headers: ["CHILD_DATE_OF_BIRTH", "CHILD_FIRST_NAME", "CHILD_LAST_NAME"]
1+
There is a problemThe file is missing the following headers: CHILD_DATE_OF_BIRTH, CHILD_FIRST_NAME, CHILD_LAST_NAME

0 commit comments

Comments
 (0)