signup.py 954 Bytes
Newer Older
1 2
from lettuce import world, step

Calen Pennington committed
3

4 5 6 7 8 9
@step('I fill in "([^"]*)" on the registration form with "([^"]*)"$')
def when_i_fill_in_field_on_the_registration_form_with_value(step, field, value):
    register_form = world.browser.find_by_css('form#register_form')
    form_field = register_form.find_by_name(field)
    form_field.fill(value)

Calen Pennington committed
10

11 12 13 14 15
@step('I press the "([^"]*)" button on the registration form$')
def i_press_the_button_on_the_registration_form(step, button):
    register_form = world.browser.find_by_css('form#register_form')
    register_form.find_by_value(button).click()

Calen Pennington committed
16

17 18 19 20
@step('I check the checkbox named "([^"]*)"$')
def i_check_checkbox(step, checkbox):
    world.browser.find_by_name(checkbox).check()

Calen Pennington committed
21

22 23 24 25
@step('I should see "([^"]*)" in the dashboard banner$')
def i_should_see_text_in_the_dashboard_banner_section(step, text):
    css_selector = "section.dashboard-banner h2"
    assert (text in world.browser.find_by_css(css_selector).text)