mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-24 09:46:11 +01:00
parent
15a2eb6f08
commit
bc73b18bed
9 changed files with 364 additions and 311 deletions
|
|
@ -15,8 +15,7 @@ When /^I drag "(.*)" to "(.*)"$/ do |dragged, target|
|
|||
|
||||
selenium.drag_and_drop_to_object(drag_name, drop_name)
|
||||
|
||||
arrow = "xpath=//div[@id='line_todo_#{drop_id}']/div/a[@class='show_successors']/img"
|
||||
selenium.wait_for_element(arrow, :timeout_in_seconds => 5)
|
||||
wait_for_ajax
|
||||
end
|
||||
|
||||
When /^I expand the dependencies of "([^\"]*)"$/ do |todo_name|
|
||||
|
|
|
|||
|
|
@ -34,3 +34,34 @@ Then /^I should not see the context "([^"]*)"$/ do |context_name|
|
|||
!selenium.is_visible("xpath=//div[@id='c#{context.id}']")
|
||||
end
|
||||
end
|
||||
|
||||
Then /^I should see an error flash message saying "([^"]*)"$/ do |message|
|
||||
xpath = "//div[@id='message_holder']/h4[@id='flash']"
|
||||
text = response.selenium.get_text("xpath=#{xpath}")
|
||||
text.should == message
|
||||
end
|
||||
|
||||
Then /^I should see "([^"]*)" in context container for "([^"]*)"$/ do |todo_description, context_name|
|
||||
context = @current_user.contexts.find_by_name(context_name)
|
||||
context.should_not be_nil
|
||||
todo = @current_user.todos.find_by_description(todo_description)
|
||||
todo.should_not be_nil
|
||||
|
||||
xpath = "xpath=//div[@id=\"c#{context.id}\"]//div[@id='line_todo_#{todo.id}']"
|
||||
selenium.wait_for_element(xpath, :timeout_in_seconds => 5)
|
||||
selenium.is_visible(xpath).should be_true
|
||||
end
|
||||
|
||||
Then /^I should see "([^"]*)" in project container for "([^"]*)"$/ do |todo_description, project_name|
|
||||
todo = @current_user.todos.find_by_description(todo_description)
|
||||
todo.should_not be_nil
|
||||
|
||||
project = @current_user.projects.find_by_name(project_name)
|
||||
project.should_not be_nil
|
||||
|
||||
xpath = "//div[@id='p#{project.id}items']//div[@id='line_todo_#{todo.id}']"
|
||||
|
||||
selenium.wait_for_element("xpath=#{xpath}", :timeout_in_seconds => 5)
|
||||
selenium.is_visible(xpath).should be_true
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,9 @@ Given /^I have a project "([^"]*)" that has the following todos$/ do |project_na
|
|||
unless todo[:tags].nil?
|
||||
new_todo.tag_with(todo[:tags])
|
||||
end
|
||||
unless todo[:completed].nil?
|
||||
new_todo.complete! if todo[:completed] == 'yes'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue