another attempt at #1150 and fix some failing cucumber scenarios

This commit is contained in:
Reinier Balt 2011-04-19 16:40:55 +02:00
parent 98d8712229
commit af4489ff6e
11 changed files with 82 additions and 86 deletions

View file

@ -1,8 +1,13 @@
Then /^I should not see the context "([^"]*)"$/ do |context_name|
context = @current_user.contexts.find_by_name(context_name)
context.should_not be_nil
wait_for :timeout => 5 do
!selenium.is_visible("xpath=//div[@id='c#{context.id}']")
xpath = "//div[@id='c#{context.id}']"
if selenium.is_element_present(xpath) # only check visibility if it is present
wait_for :timeout => 5 do
!selenium.is_visible("xpath=#{xpath}")
end
end
end

View file

@ -55,13 +55,6 @@ Given /^I have the following contexts$/ do |table|
end
end
# TODO: refactor this to paths.rb
When /^I visit the context page for "([^\"]*)"$/ do |context_name|
context = @current_user.contexts.find_by_name(context_name)
context.should_not be_nil
visit "/contexts/#{context.id}"
end
When /^I edit the context name in place to be "([^\"]*)"$/ do |new_context_name|
selenium.click "context_name"
fill_in "value", :with => new_context_name

View file

@ -46,16 +46,6 @@ Given /^I have a hidden project called "([^"]*)"$/ do |project_name|
@project.hide!
end
When /^I visit the "([^\"]*)" project$/ do |project_name|
@project = Project.find_by_name(project_name)
@project.should_not be_nil
visit project_path(@project)
end
When /^I visit the project page for "([^"]*)"$/ do |project_name|
When "I visit the \"#{project_name}\" project"
end
When /^I edit the project description to "([^\"]*)"$/ do |new_description|
click_link "link_edit_project_#{@project.id}"
fill_in "project[description]", :with => new_description

View file

@ -51,6 +51,11 @@ When /^I submit a new action with description "([^"]*)" to project "([^"]*)" wit
submit_next_action_form
end
When /^I submit a new action with description "([^"]*)" to project "([^"]*)" in the context "([^"]*)"$/ do |description, project_name, context_name|
When "I submit a new action with description \"#{description}\" to project \"#{project_name}\" with tags \"\" in the context \"#{context_name}\""
end
When /^I submit a new action with description "([^"]*)" in the context "([^"]*)"$/ do |description, context_name|
fill_in "todo[description]", :with => description