diff --git a/libs/playwright_ops.py b/libs/playwright_ops.py index f7a6dc6..b9f2133 100644 --- a/libs/playwright_ops.py +++ b/libs/playwright_ops.py @@ -68,16 +68,16 @@ def get_object_property(self, locator: str, property: str, by_test_id: bool = Fa elem = self.ce.page.get_by_role(locator).nth(0) return elem.is_visible() - def perform_action(self, locator, action, value=None) -> None: + def perform_action(self, locator, action, value=None, exact: bool = False) -> None: self.capture_screenshot(identifier=locator, action=f"before-{action}") match action.lower(): case actions.CLICK_LINK: if escape_characters.SEPARATOR in locator: _location = locator.split(escape_characters.SEPARATOR)[0] _locator = locator.split(escape_characters.SEPARATOR)[1] - elem = self.ce.page.get_by_role(_location, name=_locator).nth(0) + elem = self.ce.page.get_by_role(_location, name=_locator, exact=exact).nth(0) else: - elem = self.ce.page.get_by_role(playwright_roles.LINK, name=locator).nth(0) + elem = self.ce.page.get_by_role(playwright_roles.LINK, name=locator, exact=exact).nth(0) elem.scroll_into_view_if_needed() elem.click() case actions.CLICK_BUTTON: @@ -126,7 +126,7 @@ def perform_action(self, locator, action, value=None) -> None: _locator = locator.split(escape_characters.SEPARATOR)[1] elem = self.ce.page.get_by_role(_location, name=_locator).nth(0) else: - elem = self.ce.page.get_by_label(locator, exact=True).nth(0) + elem = self.ce.page.get_by_label(locator, exact=False).nth(0) elem.scroll_into_view_if_needed() elem.set_input_files(value) case actions.SELECT_FROM_LIST: diff --git a/libs/wrappers.py b/libs/wrappers.py index 2c84b11..08be6b3 100644 --- a/libs/wrappers.py +++ b/libs/wrappers.py @@ -1,5 +1,5 @@ import time -from datetime import datetime +from datetime import datetime, timedelta from libs.constants import escape_characters @@ -54,3 +54,10 @@ def clean_file_name(file_name: str) -> str: for _chr in escape_characters.FILE_NAME: file_name = file_name.replace(_chr, "") return file_name + + +def get_future_date(offset_days: int) -> str: + _future_date = datetime.now() + timedelta(days=offset_days) + while _future_date.weekday() >= 5: + _future_date = _future_date + timedelta(days=1) + return _future_date.strftime("%Y%m%d") diff --git a/pages/pg_children.py b/pages/pg_children.py new file mode 100644 index 0000000..4cba07d --- /dev/null +++ b/pages/pg_children.py @@ -0,0 +1,17 @@ +from libs import CurrentExecution, playwright_ops +from libs.constants import actions, object_properties, wait_time +from libs.wrappers import * + + +class pg_children: + po = playwright_ops.playwright_operations() + ce = CurrentExecution() + + LBL_CHILDREN = "Children" + LBL_HEADING = "heading" + LBL_MAIN = "main" + LBL_TABLE_HEADERS = "Full name NHS number Date of birth Postcode School" + + def verify_headers(self): + self.po.verify(locator=self.LBL_HEADING, property=object_properties.TEXT, value=self.LBL_CHILDREN, exact=True) + self.po.verify(locator=self.LBL_MAIN, property=object_properties.TEXT, value=self.LBL_TABLE_HEADERS) diff --git a/pages/pg_dashboard.py b/pages/pg_dashboard.py index f985072..9f3fb12 100644 --- a/pages/pg_dashboard.py +++ b/pages/pg_dashboard.py @@ -11,6 +11,7 @@ class pg_dashboard: LNK_CHILDREN = f"heading{escape_characters.SEPARATOR}Children" LNK_NOTICES = f"heading{escape_characters.SEPARATOR}Important Notices" LNK_ORGANISATION = f"heading{escape_characters.SEPARATOR}Your organisation" + LNK_DASHBOARD = "Manage vaccinations in schools" def click_programmes(self): self.po.perform_action(locator=self.LNK_PROGRAMMES, action=actions.CLICK_LINK) @@ -30,9 +31,12 @@ def click_important_notices(self): def click_your_organisation(self): self.po.perform_action(locator=self.LNK_ORGANISATION, action=actions.CLICK_LINK) + def go_to_dashboard(self): + self.po.perform_action(locator=self.LNK_DASHBOARD, action=actions.CLICK_LINK) + def verify_all_expected_links(self): self.po.verify(locator=self.LNK_PROGRAMMES, property=object_properties.VISIBILITY, value=True, exact=True) - self.po.verify(locator=self.LNK_VACCINES, property=object_properties.VISIBILITY, value=True, exact=True) + # self.po.verify(locator=self.LNK_VACCINES, property=object_properties.VISIBILITY, value=True, exact=True) # Out of scope for 1a self.po.verify(locator=self.LNK_SESSIONS, property=object_properties.VISIBILITY, value=True, exact=True) self.po.verify(locator=self.LNK_CHILDREN, property=object_properties.VISIBILITY, value=True, exact=True) self.po.verify(locator=self.LNK_NOTICES, property=object_properties.VISIBILITY, value=True, exact=True) diff --git a/pages/pg_sessions.py b/pages/pg_sessions.py new file mode 100644 index 0000000..fb2f36f --- /dev/null +++ b/pages/pg_sessions.py @@ -0,0 +1,160 @@ +import re + +from playwright.sync_api import expect + +from libs import CurrentExecution, file_ops, playwright_ops, testdata_ops +from libs.constants import actions, object_properties, wait_time +from libs.wrappers import * +from pages import pg_dashboard + + +class pg_sessions: + po = playwright_ops.playwright_operations() + ce = CurrentExecution() + tdo = testdata_ops.testdata_operations() + fo = file_ops.file_operations() + dashboard_page = pg_dashboard.pg_dashboard() + + LNK_SCHEDULED = "Scheduled" + LNK_UNSCHEDULED = "Unscheduled" + LNK_SCHOOL = "The Ruiz Centre" + LNK_IMPORT_CLASS_LIST = "Import class list" + LBL_CHOOSE_COHORT_FILE = "The Ruiz CentreImport class" + BTN_CONTINUE = "Continue" + LNK_ADD_SESSION_DATES = "Add session dates" + LNK_RECORD_VACCINATIONS = "Record vaccinations" + LNK_CHILD_FULL_NAME = "ChildFirst28 ChildLast28" + LNK_UPDATE_TRIAGE_OUTCOME = "Update triage outcome" + LNK_SCHEDULE_SESSIONS = "Schedule sessions" + RDO_YES_SAFE_TO_VACCINATE = "Yes, it’s safe to vaccinate" + BTN_SAVE_TRIAGE = "Save triage" + LBL_PARAGRAPH = "paragraph" + LBL_TRIAGE_UPDATED_MESSAGE = "Triage outcome updated for ChildFirst28 ChildLast28" + LBL_MAIN = "main" + TXT_DAY = "Day" + TXT_MONTH = "Month" + TXT_YEAR = "Year" + LNK_EDIT_SESSION = "Edit session" + LNK_CHANGE_SESSION_DATES = "Change session dates" + BTN_DELETE = "Delete" + LNK_CANCEL = "Cancel" + LNK_CONTINUE = "Continue" + + def get_display_formatted_date(self, date_to_format: str) -> str: + _parsed_date = datetime.strptime(date_to_format, "%Y%m%d") + _formatted_date = _parsed_date.strftime("%A %d %B %Y").replace(" 0", " ") + return _formatted_date + + def click_Scheduled(self): + self.po.perform_action(locator=self.LNK_SCHEDULED, action=actions.CLICK_LINK, exact=True) + + def click_Unscheduled(self): + self.po.perform_action(locator=self.LNK_UNSCHEDULED, action=actions.CLICK_LINK, exact=True) + + def click_School(self): + self.po.perform_action(locator=self.LNK_SCHOOL, action=actions.CLICK_LINK) + + def click_Import_Class_List(self): + self.po.perform_action(locator=self.LNK_IMPORT_CLASS_LIST, action=actions.CLICK_LINK) + + def click_Continue(self): + self.po.perform_action(locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON) + + def choose_file_child_records(self, file_path: str): + self.po.perform_action( + locator=self.LBL_CHOOSE_COHORT_FILE, + action=actions.SELECT_FILE, + value=file_path, + ) + + def click_Record_Vaccinations(self): + self.po.perform_action(locator=self.LNK_RECORD_VACCINATIONS, action=actions.CLICK_LINK) + + def click_child_full_name(self): + self.po.perform_action(locator=self.LNK_CHILD_FULL_NAME, action=actions.CLICK_LINK) + + def click_Update_Triage_Outcome(self): + self.po.perform_action(locator=self.LNK_UPDATE_TRIAGE_OUTCOME, action=actions.CLICK_LINK) + + def select_Yes_Safe_To_Vaccinate(self): + self.po.perform_action(locator=self.RDO_YES_SAFE_TO_VACCINATE, action=actions.RADIO_BUTTON_SELECT) + + def click_Save_Triage(self): + self.po.perform_action(locator=self.BTN_SAVE_TRIAGE, action=actions.CLICK_BUTTON) + + def __schedule_session(self, future_date: str, expect_error: bool): + _day = future_date[-2:] + _month = future_date[4:6] + _year = future_date[:4] + self.po.perform_action(locator=self.LNK_SCHEDULE_SESSIONS, action=actions.CLICK_LINK) + self.po.perform_action(locator=self.LNK_ADD_SESSION_DATES, action=actions.CLICK_LINK) + self.po.perform_action(locator=self.TXT_DAY, action=actions.FILL, value=_day) + self.po.perform_action(locator=self.TXT_MONTH, action=actions.FILL, value=_month) + self.po.perform_action(locator=self.TXT_YEAR, action=actions.FILL, value=_year) + self.po.perform_action(locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON) + if expect_error: + _expected_message = "There is a problem Enter a date" + self.po.verify( + locator=self.LBL_MAIN, property=object_properties.TEXT, value=_expected_message, exact=False + ) + + def __delete_all_sessions(self): + self.po.perform_action(locator=self.LNK_EDIT_SESSION, action=actions.CLICK_LINK) + self.po.perform_action(locator=self.LNK_CHANGE_SESSION_DATES, action=actions.CLICK_LINK) + self.po.perform_action(locator=self.BTN_DELETE, action=actions.CLICK_BUTTON) + self.po.perform_action(locator=self.LNK_CANCEL, action=actions.CLICK_LINK) + self.po.perform_action(locator=self.LNK_CONTINUE, action=actions.CLICK_LINK) + # TODO: Use the common verify function + expect( + self.ce.page.locator("div") + .filter(has_text=re.compile(r"^Session datesNot provided$")) + .get_by_role("definition") + ).to_be_visible() + + def verify_Triage_Updated(self): + self.po.verify( + locator=self.LBL_PARAGRAPH, + property=object_properties.TEXT, + value=self.LBL_TRIAGE_UPDATED_MESSAGE, + exact=True, + ) + + def verify_scheduled_date(self, message: str): + self.po.verify(locator=self.LBL_MAIN, property=object_properties.TEXT, value=message, exact=False) + + def update_triage_outcome_positive(self, file_paths): + _input_file_path, _ = self.tdo.split_file_paths(file_paths=file_paths) + self.click_Scheduled() + self.click_School() + self.click_Import_Class_List() + self.choose_file_child_records(file_path=_input_file_path) + self.click_Continue() + self.dashboard_page.go_to_dashboard() + self.dashboard_page.click_sessions() + self.click_Scheduled() + self.click_School() + self.click_Record_Vaccinations() + self.click_child_full_name() + self.click_Update_Triage_Outcome() + self.select_Yes_Safe_To_Vaccinate() + self.click_Save_Triage() + self.verify_Triage_Updated() + + def schedule_a_valid_session(self): + _future_date = get_future_date(offset_days=10) + _expected_message = f"Session dates {self.get_display_formatted_date(date_to_format=_future_date)}" + self.click_Unscheduled() + self.click_School() + self.__schedule_session(future_date=_future_date, expect_error=False) + self.verify_scheduled_date(message=_expected_message) + + def delete_all_sessions(self): + self.click_Scheduled() + self.click_School() + self.__delete_all_sessions() + + def create_invalid_session(self): + _future_date = "20241332" + self.click_Unscheduled() + self.click_School() + self.__schedule_session(future_date=_future_date, expect_error=True) diff --git a/pytest.ini b/pytest.ini index e5bdd3f..ccf4337 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ [pytest] -addopts = -vs -rf --alluredir=./reports/ --html-report=./reports/ +addopts = -vs -rf --alluredir=./reports/ --html-report=./reports/ #-n auto --dist=loadfile log_file = logs/pytest.log @@ -21,3 +21,4 @@ markers = cohorts childlist vaccsbatch + rav diff --git a/test_data/cohorts/i_positive.csv b/test_data/cohorts/i_positive.csv index cc42fe3..e2215fb 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 -ChildFirst,ChildLast,ChildCommon,1-1-2010,110158,,Addr1,Add2,City,AA1 1AA,Parent1Name,Dad,dad@example.com,,Parent2Name,Mum,mum@example.com, +ChildFirst28,ChildLast28,ChildCommon,1-1-2009,134522,,Addr1,Add2,City,AA1 1AA,Parent1Name1,Dad,dad1@example.com,,Parent2Name1,Mum,mum1@example.com, diff --git a/test_data/hpv/i_positive.csv b/test_data/hpv/i_positive.csv index 34fb944..29f241a 100644 --- a/test_data/hpv/i_positive.csv +++ b/test_data/hpv/i_positive.csv @@ -1,16 +1,17 @@ -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,LOCAL_PATIENT_ID,LOCAL_PATIENT_ID_URI,CARE_SETTING -P_Gardasil9,R1L,110158,Eton College,9729852545,BERT,BOYES,20100811,Male,DN9 1PB,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1 -P_Gardasil,R1L,110158,Eton College,9650974318,BOB,JERMEY,20100819,Male,DN38 6JP,20240514,Gardasil,123013325,20220730,Left Thigh,2,LocalPatient3,www.LocalPatient3,1 -P_Cervarix,R1L,110158,Eton College,5990960948,MURRAY,MARQUARDT,20100808,Male,N8 7RE,20240514,Cervarix,123013325,20220730,Left Thigh,3,LocalPatient3,www.LocalPatient3,1 -P_Gardasil9,R1L,888888,Test-Auto School,9461217986,SHEENA,HART-DAVIS,20100818,Female,HD9 2DD,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1 -P_Gardasil,R1L,999999,Homeschooled,9448251165,ANDRIANA,MACLULICH,20100813,Female,DN17 1UE,20240514,Gardasil,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1 -P_Cervarix,R1L,110158,Eton College,9490189804,VISHALA,MOKATE,20100817,Female,LA22 9SJ,20240514,Cervarix,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1 -P_NFA,R1L,110158,Eton College,9694580307,LERON,KUFAKI,20100811,Male,ZZ99 3VZ,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1 -P_Add_Not_Known,R1L,110158,Eton College,9694580307,LERON,KUFAKI,20100811,Male,ZZ99 3WZ,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1 -P_Site_LB,R1L,110158,Eton College,9694580307,LERON,KUFAKI,20100811,Male,DN34 4SE,20240514,Gardasil9,123013325,20220730,Left Buttock,1,LocalPatient3,www.LocalPatient3,1 -P_Site_RB,R1L,110158,Eton College,9460860354,MATTIE,MERRIGAN,20100831,Male,TS8 9EF,20240514,Gardasil9,123013325,20220730,Right Buttock,1,LocalPatient3,www.LocalPatient3,1 -P_Site_LT,R1L,110158,Eton College,9651751703,SARA,NOYES,20100829,Not Known,HU5 3SG,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1 -P_Site_LUA,R1L,110158,Eton College,5991336512,HARLEY,PHILLIPS,20100821,Female,ZZ99 3AZ,20240514,Gardasil9,123013325,20220730,Left Upper Arm,1,LocalPatient3,www.LocalPatient3,1 -P_Site_RUA,R1L,110158,Eton College,9454468014,GIDEON,CREAN,20100830,Male,NE39 1AD,20240514,Gardasil9,123013325,20220730,Right Upper Arm,1,LocalPatient3,www.LocalPatient3,1 -P_Site_RT,R1L,110158,Eton College,9686147837,JEFF,GREENE,20100808,Male,SK16 4HT,20240514,Gardasil9,123013325,20220730,Right Thigh,1,LocalPatient3,www.LocalPatient3,1 -P_AllowPastExpiryDate,R1L,110158,Eton College,9448205147,DARIEN,MARGETSON,20100827,Female,BH23 8BY,20240514,Gardasil9,123013325,20120730,Left Thigh,1,www.LocalPatient3,www.LocalPatient3,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,LOCAL_PATIENT_ID,LOCAL_PATIENT_ID_URI,CARE_SETTING,VACCINATED +P_Gardasil9,R1L,110158,Eton College,9729852545,BERT,BOYES,20100811,Male,DN9 1PB,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y +P_Gardasil,R1L,110158,Eton College,9650974318,BOB,JERMEY,20100819,Male,DN38 6JP,20240514,Gardasil,123013325,20220730,Left Thigh,2,LocalPatient3,www.LocalPatient3,1,Y +P_Cervarix,R1L,110158,Eton College,5990960948,MURRAY,MARQUARDT,20100808,Male,N8 7RE,20240514,Cervarix,123013325,20220730,Left Thigh,3,LocalPatient3,www.LocalPatient3,1,Y +P_Gardasil9,R1L,888888,Test-Auto School,9461217986,SHEENA,HART-DAVIS,20100818,Female,HD9 2DD,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y +P_Gardasil,R1L,999999,Homeschooled,9448251165,ANDRIANA,MACLULICH,20100813,Female,DN17 1UE,20240514,Gardasil,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y +P_Cervarix,R1L,110158,Eton College,9490189804,VISHALA,MOKATE,20100817,Female,LA22 9SJ,20240514,Cervarix,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y +P_NFA,R1L,110158,Eton College,9694580307,LERON,KUFAKI,20100811,Male,ZZ99 3VZ,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y +P_Add_Not_Known,R1L,110158,Eton College,9694580307,LERON,KUFAKI,20100811,Male,ZZ99 3WZ,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y +P_Site_LB,R1L,110158,Eton College,9694580307,LERON,KUFAKI,20100811,Male,DN34 4SE,20240514,Gardasil9,123013325,20220730,Left Buttock,1,LocalPatient3,www.LocalPatient3,1,Y +P_Site_RB,R1L,110158,Eton College,9460860354,MATTIE,MERRIGAN,20100831,Male,TS8 9EF,20240514,Gardasil9,123013325,20220730,Right Buttock,1,LocalPatient3,www.LocalPatient3,1,Y +P_Site_LT,R1L,110158,Eton College,9651751703,SARA,NOYES,20100829,Not Known,HU5 3SG,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y +P_Site_LUA,R1L,110158,Eton College,5991336512,HARLEY,PHILLIPS,20100821,Female,ZZ99 3AZ,20240514,Gardasil9,123013325,20220730,Left Upper Arm,1,LocalPatient3,www.LocalPatient3,1,Y +P_Site_RUA,R1L,110158,Eton College,9454468014,GIDEON,CREAN,20100830,Male,NE39 1AD,20240514,Gardasil9,123013325,20220730,Right Upper Arm,1,LocalPatient3,www.LocalPatient3,1,Y +P_Site_RT,R1L,110158,Eton College,9686147837,JEFF,GREENE,20100808,Male,SK16 4HT,20240514,Gardasil9,123013325,20220730,Right Thigh,1,LocalPatient3,www.LocalPatient3,1,Y +P_AllowPastExpiryDate,R1L,110158,Eton College,9448205147,DARIEN,MARGETSON,20100827,Female,BH23 8BY,20240514,Gardasil9,123013325,20120730,Left Thigh,1,www.LocalPatient3,www.LocalPatient3,1,Y +P_NotVaccinated,R1L,110158,Eton College,9448205148,NOT1,VACCINATED1,20100827,Female,BH23 8BY,20240514,Gardasil9,123013325,20120730,Left Thigh,1,www.LocalPatient3,www.LocalPatient3,1,N diff --git a/test_data/hpv/o_positive.csv b/test_data/hpv/o_positive.csv index aa949cd..e3296db 100644 --- a/test_data/hpv/o_positive.csv +++ b/test_data/hpv/o_positive.csv @@ -1,3 +1,7 @@ Completed Programme HPV Type Immunisation list +Imported by Nurse Joy +Omitted records 8 previously imported records were omitted +Duplicate records 5 duplicate records need review +13 vaccination records diff --git a/tests/test_2_sessions.py b/tests/test_2_sessions.py new file mode 100644 index 0000000..be62983 --- /dev/null +++ b/tests/test_2_sessions.py @@ -0,0 +1,30 @@ +import pytest + +from pages import pg_dashboard, pg_login, pg_sessions + + +class Test_Regression_Sessions: + login_page = pg_login.pg_login() + 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, create_browser_page): + self.login_page.perform_valid_login() + self.dashboard_page.click_sessions() + self.sessions_page.schedule_a_valid_session() + + @pytest.mark.sessions + @pytest.mark.order(202) + def test_reg_delete_all_sessions(self, create_browser_page): + self.login_page.perform_valid_login() + self.dashboard_page.click_sessions() + self.sessions_page.delete_all_sessions() + + @pytest.mark.sessions + @pytest.mark.order(203) + def test_reg_create_invalid_schedule(self, create_browser_page): + self.login_page.perform_valid_login() + self.dashboard_page.click_sessions() + self.sessions_page.create_invalid_session() diff --git a/tests/test_50_bugs.py b/tests/test_50_bugs.py new file mode 100644 index 0000000..a67c15f --- /dev/null +++ b/tests/test_50_bugs.py @@ -0,0 +1,16 @@ +import pytest + +from pages import pg_children, pg_dashboard, pg_login + + +class Test_Regression_Bugs: + login_page = pg_login.pg_login() + dashboard_page = pg_dashboard.pg_dashboard() + children_page = pg_children.pg_children() + + @pytest.mark.bugs + @pytest.mark.order(5001) + def test_reg_children_page(self, create_browser_page): + self.login_page.perform_valid_login() + self.dashboard_page.click_children() + self.children_page.verify_headers() diff --git a/tests/test_5_child_list_upload.py b/tests/test_5_child_list_upload.py index 5a32bce..9b6f203 100644 --- a/tests/test_5_child_list_upload.py +++ b/tests/test_5_child_list_upload.py @@ -11,7 +11,6 @@ class Test_Regression_Child_List_Upload: @pytest.mark.childlist @pytest.mark.order(501) - @pytest.mark.skip(reason="Covered by cohort uploads") def test_reg_child_list_file_upload_positive(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_programmes() @@ -19,7 +18,6 @@ def test_reg_child_list_file_upload_positive(self, create_browser_page): @pytest.mark.childlist @pytest.mark.order(502) - @pytest.mark.skip(reason="Covered by cohort uploads") def test_reg_child_list_file_upload_negative(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_programmes() @@ -27,7 +25,6 @@ def test_reg_child_list_file_upload_negative(self, create_browser_page): @pytest.mark.childlist @pytest.mark.order(503) - @pytest.mark.skip(reason="Covered by cohort uploads") def test_reg_child_list_file_structure(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_programmes() @@ -35,7 +32,6 @@ def test_reg_child_list_file_structure(self, create_browser_page): @pytest.mark.childlist @pytest.mark.order(504) - @pytest.mark.skip(reason="Covered by cohort uploads") def test_reg_child_list_no_record(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_programmes() @@ -43,7 +39,6 @@ def test_reg_child_list_no_record(self, create_browser_page): @pytest.mark.childlist @pytest.mark.order(505) - @pytest.mark.skip(reason="Covered by cohort uploads") def test_reg_child_list_empty_file(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_programmes() diff --git a/tests/test_6_vaccs_batch.py b/tests/test_6_vaccs_batch.py index dcd7f75..cf601a8 100644 --- a/tests/test_6_vaccs_batch.py +++ b/tests/test_6_vaccs_batch.py @@ -11,6 +11,7 @@ class Test_Regression_Cohorts: @pytest.mark.vaccsbatch @pytest.mark.mobile @pytest.mark.order(601) + @pytest.mark.skip(reason="Out of scope for 1a") def test_reg_batch_add_batch(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_vaccines() @@ -19,6 +20,7 @@ def test_reg_batch_add_batch(self, create_browser_page): @pytest.mark.vaccsbatch @pytest.mark.mobile @pytest.mark.order(602) + @pytest.mark.skip(reason="Out of scope for 1a") def test_reg_batch_change_batch(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_vaccines() @@ -28,6 +30,7 @@ def test_reg_batch_change_batch(self, create_browser_page): @pytest.mark.vaccsbatch @pytest.mark.mobile @pytest.mark.order(603) + @pytest.mark.skip(reason="Out of scope for 1a") def test_reg_batch_archive_batch(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_vaccines() @@ -37,6 +40,7 @@ def test_reg_batch_archive_batch(self, create_browser_page): @pytest.mark.vaccsbatch @pytest.mark.mobile @pytest.mark.order(604) + @pytest.mark.skip(reason="Out of scope for 1a") def test_reg_batch_add_change_archive_batch(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_vaccines() diff --git a/tests/test_7_record_a_vaccine_using_ui.py b/tests/test_7_record_a_vaccine_using_ui.py new file mode 100644 index 0000000..be372c5 --- /dev/null +++ b/tests/test_7_record_a_vaccine_using_ui.py @@ -0,0 +1,18 @@ +import pytest + +from libs.constants import test_data_file_paths +from pages import pg_dashboard, pg_login, pg_sessions + + +class Test_Regression_Record_a_Vaccine_Using_UI: + login_page = pg_login.pg_login() + home_page = pg_dashboard.pg_dashboard() + sessions_page = pg_sessions.pg_sessions() + + @pytest.mark.rav + @pytest.mark.order(701) + @pytest.mark.skip(reason="Out of scope for 1a") + def test_reg_rav_triage_positive(self, create_browser_page): + self.login_page.perform_valid_login() + self.home_page.click_sessions() + self.sessions_page.update_triage_outcome_positive(file_paths=test_data_file_paths.COHORTS_POSITIVE) diff --git a/tests/test_2_vaccs_upload.py b/tests/test_8_vaccs_upload.py similarity index 92% rename from tests/test_2_vaccs_upload.py rename to tests/test_8_vaccs_upload.py index df9e357..21ee00e 100644 --- a/tests/test_2_vaccs_upload.py +++ b/tests/test_8_vaccs_upload.py @@ -10,21 +10,21 @@ class Test_Regression_Vaccinations_Upload: programmes_page = pg_programmes.pg_programmes() @pytest.mark.vaccinations - @pytest.mark.order(201) + @pytest.mark.order(801) def test_reg_hpv_positive_file_upload(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_programmes() self.programmes_page.upload_hpv_vaccination_records(file_paths=test_data_file_paths.VACCS_HPV_POSITIVE) @pytest.mark.vaccinations - @pytest.mark.order(202) + @pytest.mark.order(802) def test_reg_hpv_negative_file_upload(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_programmes() self.programmes_page.upload_hpv_vaccination_records(file_paths=test_data_file_paths.VACCS_HPV_NEGATIVE) @pytest.mark.vaccinations - @pytest.mark.order(203) + @pytest.mark.order(803) def test_reg_hpv_duplicate_record_upload(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_programmes() @@ -33,21 +33,21 @@ def test_reg_hpv_duplicate_record_upload(self, create_browser_page): self.programmes_page.upload_hpv_vaccination_records(file_paths=test_data_file_paths.VACCS_HPV_DUP_2) @pytest.mark.vaccinations - @pytest.mark.order(204) + @pytest.mark.order(804) def test_reg_hpv_file_structure(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_programmes() self.programmes_page.upload_invalid_files(file_paths=test_data_file_paths.VACCS_HPV_INVALID_STRUCTURE) @pytest.mark.vaccinations - @pytest.mark.order(205) + @pytest.mark.order(805) def test_reg_hpv_no_record(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_programmes() self.programmes_page.upload_invalid_files(file_paths=test_data_file_paths.VACCS_HPV_HEADER_ONLY) @pytest.mark.vaccinations - @pytest.mark.order(206) + @pytest.mark.order(806) def test_reg_hpv_empty_file(self, create_browser_page): self.login_page.perform_valid_login() self.home_page.click_programmes()