From e54ce295879866243639d7757914084f90b116f0 Mon Sep 17 00:00:00 2001 From: Ben Patterson Date: Tue, 9 Jun 2015 07:33:42 -0400 Subject: [PATCH] Fix flaky lettuce test. TE-572. This should be ported to bok-choy, but until then we should fix the flakiness in this test. It needs to wait for the page to change after the user clicks 'reset'. --- lms/djangoapps/courseware/features/problems.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lms/djangoapps/courseware/features/problems.py b/lms/djangoapps/courseware/features/problems.py index bdf2d9e3f3..5dc0b6f8ab 100644 --- a/lms/djangoapps/courseware/features/problems.py +++ b/lms/djangoapps/courseware/features/problems.py @@ -172,8 +172,10 @@ def assert_answer_mark(_step, problem_type, isnt_marked, correctness): # At least one of the correct selectors should be present for sel in PROBLEM_DICT[problem_type][correctness]: if bool(isnt_marked): + world.wait_for(lambda _: world.is_css_not_present(sel)) # pylint: disable=cell-var-from-loop has_expected = world.is_css_not_present(sel) else: + world.css_find(sel) # css_find includes a wait_for pattern has_expected = world.is_css_present(sel) # As soon as we find the selector, break out of the loop