Skip to content

Commit 1a71deb

Browse files
Consent workflow (#33)
1 parent 91bd183 commit 1a71deb

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

pages/pg_parental_consent.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ def select_severe_reaction(self, reaction_details: str = data_values.EMPTY) -> N
151151
self.po.perform_action(locator=self.TXT_DETAILS, action=actions.FILL, value=reaction_details)
152152
self.po.perform_action(locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON)
153153

154+
def select_extra_support(self, extra_support_details: str = data_values.EMPTY) -> None:
155+
if extra_support_details == data_values.EMPTY:
156+
self.po.perform_action(locator=self.RDO_NO, action=actions.RADIO_BUTTON_SELECT)
157+
else:
158+
self.po.perform_action(locator=self.RDO_YES, action=actions.RADIO_BUTTON_SELECT)
159+
self.po.perform_action(locator=self.TXT_DETAILS, action=actions.FILL, value=extra_support_details)
160+
self.po.perform_action(locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON)
161+
154162
def click_confirm_details(self) -> None:
155163
self.po.perform_action(locator=self.BTN_CONFIRM, action=actions.CLICK_BUTTON)
156164

@@ -182,9 +190,7 @@ def select_consent_not_given_reason(self, reason: str, reason_details: str) -> N
182190
self.po.perform_action(locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON)
183191

184192
def service_give_consent(self):
185-
from libs import CurrentExecution as ce
186-
187-
self.po.perform_action(locator="Parent1Name1 (Dad)", action=actions.RADIO_BUTTON_SELECT)
193+
self.po.perform_action(locator="Parent1 (Dad)", action=actions.RADIO_BUTTON_SELECT)
188194
self.po.perform_action(locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON)
189195
self.po.perform_action(locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON) # Parent contact details page
190196
self.po.perform_action(locator=self.RDO_ONLINE, action=actions.RADIO_BUTTON_SELECT)

test_data/ParentalConsent.xlsx

110 Bytes
Binary file not shown.

test_data/cohorts/i_positive.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
CHILD_FIRST_NAME,CHILD_LAST_NAME,CHILD_COMMON_NAME,CHILD_DATE_OF_BIRTH,CHILD_SCHOOL_URN,CHILD_NHS_NUMBER,CHILD_ADDRESS_LINE_1,CHILD_ADDRESS_LINE_2,CHILD_TOWN,CHILD_POSTCODE,PARENT_1_NAME,PARENT_1_RELATIONSHIP,PARENT_1_EMAIL,PARENT_1_PHONE,PARENT_2_NAME,PARENT_2_RELATIONSHIP,PARENT_2_EMAIL,PARENT_2_PHONE
2-
C<<FNAME>>,C<<LNAME>>,ChildCommon,1-1-2009,148419,<<NHS_NO>>,Addr1,Add2,City,AA1 1AA,Parent1Name1,Dad,[email protected],,Parent2Name1,Mum,[email protected],
2+
C<<FNAME>>,C<<LNAME>>,ChildCommon,1-1-2009,148419,<<NHS_NO>>,Addr1,Add2,City,AA1 1AA,Parent1,Dad,[email protected],,Parent2,Mum,[email protected],

tests/helpers/parental_consent_helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def read_data_for_scenario(self, scenario_data) -> None:
3535
self.allergy_details = str(_row["AllergyDetails"])
3636
self.medical_condition_details = str(_row["MedicalConditionDetails"])
3737
self.reaction_details = str(_row["ReactionDetails"])
38+
self.extra_support_details = str(_row["ExtraSupportDetails"])
3839
self.consent_not_given_reason = str(_row["ConsentNotGivenReason"])
3940
self.consent_not_given_details = str(_row["ConsentNotGivenDetails"])
4041
self.expected_message = str(_row["ExpectedFinalMessage"])
@@ -66,10 +67,11 @@ def enter_details(self) -> None:
6667
self.pc.select_severe_allergies(allergy_details=self.allergy_details)
6768
self.pc.select_medical_condition(medical_condition_details=self.medical_condition_details)
6869
self.pc.select_severe_reaction(reaction_details=self.reaction_details)
70+
self.pc.select_extra_support(extra_support_details=self.extra_support_details)
6971
else:
7072
self.pc.select_consent_not_given_reason(
7173
reason=self.consent_not_given_reason, reason_details=self.consent_not_given_details
7274
)
7375
self.pc.click_confirm_details()
7476
self.pc.verify_final_message(expected_message=self.expected_message)
75-
self.ce.end_test()
77+
# self.ce.end_test()

tests/test_09_consent.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Test_Regression_Consent:
1313
sessions_page = pg_sessions.pg_sessions()
1414

1515
@pytest.fixture()
16-
def test_setup(self, start_mavis: None):
16+
def test_setup(self, start_mavis):
1717
self.login_page.perform_valid_login()
1818
self.dashboard_page.click_sessions()
1919
self.sessions_page.schedule_a_valid_session(for_today=True)
@@ -27,31 +27,23 @@ def test_setup(self, start_mavis: None):
2727
self.dashboard_page.click_sessions()
2828
self.sessions_page.delete_all_sessions()
2929

30-
@pytest.fixture
30+
@pytest.fixture()
3131
def get_session_link(self, start_mavis):
3232
self.login_page.perform_valid_login()
3333
self.dashboard_page.click_sessions()
3434
self.sessions_page.schedule_a_valid_session()
3535
link = self.sessions_page.get_consent_url()
3636
self.login_page.perform_logout()
3737
yield link
38-
self.login_page.go_to_login_page
38+
self.login_page.go_to_login_page()
3939
self.login_page.perform_valid_login()
4040
self.dashboard_page.click_sessions()
4141
self.sessions_page.delete_all_sessions()
42-
43-
# @pytest.mark.consent
44-
# @pytest.mark.mobile
45-
# @pytest.mark.order(901)
46-
# @pytest.mark.parametrize("scenario_data", helper.df.iterrows(), ids=[_tc[0] for _tc in helper.df.iterrows()])
47-
# def test_reg_parental_consent_workflow(self, start_consent_workflow, scenario_data):
48-
# self.helper.read_data_for_scenario(scenario_data=scenario_data)
49-
# self.helper.enter_details()
42+
self.login_page.perform_logout()
5043

5144
@pytest.mark.consent
5245
@pytest.mark.mobile
5346
@pytest.mark.order(901)
54-
@pytest.mark.skip(reason="Under maintenance")
5547
@pytest.mark.parametrize("scenario_data", helper.df.iterrows(), ids=[_tc[0] for _tc in helper.df.iterrows()])
5648
def test_reg_parental_consent_workflow(self, get_session_link, scenario_data):
5749
self.login_page.go_to_url(url=get_session_link)

0 commit comments

Comments
 (0)