From d86502bdc1ed0c6bfe2e1de68ce5d7ba7209870e Mon Sep 17 00:00:00 2001 From: JonahStanley Date: Wed, 3 Jul 2013 15:42:55 -0400 Subject: [PATCH] Added in a retry for checking the class of the video --- cms/djangoapps/contentstore/features/common.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/features/common.py b/cms/djangoapps/contentstore/features/common.py index 5a8e02f168..820c643f9e 100644 --- a/cms/djangoapps/contentstore/features/common.py +++ b/cms/djangoapps/contentstore/features/common.py @@ -223,7 +223,13 @@ def shows_captions(step, show_captions): # Prevent cookies from overriding course settings world.browser.cookies.delete('hide_captions') if show_captions == 'does not': - assert world.css_find('.video')[0].has_class('closed') + attempt = 0 + while attempt < 5: + try: + assert world.css_find('.video')[0].has_class('closed') + except: + attempt += 1 + assert_true(attempt < 5, "There was a stale reference exception in accessing the class of the video") else: assert world.is_css_not_present('.video.closed')