Skip to content

Commit

Permalink
Merge branch 'main' into RAVS-1094-Automate-Reports-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
neelimaguntupalli1-nhs authored Nov 29, 2024
2 parents 4e5ac87 + 0f8210e commit 9c0fd82
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion features/reports.feature
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Scenario Outline: Choose data page is displayed
And I select the site <site> and click continue
Then the choose data page should be displayed and all data options should be checked by default


Examples:
|vaccineType | site |
| COVID-19 | Albert House |
Expand Down Expand Up @@ -177,4 +178,3 @@ Scenario Outline: User can download the report
| index | nhs_number | site | care_model | eligibility | assess_date | consent | vaccination | vaccination_date | name | dob | address | chosen_vaccine | batch_number | batch_expiry_date |
| 0 | 9693632109 | Albert House | Vaccination Centre open to the public | yes | today | yes | yes | today | Bill GARTON | 23/6/1946 | 1 MOUNT AVENUE, BARTON-UPON-HUMBER, S HUMBERSIDE, DN18 5DW | COVID-19 | AUTOMATION-SJ1 | 19/10/2026 |
| 0 | 9693632109 | Albert House | Vaccination Centre open to the public | yes | today | yes | yes | today-32 | Bill GARTON | 23/6/1946 | 1 MOUNT AVENUE, BARTON-UPON-HUMBER, S HUMBERSIDE, DN18 5DW | COVID-19 | AUTOMATION-SJ1 | 19/10/2026 |

8 changes: 1 addition & 7 deletions pages/reports_data_selection_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ def check_reports_data_check_box_checked(data):
wait_for_element_to_appear(element)
return check_element_checked(element)

def check_reports_data_check_box_exists(data):
wait_for_element_to_disappear(PAGE_LOADING_ELEMENT)
element = ("label", data)
wait_for_element_to_appear(element)
return check_element_exists(element)

def click_reports_data_check_box(data):
wait_for_element_to_disappear(PAGE_LOADING_ELEMENT)
element = ("label", data)
Expand All @@ -41,7 +35,7 @@ def check_continue_to_reports_check_and_confirm_button_exists():
wait_for_element_to_disappear(PAGE_LOADING_ELEMENT)
wait_for_element_to_appear(CONTINUE_TO_REPORTS_CHECK_AND_CONFIRM_BUTTON)
return check_element_exists(CONTINUE_TO_REPORTS_CHECK_AND_CONFIRM_BUTTON)

def click_continue_to_reports_select_data_button():
wait_for_element_to_disappear(PAGE_LOADING_ELEMENT)
wait_for_element_to_appear(CONTINUE_TO_REPORTS_CHECK_AND_CONFIRM_BUTTON)
Expand Down
14 changes: 12 additions & 2 deletions tests/test_reports_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ def I_click_confirm_to_generate_report(shared_data):
attach_screenshot("clicked_reports_download_report_button")
logging.info("clicked_reports_download_report_button")


@then("the report is downloaded successfully")
def the_report_is_downloaded_successfully(shared_data):
assert os.path.exists(shared_data['report_download_path']), f"Downloaded file not found: {shared_data['report_download_path']}"
Expand All @@ -310,7 +309,6 @@ def the_report_is_downloaded_successfully(shared_data):
is_valid, _ = validate_report_headers(shared_data['report_download_path'], expected_headers)
assert is_valid, "Report headers are invalid. See logs for details."


@then(parse("the report is downloaded successfully and contains the vaccine record for {nhs_number}"))
def the_report_is_downloaded_successfully(shared_data, nhs_number):
assert os.path.exists(shared_data['report_download_path']), f"Downloaded file not found: {shared_data['report_download_path']}"
Expand Down Expand Up @@ -400,3 +398,15 @@ def the_report_is_downloaded_successfully(shared_data, nhs_number):
)

logger.info(f"Vaccination date '{vaccination_date}' is correctly not present in the report.")
attach_screenshot("click_" + site.lower() + "_check_box_on_reports_page")
logging.info("click_" + site.lower() + "_check_box_on_reports_page")
click_continue_to_reports_select_data_button()
attach_screenshot("click_continue_to_reports_select_data_button")
logging.info("click_continue_to_reports_select_data_button")

@then("the choose data page should be displayed")
def the_choose_data_page_should_be_displayed():
assert check_data_check_box_exists("Patients") == True
attach_screenshot("check_choose_data_pages_reports_exists")
logging.info("check_choose_data_pages_reports_exists")

0 comments on commit 9c0fd82

Please sign in to comment.