|
11 | 11 | fill_in_and_submit_smoking_eligibility, |
12 | 12 | fill_in_and_submit_date_of_birth, |
13 | 13 | fill_in_and_submit_weight_metric, |
14 | | - fill_in_and_submit_weight_imperial |
| 14 | + fill_in_and_submit_weight_imperial, |
| 15 | + fill_in_and_submit_sex_at_birth |
15 | 16 | ) |
16 | 17 |
|
17 | 18 | from .helpers.assertion_helpers import expect_back_link_to_have_url |
@@ -49,43 +50,45 @@ def test_full_questionnaire_user_journey(self): |
49 | 50 |
|
50 | 51 | expect(page).to_have_url( |
51 | 52 | f"{self.live_server_url}/have-you-ever-smoked") |
52 | | - |
| 53 | + expect_back_link_to_have_url(page, "/start") |
53 | 54 | fill_in_and_submit_smoking_eligibility(page, smoking_status) |
54 | 55 |
|
55 | 56 | expect(page).to_have_url(f"{self.live_server_url}/date-of-birth") |
56 | 57 | expect_back_link_to_have_url(page, "/have-you-ever-smoked") |
57 | | - |
58 | 58 | fill_in_and_submit_date_of_birth(page, age) |
59 | 59 |
|
60 | 60 | expect(page).to_have_url(f"{self.live_server_url}/height") |
61 | | - |
| 61 | + expect_back_link_to_have_url(page, "/date-of-birth") |
62 | 62 | fill_in_and_submit_height_metric(page, height) |
63 | 63 |
|
64 | | - expect(page).to_have_url(f"{self.live_server_url}/weight") |
65 | | - |
66 | 64 | page.click("text=Back") |
67 | | - |
68 | 65 | expect(page).to_have_url(f"{self.live_server_url}/height") |
69 | | - |
70 | 66 | page.click("text=Switch to imperial") |
71 | | - |
72 | 67 | fill_in_and_submit_height_imperial(page, feet, inches) |
73 | 68 |
|
74 | 69 | expect(page).to_have_url(f"{self.live_server_url}/weight") |
75 | | - |
| 70 | + expect_back_link_to_have_url(page, "/height") |
76 | 71 | fill_in_and_submit_weight_metric(page, weight_metric) |
77 | | - |
78 | | - expect(page).to_have_url(f"{self.live_server_url}/responses") |
79 | 72 | page.click("text=Back") |
| 73 | + |
| 74 | + expect(page).to_have_url(f"{self.live_server_url}/weight") |
80 | 75 | page.get_by_role("link", name="Switch to stone and pounds").click() |
81 | 76 | fill_in_and_submit_weight_imperial(page, weight_stone, weight_pound) |
| 77 | + |
| 78 | + expect(page).to_have_url(f"{self.live_server_url}/sex-at-birth") |
| 79 | + expect_back_link_to_have_url(page, "/weight") |
| 80 | + fill_in_and_submit_sex_at_birth(page, "Male") |
| 81 | + |
82 | 82 | expect(page).to_have_url(f"{self.live_server_url}/responses") |
| 83 | + expect_back_link_to_have_url(page, "/sex-at-birth") |
| 84 | + |
83 | 85 | responses = page.locator(".responses") |
84 | 86 | expect(responses).to_contain_text("Have you ever smoked? Yes, I used to smoke regularly") |
85 | 87 | expect(responses).to_contain_text( |
86 | 88 | age.strftime("What is your date of birth? %Y-%m-%d")) |
87 | 89 | expect(responses).to_contain_text(f"What is your height? {feet} feet {inches} inches") |
88 | 90 | expect(responses).to_contain_text(f"What is your weight? {weight_stone} stone {weight_pound} pound") |
| 91 | + expect(responses).to_contain_text("What was your sex at birth? Male") |
89 | 92 |
|
90 | 93 | page.click("text=Submit") |
91 | 94 |
|
|
0 commit comments