|
| 1 | +Feature: Validation errors |
| 2 | + Scenario: Date of birth form errors |
| 3 | + Given I have started the questionnaire |
| 4 | + When I go to "/date-of-birth" |
| 5 | + And I submit the form |
| 6 | + Then I am on "/date-of-birth" |
| 7 | + And I see a form error "Enter your date of birth." |
| 8 | + |
| 9 | + Scenario: Height form errors |
| 10 | + Given I have started the questionnaire |
| 11 | + When I go to "/height" |
| 12 | + And I submit the form |
| 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 | + |
| 22 | + Scenario: Height imperial form errors |
| 23 | + Given I have started the questionnaire |
| 24 | + When I go to "/height?unit=imperial" |
| 25 | + And I submit the form |
| 26 | + Then I am on "/height?unit=imperial" |
| 27 | + And I see a form error "Enter your height." |
| 28 | + When I fill in and submit my height with "5.2" feet and "2" inches |
| 29 | + Then I am on "/height?unit=imperial" |
| 30 | + And I see a form error "Feet must be in whole numbers" |
| 31 | + When I fill in and submit my height with "5" feet and "2.2" inches |
| 32 | + Then I am on "/height?unit=imperial" |
| 33 | + And I see a form error "Inches must be in whole numbers" |
| 34 | + When I fill in and submit my height with "8" feet and "1" inch |
| 35 | + Then I am on "/height?unit=imperial" |
| 36 | + And I see a form error "Height must be between 4 feet 7 inches and 8 feet" |
| 37 | + |
| 38 | + Scenario: Weight form errors |
| 39 | + Given I have started the questionnaire |
| 40 | + When I go to "/weight" |
| 41 | + And I submit the form |
| 42 | + Then I am on "/weight" |
| 43 | + And I see a form error "Enter your weight." |
| 44 | + When I fill in and submit my weight with "25.3" |
| 45 | + Then I am on "/weight" |
| 46 | + And I see a form error "Weight must be between 25.4kg and 317.5kg" |
| 47 | + When I fill in and submit my weight with "317.6" |
| 48 | + Then I am on "/weight" |
| 49 | + And I see a form error "Weight must be between 25.4kg and 317.5kg" |
| 50 | + |
| 51 | + Scenario: Weight imperial form errors |
| 52 | + Given I have started the questionnaire |
| 53 | + When I go to "/weight?unit=imperial" |
| 54 | + And I submit the form |
| 55 | + Then I am on "/weight?unit=imperial" |
| 56 | + And I see a form error "Enter your weight." |
| 57 | + When I fill in and submit my weight with "5.2" stone and "2" pounds |
| 58 | + Then I am on "/weight?unit=imperial" |
| 59 | + And I see a form error "Stone must be in whole numbers" |
| 60 | + When I fill in and submit my weight with "5" stone and "2.2" pounds |
| 61 | + Then I am on "/weight?unit=imperial" |
| 62 | + And I see a form error "Pounds must be in whole numbers" |
| 63 | + When I fill in and submit my weight with "3" stone and "12" pounds |
| 64 | + Then I am on "/weight?unit=imperial" |
| 65 | + And I see a form error "Weight must be between 4 stone and 50 stone" |
| 66 | + When I fill in and submit my weight with "50" stone and "1" pound |
| 67 | + Then I am on "/weight?unit=imperial" |
| 68 | + And I see a form error "Weight must be between 4 stone and 50 stone" |
| 69 | + |
| 70 | + Scenario: Sex at birth form errors |
| 71 | + Given I have started the questionnaire |
| 72 | + When I go to "/sex-at-birth" |
| 73 | + And I submit the form |
| 74 | + Then I am on "/sex-at-birth" |
| 75 | + And I see a form error "Select your sex at birth." |
| 76 | + |
| 77 | + Scenario: Gender form errors |
| 78 | + Given I have started the questionnaire |
| 79 | + When I go to "/gender" |
| 80 | + And I submit the form |
| 81 | + Then I am on "/gender" |
| 82 | + And I see a form error "Select the option that best describes your gender." |
| 83 | + |
| 84 | + Scenario: Ethnicity form errors |
| 85 | + Given I have started the questionnaire |
| 86 | + When I go to "/ethnicity" |
| 87 | + And I submit the form |
| 88 | + Then I am on "/ethnicity" |
| 89 | + And I see a form error "Select your ethnic background." |
0 commit comments