From a8e426a2cdd3eb7d97c476364cb9e5dad557e3f5 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Fri, 19 Apr 2013 20:00:32 +0200 Subject: [PATCH] fix regressions --- features/context_edit.feature | 2 +- features/dependencies.feature | 2 +- features/edit_a_todo.feature | 2 +- features/project_edit.feature | 2 +- features/step_definitions/container_steps.rb | 2 +- .../step_definitions/todo_create_steps.rb | 2 +- features/support/paths.rb | 4 ++-- features/support/tracks_id_helper.rb | 24 ++++++++++++------- 8 files changed, 24 insertions(+), 16 deletions(-) diff --git a/features/context_edit.feature b/features/context_edit.feature index 3700f3f2..86878e7f 100644 --- a/features/context_edit.feature +++ b/features/context_edit.feature @@ -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 diff --git a/features/dependencies.feature b/features/dependencies.feature index dfaf9600..0fc1a6bd 100644 --- a/features/dependencies.feature +++ b/features/dependencies.feature @@ -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 diff --git a/features/edit_a_todo.feature b/features/edit_a_todo.feature index f3cbca99..56f0a769 100644 --- a/features/edit_a_todo.feature +++ b/features/edit_a_todo.feature @@ -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 diff --git a/features/project_edit.feature b/features/project_edit.feature index f4570b0b..1420db21 100644 --- a/features/project_edit.feature +++ b/features/project_edit.feature @@ -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 diff --git a/features/step_definitions/container_steps.rb b/features/step_definitions/container_steps.rb index e8f82bd4..a9a891d4 100644 --- a/features/step_definitions/container_steps.rb +++ b/features/step_definitions/container_steps.rb @@ -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 ####### diff --git a/features/step_definitions/todo_create_steps.rb b/features/step_definitions/todo_create_steps.rb index bd276e95..53d5ec80 100644 --- a/features/step_definitions/todo_create_steps.rb +++ b/features/step_definitions/todo_create_steps.rb @@ -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}") diff --git a/features/support/paths.rb b/features/support/paths.rb index 6635016d..7147f010 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -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) diff --git a/features/support/tracks_id_helper.rb b/features/support/tracks_id_helper.rb index b5a83c60..1ad22626 100644 --- a/features/support/tracks_id_helper.rb +++ b/features/support/tracks_id_helper.rb @@ -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 \ No newline at end of file