courseware_common.py 1.16 KB
Newer Older
1
# pylint: disable=missing-docstring
2
# pylint: disable=redefined-outer-name
3
# pylint: disable=unused-argument
4

5
from lettuce import step, world
6

Calen Pennington committed
7

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

Calen Pennington committed
12

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

17

18 19 20 21 22
@step('I click the "([^"]*)" button$')
def i_click_on_the_button(step, data_attr):
    world.click_button(data_attr)


23 24 25 26 27
@step('I click on the "([^"]*)" link$')
def i_click_on_the_link(step, link_text):
    world.click_link(link_text)


28 29
@step('I visit the courseware URL$')
def i_visit_the_course_info_url(step):
30
    world.visit('/courses/MITx/6.002x/2012_Fall/courseware')
31

Calen Pennington committed
32

33 34
@step(u'I am on the dashboard page$')
def i_am_on_the_dashboard_page(step):
35 36
    assert world.is_css_present('section.courses')
    assert world.url_equals('/dashboard')
37

Calen Pennington committed
38

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

43

44 45
@step('the login dialog is visible$')
def login_dialog_visible(step):
46
    assert world.css_visible('form#login_form.login_form')