courses.py 1.61 KB
Newer Older
1 2 3
#pylint: disable=C0111
#pylint: disable=W0621

4 5 6 7
from lettuce import world, step
from common import *

############### ACTIONS ####################
Calen Pennington committed
8 9


10 11
@step('There are no courses$')
def no_courses(step):
12
    world.clear_courses()
13

Calen Pennington committed
14

15 16
@step('I click the New Course button$')
def i_click_new_course(step):
17
    world.css_click('.new-course-button')
18

Calen Pennington committed
19

20 21 22 23
@step('I fill in the new course information$')
def i_fill_in_a_new_course_information(step):
    fill_in_course_info()

Calen Pennington committed
24

25 26 27 28
@step('I create a new course$')
def i_create_a_course(step):
    create_a_course()

Calen Pennington committed
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'
33
    world.css_click(course_css)
34 35

############ ASSERTIONS ###################
Calen Pennington committed
36 37


38 39
@step('the Courseware page has loaded in Studio$')
def courseware_page_has_loaded_in_studio(step):
40
    course_title_css = 'span.course-title'
41
    assert world.is_css_present(course_title_css)
42

Calen Pennington committed
43

44 45 46
@step('I see the course listed in My Courses$')
def i_see_the_course_in_my_courses(step):
    course_css = 'span.class-name'
47
    assert world.css_has_text(course_css, 'Robot Super Course')
48

Will Daly committed
49

50 51 52
@step('the course is loaded$')
def course_is_loaded(step):
    class_css = 'a.class-name'
53
    assert world.css_has_text(course_css, 'Robot Super Cousre')
Calen Pennington committed
54

55 56 57 58

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

61 62 63 64

@step('I see a link for adding a new section$')
def i_see_new_section_link(step):
    link_css = 'a.new-courseware-section-button'
David Baumgold committed
65
    assert world.css_has_text(link_css, 'New Section')