Add acceptance test for XML-only video content.
Since we've had issues with the default video being incorrectly shown, this creates an XML-only video and ensures that the correct (non-default) Youtube ID is sent to the client.
This commit is contained in:
@@ -47,3 +47,7 @@ Feature: Video Component
|
||||
Given I have created a Video Alpha component
|
||||
And I have set "show captions" to True
|
||||
Then when I view the videoalpha it does show the captions
|
||||
|
||||
Scenario: Video data is shown correctly
|
||||
Given I have created a video with only XML data
|
||||
Then the correct Youtube video is shown
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
from lettuce import world, step
|
||||
from terrain.steps import reload_the_page
|
||||
from xmodule.modulestore import Location
|
||||
from contentstore.utils import get_modulestore
|
||||
|
||||
|
||||
############### ACTIONS ####################
|
||||
|
||||
@@ -44,3 +47,39 @@ def videoalpha_name_persisted(step):
|
||||
reload_the_page(step)
|
||||
world.edit_component()
|
||||
world.verify_setting_entry(world.get_setting_entry('Display Name'), 'Display Name', '3.4', True)
|
||||
|
||||
|
||||
@step('I have created a video with only XML data')
|
||||
def xml_only_video(step):
|
||||
# Create a new video *without* metadata. This requires a certain
|
||||
# amount of rummaging to make sure all the correct data is present
|
||||
step.given('I have clicked the new unit button')
|
||||
|
||||
# Wait for the new unit to be created and to load the page
|
||||
world.wait(1)
|
||||
|
||||
location = world.scenario_dict['COURSE'].location
|
||||
store = get_modulestore(location)
|
||||
|
||||
parent_location = store.get_items(Location(category='vertical', revision='draft'))[0].location
|
||||
|
||||
youtube_id = 'ABCDEFG'
|
||||
world.scenario_dict['YOUTUBE_ID'] = youtube_id
|
||||
|
||||
# Create a new Video component, but ensure that it doesn't have
|
||||
# metadata. This allows us to test that we are correctly parsing
|
||||
# out XML
|
||||
video = world.ItemFactory.create(
|
||||
parent_location=parent_location,
|
||||
category='video',
|
||||
data='<video youtube="1.00:%s"></video>' % youtube_id
|
||||
)
|
||||
|
||||
# Refresh to see the new video
|
||||
reload_the_page(step)
|
||||
|
||||
|
||||
@step('The correct Youtube video is shown')
|
||||
def the_youtube_video_is_shown(_step):
|
||||
ele = world.css_find('.video').first
|
||||
assert ele['data-youtube-id-1-0'] == world.scenario_dict['YOUTUBE_ID']
|
||||
|
||||
Reference in New Issue
Block a user