replace selenium script with cucumber story for switching recurrence option

This commit is contained in:
Reinier Balt 2010-05-05 13:00:44 +02:00
parent 0d7980e87b
commit e1b52aeb13
4 changed files with 34 additions and 12 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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"