diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb index 8f257eee..384c7057 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -405,7 +405,7 @@ module TodosHelper html += step + "({ go: function() {\r\n" end end - html += "}}) " * animation.length + html += "}}) " * animation.size return html + ";" end diff --git a/features/context_edit.feature b/features/context_edit.feature index 9f5abecc..8cca170d 100644 --- a/features/context_edit.feature +++ b/features/context_edit.feature @@ -12,7 +12,7 @@ Feature: Edit a context @selenium Scenario: In place edit of context name Given I have a context called "Errands" - When I visit the context page for "Errands" + When I go to the context page for "Errands" And I edit the context name in place to be "OutAndAbout" Then I should see the context name is "OutAndAbout" When I go to the contexts page diff --git a/features/dependencies.feature b/features/dependencies.feature index 591f345f..b7dec50a 100644 --- a/features/dependencies.feature +++ b/features/dependencies.feature @@ -13,7 +13,7 @@ Feature: dependencies Scenario: Adding dependency to dependency by drag and drop Given I have a project "dependencies" with 3 todos And "Todo 2" depends on "Todo 1" - When I visit the "dependencies" project + When I go to the "dependencies" project And I drag "Todo 3" to "Todo 2" Then the successors of "Todo 1" should include "Todo 2" And the successors of "Todo 2" should include "Todo 3" @@ -31,7 +31,7 @@ Feature: dependencies | test 1 | @pc | | test 2 | @pc | | test 3 | @pc | - When I visit the "dependencies" project + When I go to the "dependencies" project When I edit the dependency of "test 1" to add "test 2" as predecessor Then I should see "test 1" within the dependencies of "test 2" And I should see "test 1" in the deferred container @@ -51,7 +51,7 @@ Feature: dependencies | test 1 | @pc | | test 2 | @pc | And "test 1" depends on "test 2" - When I visit the "dependencies" project + When I go to the "dependencies" project Then I should see "test 1" in the deferred container When I edit the dependency of "test 1" to remove "test 2" as predecessor Then I should not see "test 1" within the dependencies of "test 2" @@ -66,7 +66,7 @@ Feature: dependencies | test 2 | @pc | | test 3 | @pc | And "test 2" depends on "test 1" - When I visit the "dependencies" project + When I go to the "dependencies" project Then I should see "test 2" in the deferred container And I should see "test 1" in the action container When I mark "test 1" as complete @@ -84,7 +84,7 @@ Feature: dependencies | test 2 | @pc | | test 3 | @pc | And "test 2" depends on "test 1" - When I visit the "dependencies" project + When I go to the "dependencies" project Then I should see "test 2" in the deferred container And I should see "test 1" in the action container When I delete the action "test 1" @@ -95,7 +95,7 @@ Feature: dependencies Scenario: Deleting a successor will update predecessor Given this is a pending scenario - @selenium @wip + @selenium Scenario: Dragging an action to a completed action will not add it as a dependency Given I have a context called "@pc" And I have a project "dependencies" that has the following todos @@ -103,7 +103,7 @@ Feature: dependencies | test 1 | @pc | no | | test 2 | @pc | no | | test 3 | @pc | yes | - When I visit the "dependencies" project + When I go to the "dependencies" project And I drag "test 1" to "test 3" Then I should see an error flash message saying "Cannot add this action as a dependency to a completed action!" And I should see "test 1" in project container for "dependencies" \ No newline at end of file diff --git a/features/edit_a_todo.feature b/features/edit_a_todo.feature index a2441a5c..3c77252e 100644 --- a/features/edit_a_todo.feature +++ b/features/edit_a_todo.feature @@ -83,7 +83,7 @@ Feature: Edit a next action from every page Scenario Outline: I can mark a deferred todo complete and it will update empty messages Given I have a context called "visible context" And I have a project called "visible project" - When I go to the # not for home page or context because it does not show deferred todos + When I go to the Then I should see "" When I submit a new deferred action with description "visible todo" to project "visible project" with tags "starred" in the context "visible context" Then I should see "visible todo" diff --git a/features/notes_manage.feature b/features/notes_manage.feature index a94ac2ec..410d61d3 100644 --- a/features/notes_manage.feature +++ b/features/notes_manage.feature @@ -24,7 +24,7 @@ Feature: View, add, remove notes Scenario: Link to note Given I have a project "Pass Final Exam" with 1 note - When I visit the "Pass Final Exam" project + When I go to the "Pass Final Exam" project And I click the icon next to the note Then I should see the note text diff --git a/features/project_edit.feature b/features/project_edit.feature index 4b924442..cb6f38f8 100644 --- a/features/project_edit.feature +++ b/features/project_edit.feature @@ -47,7 +47,7 @@ Feature: Edit a project Given I have a project "test" with 1 todos When I go to the projects page Then the badge should show 2 # "manage me" and "test" - When I visit the "manage me" project + When I go to the "manage me" project And I try to edit the project name to "test" Then I should see "Name already exists" diff --git a/features/shared_add_new_todo.feature b/features/shared_add_new_todo.feature index 99caa94d..f9bf7982 100644 --- a/features/shared_add_new_todo.feature +++ b/features/shared_add_new_todo.feature @@ -13,22 +13,22 @@ Feature: Add new next action from every page @selenium Scenario Outline: I can hide the input form for single next action on a page - When I the + When I go to the Then the single action form should be visible When I follow "Hide form" Then the single action form should not be visible Scenarios: - | action | page | - | go to | home page | - | go to | tickler page | - | visit | project page for "test project" | - | visit | context page for "test context" | - | go to | tag page for "starred" | + | page | + | home page | + | tickler page | + | "test project" project | + | context page for "test context" | + | tag page for "starred" | @selenium Scenario Outline: I can hide the input form for multiple next actions - When I the + When I go to the Then the single action form should be visible When I follow "Add multiple next actions" Then the multiple action form should be visible @@ -37,16 +37,16 @@ Feature: Add new next action from every page And the multiple action form should not be visible Scenarios: - | action | page | - | go to | home page | - | go to | tickler page | - | visit | project page for "test project" | - | visit | context page for "test context" | - | go to | tag page for "starred" | + | page | + | home page | + | tickler page | + | "test project" project | + | context page for "test context" | + | tag page for "starred" | @selenium Scenario Outline: I can hide the input form and then choose both input forms - When I the + When I go to the Then the single action form should be visible When I follow "Hide form" Then the single action form should not be visible @@ -57,16 +57,16 @@ Feature: Add new next action from every page And the multiple action form should not be visible Scenarios: - | action | page | - | go to | home page | - | go to | tickler page | - | visit | project page for "test project" | - | visit | context page for "test context" | - | go to | tag page for "starred" | + | page | + | home page | + | tickler page | + | "test project" project | + | context page for "test context" | + | tag page for "starred" | @selenium Scenario Outline: I can switch forms for single next action to multiple next actions - When I the + When I go to the Then the single action form should be visible When I follow "Add multiple next actions" Then the single action form should not be visible @@ -76,30 +76,30 @@ Feature: Add new next action from every page And the multiple action form should not be visible Scenarios: - | action | page | - | go to | home page | - | go to | tickler page | - | visit | project page for "test project" | - | visit | context page for "test context" | - | go to | tag page for "starred" | + | page | + | home page | + | tickler page | + | "test project" project | + | context page for "test context" | + | tag page for "starred" | @selenium Scenario Outline: I can add a todo from several pages - When I the + When I go to the And I submit a new action with description "a new next action" Then I should "a new next action" Scenarios: - | action | page | see | - | go to | home page | see | - | go to | tickler page | not see | - | visit | project page for "test project" | see | - | visit | context page for "test context" | see | - | go to | tag page for "starred" | not see | + | page | see | + | home page | see | + | tickler page | not see | + | "test project" project | see | + | context page for "test context" | see | + | tag page for "starred" | not see | @selenium Scenario Outline: I can add multiple todos from several pages - When I the + When I go to the And I follow "Add multiple next actions" And I submit multiple actions with using """ @@ -112,36 +112,39 @@ Feature: Add new next action from every page And the number of actions should be Scenarios: - | action | page | see | badge | count | - | go to | home page | see | 3 | 3 | - | go to | tickler page | not see | 0 | 3 | - | visit | project page for "test project" | see | 3 | 3 | - | visit | context page for "test context" | see | 2 | 3 | - | go to | tag page for "starred" | not see | 0 | 3 | + | page | see | badge | count | + | home page | see | 3 | 3 | + | tickler page | not see | 0 | 3 | + | "test project" project | see | 3 | 3 | + | context page for "test context" | see | 2 | 3 | + | tag page for "starred" | not see | 0 | 3 | + @selenium Scenario: Adding a todo to another project does not show the todo - Given this is a pending scenario - - Scenario: Adding a todo to a hidden project does not show the todo - Given this is a pending scenario + Given I have a project called "another project" + When I go to the "test project" project + And I submit a new action with description "can you see me?" to project "another project" in the context "test context" + Then I should not see "can you see me?" + When I go to the "another project" project + Then I should see "can you see me?" @selenium Scenario Outline: Adding a todo with a new context shows the new context - When I the + When I go to the And I submit a new with description "do at new context" and the tags "starred" in the context "New" Then a confirmation for adding a new context "New" should be asked And the container for the context "New" should And the badge should show Scenarios: - | action | page | todo | badge | visible | - | go to | home page | action | 2 | be visible | - | go to | tickler page | deferred action | 1 | be visible | - | visit | project page for "test project" | action | 2 | not be visible | - | visit | context page for "test context" | action | 1 | not be visible | - | go to | tag page for "starred" | action | 1 | be visible | + | page | todo | badge | visible | + | home page | action | 2 | be visible | + | tickler page | deferred action | 1 | be visible | + | "test project" project | action | 2 | not be visible | + | context page for "test context" | action | 1 | not be visible | + | tag page for "starred" | action | 1 | be visible | - @selenium + @selenium Scenario Outline: Adding a todo to a hidden project does not show the todo Given I have a hidden project called "hidden project" And I have a project called "visible project" @@ -174,7 +177,7 @@ Feature: Add new next action from every page When I submit a new action with description "another new todo" in the context "hidden context" Then I should not see "another new todo" - @selenium + @selenium Scenario: Adding a todo to a context show the todo in that context page Given I have a context called "visible context" And I have a hidden context called "hidden context" diff --git a/features/step_definitions/container_steps.rb b/features/step_definitions/container_steps.rb index 03c8d308..5f811c11 100644 --- a/features/step_definitions/container_steps.rb +++ b/features/step_definitions/container_steps.rb @@ -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 diff --git a/features/step_definitions/context_steps.rb b/features/step_definitions/context_steps.rb index 40a8b3ba..dc3b9e09 100644 --- a/features/step_definitions/context_steps.rb +++ b/features/step_definitions/context_steps.rb @@ -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 diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index a74ca756..66fd510d 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -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 diff --git a/features/step_definitions/todo_create_steps.rb b/features/step_definitions/todo_create_steps.rb index 93ede4be..8dc7dea3 100644 --- a/features/step_definitions/todo_create_steps.rb +++ b/features/step_definitions/todo_create_steps.rb @@ -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