fix timing issues on failing scenarios. Fix deprecated jquery functions and update jqueryui

Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
Reinier Balt 2013-02-15 20:51:35 +01:00
parent 98fbbccdcb
commit 1b0d08bbb5
39 changed files with 715 additions and 600 deletions

View file

@ -13,6 +13,8 @@ end
When /^I edit the context to rename it to "([^\"]*)"$/ do |new_name|
find("a#link_edit_context_#{@context.id}").click
# wait for the form to appear (which included a submit button)
page.should have_css("button#submit_context_#{@context.id}", :visible=>true)
within "div.edit-form" do
@ -21,6 +23,8 @@ When /^I edit the context to rename it to "([^\"]*)"$/ do |new_name|
end
# wait for the form to go away
page.should_not have_css("button#submit_context_#{@context.id}", :visible => true)
# wait for the changed context to appear
page.should have_css("a#link_edit_context_#{@context.id}", :visible=> true)
end

View file

@ -133,7 +133,9 @@ end
When /^I try to edit the project name to "([^\"]*)"$/ do |new_title|
edit_project_no_wait(@project) do
fill_in "project[name]", :with => new_title
within "form.edit-project-form" do
fill_in "project[name]", :with => new_title
end
end
end
@ -202,15 +204,20 @@ When /^I edit project settings and mark the project as reviewed$/ do
end
When /^I add a note "([^"]*)" to the project$/ do |note_body|
click_link "Add a note"
page.should have_css "div.widgets button#submit_note"
fill_in "note[body]", :with => note_body
click_button "Add note"
submit_button = "div.widgets button#submit_note"
click_link "Add a note"
page.should have_css submit_button
fill_in "note[body]", :with => note_body
elem = find(submit_button)
elem.should_not be_nil # form is hidden
elem.should_not be_visible
elem.should_not be_nil
elem.click
wait_until do
!elem.visible?
end
end
When /^I click on the first note icon$/ do
@ -245,9 +252,10 @@ Then /^I edit the default tags to "([^"]*)"$/ do |default_tags|
end
Then /^I should be able to change the project name in place$/ do
#Note that this is not changing the project name
# Note that this is not changing the project name
page.should have_css("div#project_name>form>input")
page.find("div#project_name > form > button[type=cancel]").click
page.should_not have_css("div#project_name>form>input")
end
Then /^I should not be able to change the project name in place$/ do

View file

@ -7,6 +7,7 @@ When /^I mark "([^"]*)" as complete$/ do |action_description|
check "mark_complete_#{todo.id}"
wait_for_ajax
wait_for_animations_to_end
end
When /^I mark "([^"]*)" as uncompleted$/ do |action_description|
@ -16,6 +17,7 @@ When /^I mark "([^"]*)" as uncompleted$/ do |action_description|
uncheck "mark_complete_#{todo.id}"
wait_for_ajax
wait_for_animations_to_end
end
When /^I mark the completed todo "([^"]*)" active$/ do |action_description|
@ -68,6 +70,8 @@ When /I change the (.*) field of "([^\"]*)" to "([^\"]*)"$/ do |field_name, todo
open_edit_form_for(todo)
within "form.edit_todo_form" do
fill_in "#{field_name}", :with => new_value
# force blur event
page.execute_script("$('form.edit_todo_form input.#{field_name}_todo_#{todo.id}').blur();")
end
submit_edit_todo_form(todo)
wait_for_ajax