mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-11 23:22:36 +01:00
replace selenium script with cucumber story for switching recurrence option
This commit is contained in:
parent
0d7980e87b
commit
e1b52aeb13
4 changed files with 34 additions and 12 deletions
25
features/recurring_todos.feature
Normal file
25
features/recurring_todos.feature
Normal 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
|
||||||
7
features/step_definitions/recurring_todo_steps.rb
Normal file
7
features/step_definitions/recurring_todo_steps.rb
Normal 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
|
||||||
|
|
@ -18,6 +18,8 @@ module NavigationHelpers
|
||||||
contexts_path
|
contexts_path
|
||||||
when /the manage users page/
|
when /the manage users page/
|
||||||
users_path
|
users_path
|
||||||
|
when /the repeating todos page/
|
||||||
|
recurring_todos_path
|
||||||
|
|
||||||
# Add more page name => path mappings here
|
# Add more page name => path mappings here
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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"
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue