Skip to content

Commit c344f49

Browse files
authored
Merge pull request #210 from NHSDigital/move-accessibility-tests-to-behave
Move accessibility tests to behave
2 parents 0a925e0 + e94907e commit c344f49

38 files changed

Lines changed: 401 additions & 416 deletions

features/asbestos_exposure.feature

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Feature: Asbestos exposure page
2+
Scenario: The page is accessible
3+
Given I am logged in
4+
When I go to "/asbestos-exposure"
5+
Then there are no accessibility violations
6+
7+
Scenario: Form errors
8+
Given I am logged in
9+
When I go to "/asbestos-exposure"
10+
And I click "Continue"
11+
Then I am on "/asbestos-exposure"
12+
And I see a form error "Select if you have been exposed to asbestos"
13+
And there are no accessibility violations
14+
15+
Scenario: Navigating backwards and forwards
16+
Given I am logged in
17+
When I go to "/asbestos-exposure"
18+
Then I see a back link to "/respiratory-conditions"
19+
When I fill in and submit my asbestos exposure with "No"
20+
Then I am on "/cancer-diagnosis"
21+

features/cancer_diagnosis.feature

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Feature: Cancer diagnosis page
2+
Scenario: The page is accessible
3+
Given I am logged in
4+
When I go to "/cancer-diagnosis"
5+
Then there are no accessibility violations
6+
7+
Scenario: Form errors
8+
Given I am logged in
9+
When I go to "/cancer-diagnosis"
10+
And I click "Continue"
11+
Then I am on "/cancer-diagnosis"
12+
And I see a form error "Select if you have been diagnosed with cancer"
13+
And there are no accessibility violations
14+
15+
Scenario: Navigating backwards and forwards
16+
Given I am logged in
17+
When I go to "/cancer-diagnosis"
18+
Then I see a back link to "/asbestos-exposure"
19+
When I fill in and submit my asbestos exposure with "No"
20+
Then I am on "/family-history-lung-cancer"
21+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Feature: Date of birth page
2+
Scenario: The page is accessible
3+
Given I am logged in
4+
When I go to "/date-of-birth"
5+
Then there are no accessibility violations
6+
7+
Scenario: Form errors
8+
Given I am logged in
9+
And I have started the questionnaire
10+
When I go to "/date-of-birth"
11+
When I click "Continue"
12+
Then I am on "/date-of-birth"
13+
And I see a form error "Enter your date of birth"
14+
When I fill in and submit my date of birth with "51-01-2001"
15+
Then I am on "/date-of-birth"
16+
And I see a form error "Date of birth must be a real date"
17+
When I fill in and submit my date of birth with "01-13-2001"
18+
Then I am on "/date-of-birth"
19+
And I see a form error "Date of birth must be a real date"
20+
When I fill in and submit my date of birth with "31-02-2001"
21+
Then I am on "/date-of-birth"
22+
And I see a form error "Date of birth must be a real date"
23+
And there are no accessibility violations
24+
25+
Scenario: Eligibility of people not in age range
26+
Given I am logged in
27+
When I go to "/date-of-birth"
28+
And I fill in and submit my date of birth with "01-01-1900"
29+
Then I am on "/age-range-exit"
30+
And I see a title "You are not eligible for lung cancer screening"
31+
32+
Scenario: Navigating backwards and forwards
33+
Given I am logged in
34+
When I go to "/date-of-birth"
35+
Then I see a back link to "/have-you-ever-smoked"
36+
When I fill in and submit my date of birth as 55 years ago
37+
Then I am on "/height"

