diff --git a/features/recurring_todos.feature b/features/recurring_todos.feature new file mode 100644 index 00000000..98d54c82 --- /dev/null +++ b/features/recurring_todos.feature @@ -0,0 +1,25 @@ +Feature: Manage recurring todos + + In order to manage repeating todos + As a Tracks user + I want to view, edit, add, or remove recurrence patterns of repeating todos + + Background: + Given the following user record + | login | password | is_admin | + | testuser | secret | false | + And I have logged in as "testuser" with password "secret" + + @selenium + Scenario: Being able to select daily, weekly, monthly and yearly pattern + When I go to the repeating todos page + And I follow "Add a new recurring action" + Then I should see the form for "Daily" recurrence pattern + When I select "Weekly" recurrence pattern + Then I should see the form for "Weekly" recurrence pattern + When I select "Monthly" recurrence pattern + Then I should see the form for "Monthly" recurrence pattern + When I select "Yearly" recurrence pattern + Then I should see the form for "Yearly" recurrence pattern + When I select "Daily" recurrence pattern + Then I should see the form for "Daily" recurrence pattern \ No newline at end of file diff --git a/features/step_definitions/recurring_todo_steps.rb b/features/step_definitions/recurring_todo_steps.rb new file mode 100644 index 00000000..2982eb26 --- /dev/null +++ b/features/step_definitions/recurring_todo_steps.rb @@ -0,0 +1,7 @@ +When /^I select "([^\"]*)" recurrence pattern$/ do |recurrence_period| + selenium.click("recurring_todo_recurring_period_#{recurrence_period.downcase}") +end + +Then /^I should see the form for "([^\"]*)" recurrence pattern$/ do |recurrence_period| + selenium.is_visible("recurring_#{recurrence_period.downcase}") +end diff --git a/features/support/paths.rb b/features/support/paths.rb index cb895557..51edcca2 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -18,6 +18,8 @@ module NavigationHelpers contexts_path when /the manage users page/ users_path + when /the repeating todos page/ + recurring_todos_path # Add more page name => path mappings here diff --git a/test/selenium/recurring_todos/switch_recurrence_options.rsel b/test/selenium/recurring_todos/switch_recurrence_options.rsel deleted file mode 100644 index 073c0f9c..00000000 --- a/test/selenium/recurring_todos/switch_recurrence_options.rsel +++ /dev/null @@ -1,12 +0,0 @@ -setup :fixtures => :users, :clear_tables => [:projects, :contexts, :todos] -login :as => 'admin' -open "/recurring_todos" -click "css=#recurring_new_container a" -click "recurring_todo_recurring_period_daily" -assert_visible "recurring_daily" -click "recurring_todo_recurring_period_weekly" -assert_visible "recurring_weekly" -click "recurring_todo_recurring_period_monthly" -assert_visible "recurring_monthly" -click "recurring_todo_recurring_period_yearly" -assert_visible "recurring_yearly"