Skip to content

Commit

Permalink
deploy: dd655e7
Browse files Browse the repository at this point in the history
  • Loading branch information
neelimaguntupalli1-nhs committed Nov 6, 2024
1 parent 70758f1 commit 2900751
Show file tree
Hide file tree
Showing 548 changed files with 21,819 additions and 4,514 deletions.
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"cSpell.words": [
"CAREHOME",
"immunisation",
"organisation",
"WHITESTONES"
"organisation"
]
}
Binary file modified allure-report.tar.gz
Binary file not shown.
86 changes: 65 additions & 21 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
# from pages.add_vaccines_page import *
from pages.add_vaccines_page import *
from pages.settings_page import *
from pages.site_vaccine_batches_page import *
from pages.vaccines_page import *
Expand Down Expand Up @@ -107,6 +107,46 @@ def navigate_to_ravs(request):
navigate_to_ravs_login_page(url)
return True

# Fixture for clicking back button
@pytest.fixture(scope='function')
def click_back_button_recording_consent(request):
click_back_button()

def set_vaccinator_location(site, care_model):
select_site(site)
select_care_model(care_model)
if care_model == "Care Home":
enter_carehome_name("WHITESTONES CARE HOME")
click_continue_to_record_a_vaccination_homepage()

@pytest.fixture(scope='function')
def login_and_navigate_to_homepage(request, navigate_and_login):
click_continue_to_record_a_vaccination_homepage()

# Fixture for logging in and navigating to appointments open first patient
@pytest.fixture(scope='function')
def login_and_navigate_to_appointments_open_first_patient(request, navigate_and_login):
attach_screenshot("user_has_logged_in")
site = "ST JOHN'S HOUSE"
care_model = "Vaccination Centre"
select_site(site)
attach_screenshot("user_has_selected_site")
select_care_model(care_model)
if care_model == "Care Home":
enter_carehome_name("WHITESTONES CARE HOME")
attach_screenshot("user_has_selected_site")
attach_screenshot("user_has_selected_care_model")
click_continue_to_record_a_vaccination_homepage()
attach_screenshot("user_has_clicked_continue_to_ravs_homepage")
current_date = datetime.now()
fromDate = datetime(2023, 12, 1)
set_from_date(fromDate)
click_active_from_date()
toDate = datetime.today()
set_to_date(toDate)
click_active_to_date_today()
click_first_patient()

