From 9cce3a9a0716c4903237164137dcf01fb7b244f4 Mon Sep 17 00:00:00 2001 From: JonahStanley Date: Fri, 2 Aug 2013 14:57:22 -0400 Subject: [PATCH] Cleaned up some tests and made them work for firefox --- cms/djangoapps/contentstore/features/course-team.py | 6 +++--- cms/djangoapps/contentstore/features/static-pages.py | 10 +++------- cms/djangoapps/contentstore/features/textbooks.py | 6 ++++++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cms/djangoapps/contentstore/features/course-team.py b/cms/djangoapps/contentstore/features/course-team.py index 2871d7a7af..c5c20fe396 100644 --- a/cms/djangoapps/contentstore/features/course-team.py +++ b/cms/djangoapps/contentstore/features/course-team.py @@ -42,9 +42,9 @@ def add_other_user(_step, name): world.wait(0.5) email_css = 'input#user-email-input' - f = world.css_find(email_css) - f._element.send_keys(name, EMAIL_EXTENSION) - + world.css_fill(email_css, name + EMAIL_EXTENSION) + world.trigger_event(email_css) + from pdb import set_trace;set_trace() confirm_css = 'form.create-user button.action-primary' world.css_click(confirm_css) diff --git a/cms/djangoapps/contentstore/features/static-pages.py b/cms/djangoapps/contentstore/features/static-pages.py index 20473721a4..d3244955e1 100644 --- a/cms/djangoapps/contentstore/features/static-pages.py +++ b/cms/djangoapps/contentstore/features/static-pages.py @@ -41,13 +41,9 @@ def change_name(_step, new_name): settings_css = '#settings-mode a' world.css_click(settings_css) input_css = 'input.setting-input' - name_input = world.css_find(input_css) - if world.is_mac(): - name_input._element.send_keys(Keys.COMMAND + 'a') - else: - name_input._element.send_keys(Keys.CONTROL + 'a') - name_input._element.send_keys(Keys.DELETE) - name_input._element.send_keys(new_name) + world.css_fill(input_css, new_name) + if world.is_firefox(): + world.trigger_event(input_css) save_button = 'a.save-button' world.css_click(save_button) diff --git a/cms/djangoapps/contentstore/features/textbooks.py b/cms/djangoapps/contentstore/features/textbooks.py index 31e628a0b2..d9c08ec6eb 100644 --- a/cms/djangoapps/contentstore/features/textbooks.py +++ b/cms/djangoapps/contentstore/features/textbooks.py @@ -45,6 +45,8 @@ def click_new_textbook(_step, on): def name_textbook(_step, name): input_css = ".textbook input[name=textbook-name]" world.css_fill(input_css, name) + if world.is_firefox(): + world.trigger_event(input_css) @step(u'I name the (first|second|third) chapter "([^"]*)"') @@ -52,6 +54,8 @@ def name_chapter(_step, ordinal, name): index = ["first", "second", "third"].index(ordinal) input_css = ".textbook .chapter{i} input.chapter-name".format(i=index+1) world.css_fill(input_css, name) + if world.is_firefox(): + world.trigger_event(input_css) @step(u'I type in "([^"]*)" for the (first|second|third) chapter asset') @@ -59,6 +63,8 @@ def asset_chapter(_step, name, ordinal): index = ["first", "second", "third"].index(ordinal) input_css = ".textbook .chapter{i} input.chapter-asset-path".format(i=index+1) world.css_fill(input_css, name) + if world.is_firefox(): + world.trigger_event(input_css) @step(u'I click the Upload Asset link for the (first|second|third) chapter')