courses.py 1.55 KB
Newer Older
1 2 3 4
from lettuce import world, step
from common import *

############### ACTIONS ####################
Calen Pennington committed
5 6


7 8 9 10
@step('There are no courses$')
def no_courses(step):
    clear_courses()

Calen Pennington committed
11

12 13 14 15
@step('I click the New Course button$')
def i_click_new_course(step):
    css_click('.new-course-button')

Calen Pennington committed
16

17 18 19 20
@step('I fill in the new course information$')
def i_fill_in_a_new_course_information(step):
    fill_in_course_info()

Calen Pennington committed
21

22 23 24 25
@step('I create a new course$')
def i_create_a_course(step):
    create_a_course()

Calen Pennington committed
26

27 28 29 30 31 32
@step('I click the course link in My Courses$')
def i_click_the_course_link_in_my_courses(step):
    course_css = 'span.class-name'
    css_click(course_css)

############ ASSERTIONS ###################
Calen Pennington committed
33 34


35 36
@step('the Courseware page has loaded in Studio$')
def courseware_page_has_loaded_in_studio(step):
37 38
    course_title_css = 'span.course-title'
    assert world.browser.is_element_present_by_css(course_title_css)
39

Calen Pennington committed
40

41 42 43
@step('I see the course listed in My Courses$')
def i_see_the_course_in_my_courses(step):
    course_css = 'span.class-name'
Calen Pennington committed
44 45
    assert_css_with_text(course_css, 'Robot Super Course')

46 47 48 49

@step('the course is loaded$')
def course_is_loaded(step):
    class_css = 'a.class-name'
Calen Pennington committed
50 51
    assert_css_with_text(class_css, 'Robot Super Course')

52 53 54 55

@step('I am on the "([^"]*)" tab$')
def i_am_on_tab(step, tab_name):
    header_css = 'div.inner-wrapper h1'
Calen Pennington committed
56 57
    assert_css_with_text(header_css, tab_name)

58 59 60 61

@step('I see a link for adding a new section$')
def i_see_new_section_link(step):
    link_css = 'a.new-courseware-section-button'
Calen Pennington committed
62
    assert_css_with_text(link_css, 'New Section')