features/ethnicity.feature

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Feature: Ethnicity page
2+
Scenario: The page is accessible
3+
Given I am logged in
4+
When I go to "/ethnicity"
5+
Then there are no accessibility violations
6+
7+
Scenario: Form errors
8+
Given I am logged in
9+
When I go to "/ethnicity"
10+
And I click "Continue"
11+
Then I am on "/ethnicity"
12+
And I see a form error "Select your ethnic background"
13+
And there are no accessibility violations
14+
15+
Scenario: Navigating backwards and forwards
16+
Given I am logged in
17+
When I go to "/ethnicity"
18+
Then I see a back link to "/gender"
19+
When I fill in and submit my ethnicity with "White"
20+
Then I am on "/education"
21+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Feature: Family history of lung cancer page
2+
Scenario: The page is accessible
3+
Given I am logged in
4+
When I go to "/family-history-lung-cancer"
5+
Then there are no accessibility violations
6+
7+
Scenario: Form errors
8+
Given I am logged in
9+
When I go to "/family-history-lung-cancer"
10+
And I click "Continue"
11+
Then I am on "/family-history-lung-cancer"
12+
And I see a form error "Select if any of your parents, siblings or children have had a diagnosis of lung cancer"
13+
And there are no accessibility violations
14+
15+
Scenario: Navigating backwards and forwards
16+
Given I am logged in
17+
When I go to "/family-history-lung-cancer"
18+
Then I see a back link to "/cancer-diagnosis"
19+
When I fill in and submit my asbestos exposure with "No"
20+
Then I am on "/responses"
21+
When I click "Back"
22+
When I fill in and submit my family history lung cancer with "Yes"
23+
Then I am on "/relatives-age-when-diagnosed"
24+

features/gender.feature

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Feature: Gender page
2+
Scenario: The page is accessible
3+
Given I am logged in
4+
When I go to "/gender"
5+
Then there are no accessibility violations
6+
7+
Scenario: Form errors
8+
Given I am logged in
9+
When I go to "/gender"
10+
And I click "Continue"
11+
Then I am on "/gender"
12+
And I see a form error "Select the option that best describes your gender"
13+
And there are no accessibility violations
14+
15+
Scenario: Navigating backwards and forwards
16+
Given I am logged in
17+
When I go to "/gender"
18+
Then I see a back link to "/sex-at-birth"
19+
When I fill in and submit my gender with "Female"
20+
Then I am on "/ethnicity"
21+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Feature: Have you ever smoked page
2+
Scenario: The page is accessible
3+
Given I am logged in
4+
When I go to "/have-you-ever-smoked"
5+
Then there are no accessibility violations
6+
7+
Scenario: Form errors
8+
Given I am logged in
9+
When I go to "/have-you-ever-smoked"
10+
And I submit the form
11+
Then I am on "/have-you-ever-smoked"
12+
And I see a form error "Select if you have ever smoked"
13+
And there are no accessibility violations
14+
15+
Scenario: Eligibility of non smokers
16+
Given I am logged in
17+
When I go to "/have-you-ever-smoked"
18+
And I fill in and submit my smoking status with "No, I have never smoked"
19+
Then I am on "/non-smoker-exit"
20+
And I see a title "You are not eligible for lung cancer screening"
21+
And there are no accessibility violations
22+
23+
Scenario: Navigating backwards and forwards
24+
Given I am logged in
25+
When I go to "/have-you-ever-smoked"
26+
Then I see a back link to "/start"
27+
When I fill in and submit my smoking status with "Yes, I used to smoke"
28+
Then I am on "/date-of-birth"

