diff --git a/features/contexts_manage.feature b/features/contexts_manage.feature index 9f819215..57002fcf 100644 --- a/features/contexts_manage.feature +++ b/features/contexts_manage.feature @@ -13,7 +13,7 @@ Feature: Manage contexts @selenium Scenario: In place edit of context name Given I have a context called "Errands" - When I visits the context page for "Errands" + When I visit 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/shared_add_new_todo.feature b/features/shared_add_new_todo.feature new file mode 100644 index 00000000..6164469e --- /dev/null +++ b/features/shared_add_new_todo.feature @@ -0,0 +1,85 @@ +Feature: Add new next action from every page + + In order to quickly add a new next action + As a Tracks user + I want to to be able to add one or more new next actions from every page + + Background: + Given the following user record + | login | password | is_admin | + | testuser | secret | false | + And I have logged in as "testuser" with password "secret" + And I have a context called "test" + And I have a project "test" with 1 todos + + @selenium + Scenario Outline: I can hide the input form for single next action on a page + When I 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"| + | visit | context page for "test"| + | visit | tag page for "starred" | + + @selenium + Scenario Outline: I can hide the input form for multiple next actions + When I the + Then the single action form should be visible + When I follow "Add multiple next actions" + Then the multiple action form should be visible + When I follow "« Hide form" + Then the single action form should not be visible + 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"| + | visit | context page for "test"| + | visit | tag page for "starred" | + + @selenium + Scenario Outline: I can hide the input form and then choose both input forms + When I the + Then the single action form should be visible + When I follow "« Hide form" + Then the single action form should not be visible + When I follow "Add multiple next actions" + Then the multiple action form should be visible + When I follow "« Hide form" + Then the single action form should not be visible + 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"| + | visit | context page for "test"| + | visit | tag page for "starred" | + + @selenium + Scenario Outline: I can switch forms for single next action to multiple next actions + When I 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 + And the multiple action form should be visible + When I follow "Add single next action" + Then the single action form should be visible + 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"| + | visit | context page for "test"| + | visit | tag page for "starred" | diff --git a/features/step_definitions/context_steps.rb b/features/step_definitions/context_steps.rb index 15864b48..532a9f0d 100644 --- a/features/step_definitions/context_steps.rb +++ b/features/step_definitions/context_steps.rb @@ -20,7 +20,7 @@ Given /^I have a context "([^\"]*)" with (.*) actions$/ do |context_name, number end end -When /^I visits the context page for "([^\"]*)"$/ do |context_name| +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}" diff --git a/features/step_definitions/project_steps.rb b/features/step_definitions/project_steps.rb index 9ec28edc..ab6d58d2 100644 --- a/features/step_definitions/project_steps.rb +++ b/features/step_definitions/project_steps.rb @@ -21,6 +21,11 @@ When /^I visit the "([^\"]*)" project$/ do |project_name| 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/shared_new_todo_steps.rb b/features/step_definitions/shared_new_todo_steps.rb new file mode 100644 index 00000000..d5f8468c --- /dev/null +++ b/features/step_definitions/shared_new_todo_steps.rb @@ -0,0 +1,16 @@ +Then /^the single action form should be visible$/ do + selenium.is_visible("todo_new_action").should == true +end + +Then /^the single action form should not be visible$/ do + selenium.is_visible("todo_new_action").should == false +end + +Then /^the multiple action form should be visible$/ do + selenium.is_visible("todo_multi_add").should == true +end + +Then /^the multiple action form should not be visible$/ do + selenium.is_visible("todo_multi_add").should == false +end + diff --git a/features/step_definitions/todo_tag_steps.rb.rb b/features/step_definitions/todo_tag_steps.rb.rb new file mode 100644 index 00000000..e51e99bf --- /dev/null +++ b/features/step_definitions/todo_tag_steps.rb.rb @@ -0,0 +1,3 @@ +When /^I visit the tag page for "([^"]*)"$/ do |tag_name| + visit "/todos/tag/#{tag_name}" +end diff --git a/features/support/paths.rb b/features/support/paths.rb index bc778a1e..1c987fb9 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -26,12 +26,14 @@ module NavigationHelpers recurring_todos_path when /the integrations page/ integrations_path + when /the tickler page/ + tickler_path - # Add more mappings here. - # Here is an example that pulls values out of the Regexp: - # - # when /^(.*)'s profile page$/i - # user_profile_path(User.find_by_login($1)) + # Add more mappings here. + # Here is an example that pulls values out of the Regexp: + # + # when /^(.*)'s profile page$/i + # user_profile_path(User.find_by_login($1)) else begin