From c58e5142312a18336a2da78a03119c8189cccb90 Mon Sep 17 00:00:00 2001 From: Ben Patterson Date: Wed, 8 Feb 2017 09:17:54 -0500 Subject: [PATCH] Properly wait for LTI stub's buttons to render --- common/djangoapps/terrain/stubs/lti.py | 6 +++--- lms/djangoapps/courseware/features/lti.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/djangoapps/terrain/stubs/lti.py b/common/djangoapps/terrain/stubs/lti.py index edb6137d7e..fd43cef180 100644 --- a/common/djangoapps/terrain/stubs/lti.py +++ b/common/djangoapps/terrain/stubs/lti.py @@ -191,13 +191,13 @@ class StubLtiHandler(StubHttpRequestHandler): if submit_url: submit_form = textwrap.dedent("""
- +
- +
- +
""").format(submit_url=submit_url) else: diff --git a/lms/djangoapps/courseware/features/lti.py b/lms/djangoapps/courseware/features/lti.py index 97d1cdce95..fa2250f9ff 100644 --- a/lms/djangoapps/courseware/features/lti.py +++ b/lms/djangoapps/courseware/features/lti.py @@ -359,6 +359,7 @@ def click_grade(_step, version): location = world.scenario_dict['LTI'].location.html_id() iframe_name = 'ltiFrame-' + location with world.browser.get_iframe(iframe_name) as iframe: + world.wait_for_visible('#' + version_map[version]['selector']) iframe.find_by_name(version_map[version]['selector']).first.click() assert iframe.is_text_present(version_map[version]['expected_text'])