features/height.feature

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Feature: Height page
2+
Scenario: The page is accessible
3+
Given I am logged in
4+
When I go to "/height"
5+
Then there are no accessibility violations
6+
When I click "Switch to feet and inches"
7+
Then there are no accessibility violations
8+
9+
Scenario: Metric form errors
10+
Given I am logged in
11+
When I go to "/height"
12+
And I click "Continue"
13+
Then I am on "/height"
14+
And I see a form error "Enter your height"
15+
When I fill in and submit my height with "139.6"
16+
Then I am on "/height"
17+
And I see a form error "Height must be between 139.7cm and 243.8 cm"
18+
When I fill in and submit my height with "243.9"
19+
Then I am on "/height"
20+
And I see a form error "Height must be between 139.7cm and 243.8 cm"
21+
And there are no accessibility violations
22+
23+
Scenario: Imperial form errors
24+
Given I am logged in
25+
When I go to "/height?unit=imperial"
26+
And I click "Continue"
27+
Then I am on "/height?unit=imperial"
28+
And I see a form error "Enter your height"
29+
When I fill in and submit my height with "5.2" feet and "2" inches
30+
Then I am on "/height?unit=imperial"
31+
And I see a form error "Feet must be in whole numbers"
32+
When I fill in and submit my height with "5" feet and "2.2" inches
33+
Then I am on "/height?unit=imperial"
34+
And I see a form error "Inches must be in whole numbers"
35+
When I fill in and submit my height with "8" feet and "1" inch
36+
Then I am on "/height?unit=imperial"
37+
And I see a form error "Height must be between 4 feet 7 inches and 8 feet"
38+
And there are no accessibility violations
39+
40+
Scenario: Navigating backwards and forwards
41+
Given I am logged in
42+
When I go to "/height"
43+
Then I see a back link to "/date-of-birth"
44+
When I fill in and submit my height with "170"
45+
Then I am on "/weight"
46+
When I click "Back"
47+
And I click "Switch to feet and inches"
48+
When I fill in and submit my height with "5" feet and "7" inches
49+
Then I am on "/weight"
50+
When I click "Back"
51+
Then I am on "/height"
52+
Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,57 @@
11
Feature: Questionnaire
2+
Scenario: Cannot change responses once submitted
3+
Given I am logged in
4+
And I have already submitted my responses
5+
When I go to "/start"
6+
And I click "Start"
7+
Then I am on "/start"
8+
29
Scenario: The user can complete the full questionnaire
310
Given I am logged in
411
When I go to "/start"
512
And I click "Start"
13+
614
Then I am on "/have-you-ever-smoked"
7-
And I see a back link to "/start"
815
When I fill in and submit my smoking status with "Yes, I used to smoke"
16+
917
Then I am on "/date-of-birth"
10-
And I see a back link to "/have-you-ever-smoked"
1118
When I fill in and submit my date of birth as 55 years ago
19+
1220
Then I am on "/height"
13-
And I see a back link to "/date-of-birth"
14-
When I fill in and submit my height with "170"
15-
And I click "Back"
16-
And I click "Switch to feet and inches"
17-
When I fill in and submit my height with "5" feet and "7" inches
21+
When I click "Switch to feet and inches"
22+
And I fill in and submit my height with "5" feet and "7" inches
23+
1824
Then I am on "/weight"
19-
And I see a back link to "/height"
20-
When I fill in and submit my weight with "70"
21-
And I click "Back"
22-
And I click "Switch to stone and pounds"
23-
When I fill in and submit my weight with "5" stone and "10" pounds
25+
When I click "Switch to stone and pounds"
26+
And I fill in and submit my weight with "5" stone and "10" pounds
27+
2428
Then I am on "/sex-at-birth"
25-
And I see a back link to "/weight"
2629
When I fill in and submit my sex at birth with "Male"
30+
2731
Then I am on "/gender"
28-
And I see a back link to "/sex-at-birth"
2932
When I fill in and submit my gender with "Female"
33+
3034
Then I am on "/ethnicity"
31-
And I see a back link to "/gender"
3235
When I fill in and submit my ethnicity with "White"
36+
3337
Then I am on "/education"
34-
And I see a back link to "/ethnicity"
3538
When I click "Continue"
39+
3640
Then I am on "/respiratory-conditions"
37-
And I see a back link to "/education"
3841
When I fill in and submit my respiratory conditions with "Pneumonia" and "Emphysema"
42+
3943
Then I am on "/asbestos-exposure"
40-
And I see a back link to "/respiratory-conditions"
4144
When I fill in and submit my asbestos exposure with "No"
45+
4246
Then I am on "/cancer-diagnosis"
43-
And I see a back link to "/asbestos-exposure"
4447
When I fill in and submit my cancer diagnosis with "No"
48+
4549
Then I am on "/family-history-lung-cancer"
46-
And I see a back link to "/cancer-diagnosis"
4750
When I fill in and submit my family history lung cancer with "Yes"
51+
4852
Then I am on "/relatives-age-when-diagnosed"
49-
And I see a back link to "/family-history-lung-cancer"
5053
When I fill in and submit my relatives age when diagnosed with "Yes, they were younger than 60"
54+
5155
Then I am on "/responses"
5256
And I see a back link to "/relatives-age-when-diagnosed"
5357
And I see responses "Have you ever smoked? Yes, I used to smoke"

0 commit comments

Comments
 (0)