|
| 1 | +@PeriodsWhenYouStoppedSmoking |
| 2 | +Feature: Periods when you stopped smoking page |
| 3 | + Scenario: The page is accessible |
| 4 | + Given I am logged in |
| 5 | + And I have answered questions showing I am eligible |
| 6 | + When I go to "/periods-when-you-stopped-smoking" |
| 7 | + # TODO: problem with aria expanded from nhsuk frontend |
| 8 | + # Then there are no accessibility violations |
| 9 | + |
| 10 | + Scenario: Form errors |
| 11 | + Given I am logged in |
| 12 | + And I have answered questions showing I am eligible |
| 13 | + When I go to "/periods-when-you-stopped-smoking" |
| 14 | + When I submit the form |
| 15 | + Then I am on "/periods-when-you-stopped-smoking" |
| 16 | + And I see a form error "Select if you ever stopped smoking for periods of 1 year or longer" |
| 17 | + # TODO: problem with aria expanded from nhsuk frontend |
| 18 | + # And there are no accessibility violations |
| 19 | + |
| 20 | + Scenario: Navigating backwards and forwards |
| 21 | + Given I am logged in |
| 22 | + And I have answered questions showing I am eligible |
| 23 | + When I go to "/periods-when-you-stopped-smoking" |
| 24 | + Then I see a back link to "/family-history-lung-cancer" |
| 25 | + When I check "Yes" |
| 26 | + And I fill in "Enter the total number of years you stopped smoking for" with "10" |
| 27 | + And I submit the form |
| 28 | + Then I am on "/check-your-answers" |
| 29 | + |
| 30 | + Scenario: Checking responses and changing them |
| 31 | + Given I am logged in |
| 32 | + And I have answered questions showing I am eligible |
| 33 | + When I go to "/periods-when-you-stopped-smoking" |
| 34 | + And I check "Yes" |
| 35 | + And I fill in "Enter the total number of years you stopped smoking for" with "10" |
| 36 | + And I submit the form |
| 37 | + When I go to "/check-your-answers" |
| 38 | + Then I see "Yes (10 years)" as a response to "Have you ever stopped smoking for periods of 1 year or longer?" under "Smoking history" |
| 39 | + And I see "/periods-when-you-stopped-smoking?change=True" as a link to change "Have you ever stopped smoking for periods of 1 year or longer?" under "Smoking history" |
| 40 | + When I click the link to change "Have you ever stopped smoking for periods of 1 year or longer?" under "Smoking history" |
| 41 | + Then I am on "/periods-when-you-stopped-smoking?change=True" |
| 42 | + And I see "Yes" selected |
| 43 | + When I check "No" |
| 44 | + And I submit the form |
| 45 | + Then I am on "/check-your-answers" |
| 46 | + And I see "No" as a response to "Have you ever stopped smoking for periods of 1 year or longer?" under "Smoking history" |
0 commit comments