courseware_common.py 888 Bytes
Newer Older
1 2 3
#pylint: disable=C0111
#pylint: disable=W0621

4 5
from lettuce import world, step

Calen Pennington committed
6

7 8
@step('I click on View Courseware')
def i_click_on_view_courseware(step):
9
    world.css_click('a.enter-course')
10

Calen Pennington committed
11

12
@step('I click on the "([^"]*)" tab$')
13 14
def i_click_on_the_tab(step, tab_text):
    world.click_link(tab_text)
15

16

17 18
@step('I visit the courseware URL$')
def i_visit_the_course_info_url(step):
19
    world.visit('/courses/MITx/6.002x/2012_Fall/courseware')
20

Calen Pennington committed
21

22 23
@step(u'I am on the dashboard page$')
def i_am_on_the_dashboard_page(step):
24 25
    assert world.is_css_present('section.courses')
    assert world.url_equals('/dashboard')
26

Calen Pennington committed
27

28
@step('the "([^"]*)" tab is active$')
29 30
def the_tab_is_active(step, tab_text):
    assert world.css_text('.course-tabs a.active') == tab_text
Calen Pennington committed
31

32

33 34
@step('the login dialog is visible$')
def login_dialog_visible(step):
35
    assert world.css_visible('form#login_form.login_form')