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

5 6
from lettuce import world, step

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 on the "([^"]*)" link$')
def i_click_on_the_link(step, link_text):
    world.click_link(link_text)


23 24
@step('I visit the courseware URL$')
def i_visit_the_course_info_url(step):
25
    world.visit('/courses/MITx/6.002x/2012_Fall/courseware')
26

Calen Pennington committed
27

28 29
@step(u'I am on the dashboard page$')
def i_am_on_the_dashboard_page(step):
30 31
    assert world.is_css_present('section.courses')
    assert world.url_equals('/dashboard')
32

Calen Pennington committed
33

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

38

39 40
@step('the login dialog is visible$')
def login_dialog_visible(step):
41
    assert world.css_visible('form#login_form.login_form')