diff --git a/pages/pg_parental_consent.py b/pages/pg_parental_consent.py index 5e68242738a..7882c17042a 100644 --- a/pages/pg_parental_consent.py +++ b/pages/pg_parental_consent.py @@ -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) @@ -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) diff --git a/test_data/ParentalConsent.xlsx b/test_data/ParentalConsent.xlsx index 4d126559df5..1672fed5a47 100644 Binary files a/test_data/ParentalConsent.xlsx and b/test_data/ParentalConsent.xlsx differ diff --git a/test_data/cohorts/i_positive.csv b/test_data/cohorts/i_positive.csv index 4da02d19644..ccf21fa4f20 100644 --- a/test_data/cohorts/i_positive.csv +++ b/test_data/cohorts/i_positive.csv @@ -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<>,C<>,ChildCommon,1-1-2009,148419,<>,Addr1,Add2,City,AA1 1AA,Parent1Name1,Dad,dad1@example.com,,Parent2Name1,Mum,mum1@example.com, +C<>,C<>,ChildCommon,1-1-2009,148419,<>,Addr1,Add2,City,AA1 1AA,Parent1,Dad,dad1@example.com,,Parent2,Mum,mum1@example.com, diff --git a/tests/helpers/parental_consent_helper.py b/tests/helpers/parental_consent_helper.py index 2a645441395..51d2837db61 100644 --- a/tests/helpers/parental_consent_helper.py +++ b/tests/helpers/parental_consent_helper.py @@ -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"]) @@ -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() diff --git a/tests/test_09_consent.py b/tests/test_09_consent.py index f29c1d6a4ec..5d5e75fefb0 100644 --- a/tests/test_09_consent.py +++ b/tests/test_09_consent.py @@ -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) @@ -27,7 +27,7 @@ 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() @@ -35,23 +35,15 @@ def get_session_link(self, start_mavis): 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)