Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pages/pg_parental_consent.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ def select_severe_reaction(self, reaction_details: str = data_values.EMPTY) -> N
self.po.perform_action(locator=self.TXT_DETAILS, action=actions.FILL, value=reaction_details)
self.po.perform_action(locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON)

def select_extra_support(self, extra_support_details: str = data_values.EMPTY) -> None:
if extra_support_details == data_values.EMPTY:
self.po.perform_action(locator=self.RDO_NO, action=actions.RADIO_BUTTON_SELECT)
else:
self.po.perform_action(locator=self.RDO_YES, action=actions.RADIO_BUTTON_SELECT)
self.po.perform_action(locator=self.TXT_DETAILS, action=actions.FILL, value=extra_support_details)
self.po.perform_action(locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON)

def click_confirm_details(self) -> None:
self.po.perform_action(locator=self.BTN_CONFIRM, action=actions.CLICK_BUTTON)

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

def service_give_consent(self):
from libs import CurrentExecution as ce

self.po.perform_action(locator="Parent1Name1 (Dad)", action=actions.RADIO_BUTTON_SELECT)
self.po.perform_action(locator="Parent1 (Dad)", action=actions.RADIO_BUTTON_SELECT)
self.po.perform_action(locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON)
self.po.perform_action(locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON) # Parent contact details page
self.po.perform_action(locator=self.RDO_ONLINE, action=actions.RADIO_BUTTON_SELECT)
Expand Down
Binary file modified test_data/ParentalConsent.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion test_data/cohorts/i_positive.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
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
C<<FNAME>>,C<<LNAME>>,ChildCommon,1-1-2009,148419,<<NHS_NO>>,Addr1,Add2,City,AA1 1AA,Parent1Name1,Dad,[email protected],,Parent2Name1,Mum,[email protected],
C<<FNAME>>,C<<LNAME>>,ChildCommon,1-1-2009,148419,<<NHS_NO>>,Addr1,Add2,City,AA1 1AA,Parent1,Dad,[email protected],,Parent2,Mum,[email protected],
4 changes: 3 additions & 1 deletion tests/helpers/parental_consent_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def read_data_for_scenario(self, scenario_data) -> None:
self.allergy_details = str(_row["AllergyDetails"])
self.medical_condition_details = str(_row["MedicalConditionDetails"])
self.reaction_details = str(_row["ReactionDetails"])
self.extra_support_details = str(_row["ExtraSupportDetails"])
self.consent_not_given_reason = str(_row["ConsentNotGivenReason"])
self.consent_not_given_details = str(_row["ConsentNotGivenDetails"])
self.expected_message = str(_row["ExpectedFinalMessage"])
Expand Down Expand Up @@ -66,10 +67,11 @@ def enter_details(self) -> None:
self.pc.select_severe_allergies(allergy_details=self.allergy_details)
self.pc.select_medical_condition(medical_condition_details=self.medical_condition_details)
self.pc.select_severe_reaction(reaction_details=self.reaction_details)
self.pc.select_extra_support(extra_support_details=self.extra_support_details)
else:
self.pc.select_consent_not_given_reason(
reason=self.consent_not_given_reason, reason_details=self.consent_not_given_details
)
self.pc.click_confirm_details()
self.pc.verify_final_message(expected_message=self.expected_message)
self.ce.end_test()
# self.ce.end_test()
16 changes: 4 additions & 12 deletions tests/test_09_consent.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Test_Regression_Consent:
sessions_page = pg_sessions.pg_sessions()

@pytest.fixture()
def test_setup(self, start_mavis: None):
def test_setup(self, start_mavis):
self.login_page.perform_valid_login()
self.dashboard_page.click_sessions()
self.sessions_page.schedule_a_valid_session(for_today=True)
Expand All @@ -27,31 +27,23 @@ def test_setup(self, start_mavis: None):
self.dashboard_page.click_sessions()
self.sessions_page.delete_all_sessions()

@pytest.fixture
@pytest.fixture()
def get_session_link(self, start_mavis):
self.login_page.perform_valid_login()
self.dashboard_page.click_sessions()
self.sessions_page.schedule_a_valid_session()
link = self.sessions_page.get_consent_url()
self.login_page.perform_logout()
yield link
self.login_page.go_to_login_page
self.login_page.go_to_login_page()
self.login_page.perform_valid_login()
self.dashboard_page.click_sessions()
self.sessions_page.delete_all_sessions()

# @pytest.mark.consent
# @pytest.mark.mobile
# @pytest.mark.order(901)
# @pytest.mark.parametrize("scenario_data", helper.df.iterrows(), ids=[_tc[0] for _tc in helper.df.iterrows()])
# def test_reg_parental_consent_workflow(self, start_consent_workflow, scenario_data):
# self.helper.read_data_for_scenario(scenario_data=scenario_data)
# self.helper.enter_details()
self.login_page.perform_logout()

@pytest.mark.consent
@pytest.mark.mobile
@pytest.mark.order(901)
@pytest.mark.skip(reason="Under maintenance")
@pytest.mark.parametrize("scenario_data", helper.df.iterrows(), ids=[_tc[0] for _tc in helper.df.iterrows()])
def test_reg_parental_consent_workflow(self, get_session_link, scenario_data):
self.login_page.go_to_url(url=get_session_link)
Expand Down
Loading