Commit 419207ac by JonahStanley

Fixed issues with problem-editor.feature

parent 3bc34d71
......@@ -242,9 +242,7 @@ def save_button_disabled(step):
@step('I confirm the prompt')
def confirm_the_prompt(step):
prompt_css = 'a.button.action-primary'
world.wait_for(lambda _driver: world.css_visible(prompt_css))
world.css_click(prompt_css)
world.wait_for(lambda _driver: not world.css_visible(prompt_css))
world.css_click(prompt_css, success_condition=lambda: not world.css_visible(prompt_css))
@step(u'I am shown a (.*)$')
......
......@@ -13,6 +13,10 @@ def create_component_instance(step, component_button_css, category,
click_new_component_button(step, component_button_css)
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)
......@@ -39,11 +43,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.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')
......
......@@ -156,7 +156,7 @@ def cancel_does_not_save_changes(step):
def create_latex_problem(step):
world.click_new_component_button(step, '.large-problem-icon')
# Go to advanced tab.
world.css_click('#ui-id-2')
world.css_click('#ui-id-2', success_condition=lambda: world.css_has_class('div.ui-tabs li', 'ui-state-active', index=1))
world.click_component_from_menu("problem", "latex_problem.yaml", '.xmodule_CapaModule')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment