-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathheight.feature
More file actions
76 lines (71 loc) · 3.07 KB
/
height.feature
File metadata and controls
76 lines (71 loc) · 3.07 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
71
72
73
74
75
@Height
Feature: Height page
Scenario: The page is accessible
Given I am logged in
When I go to "/height"
Then there are no accessibility violations
When I click "Switch to feet and inches"
Then there are no accessibility violations
Scenario: Metric form errors
Given I am logged in
When I go to "/height"
And I click "Continue"
Then I am on "/height"
And I see a form error "Enter your height"
When I fill in and submit my height with "139.6"
Then I am on "/height"
And I see a form error "Height must be between 139.7cm and 243.8 cm"
When I fill in and submit my height with "243.9"
Then I am on "/height"
And I see a form error "Height must be between 139.7cm and 243.8 cm"
And there are no accessibility violations
Scenario: Imperial form errors
Given I am logged in
When I go to "/height?unit=imperial"
And I click "Continue"
Then I am on "/height?unit=imperial"
And I see a form error "Enter your height"
When I fill in and submit my height with "5.2" feet and "2" inches
Then I am on "/height?unit=imperial"
And I see a form error "Feet must be in whole numbers"
When I fill in and submit my height with "5" feet and "2.2" inches
Then I am on "/height?unit=imperial"
And I see a form error "Inches must be in whole numbers"
When I fill in and submit my height with "8" feet and "1" inch
Then I am on "/height?unit=imperial"
And I see a form error "Height must be between 4 feet 7 inches and 8 feet"
And there are no accessibility violations
Scenario: Navigating backwards and forwards
Given I am logged in
When I go to "/height"
Then I see a back link to "/check-if-you-need-an-appointment"
When I fill in and submit my height with "170"
Then I am on "/weight"
When I click "Back"
And I click "Switch to feet and inches"
When I fill in and submit my height with "5" feet and "7" inches
Then I am on "/weight"
When I click "Back"
Then I am on "/height"
Scenario: Checking responses and changing them
Given I am logged in
When I go to "/height"
And I fill in and submit my height with "170"
When I go to "/check-your-answers"
Then I see "170 cm" as a response to "Height" under "About you"
And I see "/height?change=True" as a link to change "Height" under "About you"
When I click the link to change "Height" under "About you"
Then I am on "/height?change=True"
And I see "170.0" filled in for "Centimetres"
When I click "Switch to feet and inches"
And I fill in and submit my height with "5" feet and "7" inches
Then I am on "/check-your-answers"
And I see "5 feet 7 inches" as a response to "Height" under "About you"
When I click the link to change "Height" under "About you"
Then I am on "/height?change=True"
And I see "5" filled in for "Feet"
And I see "7" filled in for "Inches"
When I click "Switch to centimetres"
And I fill in and submit my height with "170.4"
Then I am on "/check-your-answers"
And I see "170.4 cm" as a response to "Height" under "About you"