Skip to content

Commit 57ad291

Browse files
committed
Ensure behave step methods only contain lower case chars
1 parent 3804ad5 commit 57ad291

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

tests/features/steps/error_steps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44

55
@then(u'I see an error summary "{error_summary}"')
6-
def then_I_see_an_error_summary(context, error_summary):
6+
def then_i_see_an_error_summary(context, error_summary):
77
expect(context.page.locator('.nhsuk-error-summary')).to_contain_text(error_summary)
88

99
@then(u'I see a form error "{error_message}"')
10-
def then_I_see_a_form_error(context, error_message):
10+
def then_i_see_a_form_error(context, error_message):
1111
expect(context.page.locator('.nhsuk-error-message')).to_contain_text(error_message)

tests/features/steps/form_steps.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,47 @@
44

55

66
@when('I submit my participant id')
7-
def when_I_submit_my_participant_id(context):
7+
def when_i_submit_my_participant_id(context):
88
if not hasattr(context, 'participant_id'):
99
context.participant_id = 'abc123'
1010
context.page.fill('input[name="participant_id"]', context.participant_id)
1111
context.page.click('button[type="submit"]')
1212

1313
@when('I fill in and submit my smoking status with "{smoking_status}"')
14-
def when_I_fill_in_and_submit_my_smoking_status(context, smoking_status):
14+
def when_i_fill_in_and_submit_my_smoking_status(context, smoking_status):
1515
context.page.get_by_label(smoking_status).check()
1616
context.page.click("text=Continue")
1717

1818
@when('I fill in and submit my date of birth with "{date_of_birth}"')
19-
def when_I_fill_in_and_submit_my_date_of_birth(context, date_of_birth):
19+
def when_i_fill_in_and_submit_my_date_of_birth(context, date_of_birth):
2020
day, month, year = date_of_birth.split('-')
2121
context.page.get_by_label('Day').fill(day)
2222
context.page.get_by_label('Month').fill(month)
2323
context.page.get_by_label('Year').fill(year)
2424
context.page.click("text=Continue")
2525

2626
@when(u'I fill in and submit my date of birth as {years} years ago')
27-
def when_I_fill_in_and_submit_my_date_of_birth_as_x_years_ago(context, years):
27+
def when_i_fill_in_and_submit_my_date_of_birth_as_x_years_ago(context, years):
2828
date_of_birth = datetime.now() - relativedelta(years=int(years))
2929
context.page.get_by_label('Day').fill(str(date_of_birth.day))
3030
context.page.get_by_label('Month').fill(str(date_of_birth.month))
3131
context.page.get_by_label('Year').fill(str(date_of_birth.year))
3232
context.page.click("text=Continue")
3333

3434
@when(u'I fill in and submit my height with "{height}"')
35-
def when_I_fill_in_and_submit_my_height(context, height):
35+
def when_i_fill_in_and_submit_my_height(context, height):
3636
context.page.get_by_label('Centimetre').fill(height)
3737
context.page.click("text=Continue")
3838

3939
@when(u'I fill in and submit my height with "{feet}" feet and "{inches}" inch')
4040
@when(u'I fill in and submit my height with "{feet}" feet and "{inches}" inches')
41-
def when_I_fill_in_and_submit_my_height_with_feet_and_inches(context, feet, inches):
41+
def when_i_fill_in_and_submit_my_height_with_feet_and_inches(context, feet, inches):
4242
context.page.get_by_label('Feet').fill(feet)
4343
context.page.get_by_label('Inches').fill(inches)
4444
context.page.click("text=Continue")
4545

4646
@when(u'I fill in and submit my weight with "{weight}"')
47-
def when_I_fill_in_and_submit_my_weight(context, weight):
47+
def when_i_fill_in_and_submit_my_weight(context, weight):
4848
context.page.get_by_label('Kilograms').fill(weight)
4949
context.page.click("text=Continue")
5050

@@ -56,31 +56,31 @@ def stone_and_pounds(context, stone, pounds):
5656
context.page.click("text=Continue")
5757

5858
@when(u'I fill in and submit my sex at birth with "{sex_at_birth}"')
59-
def when_I_fill_in_and_submit_my_sex_at_birth(context, sex_at_birth):
59+
def when_i_fill_in_and_submit_my_sex_at_birth(context, sex_at_birth):
6060
context.page.get_by_label(sex_at_birth, exact=True).check()
6161
context.page.click("text=Continue")
6262

