Commit e54ce295 by Ben Patterson

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'.
parent 9a55497e
......@@ -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
......
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