diff --git a/cms/djangoapps/contentstore/features/common.py b/cms/djangoapps/contentstore/features/common.py index 648ca680b9..8ed010223a 100644 --- a/cms/djangoapps/contentstore/features/common.py +++ b/cms/djangoapps/contentstore/features/common.py @@ -252,7 +252,7 @@ def save_button_disabled(step): @step('I confirm the prompt') def confirm_the_prompt(step): prompt_css = 'a.button.action-primary' - world.css_click(prompt_css) + world.css_click(prompt_css, success_condition=lambda: not world.css_visible(prompt_css)) @step(u'I am shown a (.*)$') @@ -262,6 +262,7 @@ def i_am_shown_a_notification(step, notification_type): def type_in_codemirror(index, text): world.css_click(".CodeMirror", index=index) + world.browser.execute_script("$('div.CodeMirror.CodeMirror-focused > div').css('overflow', '')") g = world.css_find("div.CodeMirror.CodeMirror-focused > div > textarea") if world.is_mac(): g._element.send_keys(Keys.COMMAND + 'a') diff --git a/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py b/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py index 8a8f6deb04..513eb699e9 100644 --- a/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py +++ b/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py @@ -12,6 +12,10 @@ def create_component_instance(step, component_button_css, category, has_multiple_templates=True): click_new_component_button(step, component_button_css) + if category in ('problem', 'html'): + def animation_done(_driver): + return world.browser.evaluate_script("$('div.new-component').css('display')") == 'none' + world.wait_for(animation_done) if has_multiple_templates: click_component_from_menu(category, boilerplate, expected_css) @@ -22,6 +26,7 @@ def create_component_instance(step, component_button_css, category, "Component instance with css {css} was not created successfully".format(css=expected_css)) + @world.absorb def click_new_component_button(step, component_button_css): step.given('I have clicked the new unit button') @@ -43,11 +48,13 @@ def click_component_from_menu(category, boilerplate, expected_css): elem_css = "a[data-category='{}']:not([data-boilerplate])".format(category) elements = world.css_find(elem_css) assert_equal(len(elements), 1) - world.css_click(elem_css) + world.wait_for(lambda _driver: world.css_visible(elem_css)) + world.css_click(elem_css, success_condition=lambda: 1 == len(world.css_find(expected_css))) @world.absorb def edit_component_and_select_settings(): + world.wait_for(lambda _driver: world.css_visible('a.edit-button')) world.css_click('a.edit-button') world.css_click('#settings-mode') diff --git a/cms/djangoapps/contentstore/features/problem-editor.py b/cms/djangoapps/contentstore/features/problem-editor.py index 565a35f802..d7ccb557ba 100644 --- a/cms/djangoapps/contentstore/features/problem-editor.py +++ b/cms/djangoapps/contentstore/features/problem-editor.py @@ -155,6 +155,10 @@ def cancel_does_not_save_changes(step): @step('I have created a LaTeX Problem') def create_latex_problem(step): world.click_new_component_button(step, '.large-problem-icon') + + def animation_done(_driver): + return world.browser.evaluate_script("$('div.new-component').css('display')") == 'none' + world.wait_for(animation_done) # Go to advanced tab. world.css_click('#ui-id-2') world.click_component_from_menu("problem", "latex_problem.yaml", '.xmodule_CapaModule') diff --git a/cms/djangoapps/contentstore/features/upload.py b/cms/djangoapps/contentstore/features/upload.py index 0c700956e3..df63b26b3b 100644 --- a/cms/djangoapps/contentstore/features/upload.py +++ b/cms/djangoapps/contentstore/features/upload.py @@ -58,7 +58,7 @@ def delete_file(_step, file_name): world.css_click(delete_css, index=index) prompt_confirm_css = 'li.nav-item > a.action-primary' - world.css_click(prompt_confirm_css) + world.css_click(prompt_confirm_css, success_condition=lambda: not world.css_visible(prompt_confirm_css)) @step(u'I should see only one "([^"]*)"$') diff --git a/cms/djangoapps/contentstore/features/video-editor.py b/cms/djangoapps/contentstore/features/video-editor.py index 93d638e621..6113f42c91 100644 --- a/cms/djangoapps/contentstore/features/video-editor.py +++ b/cms/djangoapps/contentstore/features/video-editor.py @@ -19,5 +19,6 @@ def i_see_the_correct_settings_and_values(step): @step('I have set "show captions" to (.*)') def set_show_captions(step, setting): world.css_click('a.edit-button') + world.wait_for(lambda _driver: world.css_visible('a.save-button')) world.browser.select('Show Captions', setting) world.css_click('a.save-button') diff --git a/doc/testing.md b/doc/testing.md index cfca297f2b..b060336d1d 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -186,8 +186,8 @@ uses [Selenium](http://docs.seleniumhq.org/) to control the Chrome browser. **Prerequisite**: You must have [ChromeDriver](https://code.google.com/p/selenium/wiki/ChromeDriver) installed to run the tests in Chrome. The tests are confirmed to run -with Chrome (not Chromium) version 26.0.0.1410.63 with ChromeDriver -version r195636. +with Chrome (not Chromium) version 28.0.1500.71 with ChromeDriver +version 2.1.210398. To run all the acceptance tests: diff --git a/lms/djangoapps/courseware/features/homepage.py b/lms/djangoapps/courseware/features/homepage.py index 585d1582d7..51c3277e69 100644 --- a/lms/djangoapps/courseware/features/homepage.py +++ b/lms/djangoapps/courseware/features/homepage.py @@ -8,7 +8,7 @@ from nose.tools import assert_in, assert_equals @step(u'I should see the following Partners in the Partners section') def i_should_see_partner(step): partners = world.browser.find_by_css(".partner .name span") - names = set(span.text for span in partners) + names = set(span.html for span in partners) for partner in step.hashes: assert_in(partner['Partner'], names)