From 973d5e653df5bf2fad92ce1736e8edde9d54a7b9 Mon Sep 17 00:00:00 2001 From: JonahStanley Date: Fri, 2 Aug 2013 15:25:14 -0400 Subject: [PATCH] Fixed issue of firefox behaving differently for erroneous input Removed set traces --- cms/djangoapps/contentstore/features/common.py | 4 ++++ cms/djangoapps/contentstore/features/problem-editor.py | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/features/common.py b/cms/djangoapps/contentstore/features/common.py index b3b7ff3115..3377c04850 100644 --- a/cms/djangoapps/contentstore/features/common.py +++ b/cms/djangoapps/contentstore/features/common.py @@ -197,11 +197,15 @@ def add_subsection(name='Subsection One'): def set_date_and_time(date_css, desired_date, time_css, desired_time): world.css_fill(date_css, desired_date) + if world.is_firefox(): + world.trigger_event(date_css) # hit TAB to get to the time field e = world.css_find(date_css).first # pylint: disable=W0212 e._element.send_keys(Keys.TAB) world.css_fill(time_css, desired_time) + if world.is_firefox(): + world.trigger_event(time_css) e = world.css_find(time_css).first e._element.send_keys(Keys.TAB) time.sleep(float(1)) diff --git a/cms/djangoapps/contentstore/features/problem-editor.py b/cms/djangoapps/contentstore/features/problem-editor.py index 284d4fa41d..f155af6c16 100644 --- a/cms/djangoapps/contentstore/features/problem-editor.py +++ b/cms/djangoapps/contentstore/features/problem-editor.py @@ -130,13 +130,18 @@ def set_the_weight_to_abc(step, bad_weight): world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT), PROBLEM_WEIGHT, "", True) world.save_component_and_reopen(step) # But no change was actually ever sent to the model, so on reopen, explicitly_set is False - world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT), PROBLEM_WEIGHT, "", False) + if world.is_firefox(): + world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT), PROBLEM_WEIGHT, "", True) + else: + world.verify_setting_entry(world.get_setting_entry(PROBLEM_WEIGHT), PROBLEM_WEIGHT, "", False) @step('if I set the max attempts to "(.*)", it displays initially as "(.*)", and is persisted as "(.*)"') def set_the_max_attempts(step, max_attempts_set, max_attempts_displayed, max_attempts_persisted): index = world.get_setting_entry_index(MAXIMUM_ATTEMPTS) world.css_fill('.wrapper-comp-setting .setting-input', max_attempts_set, index=index) + if world.is_firefox(): + world.trigger_event('.wrapper-comp-setting .setting-input', index=index) world.verify_setting_entry(world.get_setting_entry(MAXIMUM_ATTEMPTS), MAXIMUM_ATTEMPTS, max_attempts_displayed, True) world.save_component_and_reopen(step) world.verify_setting_entry(world.get_setting_entry(MAXIMUM_ATTEMPTS), MAXIMUM_ATTEMPTS, max_attempts_persisted, True) @@ -222,6 +227,8 @@ def verify_unset_display_name(): def set_weight(weight): index = world.get_setting_entry_index(PROBLEM_WEIGHT) world.css_fill('.wrapper-comp-setting .setting-input', weight, index=index) + if world.is_firefox(): + world.trigger_event('.wrapper-comp-setting .setting-input', index=index) def open_high_level_source():