Commit a15be622 by Ben Patterson Committed by GitHub

Merge pull request #14133 from edx/benp/fix-flaky-video-trans

Flaky video translations test fix.
parents cc91ec7d 4c48e6a3
...@@ -629,14 +629,19 @@ class VideoPage(PageObject): ...@@ -629,14 +629,19 @@ class VideoPage(PageObject):
""" """
self.wait_for_ajax() self.wait_for_ajax()
# TODO remove this sleep and wait for the right thing to finish rendering
time.sleep(1)
# mouse over to transcript button # mouse over to transcript button
cc_button_selector = self.get_element_selector(VIDEO_BUTTONS["transcript"]) cc_button_selector = self.get_element_selector(VIDEO_BUTTONS["transcript_button"])
element_to_hover_over = self.q(css=cc_button_selector).results[0] element_to_hover_over = self.q(css=cc_button_selector).results[0]
ActionChains(self.browser).move_to_element(element_to_hover_over).perform() ActionChains(self.browser).move_to_element(element_to_hover_over).perform()
language_selector = VIDEO_MENUS["language"] + ' li[data-lang-code="{code}"]'.format(code=code) language_selector = VIDEO_MENUS["language"] + ' li[data-lang-code="{code}"]'.format(code=code)
language_selector = self.get_element_selector(language_selector) language_selector = self.get_element_selector(language_selector)
self.wait_for_element_visibility(language_selector, 'language menu is visible') self.wait_for_element_visibility(language_selector, 'language menu is visible')
hover_target = self.q(css=language_selector).results[0]
ActionChains(self.browser).move_to_element(hover_target).perform()
self.q(css=language_selector).first.click() self.q(css=language_selector).first.click()
# Sometimes language is not clicked correctly. So, if the current language code # Sometimes language is not clicked correctly. So, if the current language code
...@@ -887,7 +892,7 @@ class VideoPage(PageObject): ...@@ -887,7 +892,7 @@ class VideoPage(PageObject):
Wait until captions rendered completely. Wait until captions rendered completely.
""" """
captions_rendered_selector = self.get_element_selector(CSS_CLASS_NAMES['captions_rendered']) captions_rendered_selector = self.get_element_selector(CSS_CLASS_NAMES['captions_rendered'])
self.wait_for_element_presence(captions_rendered_selector, 'Captions Rendered') self.wait_for_element_visibility(captions_rendered_selector, 'Captions Rendered')
def wait_for_closed_captions(self): def wait_for_closed_captions(self):
""" """
......
...@@ -1035,6 +1035,8 @@ class Html5VideoTest(VideoBaseTest): ...@@ -1035,6 +1035,8 @@ class Html5VideoTest(VideoBaseTest):
# check if "Welcome to edX." text in the captions # check if "Welcome to edX." text in the captions
self.assertIn('Welcome to edX.', self.video.captions_text) self.assertIn('Welcome to edX.', self.video.captions_text)
self.video.wait_for_element_visibility('.transcript-end', 'Transcript has loaded')
# check if we can download transcript in "srt" format that has text "Welcome to edX." # check if we can download transcript in "srt" format that has text "Welcome to edX."
self.assertTrue(self.video.downloaded_transcript_contains_text('srt', 'Welcome to edX.')) self.assertTrue(self.video.downloaded_transcript_contains_text('srt', 'Welcome to edX.'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment