From f634c708dd337f93b376c1e6c84386b21b8d8616 Mon Sep 17 00:00:00 2001 From: "chinmay.mudholkar1@nhs.net" Date: Thu, 21 Nov 2024 18:15:33 +0000 Subject: [PATCH] fixes --- conftest.py | 9 +++++ libs/constants.py | 1 + libs/playwright_ops.py | 3 ++ pages/pg_login.py | 7 ++++ pages/pg_sessions.py | 4 +++ pytest.ini | 1 + test_data/ParentalConsent.xlsx | Bin 8676 -> 8657 bytes test_data/child/o_invalid_structure.csv | 2 +- test_data/child/o_negative.csv | 2 +- test_data/class_list/o_invalid_structure.csv | 2 +- test_data/cohorts/o_invalid_structure.csv | 2 +- test_data/cohorts/o_negative.csv | 4 +-- test_data/hpv/i_dup_1.csv | 4 +-- test_data/hpv/i_dup_2.csv | 4 +-- test_data/hpv/i_negative.csv | 8 ++--- test_data/hpv/i_positive.csv | 12 +++---- test_data/hpv/o_invalid_structure.csv | 2 +- test_data/hpv/o_negative.csv | 16 +++++---- test_data/hpv/o_positive.csv | 2 +- tests/test_02_sessions.py | 19 +++++----- tests/test_03_class_list_upload.py | 12 +++---- tests/test_04_cohorts.py | 27 +++++++------- tests/test_05_child_list_upload.py | 27 +++++++------- tests/test_06_vaccs_batch.py | 23 ++++++------ tests/test_07_record_a_vaccine_using_ui.py | 4 +-- tests/test_08_vaccs_upload.py | 14 ++++---- ...{test_10_consent.py => test_09_consent.py} | 33 +++++++++++++++--- 27 files changed, 145 insertions(+), 99 deletions(-) rename tests/{test_10_consent.py => test_09_consent.py} (54%) diff --git a/conftest.py b/conftest.py index d698190b49c..d650a9b20a6 100644 --- a/conftest.py +++ b/conftest.py @@ -35,6 +35,15 @@ def start_mavis(start_exe_session, start_playwright): close_browser(browser=_browser, page=ce.page) +# @pytest.fixture +# def start_consent_workflow(start_exe_session, start_playwright): +# _browser, _context = start_browser(pw=start_playwright, browser_or_device=ce.current_browser_name) +# ce.page = _context.new_page() +# ce.page.goto(url=ce.parental_consent_url) +# yield +# close_browser(browser=_browser, page=ce.page) + + @pytest.fixture def start_consent_workflow(start_exe_session, start_playwright): _browser, _context = start_browser(pw=start_playwright, browser_or_device=ce.current_browser_name) diff --git a/libs/constants.py b/libs/constants.py index 6e39ce9b3b3..323a2142e4a 100644 --- a/libs/constants.py +++ b/libs/constants.py @@ -4,6 +4,7 @@ class object_properties: TEXT: Final[str] = "text" VISIBILITY: Final[str] = "visibility" + HREF: Final[str] = "href" class actions: diff --git a/libs/playwright_ops.py b/libs/playwright_ops.py index 9f5ad8e3ef1..f0155b56e44 100644 --- a/libs/playwright_ops.py +++ b/libs/playwright_ops.py @@ -67,6 +67,9 @@ def get_object_property(self, locator: str, property: str, by_test_id: bool = Fa else: elem = self.ce.page.get_by_role(locator).nth(0) return elem.is_visible() + case object_properties.HREF: + elem = self.ce.page.get_by_role("link", name=locator).nth(0) + return elem.get_attribute(object_properties.HREF) def perform_action(self, locator, action, value=None, exact: bool = False) -> None: self.capture_screenshot(identifier=locator, action=f"before-{action}") diff --git a/pages/pg_login.py b/pages/pg_login.py index 95efe663d3a..ecfc3a84e79 100644 --- a/pages/pg_login.py +++ b/pages/pg_login.py @@ -46,3 +46,10 @@ def perform_invalid_login(self, user: str, pwd: str, expected_message: str) -> s def perform_logout(self): self.po.perform_action(locator=self.BTN_LOGOUT, action=actions.CLICK_BUTTON) + + def go_to_url(self, url: str) -> None: + _full_url = f"{self.ce.service_url.replace("/start","")}{url}" if url.startswith("/") else url + self.ce.page.goto(_full_url) + + def go_to_login_page(self) -> None: + self.ce.page.goto(self.ce.service_url) diff --git a/pages/pg_sessions.py b/pages/pg_sessions.py index 6449842ea4f..979370c46df 100644 --- a/pages/pg_sessions.py +++ b/pages/pg_sessions.py @@ -59,6 +59,7 @@ class pg_sessions: LBL_CHILD_NOT_COMPETENT = "Child assessed as not Gillick competent" LNK_EDIT_GILLICK_COMPETENCE = "Edit Gillick competence" BTN_UPDATE_GILLICK_ASSESSMENT = "Update your assessment" + LNK_CONSENT_FORM = "View parental consent form (" def __get_display_formatted_date(self, date_to_format: str) -> str: _parsed_date = datetime.strptime(date_to_format, "%Y%m%d") @@ -333,3 +334,6 @@ def set_gillick_competence_for_student(self): self.add_gillick_competence(is_competent=True, competence_details="Gillick competent") self.click_edit_gillick_competence() self.edit_gillick_competence(is_competent=False, competence_details="Not Gillick competent") + + def get_consent_url(self) -> str: + return self.po.get_object_property(locator=self.LNK_CONSENT_FORM, property=object_properties.HREF) diff --git a/pytest.ini b/pytest.ini index edff0dfd839..d35a3efa9ed 100644 --- a/pytest.ini +++ b/pytest.ini @@ -23,3 +23,4 @@ markers = childlist vaccsbatch rav + bugs diff --git a/test_data/ParentalConsent.xlsx b/test_data/ParentalConsent.xlsx index 1f6f331f9c70396285ef02f9b1b956fef853af92..4d126559df5d575fe2e84e464e14881123dd9cac 100644 GIT binary patch delta 4594 zcma)Ac{r4P_cz%__Myl=V+PYABq>X>&LHbx$Py7DOR~pZh>&f@QYLHGlx;!=St8LR zOvu>xT~jIh^277Iz1Qdn=L;C1XnOFiEpoi=$n0v*6r-VT?H1bDiXgF!`4}`gZ z+ypEACMoXly>{}}@=Jn*d1XSuxHg1Knva^gN)xlFHLx%?dX0f4bjY7ltDoVuS($#@ zB<0@o74lqo*J*JkXScAP#qe6m+4)4cveX%@qpX~LMEV~Cse@7c5uKl~cdumYXKQUm z4Tig_mL9u5%a8fPF`-M^@l^nq4J4 z2a_nE%}qa6ulhYW%e@o}@>J4owJd_>FUeBM&^rp@x5TZB)2>_mt1Soik&iQ600 z!Nn^3m7pzw)?3KH-GD&jV7<>N?n&)Fy8 zKz24y=yfKRr=IDXUOPG}r{N5bi;MPuiCFn!QmZ!_?K&}ix}!LFtJaS)(`&i{n>HnO ztbIwTpJ`h_obs&4N|J51vZu+;yB&TO;snZ$OwD3OwlZP1VvW6E+gW-PJ~$;^*ABD` zN+wdPjps4t+ErfyiE>q6+FVGMFK@UQ54r224 zG{;?-2AZo-eLe|6O*YN$gZNIJnw@HW9JPk={kvidWZJO8cbW8j&sFR_%;lisw>Hm~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@r#e0IYICyLUjq-d#$@1%q}asKo^?gtK45?o;eefrZ#Z9Q=4M=g%Jr?!BIr$ z;s@{!C^Lj(jL~oCNuX_JReLce+|)D-9TS3~);L@^{6TfI(^U}NW;`5g{zPKBiAt9w zYGj`t?eIxxyQgdZj*fTzo2-(FJJfwXg|76aGAv5oa8+Si3Y01}_h^0PhHwxANliQl zDzGXuQHYktZ|7#0`UY#P%?%$xesedQ*N{2QQP_=MO0iKU{nt$_+o{~fN?h&U3Xk=v zFkK;ps>Ok%&YdHJkj5|{L@>eGPofU8eQE7V)0q5|@EQHqU2+Yg!CtOEfpqUc^{X&r z3Gats(d0%!k1eX-mthvC+00K|sDlPG1Je;Rk zx;*DdUf^ALcu%#MV@(2I%)|ZHnB?b=I}dgjxAk>)_Y*hJAt7Z3oz!1`?NDHu8Ti7n z_To5-IDP}5X2>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, diff --git a/test_data/hpv/i_dup_2.csv b/test_data/hpv/i_dup_2.csv index 59d7eeb7eaa..7ed6700be8f 100644 --- a/test_data/hpv/i_dup_2.csv +++ b/test_data/hpv/i_dup_2.csv @@ -1,2 +1,2 @@ -ORGANISATION_CODE,SCHOOL_URN,SCHOOL_NAME,NHS_NUMBER,PERSON_FORENAME,PERSON_SURNAME,PERSON_DOB,PERSON_GENDER_CODE,PERSON_POSTCODE,DATE_OF_VACCINATION,VACCINE_GIVEN,BATCH_NUMBER,BATCH_EXPIRY_DATE,ANATOMICAL_SITE,DOSE_SEQUENCE,VACCINATED,CARE_SETTING -R1L,120026,shaftesbury junior school,9316984933,Forename_5,Surname_5,20120108,Male,WF2 9AB,20241001,Cervarix,270916878,20250730,Left Buttock,1,Y,1 +TEST_DESC_IGNORED,ORGANISATION_CODE,SCHOOL_URN,SCHOOL_NAME,NHS_NUMBER,PERSON_FORENAME,PERSON_SURNAME,PERSON_DOB,PERSON_GENDER_CODE,PERSON_POSTCODE,DATE_OF_VACCINATION,VACCINE_GIVEN,BATCH_NUMBER,BATCH_EXPIRY_DATE,ANATOMICAL_SITE,DOSE_SEQUENCE,VACCINATED,CARE_SETTING,PERFORMING_PROFESSIONAL_FORENAME,PERFORMING_PROFESSIONAL_SURNAME,PERFORMING_PROFESSIONAL_EMAIL,CLINIC_NAME,TIME_OF_VACCINATION,REASON_NOT_VACCINATED +P_Gardasil9,R1L,142181,Bohunt School Wokingham,9000000000,ChildFirst1,ChildLast1,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, diff --git a/test_data/hpv/i_negative.csv b/test_data/hpv/i_negative.csv index dda14a75c99..ebe02891638 100644 --- a/test_data/hpv/i_negative.csv +++ b/test_data/hpv/i_negative.csv @@ -13,7 +13,7 @@ N_FutureDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20 N_NonLeapYearDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100229,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, N_EmptyGender,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, N_InvalidGender,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Transgender,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyPostCode,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, +N_EmptyPostCode,R1L,142181,Bohunt School Wokingham,,<>,<>,20100228,Female,,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, N_InvalidPostCode,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,1AA AA1,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, N_EmptyVaccDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, N_FutureVaccDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,20301231,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, @@ -31,6 +31,6 @@ N_InvalidProfSName,R1L,142181,Bohunt School Wokingham,<>,<>,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@invalid-example.com,Clinic,12:00, N_InvalidClinic,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,2,,,nurse.joy@example.com,Invalid Clinic,12:00, N_InvalidTime,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,,32:00, -N_InvalidReason,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,,32:00,Did not attend1 -N_InvalidVaccinatedFlag,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,X,1,,,nurse.joy@example.com,,32:00, -N_InvalidCareSetting,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,10,,,nurse.joy@example.com,,32:00, +N_InvalidReason,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,,12:00,Did not attend1 +N_InvalidVaccinatedFlag,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,X,1,,,nurse.joy@example.com,,12:00, +N_InvalidCareSetting,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,10,,,nurse.joy@example.com,,12:00, diff --git a/test_data/hpv/i_positive.csv b/test_data/hpv/i_positive.csv index 33f110332f6..3d4b5f8f161 100644 --- a/test_data/hpv/i_positive.csv +++ b/test_data/hpv/i_positive.csv @@ -2,9 +2,9 @@ TEST_DESC_IGNORED,ORGANISATION_CODE,SCHOOL_URN,SCHOOL_NAME,NHS_NUMBER,PERSON_FOR P_Gardasil9,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, P_Gardasil,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil,AutoBatch1,20301231,Right Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, P_Cervarix,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Cervarix,AutoBatch1,20301231,left upper arm,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_NFA,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3VZ,<>,Cervarix9,AutoBatch1,20301231,left arm (upper position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_Add_Not_Known,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3WZ,<>,Cervarix9,AutoBatch1,20301231,left arm (lower position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_AllowPastExpiryDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3WZ,<>,Cervarix9,AutoBatch1,20120730,right upper arm,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_SiteRAU,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3WZ,<>,Cervarix9,AutoBatch1,20320730,right arm (upper position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_SiteRAL,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3WZ,<>,Cervarix9,AutoBatch1,20320730,right arm (lower position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_NotVaccinated,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3WZ,<>,Cervarix9,AutoBatch1,20320730,right arm (upper position),1,N,1,,,nurse.joy@example.com,Clinic,12:00,Did not attend +P_NFA,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3VZ,<>,Gardasil9,AutoBatch1,20301231,left arm (upper position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, +P_Add_Not_Known,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3WZ,<>,Gardasil9,AutoBatch1,20301231,left arm (lower position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, +P_AllowPastExpiryDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20120730,right upper arm,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, +P_SiteRAU,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20320730,right arm (upper position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, +P_SiteRAL,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20320730,right arm (lower position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, +P_NotVaccinated,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,,,,,1,N,1,,,nurse.joy@example.com,Clinic,12:00,Did not attend diff --git a/test_data/hpv/o_invalid_structure.csv b/test_data/hpv/o_invalid_structure.csv index 8b7777d1274..99c9788dd1c 100644 --- a/test_data/hpv/o_invalid_structure.csv +++ b/test_data/hpv/o_invalid_structure.csv @@ -1 +1 @@ -The file is missing the following headers: ["ORGANISATION_CODE", "SCHOOL_URN", "SCHOOL_NAME", "NHS_NUMBER", "PERSON_FORENAME", "PERSON_SURNAME", "PERSON_DOB", "PERSON_POSTCODE", "DATE_OF_VACCINATION", "VACCINE_GIVEN", "BATCH_NUMBER", "BATCH_EXPIRY_DATE", "ANATOMICAL_SITE"] +The file is missing the following headers: ORGANISATION_CODE, SCHOOL_URN, SCHOOL_NAME, NHS_NUMBER, PERSON_FORENAME, PERSON_SURNAME, PERSON_DOB, PERSON_POSTCODE, DATE_OF_VACCINATION, VACCINE_GIVEN, BATCH_NUMBER, BATCH_EXPIRY_DATE, ANATOMICAL_SITE diff --git a/test_data/hpv/o_negative.csv b/test_data/hpv/o_negative.csv index 34b9f1e699f..2a49f5517da 100644 --- a/test_data/hpv/o_negative.csv +++ b/test_data/hpv/o_negative.csv @@ -16,15 +16,19 @@ Row 15 PERSON_POSTCODE: Enter a valid postcode, such as SW1A 1AA Row 16 PERSON_POSTCODE: Enter a valid postcode, such as SW1A 1AA Row 17 DATE_OF_VACCINATION: Enter a date in the correct format Row 18 DATE_OF_VACCINATION: The vaccination date is outside the programme. Enter a date before today. -Row 19 VACCINE_GIVEN: Enter a valid vaccine, eg Gardasil 9. -Row 20 VACCINE_GIVEN: Enter a valid vaccine, eg Gardasil 9. +Row 19 VACCINE_GIVEN: Enter a valid vaccine, eg Gardasil9. +Row 20 VACCINE_GIVEN: Enter a valid vaccine, eg Gardasil9. Row 21 BATCH_NUMBER: Enter a batch number. Row 22 BATCH_EXPIRY_DATE: Enter a batch expiry date. Row 23 ANATOMICAL_SITE: Enter an anatomical site. +Row 24 ANATOMICAL_SITE: Enter a anatomical site that is appropriate for the vaccine. Row 25 DOSE_SEQUENCE: The dose sequence number cannot be greater than 3. Enter a dose sequence number, for example, 1, 2 or 3. Row 26 DOSE_SEQUENCE: must be less than or equal to 3 Row 27 CARE_SETTING: Enter a care setting. -Row 28 CARE_SETTING: Enter a valid care setting. -Row 32 PERFORMING_PROFESSIONAL_EMAIL: Enter a valid email address -Row 34 TIME_OF_VACCINATION: Enter a time in the correct format -Row 35 REASON_NOT_VACCINATED: Enter a reason +Row 28 PERFORMING_PROFESSIONAL_EMAIL: Enter a valid email address +Row 29 PERFORMING_PROFESSIONAL_EMAIL: Enter a valid email address +Row 30 PERFORMING_PROFESSIONAL_EMAIL: Enter a valid email address +Row 31 CLINIC_NAME: Enter a clinic name +Row 32 TIME_OF_VACCINATION: Enter a time in the correct format +Row 34 VACCINATED: You need to record whether the child was vaccinated or not. Enter ‘Y’ or ‘N’ in the ‘vaccinated’ column.BATCH_EXPIRY_DATE: must be blankBATCH_NUMBER: must be blankANATOMICAL_SITE: must be blankREASON_NOT_VACCINATED: Enter a valid reasonVACCINE_GIVEN: must be blank +Row 35 CARE_SETTING: Enter a valid care setting. diff --git a/test_data/hpv/o_positive.csv b/test_data/hpv/o_positive.csv index d08e9408e5c..1e717177385 100644 --- a/test_data/hpv/o_positive.csv +++ b/test_data/hpv/o_positive.csv @@ -2,4 +2,4 @@ Completed Programme HPV Type Immunisation list Imported by Nurse Joy -15 vaccination records +9 vaccination records diff --git a/tests/test_02_sessions.py b/tests/test_02_sessions.py index ce5dcac32ab..0360b78fb5a 100644 --- a/tests/test_02_sessions.py +++ b/tests/test_02_sessions.py @@ -8,23 +8,24 @@ class Test_Regression_Sessions: dashboard_page = pg_dashboard.pg_dashboard() sessions_page = pg_sessions.pg_sessions() - @pytest.mark.sessions - @pytest.mark.order(201) - def test_reg_create_valid_session(self, start_mavis): + @pytest.fixture + def test_setup(self, start_mavis): self.login_page.perform_valid_login() self.dashboard_page.click_sessions() + yield + self.login_page.perform_logout() + + @pytest.mark.sessions + @pytest.mark.order(201) + def test_reg_create_valid_session(self, test_setup): self.sessions_page.schedule_a_valid_session() @pytest.mark.sessions @pytest.mark.order(202) - def test_reg_delete_all_sessions(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_sessions() + def test_reg_delete_all_sessions(self, test_setup): self.sessions_page.delete_all_sessions() @pytest.mark.sessions @pytest.mark.order(203) - def test_reg_create_invalid_session(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_sessions() + def test_reg_create_invalid_session(self, test_setup): self.sessions_page.create_invalid_session() diff --git a/tests/test_03_class_list_upload.py b/tests/test_03_class_list_upload.py index c416aae8bbc..37db4f4da02 100644 --- a/tests/test_03_class_list_upload.py +++ b/tests/test_03_class_list_upload.py @@ -10,7 +10,7 @@ class Test_Regression_Class_List_Upload: sessions_page = pg_sessions.pg_sessions() @pytest.fixture() - def create_session(self, start_mavis: None): + def test_setup(self, start_mavis: None): self.login_page.perform_valid_login() self.dashboard_page.click_sessions() self.sessions_page.schedule_a_valid_session() @@ -23,25 +23,25 @@ def create_session(self, start_mavis: None): @pytest.mark.classlist @pytest.mark.order(301) - def test_reg_class_list_file_upload_positive(self, create_session: None): + def test_reg_class_list_file_upload_positive(self, test_setup: None): self.sessions_page.upload_class_list(file_paths=test_data_file_paths.CLASS_POSITIVE) @pytest.mark.classlist @pytest.mark.order(302) - def test_reg_class_list_file_upload_negative(self, create_session: None): + def test_reg_class_list_file_upload_negative(self, test_setup: None): self.sessions_page.upload_class_list(file_paths=test_data_file_paths.CLASS_NEGATIVE) @pytest.mark.classlist @pytest.mark.order(303) - def test_reg_class_list_file_structure(self, create_session: None): + def test_reg_class_list_file_structure(self, test_setup: None): self.sessions_page.upload_invalid_class_list_records(file_paths=test_data_file_paths.CLASS_INVALID_STRUCTURE) @pytest.mark.classlist @pytest.mark.order(304) - def test_reg_class_list_no_record(self, create_session: None): + def test_reg_class_list_no_record(self, test_setup: None): self.sessions_page.upload_invalid_class_list_records(file_paths=test_data_file_paths.CLASS_HEADER_ONLY) @pytest.mark.classlist @pytest.mark.order(305) - def test_reg_class_list_empty_file(self, create_session: None): + def test_reg_class_list_empty_file(self, test_setup: None): self.sessions_page.upload_invalid_class_list_records(file_paths=test_data_file_paths.CLASS_EMPTY_FILE) diff --git a/tests/test_04_cohorts.py b/tests/test_04_cohorts.py index 2ee39060f11..5f0d79f0096 100644 --- a/tests/test_04_cohorts.py +++ b/tests/test_04_cohorts.py @@ -9,37 +9,34 @@ class Test_Regression_Cohorts: dashboard_page = pg_dashboard.pg_dashboard() programmes_page = pg_programmes.pg_programmes() - @pytest.mark.cohorts - @pytest.mark.order(401) - def test_reg_cohort_upload_positive(self, start_mavis): + @pytest.fixture() + def test_setup(self, start_mavis: None): self.login_page.perform_valid_login() self.dashboard_page.click_programmes() + yield + self.login_page.perform_logout() + + @pytest.mark.cohorts + @pytest.mark.order(401) + def test_reg_cohort_upload_positive(self, test_setup): self.programmes_page.upload_cohorts(file_paths=test_data_file_paths.COHORTS_POSITIVE) @pytest.mark.cohorts @pytest.mark.order(402) - def test_reg_cohort_upload_negative(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_programmes() + def test_reg_cohort_upload_negative(self, test_setup): self.programmes_page.upload_cohorts(file_paths=test_data_file_paths.COHORTS_NEGATIVE) @pytest.mark.cohorts @pytest.mark.order(403) - def test_reg_cohorts_file_structure(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_programmes() + def test_reg_cohorts_file_structure(self, test_setup): self.programmes_page.upload_invalid_cohorts(file_paths=test_data_file_paths.COHORTS_INVALID_STRUCTURE) @pytest.mark.cohorts @pytest.mark.order(404) - def test_reg_cohorts_no_record(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_programmes() + def test_reg_cohorts_no_record(self, test_setup): self.programmes_page.upload_invalid_cohorts(file_paths=test_data_file_paths.COHORTS_HEADER_ONLY) @pytest.mark.cohorts @pytest.mark.order(405) - def test_reg_cohorts_empty_file(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_programmes() + def test_reg_cohorts_empty_file(self, test_setup): self.programmes_page.upload_invalid_cohorts(file_paths=test_data_file_paths.COHORTS_EMPTY_FILE) diff --git a/tests/test_05_child_list_upload.py b/tests/test_05_child_list_upload.py index 3e2622d9954..df98bf2fc84 100644 --- a/tests/test_05_child_list_upload.py +++ b/tests/test_05_child_list_upload.py @@ -9,37 +9,34 @@ class Test_Regression_Child_List_Upload: dashboard_page = pg_dashboard.pg_dashboard() programmes_page = pg_programmes.pg_programmes() - @pytest.mark.childlist - @pytest.mark.order(501) - def test_reg_child_list_file_upload_positive(self, start_mavis): + @pytest.fixture() + def test_setup(self, start_mavis: None): self.login_page.perform_valid_login() self.dashboard_page.click_programmes() + yield + self.login_page.perform_logout() + + @pytest.mark.childlist + @pytest.mark.order(501) + def test_reg_child_list_file_upload_positive(self, test_setup): self.programmes_page.upload_hpv_child_records(file_paths=test_data_file_paths.CHILD_POSITIVE) @pytest.mark.childlist @pytest.mark.order(502) - def test_reg_child_list_file_upload_negative(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_programmes() + def test_reg_child_list_file_upload_negative(self, test_setup): self.programmes_page.upload_hpv_child_records(file_paths=test_data_file_paths.CHILD_NEGATIVE) @pytest.mark.childlist @pytest.mark.order(503) - def test_reg_child_list_file_structure(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_programmes() + def test_reg_child_list_file_structure(self, test_setup): self.programmes_page.upload_invalid_hpv_child_records(file_paths=test_data_file_paths.CHILD_INVALID_STRUCTURE) @pytest.mark.childlist @pytest.mark.order(504) - def test_reg_child_list_no_record(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_programmes() + def test_reg_child_list_no_record(self, test_setup): self.programmes_page.upload_invalid_hpv_child_records(file_paths=test_data_file_paths.CHILD_HEADER_ONLY) @pytest.mark.childlist @pytest.mark.order(505) - def test_reg_child_list_empty_file(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_programmes() + def test_reg_child_list_empty_file(self, test_setup): self.programmes_page.upload_invalid_hpv_child_records(file_paths=test_data_file_paths.CHILD_EMPTY_FILE) diff --git a/tests/test_06_vaccs_batch.py b/tests/test_06_vaccs_batch.py index 0c4c7a9b974..be3245369ec 100644 --- a/tests/test_06_vaccs_batch.py +++ b/tests/test_06_vaccs_batch.py @@ -8,38 +8,37 @@ class Test_Regression_Cohorts: dashboard_page = pg_dashboard.pg_dashboard() vaccines_page = pg_vaccines.pg_vaccines() + @pytest.fixture + def test_setup(self, start_mavis): + self.login_page.perform_valid_login() + self.dashboard_page.click_vaccines() + yield + self.login_page.perform_logout() + @pytest.mark.vaccsbatch @pytest.mark.mobile @pytest.mark.order(601) - def test_reg_batch_add_batch(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_vaccines() + def test_reg_batch_add_batch(self, test_setup): self.vaccines_page.add_batch() @pytest.mark.vaccsbatch @pytest.mark.mobile @pytest.mark.order(602) - def test_reg_batch_change_batch(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_vaccines() + def test_reg_batch_change_batch(self, test_setup): self.vaccines_page.add_batch() self.vaccines_page.change_batch() @pytest.mark.vaccsbatch @pytest.mark.mobile @pytest.mark.order(603) - def test_reg_batch_archive_batch(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_vaccines() + def test_reg_batch_archive_batch(self, test_setup): self.vaccines_page.add_batch() self.vaccines_page.archive_batch() @pytest.mark.vaccsbatch @pytest.mark.mobile @pytest.mark.order(604) - def test_reg_batch_add_change_archive_batch(self, start_mavis): - self.login_page.perform_valid_login() - self.dashboard_page.click_vaccines() + def test_reg_batch_add_change_archive_batch(self, test_setup): self.vaccines_page.add_batch() self.vaccines_page.change_batch() self.vaccines_page.archive_batch() diff --git a/tests/test_07_record_a_vaccine_using_ui.py b/tests/test_07_record_a_vaccine_using_ui.py index 7fa7c147890..1e05c3a8d61 100644 --- a/tests/test_07_record_a_vaccine_using_ui.py +++ b/tests/test_07_record_a_vaccine_using_ui.py @@ -10,7 +10,7 @@ class Test_Regression_Record_a_Vaccine_Using_UI: sessions_page = pg_sessions.pg_sessions() @pytest.fixture() - def create_session(self, start_mavis: None): + def test_setup(self, start_mavis: None): self.login_page.perform_valid_login() self.dashboard_page.click_sessions() self.sessions_page.schedule_a_valid_session() @@ -24,5 +24,5 @@ def create_session(self, start_mavis: None): @pytest.mark.rav @pytest.mark.order(701) - def test_reg_rav_triage_positive(self, create_session): + def test_reg_rav_triage_positive(self, test_setup): self.sessions_page.update_triage_outcome_positive(file_paths=test_data_file_paths.COHORTS_POSITIVE) diff --git a/tests/test_08_vaccs_upload.py b/tests/test_08_vaccs_upload.py index 7c7dba44ddb..a34ac472fe3 100644 --- a/tests/test_08_vaccs_upload.py +++ b/tests/test_08_vaccs_upload.py @@ -11,7 +11,7 @@ class Test_Regression_Vaccinations_Upload: sessions_page = pg_sessions.pg_sessions() @pytest.fixture() - def create_session(self, start_mavis: None): + def test_setup(self, start_mavis: None): self.login_page.perform_valid_login() self.dashboard_page.click_sessions() self.sessions_page.schedule_a_valid_session(for_today=True) @@ -24,17 +24,17 @@ def create_session(self, start_mavis: None): @pytest.mark.vaccinations @pytest.mark.order(801) - def test_reg_hpv_positive_file_upload(self, start_mavis): + def test_reg_hpv_positive_file_upload(self, test_setup): self.programmes_page.upload_hpv_vaccination_records(file_paths=test_data_file_paths.VACCS_HPV_POSITIVE) @pytest.mark.vaccinations @pytest.mark.order(802) - def test_reg_hpv_negative_file_upload(self, create_session): + def test_reg_hpv_negative_file_upload(self, test_setup): self.programmes_page.upload_hpv_vaccination_records(file_paths=test_data_file_paths.VACCS_HPV_NEGATIVE) @pytest.mark.vaccinations @pytest.mark.order(803) - def test_reg_hpv_duplicate_record_upload(self, start_mavis): + def test_reg_hpv_duplicate_record_upload(self, test_setup): self.programmes_page.upload_hpv_vaccination_records(file_paths=test_data_file_paths.VACCS_HPV_DUP_1) self.dashboard_page.go_to_dashboard() self.dashboard_page.click_programmes() @@ -42,15 +42,15 @@ def test_reg_hpv_duplicate_record_upload(self, start_mavis): @pytest.mark.vaccinations @pytest.mark.order(804) - def test_reg_hpv_file_structure(self, start_mavis): + def test_reg_hpv_file_structure(self, test_setup): self.programmes_page.upload_invalid_files(file_paths=test_data_file_paths.VACCS_HPV_INVALID_STRUCTURE) @pytest.mark.vaccinations @pytest.mark.order(805) - def test_reg_hpv_no_record(self, start_mavis): + def test_reg_hpv_no_record(self, test_setup): self.programmes_page.upload_invalid_files(file_paths=test_data_file_paths.VACCS_HPV_HEADER_ONLY) @pytest.mark.vaccinations @pytest.mark.order(806) - def test_reg_hpv_empty_file(self, start_mavis): + def test_reg_hpv_empty_file(self, test_setup): self.programmes_page.upload_invalid_files(file_paths=test_data_file_paths.VACCS_HPV_EMPTY_FILE) diff --git a/tests/test_10_consent.py b/tests/test_09_consent.py similarity index 54% rename from tests/test_10_consent.py rename to tests/test_09_consent.py index da5672af913..f29c1d6a4ec 100644 --- a/tests/test_10_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 create_session(self, start_mavis: None): + def test_setup(self, start_mavis: None): self.login_page.perform_valid_login() self.dashboard_page.click_sessions() self.sessions_page.schedule_a_valid_session(for_today=True) @@ -27,16 +27,39 @@ def create_session(self, start_mavis: None): self.dashboard_page.click_sessions() self.sessions_page.delete_all_sessions() + @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.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() + @pytest.mark.consent @pytest.mark.mobile - @pytest.mark.order(1001) + @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, start_consent_workflow, scenario_data): + def test_reg_parental_consent_workflow(self, get_session_link, scenario_data): + self.login_page.go_to_url(url=get_session_link) self.helper.read_data_for_scenario(scenario_data=scenario_data) self.helper.enter_details() @pytest.mark.consent @pytest.mark.mobile - @pytest.mark.order(1002) - def test_reg_gillick_competence(self, create_session): + @pytest.mark.order(902) + def test_reg_gillick_competence(self, test_setup): self.sessions_page.set_gillick_competence_for_student()