fix regressions

This commit is contained in:
Reinier Balt 2013-04-19 20:00:32 +02:00
parent d732779e14
commit a8e426a2cd
8 changed files with 24 additions and 16 deletions

View file

@ -72,7 +72,7 @@ Feature: Edit a context
When I submit a new action with description "todo X" to project "test project" in the context "@personal"
Then I should see the todo "todo X"
@javascript
@javascript
Scenario: Moving the todo to the tickler will move todo to tickler container and update empty messages
Given I have a context "test" with 1 todos
When I go to the "test" context

View file

@ -75,7 +75,7 @@ Feature: dependencies
And I should not see "test 2" in the deferred container
And I should see empty message for deferred todos of project
@javascript
@javascript
Scenario: Deleting a predecessor will activate successors
Given I have a context called "@pc"
And I have a project "dependencies" that has the following todos

View file

@ -46,7 +46,7 @@ Feature: Edit a next action from every page
| context | container for context "@home" |
| project | container for project "do it!" |
@javascript @wipp
@javascript @wip
Scenario Outline: Changing container of the todo in that container will hide it
# this script fails on https://code.google.com/p/selenium/issues/detail?id=3075 for selenium-webdriver > 2.14.
# and selenium-webdriver < 2.20 fails on firefox 11 :-( So @wip for now. This may work on webkit though

View file

@ -132,7 +132,7 @@ Feature: Edit a project
And I should see empty message for completed todos of project
And I should see empty message for todos of project
@javascript
@javascript
Scenario: Moving the todo out of the tickler will move todo to active container and update empty messages
Given I have a project "test" with 1 deferred todos
When I go to the "test" project

View file

@ -48,7 +48,7 @@ Then(/^I should (not see|see) "([^"]*)" in the deferred container$/) do |visible
end
Then(/^I should (not see|see) "([^"]*)" in the action container$/) do |visible, todo_description|
check_xpath_visibility(visible, todo_in_container_xpath(@source_view.to_s, find_todo(todo_description)))
check_xpath_visibility(visible, todo_in_container_xpath(find_todo(todo_description), @source_view.to_sym))
end
####### Project #######

View file

@ -142,7 +142,7 @@ Given /^I have (\d+) completed todos in project "([^"]*)" in context "([^"]*)" w
end
Given(/^I have ([0-9]+) completed todos in context "([^"]*)"$/) do |count, context_name|
find_context(context_name)
context = find_context(context_name)
count.to_i.downto 1 do |i|
todo = @current_user.todos.create!(:context_id => context.id, :description => "todo #{i}")

View file

@ -67,10 +67,10 @@ module NavigationHelpers
@source_view = "review"
review_path(options)
when /the contexts page/
@source_view = "contexts"
@source_view = "context"
contexts_path(options)
when /the projects page/
@source_view = "projects"
@source_view = "project"
projects_path(options)
when /the manage users page/
users_path(options)

View file

@ -13,27 +13,35 @@ module TracksIdHelper
end
def project_container_xpath(project)
id = project.nil? ? "without_project_container" : "p#{project.id}"
id = project.nil? ? "without_project_container" : "p#{project.id}"
"//div[@id='#{id}']"
end
def deferred_container_xpath
"//div[@id='deferred_pending_container']"
end
def todo_line_xpath(todo)
"//div[@id='line_todo_#{todo.id}']"
end
def todo_in_container_xpath(todo, container_type)
id = "wrong"
id = todo_in_context_container_xpath(todo, todo.context) if container_type == :context
id = todo_in_project_container_xpath(todo, todo.project) if container_type == :project
return "//div[@id=\"#{id}\"]//div[@id='line_todo_#{todo.id}']"
id = "//div[@id=\"wrong\"]"
id = context_container_xpath(todo.context) if container_type == :context
id = project_container_xpath(todo.project) if container_type == :project
return "#{id}//div[@id='line_todo_#{todo.id}']"
end
def todo_in_context_container_xpath(todo, context)
"#{context_container_xpath(context)}//div[@id='line_todo_#{todo.id}']"
"#{context_container_xpath(context)}#{todo_line_xpath(todo)}"
end
def todo_in_project_container_xpath(todo, project)
return "#{project_container_xpath(project)}//div[@id='line_todo_#{todo.id}']"
"#{project_container_xpath(project)}#{todo_line_xpath(todo)}"
end
def todo_in_deferred_container_xpath(todo)
"//div[@id='deferred_pending_container']//div[@id='line_todo_#{todo.id}']"
"#{deferred_container_xpath}#{todo_line_xpath(todo)}"
end
end