2010-11-26 10:44:08 +01:00
|
|
|
Given /this is a pending scenario/ do
|
|
|
|
|
pending
|
|
|
|
|
end
|
|
|
|
|
|
2011-03-08 23:28:48 +01:00
|
|
|
Given /^I am working on the mobile interface$/ do
|
|
|
|
|
@mobile_interface = true
|
|
|
|
|
end
|
|
|
|
|
|
2010-01-13 21:52:04 +01:00
|
|
|
Then /the badge should show (.*)/ do |number|
|
2009-08-05 16:28:06 +02:00
|
|
|
badge = -1
|
2010-02-06 22:36:13 +01:00
|
|
|
xpath= "//span[@id='badge_count']"
|
|
|
|
|
|
2010-04-10 15:31:28 -04:00
|
|
|
if response.respond_to? :selenium
|
2010-02-06 22:36:13 +01:00
|
|
|
response.should have_xpath(xpath)
|
|
|
|
|
badge = response.selenium.get_text("xpath=#{xpath}").to_i
|
|
|
|
|
else
|
|
|
|
|
response.should have_xpath(xpath) do |node|
|
|
|
|
|
badge = node.first.content.to_i
|
|
|
|
|
end
|
2009-08-05 16:28:06 +02:00
|
|
|
end
|
2010-02-06 22:36:13 +01:00
|
|
|
|
2009-08-05 16:28:06 +02:00
|
|
|
badge.should == number.to_i
|
|
|
|
|
end
|
2011-02-26 11:38:39 +01:00
|
|
|
|
2011-03-08 23:28:48 +01:00
|
|
|
Then /^I should see the empty message in the deferred container$/ do
|
|
|
|
|
wait_for :timeout => 5 do
|
|
|
|
|
selenium.is_visible("xpath=//div[@id='tickler']//div[@id='tickler-empty-nd']")
|
|
|
|
|
end
|
2011-02-26 11:38:39 +01:00
|
|
|
end
|
2011-03-09 10:53:54 +01:00
|
|
|
|
|
|
|
|
Then /^I should not see the context "([^"]*)"$/ do |context_name|
|
|
|
|
|
context = @current_user.contexts.find_by_name(context_name)
|
|
|
|
|
wait_for :timeout => 5 do
|
|
|
|
|
!selenium.is_visible("xpath=//div[@id='c#{context.id}']")
|
|
|
|
|
end
|
|
|
|
|
end
|
2011-03-11 21:01:24 +01:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|