Working on Lettuce tests for video in LMS.
In progress, committing for the great git history rewrite.
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
|
||||
from lettuce import world, step
|
||||
from common import *
|
||||
from nose.tools import assert_equal
|
||||
|
||||
############### ACTIONS ####################
|
||||
|
||||
|
||||
6
lms/djangoapps/courseware/features/video.feature
Normal file
6
lms/djangoapps/courseware/features/video.feature
Normal file
@@ -0,0 +1,6 @@
|
||||
Feature: Video component
|
||||
As a student, I want to view course videos in LMS.
|
||||
|
||||
Scenario: Autoplay is enabled in LMS
|
||||
Given the course has a Video component
|
||||
Then when I view it it does autoplay
|
||||
31
lms/djangoapps/courseware/features/video.py
Normal file
31
lms/djangoapps/courseware/features/video.py
Normal file
@@ -0,0 +1,31 @@
|
||||
#pylint: disable=C0111
|
||||
#pylint: disable=W0621
|
||||
|
||||
from lettuce import world, step
|
||||
from common import *
|
||||
|
||||
############### ACTIONS ####################
|
||||
|
||||
|
||||
@step('when I view it it does autoplay')
|
||||
def does_autoplay(step):
|
||||
assert world.css_find('.video')[0]['data-autoplay'] == 'True'
|
||||
assert world.css_find('.video_control')[0].has_class('pause')
|
||||
|
||||
@step('the course has a Video component')
|
||||
def view_video(step):
|
||||
model_course = 'model_course'
|
||||
coursename = TEST_COURSE_NAME.replace(' ', '_')
|
||||
i_am_registered_for_the_course(step, coursename)
|
||||
# Make sure we have a video
|
||||
video = create_video_component(coursename)
|
||||
url = django_url('/courses/edx/%s/Test_Course/courseware/' % model_course)
|
||||
world.browser.visit(url)
|
||||
print('\n\n\n')
|
||||
print world.browser.html
|
||||
print('\n\n\n')
|
||||
|
||||
|
||||
def create_video_component(course):
|
||||
return world.ItemFactory.create(parent_location=section_location(course),
|
||||
template='i4x://edx/templates/video/default')
|
||||
Reference in New Issue
Block a user