Skip to content

Commit 125f415

Browse files
committed
Add feature spec for age range exit
1 parent 005ef72 commit 125f415

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Feature: Not in age range
2+
Scenario: Participants outside age range are not elligible
3+
Given I have started the questionnaire
4+
When I go to "/date-of-birth"
5+
And I fill in and submit my date of birth with "01-01-1900"
6+
Then I am on "/age-range-exit"
7+
And I see a title "You do not need an NHS lung health check"

tests/features/steps/form_steps.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,11 @@ def when_I_submit_my_participant_id(context):
1010
def when_I_fill_in_and_submit_my_smoking_status(context, smoking_status):
1111
context.page.get_by_label(smoking_status).check()
1212
context.page.click("text=Continue")
13+
14+
@when('I fill in and submit my date of birth with "{date_of_birth}"')
15+
def when_I_fill_in_and_submit_my_date_of_birth(context, date_of_birth):
16+
day, month, year = date_of_birth.split('-')
17+
context.page.get_by_label('Day').fill(day)
18+
context.page.get_by_label('Month').fill(month)
19+
context.page.get_by_label('Year').fill(year)
20+
context.page.click("text=Continue")

0 commit comments

Comments
 (0)