# Fixture for logging in and navigating to find a patient
@pytest.fixture(scope='function')
def login_and_navigate_to_find_a_patient(request):
Expand Down Expand Up @@ -202,13 +242,13 @@ def check_site_vaccine_type_has_active_batch(site, vaccine, vaccine_type, batch_
# If the batch does NOT currently exist, add a batch
# This adds an active batch, so we don't need to do further checks
click_view_product(site, vaccine_type)
if not check_batch_number_and_expiry_date_exists(batch_number, expiry_date, True):
if not check_batch_number_exists(batch_number, True):
add_vaccine_type_batch(batch_number, expiry_date)
return True

# If we get this far, the batch does exists but is currently INACTIVE
# This reactivates the batch
if not check_batch_number_is_active_with_date(batch_number, expiry_date, True):
if not check_batch_number_is_active(batch_number, True):
click_reactivate_batch_link(batch_number)
click_reactivate_batch_confirmation_button()

Expand All @@ -219,29 +259,30 @@ def add_site_vaccine(site, vaccine, vaccine_type, batch_number, expiry_date):
# vaccines_choose_site_page
enter_site_name(site)
select_site_from_list(site)
click_continue_to_add_vaccine_button()
click_continue_button()

# choose_vaccine_page
click_vaccine_radiobutton_on_add_vaccine_screen(vaccine)
click_vaccine_type_radiobutton_on_add_vaccine_screen(vaccine_type)
click_continue_to_add_batch_button()
click_vaccine_radiobutton(vaccine)
click_vaccine_type_radiobutton(vaccine_type)
click_continue_button()

# vaccines_add_batch_page
enter_batch_number(batch_number)
enter_expiry_date(expiry_date)
click_continue_to_confirm_batch_details_button()
click_continue_button()

# vaccines_check_and_confirm_page
click_confirm_add_vaccine_and_batch_button()
click_confirm_button()

def add_vaccine_type_batch(batch_number, expiry_date):
click_add_batch_link()
# vaccines_add_batch_page
enter_batch_number(batch_number)
enter_expiry_date(expiry_date)
click_continue_to_confirm_batch_details_button()
click_continue_button()

# vaccines_check_and_confirm_page
click_confirm_add_vaccine_and_batch_button()
click_confirm_button()

def assess_patient_with_details_and_click_continue_to_consent(eligible_decision, eligibility_type, staff_role, assessing_clinician, due_date, assessment_date, legal_mechanism, assessment_outcome, assessment_comments, eligibility_assessment_no_vaccine_given_reason=None):

Expand Down Expand Up @@ -283,11 +324,9 @@ def assess_patient_with_details_and_click_continue_to_consent(eligible_decision,
attach_screenshot("clicked_continue_to_record_consent_button")


def record_consent_details_and_click_continue_to_vaccinate(consent_decision, consent_given_by, person_consenting_name, relationship_to_patient, consent_clinician, legal_mechanism, no_consent_reason=None):
def record_consent_details_and_click_continue_to_vaccinate(consent_decision, consent_given_by, person_consenting_name, relationship_to_patient, consent_clinician, no_consent_reason=None):
attach_screenshot("before_selecting_consent_clinician")

if (legal_mechanism) != "Patient Group Direction (PGD)":
select_consent_clinician_with_name_and_council(consent_clinician)
select_consent_clinician_with_name_and_council(consent_clinician)

if consent_decision.lower() == 'yes':
click_yes_to_consent()
Expand All @@ -308,17 +347,22 @@ def record_consent_details_and_click_continue_to_vaccinate(consent_decision, co
click_save_and_return_button_on_record_consent_page()
attach_screenshot("patient_decided_to_not_consent_saved_and_returned")

def enter_vaccine_details_and_click_continue_to_check_and_confirm(vaccinate_decision, care_model, vaccination_date, vaccine, vaccine_type2, vaccination_site, batch_number, batch_expiry_date, dose_amount, vaccinator, vaccination_comments, legal_mechanism, no_vaccination_reason=None):
def enter_vaccine_details_and_click_continue_to_check_and_confirm(vaccinate_decision, care_model, vaccination_date, vaccine, vaccine_type2, vaccination_site, batch_number, batch_expiry_date, dose_amount, vaccinator, vaccination_comments, no_vaccination_reason=None):
if vaccinate_decision.lower() == 'yes':
click_yes_vaccinated_radiobutton()

click_vaccine_type(vaccine_type2)
if "covid" in (vaccine).lower():
click_covid_vaccine_type_radiobutton_choose_vaccine_for_patient_on_vaccinated_page(vaccine_type2)
elif "flu" in (vaccine).lower():
click_flu_vaccine_type_radiobutton_choose_vaccine_for_patient_on_vaccinated_page(vaccine_type2)
elif "rsv" in (vaccine).lower():
click_rsv_vaccine_type_radiobutton_choose_vaccine_for_patient_on_vaccinated_page(vaccine_type2)
elif "pertussis" in (vaccine).lower():
click_pertussis_vaccine_type_radiobutton_choose_vaccine_for_patient_on_vaccinated_page(vaccine_type2)

set_vaccination_date(vaccination_date)
click_care_model_option(care_model)
if care_model == "Care home":
enter_care_home_details("WHITESTONES CARE HOME")
if (legal_mechanism) != "Patient Group Direction (PGD)":
select_vaccinator_name_and_council(vaccinator)
select_vaccinator_name_and_council(vaccinator)
enter_vaccination_comments(vaccination_comments)
select_vaccination_site(vaccination_site)
batch_number_to_select = batch_number.upper() + " - " + batch_expiry_date
Expand Down
Binary file added data/attachments/102d6b053fc4ad4f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/10554856a93e36c9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/1061d6ba32bd40e4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/10d234c4bd989201.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/115300fd8965e986.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/116005662b62fea7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/1247b2fd6ddd8a17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/144ae76ed6ba114d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/146fe6d315eef6e6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/148ea273e5281b6b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/149ad71a47b3ec23.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/14d6118fed0f1404.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/15a6bdd03e63a49f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions data/attachments/1687802b2261de2b.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
INFO root:conftest.py:47 CHROME browser version is : 130.0.6723.116
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_given_I access the ravs web app': [<FixtureDef argname='pytestbdd_stepdef_given_I access the ravs web app' scope='function' baseid='tests/test_login_steps.py'>]
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_when_I click on the log in button': [<FixtureDef argname='pytestbdd_stepdef_when_I click on the log in button' scope='function' baseid='tests/test_login_steps.py'>]
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_when_I provide the invalid_email_address and password': [<FixtureDef argname='pytestbdd_stepdef_when_I provide the {emailAddress} and {password}' scope='function' baseid='tests/test_login_steps.py'>]
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_when_the NHS sign in button is clicked': [<FixtureDef argname='pytestbdd_stepdef_when_the NHS sign in button is clicked' scope='function' baseid='tests/test_login_steps.py'>]
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_then_sign in should fail': [<FixtureDef argname='pytestbdd_stepdef_then_sign in should {status}' scope='function' baseid='tests/test_login_steps.py'>]
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_sign_in_should_fail.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_sign_in_should_fail.png
Binary file added data/attachments/168c776a02fdf66c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/attachments/1690f182992c1689.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions data/attachments/1691c3eb594d29e9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
INFO root:conftest.py:47 CHROME browser version is : 130.0.6723.116
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_given_I login to RAVS and set vaccinator details with ALBERT HOUSE and Off-site Outreach Event and get patient details for 9437541817 with option 4 and choose to vaccinate with vaccine details as Flu, SDYY2-24A with 19/10/2026': [<FixtureDef argname='pytestbdd_stepdef_given_I login to RAVS and set vaccinator details with {site} and {care_model} and get patient details for {nhs_number} with option {index} and choose to vaccinate with vaccine details as {chosen_vaccine}, {batch_number} with {batch_expiry_date}' scope='function' baseid='tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py'>]
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_given_I search for a patient with the NHS number in the find a patient screen': [<FixtureDef argname='pytestbdd_stepdef_given_I search for a patient with the NHS number in the find a patient screen' scope='function' baseid='tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py'>]
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_entered_nhs_number_as9437541817_and_clicked_search_for_patient_button.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_entered_nhs_number_as9437541817_and_clicked_search_for_patient_button.png
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_given_I open the patient record by clicking on patient FLORINDA DUNNER': [<FixtureDef argname='pytestbdd_stepdef_given_I open the patient record by clicking on patient {name}' scope='function' baseid='tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py'>]
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_before_clicking_patient_name.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_before_clicking_patient_name.png
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_when_I click choose vaccine button and choose the Flu, SDYY2-24A with 19/10/2026 and click continue': [<FixtureDef argname='pytestbdd_stepdef_when_I click choose vaccine button and choose the {chosen_vaccine}, {batch_number} with {batch_expiry_date} and click continue' scope='function' baseid='tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py'>]
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_clicked_on_patient_FLORINDA DUNNER_and_clicked_choose_vaccine_button.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_clicked_on_patient_FLORINDA DUNNER_and_clicked_choose_vaccine_button.png
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_selected_vaccine_Flu_and_Adjuvanted Quadrivalent Influenza Vaccine_and_clicked_continue_button.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_selected_vaccine_Flu_and_Adjuvanted Quadrivalent Influenza Vaccine_and_clicked_continue_button.png
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture "pytestbdd_stepimpl_when_I assess the patient's yes with the details and date as today and click continue to record consent screen button": [<FixtureDef argname="pytestbdd_stepdef_when_I assess the patient's {eligibility} with the details and date as {assess_date} and click continue to record consent screen button" scope='function' baseid='tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py'>]
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_clicked_eligibility_yes_and_selected_eligibility_type.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_clicked_eligibility_yes_and_selected_eligibility_type.png
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_clicked_patient_give_vaccine_radio_button.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_clicked_patient_give_vaccine_radio_button.png
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_clicked_continue_to_record_consent_button.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_clicked_continue_to_record_consent_button.png
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_when_I record yes with the details and click continue to vaccinate button': [<FixtureDef argname='pytestbdd_stepdef_when_I record {consent} with the details and click continue to vaccinate button' scope='function' baseid='tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py'>]
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_before_selecting_consent_clinician.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_before_selecting_consent_clinician.png
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_clicked_continue_to_vaccinate_button.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_clicked_continue_to_vaccinate_button.png
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_when_I record yes details and date as today and click Continue to Check and confirm screen': [<FixtureDef argname='pytestbdd_stepdef_when_I record {vaccination} details and date as {vaccination_date} and click Continue to Check and confirm screen' scope='function' baseid='tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py'>]
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_entered_vaccination_details.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_entered_vaccination_details.png
DEBUG pytest_bdd.scenario:scenario.py:145 Adding providers for fixture 'pytestbdd_stepimpl_then_I need to be able to see the patient FLORINDA DUNNER, 27/3/1957, 32 HOLLAND ROAD, MANCHESTER, M8 4NP and vaccination details on the check and confirm screen': [<FixtureDef argname='pytestbdd_stepdef_then_I need to be able to see the patient {name}, {dob}, {address} and vaccination details on the check and confirm screen' scope='function' baseid='tests/test_record_a_vaccine_for_patient_with_nhs_number_steps.py'>]
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_check_and_confirm_screen_before_assertion.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_check_and_confirm_screen_before_assertion.png
DEBUG root:init_helpers.py:102 Directory verified: /app/data/attachments
DEBUG root:init_helpers.py:108 Saving screenshot to: /app/data/attachments/qa_chrome_130.0.6723.116_vaccination_dose_amount.png
DEBUG root:init_helpers.py:114 Screenshot attached at: /app/data/attachments/qa_chrome_130.0.6723.116_vaccination_dose_amount.png
Binary file added data/attachments/1715b10f7a18f07d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2900751

Please sign in to comment.