From 14b5f42c7cb75e8689ecccada084183e50cc35d2 Mon Sep 17 00:00:00 2001 From: Will Daly Date: Fri, 18 Oct 2013 09:54:49 -0400 Subject: [PATCH] Added explicit wait to avoid reading default grading value --- cms/djangoapps/contentstore/features/grading.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cms/djangoapps/contentstore/features/grading.py b/cms/djangoapps/contentstore/features/grading.py index dcc11857d8..9f1aa6b269 100644 --- a/cms/djangoapps/contentstore/features/grading.py +++ b/cms/djangoapps/contentstore/features/grading.py @@ -195,8 +195,12 @@ def i_change_grace_period(_step, grace_period): @step(u'I see the grace period is "(.*)"$') def the_grace_period_is(_step, grace_period): grace_period_css = '#course-grading-graceperiod' - ele = world.css_find(grace_period_css).first - assert_equal(ele.value, grace_period) + + # The default value is 00:00 + # so we need to wait for it to change + world.wait_for( + lambda _: world.css_has_value(grace_period_css, grace_period) + ) def get_type_index(name):