Added missing file.~ Undid a mistake. Copied Python tests from video_alpha1. moves TestLogic to __init__.py reorginizes xmodule logic tests adds docstrings for poll tests adds docstring for word cloud and conditional tests adds docstrings for video alpha tests adds videoalphafactory for tests, not finished adds imports Bug fixing. fix video/videoalpha tests Updated lettuce test. Now it is aware of the fact that Video and Video Alpha players have different base CSS classes. Removed REFACTOR comments. Turn off autoplay for Video Alpha in Studio. Carry over fix for bug where in Firefox changing to speed 1.0 has no effect. Carry over JavaScript Jasmine tests from jmclaus/videoalpha2_js branch. Exporting state object from main function of Video Alpha. More stuff from jmclaus/videoalpha2_js branch. Specs in html5_video.js all pass except ten of them. Cleaned code a bit and moved it out of display_spec.js One more spec passes Fixed remaning tests in spec/../html5_video.js test suite. Removed test video files. Added JavaScript Jasmine tests for main of Video Alpha 2. adds test for volume control and updates helper file for videoalpha
61 lines
2.2 KiB
Python
61 lines
2.2 KiB
Python
#pylint: disable=C0111
|
|
|
|
from lettuce import world, step
|
|
from lettuce.django import django_url
|
|
from common import i_am_registered_for_the_course, section_location
|
|
|
|
############### ACTIONS ####################
|
|
|
|
|
|
@step('when I view the video it has autoplay enabled')
|
|
def does_autoplay_video(_step):
|
|
assert(world.css_find('.video')[0]['data-autoplay'] == 'True')
|
|
|
|
|
|
@step('when I view the videoalpha it has autoplay enabled')
|
|
def does_autoplay_videoalpha(_step):
|
|
assert(world.css_find('.videoalpha')[0]['data-autoplay'] == 'True')
|
|
|
|
|
|
@step('the course has a Video component')
|
|
def view_video(_step):
|
|
coursenum = 'test_course'
|
|
i_am_registered_for_the_course(step, coursenum)
|
|
|
|
# Make sure we have a video
|
|
add_video_to_course(coursenum)
|
|
chapter_name = world.scenario_dict['SECTION'].display_name.replace(" ", "_")
|
|
section_name = chapter_name
|
|
url = django_url('/courses/%s/%s/%s/courseware/%s/%s' %
|
|
(world.scenario_dict['COURSE'].org, world.scenario_dict['COURSE'].number, world.scenario_dict['COURSE'].display_name.replace(' ', '_'),
|
|
chapter_name, section_name,))
|
|
world.browser.visit(url)
|
|
|
|
|
|
@step('the course has a VideoAlpha component')
|
|
def view_videoalpha(step):
|
|
coursenum = 'test_course'
|
|
i_am_registered_for_the_course(step, coursenum)
|
|
|
|
# Make sure we have a videoalpha
|
|
add_videoalpha_to_course(coursenum)
|
|
chapter_name = world.scenario_dict['SECTION'].display_name.replace(" ", "_")
|
|
section_name = chapter_name
|
|
url = django_url('/courses/%s/%s/%s/courseware/%s/%s' %
|
|
(world.scenario_dict['COURSE'].org, world.scenario_dict['COURSE'].number, world.scenario_dict['COURSE'].display_name.replace(' ', '_'),
|
|
chapter_name, section_name,))
|
|
world.browser.visit(url)
|
|
|
|
|
|
def add_video_to_course(course):
|
|
world.ItemFactory.create(parent_location=section_location(course),
|
|
category='video',
|
|
display_name='Video')
|
|
|
|
|
|
def add_videoalpha_to_course(course):
|
|
category = 'videoalpha'
|
|
world.ItemFactory.create(parent_location=section_location(course),
|
|
category=category,
|
|
display_name='Video Alpha')
|