signup.py 1.46 KB
Newer Older
1 2
# pylint: disable=C0111
# pylint: disable=W0621
3

4 5
from lettuce import world, step

Calen Pennington committed
6

7 8
@step('I fill in the registration form$')
def i_fill_in_the_registration_form(step):
9 10 11 12 13 14
    def fill_in_reg_form():
        register_form = world.css_find('form#register_form')
        register_form.find_by_name('email').fill('robot+studio@edx.org')
        register_form.find_by_name('password').fill('test')
        register_form.find_by_name('username').fill('robot-studio')
        register_form.find_by_name('name').fill('Robot Studio')
15
        register_form.find_by_name('terms_of_service').click()
16
    world.retry_on_exception(fill_in_reg_form)
17

Calen Pennington committed
18

19 20
@step('I press the Create My Account button on the registration form$')
def i_press_the_button_on_the_registration_form(step):
Jay Zoldak committed
21
    submit_css = 'form#register_form button#submit'
22
    world.css_click(submit_css)
Calen Pennington committed
23

Will Daly committed
24

25 26 27 28
@step('I should see an email verification prompt')
def i_should_see_an_email_verification_prompt(step):
    world.css_has_text('h1.page-header', u'My Courses')
    world.css_has_text('div.msg h3.title', u'We need to verify your email address')
29 30 31 32 33 34 35 36 37 38


@step(u'I fill in and submit the signin form$')
def i_fill_in_the_signin_form(step):
    def fill_login_form():
        login_form = world.browser.find_by_css('form#login_form')
        login_form.find_by_name('email').fill('robot+studio@edx.org')
        login_form.find_by_name('password').fill('test')
        login_form.find_by_name('submit').click()
    world.retry_on_exception(fill_login_form)