6363
@when(u'I fill in and submit my gender with "{gender}"')
64-
def when_I_fill_in_and_submit_my_gender(context, gender):
64+
def when_i_fill_in_and_submit_my_gender(context, gender):
6565
context.page.get_by_label(gender, exact=True).check()
6666
context.page.click("text=Continue")
6767

6868
@when(u'I fill in and submit my ethnicity with "{ethnicity}"')
69-
def when_I_fill_in_and_submit_my_ethnicity(context, ethnicity):
69+
def when_i_fill_in_and_submit_my_ethnicity(context, ethnicity):
7070
context.page.get_by_label(ethnicity, exact=True).check()
7171
context.page.click("text=Continue")
7272

7373
@when(u'I fill in and submit my respiratory conditions with "{condition_a}" and "{condition_b}"')
74-
def when_I_fill_in_and_submit_my_respiratory_conditions(context, condition_a, condition_b):
74+
def when_i_fill_in_and_submit_my_respiratory_conditions(context, condition_a, condition_b):
7575
context.page.get_by_label(condition_a).check()
7676
context.page.get_by_label(condition_b).check()
7777
context.page.click("text=Continue")
7878

7979
@when(u'I fill in and submit my asbestos exposure with "{asbestos_exposure}"')
80-
def when_I_fill_in_and_submit_my_asbestos_exposure(context, asbestos_exposure):
80+
def when_i_fill_in_and_submit_my_asbestos_exposure(context, asbestos_exposure):
8181
context.page.get_by_label(asbestos_exposure, exact=True).check()
8282
context.page.click("text=Continue")
8383

8484
@when('I submit the form')
85-
def when_I_submit_the_form(context):
85+
def when_i_submit_the_form(context):
8686
context.page.click("text=Continue")

tests/features/steps/navigation_steps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33

44

55
@when('I go to "{path}"')
6-
def given_I_go_to(context, path):
6+
def given_i_go_to(context, path):
77
context.page.goto(f"{context.live_server_url}{path}")
88

99
@when('I click "{text}"')
10-
def when_I_click(context, text):
10+
def when_i_click(context, text):
1111
context.page.click(f"text={text}")
1212

1313
@then('I am on "{path}"')
14-
def then_I_am_on(context, path):
14+
def then_i_am_on(context, path):
1515
expect(context.page).to_have_url(f"{context.live_server_url}{path}")

tests/features/steps/page_assertion_steps.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
from dateutil.relativedelta import relativedelta
55

66
@then(u'I see a title "{title}"')
7-
def then_I_see_a_title(context, title):
7+
def then_i_see_a_title(context, title):
88
expect(context.page.locator('.title')).to_have_text(title)
99

1010
@then(u'I see a back link to "{url}"')
11-
def then_I_see_a_back_link_to(context, url):
11+
def then_i_see_a_back_link_to(context, url):
1212
back_link = context.page.locator(".nhsuk-back-link")
1313
expect(back_link).to_have_count(1)
1414
expect(back_link).to_have_attribute("href", url)
1515

1616
@then(u'I see responses "{text}"')
17-
def then_I_see_responses(context, text):
17+
def then_i_see_responses(context, text):
1818
responses = context.page.locator(".responses")
1919
expect(responses).to_contain_text(text)
2020

2121
@then(u'I see responses "{text}" with a date {years} years ago')
22-
def then_I_see_responses_with_a_date(context, text, years):
22+
def then_i_see_responses_with_a_date(context, text, years):
2323
date_of_birth = datetime.now() - relativedelta(years=int(years))
2424
responses = context.page.locator(".responses")
2525
expect(responses).to_contain_text(f"{text} {date_of_birth.strftime('%Y-%m-%d')}")

tests/features/steps/participant_steps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def given_a_participant_exists(context, participant_id):
1010

1111

1212
@given('I have already submitted my responses')
13-
def given_I_have_already_submitted_my_responses(context):
13+
def given_i_have_already_submitted_my_responses(context):
1414
context.participant_id = 'abc123'
1515
participant = Participant.objects.create(unique_id=context.participant_id)
1616
participant.responseset_set.create(

0 commit comments

Comments
 (0)