From b7856d96bfd87cc1ed97268ecfdd50ed29e0f842 Mon Sep 17 00:00:00 2001 From: Will Daly Date: Mon, 7 Oct 2013 17:44:16 -0400 Subject: [PATCH] Use wait_for to allow course image time to update --- cms/djangoapps/contentstore/features/course-settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cms/djangoapps/contentstore/features/course-settings.py b/cms/djangoapps/contentstore/features/course-settings.py index 7ec6a1071a..f92df428ef 100644 --- a/cms/djangoapps/contentstore/features/course-settings.py +++ b/cms/djangoapps/contentstore/features/course-settings.py @@ -151,9 +151,10 @@ def i_see_new_course_image(_step): assert len(images) == 1 img = images[0] expected_src = '/c4x/MITx/999/asset/image.jpg' + # Don't worry about the domain in the URL - assert img['src'].endswith(expected_src), "Was looking for {expected}, found {actual}".format( - expected=expected_src, actual=img['src']) + success_func = lambda _: img['src'].endswith(expected_src) + world.wait_for(success_func) @step('the image URL should be present in the field')