diff --git a/.github/workflows/stage-1-commit.yaml b/.github/workflows/stage-1-commit.yaml index bd999b8ec..3e136de87 100644 --- a/.github/workflows/stage-1-commit.yaml +++ b/.github/workflows/stage-1-commit.yaml @@ -36,7 +36,7 @@ jobs: scan-secrets: name: "Scan secrets" runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 15 steps: - name: "Checkout code" uses: actions/checkout@v4 @@ -47,7 +47,7 @@ jobs: check-file-format: name: "Check file format" runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 15 steps: - name: "Checkout code" uses: actions/checkout@v4 @@ -92,7 +92,7 @@ jobs: permissions: id-token: write contents: read - timeout-minutes: 10 + timeout-minutes: 15 steps: - name: "Checkout code" uses: actions/checkout@v4 @@ -111,7 +111,7 @@ jobs: permissions: id-token: write contents: read - timeout-minutes: 10 + timeout-minutes: 15 steps: - name: "Checkout code" uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index c06481dfe..ef2670258 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ tox.log node_modules/ package-lock.json downloads/RAVs-Vaccination-Report.csv +report.html diff --git a/conftest.py b/conftest.py index 4cc82f124..56b5187d0 100644 --- a/conftest.py +++ b/conftest.py @@ -497,6 +497,8 @@ def step_search_for_patient(shared_data, name): @when(parse("I click choose vaccine button and choose the {chosen_vaccine}, {batch_number} with {batch_expiry_date} and click continue")) def step_choose_vaccine_and_vaccine_type(shared_data, chosen_vaccine, batch_number, batch_expiry_date): time.sleep(3) + assert check_vaccine_history_not_available_label_element_exists() == False + attach_screenshot("checked_vaccine_history_not_available_label_element_exists") immunisation_history_records_count_before_vaccination = click_on_patient_search_result_and_click_choose_vaccine(shared_data['patient_name'], chosen_vaccine) shared_data["immunisation_history_records_count_before_vaccination"] = immunisation_history_records_count_before_vaccination choose_vaccine_and_vaccine_type_for_patient(shared_data['site'], chosen_vaccine, shared_data['chosen_vaccine_type']) diff --git a/features/record_a_vaccine_for_patient_with_nhs_number.feature b/features/record_a_vaccine_for_patient_with_nhs_number.feature index 0a79bff26..b85a80366 100644 --- a/features/record_a_vaccine_for_patient_with_nhs_number.feature +++ b/features/record_a_vaccine_for_patient_with_nhs_number.feature @@ -39,6 +39,8 @@ Feature: Record vaccine | 2 | 9450141711 | BECCLES HOUSE | Housebound patient's home | yes | today-2| yes | yes | today-1 | KRISTIA SIDAWAY | 24/6/1992 | 41 BALTIMORE ROAD, LYTHAM ST. ANNES, LANCS, FY8 3NY | Flu | AUTOMATION-IT | 19/10/2026 | | 3 | 9450144699 | BIRCH HOUSE | Outreach event | yes | today-1 | yes | yes | today-1 | HOPE TULLY | 10/1/1993 | 2 CHAPEL CLOSE, WESHAM, PRESTON, PR4 3HB | Flu | AUTOMATION-C3 | 19/10/2026 | | 4 | 9437541817 | ALBERT HOUSE | Outreach event | yes | today | yes | yes | today | FLORINDA DUNNER | 27/3/1957 | 32 HOLLAND ROAD, MANCHESTER, M8 4NP | Flu | AUTOMATION-SJ1 | 19/10/2026 | + | 4 | 9223638941 | ALBERT HOUSE | Outreach event | yes | today | yes | yes | today | MICHELLE DONNELLY | 05/5/1900 | 6 WHESSOE ROAD, HARDWICK, STOCKTON-ON-TEES, CLEVELAND, TS19 8LB | Flu | AUTOMATION-SJ1 | 19/10/2026 | + | 4 | 9727840361 | ALBERT HOUSE | Outreach event | yes | today | yes | yes | today | BOBBY TICKLE | 04/5/1983 | 1 Canning Way, LOUGHBOROUGH, Leics, LE11 5YA | COVID-19 | AUTOMATION-C10 | 19/10/2026 | @recordvaccine Scenario Outline: Record a maternity vaccine with nhs number diff --git a/pages/find_a_patient_page.py b/pages/find_a_patient_page.py index 6237a7d82..4cca84579 100644 --- a/pages/find_a_patient_page.py +++ b/pages/find_a_patient_page.py @@ -156,7 +156,7 @@ def check_postcode_invalid_error_message_text_exists(): return check_element_exists(POSTCODE_INVALID_INPUT_ERROR_LABEL) def check_patient_name_search_result_exists(name, wait): - element = ("xpath", f"//span[contains(translate(text(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), '{name.lower()}')]") + element = ("xpath", f"//span[contains(translate(text(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), \"{name.lower()}\")]") wait_for_element_to_appear(element) return check_element_exists(element, wait) diff --git a/pages/patient_details_page.py b/pages/patient_details_page.py index afaa5608d..ce8268039 100644 --- a/pages/patient_details_page.py +++ b/pages/patient_details_page.py @@ -25,6 +25,12 @@ RSV_HISTORY_ELEMENT = ("text", "Respiratory syncytial virus (RSV)") PERTUSSIS_HISTORY_ELEMENT = ("text", "Pertussis") PAGE_LOADING_ELEMENT = ("text", "Loading...Loading...") +VACCINATION_HISTORY_NOT_AVAILABLE = ("role", "heading", "No vaccination history available") + +def check_vaccine_history_not_available_label_element_exists(): + wait_for_element_to_disappear(PAGE_LOADING_ELEMENT) + wait_for_element_to_appear(CHOOSE_VACCINE_BUTTON) + return check_element_exists(VACCINATION_HISTORY_NOT_AVAILABLE) def check_covid_history_element_exists(): wait_for_element_to_appear(COVID_HISTORY_ELEMENT) diff --git a/pages/reports_check_and_confirm_page.py b/pages/reports_check_and_confirm_page.py index f774efa4f..80f5f7813 100644 --- a/pages/reports_check_and_confirm_page.py +++ b/pages/reports_check_and_confirm_page.py @@ -3,10 +3,10 @@ PAGE_LOADING_ELEMENT = ("text", "Loading...Loading...") SELECT_DATA_FOR_REPORT_ERROR_MESSAGE_LINK = ("role", "button", "Select data for report") SELECT_DATA_FOR_REPORT_ERROR_MESSAGE_TEXT = ("text", "Select data for report") -CHANGE_DATE_BUTTON = ("role", "button", "Change date") -CHANGE_VACCINES_BUTTON = ("role", "button", "Change vaccines") -CHANGE_SITES_BUTTON = ("role", "button", "Change sites") -CHANGE_DATA_BUTTON = ("role", "button", "Change data") +CHANGE_DATE_BUTTON = ("role", "link", "Change date") +CHANGE_VACCINES_BUTTON = ("role", "link", "Change vaccines") +CHANGE_SITES_BUTTON = ("role", "link", "Change sites") +CHANGE_DATA_BUTTON = ("role", "link", "Change data") CONFIRM_AND_CREATE_REPORT_BUTTON = ("role", "button", "Confirm and create report") BACK_TO_SELECT_DATA_BUTTON = ("role", "button", "Back") diff --git a/tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py b/tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py index cff82be2c..392af99be 100644 --- a/tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py +++ b/tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py @@ -34,7 +34,4 @@ def test_record_a_vaccine_with_nhs_number(navigate_and_login): @scenario(f'{features_directory}/record_a_vaccine_for_patient_with_nhs_number.feature', 'Record a maternity vaccine with nhs number') def test_record_a_maternity_vaccine_with_nhs_number(navigate_and_login): - pass - - - + pass # All test steps are in conftest.py diff --git a/tests/test_reports_steps.py b/tests/test_reports_steps.py index f9bccf0b8..e0be2d63d 100644 --- a/tests/test_reports_steps.py +++ b/tests/test_reports_steps.py @@ -143,7 +143,8 @@ def the_no_vaccination_data_to_report_on_message_should_be_displayed(): @then("the Create report button should be disabled") def the_create_report_button_should_be_disabled(): - assert check_create_report_button_enabled() == False + assert check_create_report_button_exists() == False + assert check_no_vaccination_data_to_report_message_exists() == True attach_screenshot("Create report button should be disabled") logging.info("Create report button should be disabled") @@ -352,6 +353,18 @@ def the_report_is_downloaded_successfully(shared_data, nhs_number): assert not last_row[header], ( f"Column 'NoVaccinationReason' should be empty for NHS number {shared_data['nhs_number']} as vaccinated_decision is 'yes'." ) + assert last_row["Vaccine"].lower() == shared_data["chosen_vaccine"].lower(), ( + f"Mismatch in 'Vaccine': expected '{shared_data['chosen_vaccine']}' but found '{last_row['Vaccine']}'." + ) + assert last_row["VaccineProduct"].lower() == shared_data["chosen_vaccine_type"].lower(), ( + f"Mismatch in 'VaccineProduct': expected '{shared_data['chosen_vaccine_type']}' but found '{last_row['VaccineProduct']}'." + ) + assert last_row["BatchNumber"].lower() == shared_data["batch_number"].lower(), ( + f"Mismatch in 'BatchNumber': expected '{shared_data['batch_number']}' but found '{last_row['BatchNumber']}'." + ) + assert last_row["BatchExpiryDate"].lower() == shared_data["batch_expiry_date"].lower(), ( + f"Mismatch in 'BatchExpiryDate': expected '{shared_data['batch_expiry_date']}' but found '{last_row['BatchExpiryDate']}'." + ) else: assert last_row[header], ( f"Missing value in column 'NoVaccinationReason' for NHS number {shared_data['nhs_number']}." @@ -426,6 +439,30 @@ def the_report_is_downloaded_successfully(shared_data, nhs_number): f"Mismatch in 'AssessmentComments': expected '{shared_data['assessment_comments']}' but found '{last_row['AssessmentComments']}'." ) + assert last_row["AuditType"] == "Created", ( + f"Mismatch in 'AuditType': expected 'Created' but found '{last_row['AuditType']}'." + ) + + assert last_row["UserEnteringData"] == "Neelima Guntupalli", ( + f"Mismatch in 'UserEnteringData': expected 'Neelima Guntupalli' but found '{last_row['UserEnteringData']}'." + ) + + assert last_row["PrescribingMethod"] == shared_data["legal_mechanism"], ( + f"Mismatch in 'PrescribingMethod': expected '{shared_data['legal_mechanism']}' but found '{last_row['PrescribingMethod']}'." + ) + + assert last_row["VaccinationComments"] == shared_data["vaccination_comments"], ( + f"Mismatch in 'VaccinationComments': expected '{shared_data['vaccination_comments']}' but found '{last_row['VaccinationComments']}'." + ) + + assert last_row["VaccinatingClinician"] == shared_data["vaccinator"], ( + f"Mismatch in 'VaccinatingClinician': expected '{shared_data['vaccinator']}' but found '{last_row['VaccinatingClinician']}'." + ) + + assert last_row["ConsentingClinician"] == shared_data["consent_clinician_details"], ( + f"Mismatch in 'ConsentingClinician': expected '{shared_data['consent_clinician_details']}' but found '{last_row['ConsentingClinician']}'." + ) + if shared_data["consent_given_by"] != "Patient (informed consent)": assert last_row["ConsentingPersonName"].lower() == "Automation tester".lower(), ( f"Mismatch in 'ConsentingPersonName': expected 'Automation tester' but found '{last_row['ConsentingPersonName']}'."