-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathage_when_started_smoking.feature
More file actions
70 lines (65 loc) · 3.69 KB
/
age_when_started_smoking.feature
File metadata and controls
70 lines (65 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@SmokingHistory
@AgeWhenStartedSmoking
Feature: Age when started smoking
Scenario: The page is accessible
Given I am logged in
And I have answered questions showing I am eligible
When I go to "/age-when-started-smoking"
Then there are no accessibility violations
Scenario: Form errors
Given I am logged in
And I have answered questions showing I am eligible
And I am 60 years old
When I go to "/age-when-started-smoking"
And I click "Continue"
Then I am on "/age-when-started-smoking"
And I see a form error "Enter your age when you started smoking"
When I fill in "How old were you when you started smoking?" as "0" and submit
Then I see a form error "The age you started smoking must be between 1 and your current age"
When I fill in "How old were you when you started smoking?" as "70" and submit
Then I see a form error "The age you started smoking must be the same as, or less than your current age"
And there are no accessibility violations
Scenario: Navigating backwards and forwards as a former smoker
Given I am logged in
And I have answered questions showing I am eligible
And I have answered questions showing I am a former smoker
When I go to "/age-when-started-smoking"
Then I see a back link to "/relatives-age-when-diagnosed"
When I fill in "How old were you when you started smoking?" as "18" and submit
Then I am on "/when-you-quit-smoking"
Scenario: Navigating backwards and forwards as a current smoker
Given I am logged in
And I have answered questions showing I am eligible
And I have answered questions showing I am a current smoker
When I go to "/age-when-started-smoking"
Then I see a back link to "/relatives-age-when-diagnosed"
When I fill in "How old were you when you started smoking?" as "18" and submit
Then I am on "/periods-when-you-stopped-smoking"
Scenario: Checking responses and changing them as a current smoker
Given I am logged in
And I have answered questions showing I am eligible
And I have answered questions showing I am a current smoker
When I go to "/age-when-started-smoking"
And I fill in "How old were you when you started smoking?" as "18" and submit
When I go to "/check-your-answers"
Then I see "18" as a response to "Age you started smoking" under "Smoking history"
And I see "/age-when-started-smoking?change=True" as a link to change "Age you started smoking" under "Smoking history"
When I click the link to change "Age you started smoking" under "Smoking History"
Then I am on "/age-when-started-smoking?change=True"
And I see "18" filled in for "How old were you when you started smoking?"
When I fill in "How old were you when you started smoking?" as "22" and submit
Then I am on "/check-your-answers"
Scenario: Checking responses and changing them as a former smoker
Given I am logged in
And I have answered questions showing I am eligible
And I have answered questions showing I am a former smoker
When I go to "/age-when-started-smoking"
And I fill in "How old were you when you started smoking?" as "18" and submit
When I go to "/check-your-answers"
Then I see "18" as a response to "Age you started smoking" under "Smoking history"
And I see "/age-when-started-smoking?change=True" as a link to change "Age you started smoking" under "Smoking history"
When I click the link to change "Age you started smoking" under "Smoking History"
Then I am on "/age-when-started-smoking?change=True"
And I see "18" filled in for "How old were you when you started smoking?"
When I fill in "How old were you when you started smoking?" as "22" and submit
Then I am on "/check-your-answers"