Skip to content

Commit d18dced

Browse files
committed
Added test_can_select_multiple_respiratory_conditions() method
1 parent 1eef186 commit d18dced

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lung_cancer_screening/core/tests/acceptance/test_questionnaire.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,35 @@ def test_full_questionnaire_user_journey(self):
128128
page.click("text=Submit")
129129

130130
expect(page).to_have_url(f"{self.live_server_url}/your-results")
131+
132+
def test_can_select_multiple_respiratory_conditions(self):
133+
"""Test that users can select multiple respiratory conditions in the UI"""
134+
participant_id = '456'
135+
smoking_status = 'Yes, I currently smoke'
136+
age = datetime.now() - relativedelta(years=60)
137+
138+
page = self.browser.new_page()
139+
page.goto(f"{self.live_server_url}/start")
140+
141+
fill_in_and_submit_participant_id(page, participant_id)
142+
fill_in_and_submit_smoking_eligibility(page, smoking_status)
143+
fill_in_and_submit_date_of_birth(page, age)
144+
fill_in_and_submit_height_metric(page, "170")
145+
fill_in_and_submit_weight_metric(page, "70")
146+
fill_in_and_submit_sex_at_birth(page, "Female")
147+
fill_in_and_submit_gender(page, "Female")
148+
fill_in_and_submit_ethnicity(page, "White")
149+
page.click("text=Continue") # education
150+
151+
# Select multiple respiratory conditions
152+
expect(page).to_have_url(f"{self.live_server_url}/respiratory-conditions")
153+
fill_in_and_submit_respiratory_conditions(page, ["Pneumonia", "Emphysema"])
154+
155+
fill_in_and_submit_asbestos_exposure(page, "No")
156+
page.click("text=Continue") # cancer diagnosis
157+
page.click("text=Continue") # family history
158+
159+
# Verify both conditions appear on the responses page
160+
expect(page).to_have_url(f"{self.live_server_url}/responses")
161+
responses = page.locator(".responses")
162+
expect(responses).to_contain_text("Have you ever been diagnosed with any of the following respiratory conditions? Pneumonia, Emphysema")

0 commit comments

Comments
 (0)