mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-08 18:28:50 +01:00
fix #990 by moving rsel scripts to cucumber and removing selenium-on-rails plugin
Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
parent
4927f39594
commit
d9db33bc0d
194 changed files with 75 additions and 48324 deletions
|
|
@ -1,9 +0,0 @@
|
|||
setup :fixtures => :users, :clear_tables => [:projects, :contexts, :todos]
|
||||
login :as => 'admin'
|
||||
open "/"
|
||||
assert_context_count_incremented do
|
||||
type "todo_description", "a new action"
|
||||
type "todo_context_name", "Brand new context"
|
||||
click "css=#todo-form-new-action .submit_box button"
|
||||
assert_confirmation "New context 'Brand new context' will be also created. Are you sure?"
|
||||
end
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# adding a new action to context and collapsing context should remove
|
||||
# all actions in context including the newly added one
|
||||
|
||||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
open "/"
|
||||
|
||||
assert_element_present "todo_9"
|
||||
|
||||
# add new action to existing context
|
||||
type "todo_description", "a new action"
|
||||
type "todo_context_name", "agenda"
|
||||
click "css=#todo-form-new-action .submit_box button"
|
||||
wait_for_visible "flash"
|
||||
|
||||
# toggle Agenda context c1 and wait until the context has collapsed
|
||||
click "css=#toggle_c1"
|
||||
wait_for_not_visible "todo_9"
|
||||
|
||||
# check that newly added action is not there
|
||||
wait_for_not_visible "xpath=//span[text()='a new action']"
|
||||
|
||||
# toggle c1 back. Selenium does not reset cookies
|
||||
click "css=#toggle_c1"
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
|
||||
open "/"
|
||||
# we should start with 10 actions on home page
|
||||
assert_text 'badge_count', '11'
|
||||
|
||||
# set project to hidden state
|
||||
open "/projects/2"
|
||||
click 'css=.project_settings a'
|
||||
wait_for_visible "project_state_completed"
|
||||
click 'project_state_completed'
|
||||
click 'submit_project_2'
|
||||
# wait for flash before navigating away from project page
|
||||
wait_for_visible "flash"
|
||||
|
||||
# monitor badge count on home page. It should be 7 at the start
|
||||
open "/"
|
||||
wait_for_visible 'badge_count'
|
||||
assert_text 'badge_count', '7'
|
||||
|
||||
# add todo to hidden project
|
||||
type "todo_description", "should be hidden"
|
||||
type "todo_project_name", "Make more money than Billy Gates"
|
||||
type "todo_context_name", "agenda"
|
||||
click "css=#todo-form-new-action .submit_box button"
|
||||
|
||||
# wait for flash to appear
|
||||
wait_for_visible "flash"
|
||||
|
||||
verify_text_not_present 'should be hidden'
|
||||
|
||||
# badge count should still be same
|
||||
assert_text 'badge_count', '7'
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
|
||||
# set project to hidden state
|
||||
open "/projects/2"
|
||||
click 'css=.project_settings a'
|
||||
wait_for_visible "project_state_hidden"
|
||||
click 'project_state_hidden'
|
||||
click 'submit_project_2'
|
||||
# wait for flash before navigating away from project page to make sure that
|
||||
# the changes have been saved
|
||||
wait_for_visible "flash"
|
||||
|
||||
# monitor badge count on home page. It should be 7 at the start
|
||||
open "/"
|
||||
assert_text 'badge_count', '7'
|
||||
|
||||
# add todo to hidden project
|
||||
type "todo_description", "should be hidden"
|
||||
type "todo_project_name", "Make more money than Billy Gates"
|
||||
type "todo_context_name", "agenda"
|
||||
click "css=#todo-form-new-action .submit_box button"
|
||||
|
||||
# wait for flash to (dis)appear
|
||||
wait_for_visible "flash"
|
||||
|
||||
verify_text_not_present 'should be hidden'
|
||||
|
||||
# badge count should still be same
|
||||
assert_text 'badge_count', '7'
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
open "/"
|
||||
wait_for_element_present '//div[@id="line_todo_5"]//img[@alt="Delete"]/..'
|
||||
click '//div[@id="line_todo_5"]//img[@alt="Delete"]/..'
|
||||
assert_confirmation "Are you sure that you want to delete the action 'Construct time dilation device'?"
|
||||
wait_for_not_visible "c5"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
open '/'
|
||||
click "xpath=//div[@id='c5'] //div[@id='todo_5'] //input[@class='item-checkbox']"
|
||||
wait_for_element_present "xpath=//div[@id='completed_container'] //div[@id='todo_5']"
|
||||
wait_for_not_visible 'c5'
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
open '/'
|
||||
click "xpath=//div[@id='completed_container'] //div[@id='todo_3'] //input[@class='item-checkbox']"
|
||||
wait_for_element_present "xpath=//div[@id='c4'] //div[@id='todo_3']"
|
||||
wait_for_not_visible "c4empty-nd"
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
open :controller => 'login'
|
||||
type "username", username
|
||||
type "password", password
|
||||
click "//input[@value='Login']"
|
||||
wait_for_page_to_load "30000"
|
||||
click "signup"
|
||||
wait_for_page_to_load "30000"
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
open :controller => 'login'
|
||||
click "link=Login"
|
||||
wait_for_page_to_load "30000"
|
||||
type "username", username
|
||||
type "password", password
|
||||
click "//input[@value='Login']"
|
||||
wait_for_page_to_load "30000"
|
||||
click "link=Request Account"
|
||||
wait_for_page_to_load "30000"
|
||||
click "signup"
|
||||
wait_for_page_to_load "30000"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
open :controller => 'login'
|
||||
click "link=Login"
|
||||
wait_for_page_to_load "30000"
|
||||
type "username", username
|
||||
type "password", password
|
||||
click "//input[@value='Login']"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
open :controller => 'login', :action => 'logout'
|
||||
open :controller => 'login'
|
||||
type "user_login", username
|
||||
type "user_password", password
|
||||
click_and_wait "login"
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
|
||||
#first, defer a todo
|
||||
open "/projects/1"
|
||||
click "edit_icon_todo_5"
|
||||
wait_for_element_present "show_from_todo_5"
|
||||
type "show_from_todo_5", "1/1/2030"
|
||||
click "css=#submit_todo_5"
|
||||
wait_for_element_present "xpath=//div[@id='tickler'] //div[@id='todo_5']"
|
||||
|
||||
#now activate the other deferred one
|
||||
open "/projects/1"
|
||||
click "edit_icon_todo_15"
|
||||
wait_for_element_present "show_from_todo_15"
|
||||
type "show_from_todo_15", ""
|
||||
click "css=#submit_todo_15"
|
||||
wait_for_element_present "xpath=//div[@id='p1items'] //div[@id='todo_15']"
|
||||
assert_not_visible "tickler-empty-nd"
|
||||
assert_text 'badge_count', '2'
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
open "/projects/1"
|
||||
click "edit_icon_todo_15"
|
||||
wait_for_element_present "show_from_todo_15"
|
||||
type "show_from_todo_15", ""
|
||||
click "css=#submit_todo_15"
|
||||
wait_for_element_present "xpath=//div[@id='p1items'] //div[@id='todo_15']"
|
||||
wait_for_visible "tickler-empty-nd"
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
open "/projects/2"
|
||||
|
||||
click 'css=.project_settings a'
|
||||
wait_for_visible "project[default_context_name]"
|
||||
|
||||
# change default context
|
||||
type "project[default_context_name]", "errand"
|
||||
click "css=.positive"
|
||||
|
||||
wait_for_visible "flash"
|
||||
|
||||
# add actions
|
||||
type "todo_description", "test1"
|
||||
click "css=#todo-form-new-action .submit_box button"
|
||||
|
||||
wait_for_visible "flash"
|
||||
|
||||
type "todo_description", "test2"
|
||||
click "css=#todo-form-new-action .submit_box button"
|
||||
wait_for_visible "flash"
|
||||
|
||||
# check that context errand now contains 2 todos
|
||||
open "/contexts/4"
|
||||
assert_text "badge_count", "2"
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
open "/projects/1"
|
||||
|
||||
# change project name
|
||||
click "project_name"
|
||||
wait_for_element_present "css=#project_name form input"
|
||||
type "css=#project_name form input", "Test Foo"
|
||||
click "css=#project_name form button"
|
||||
wait_for_text "project_name", "Test Foo"
|
||||
|
||||
# check that the default project name is changed too
|
||||
wait_for_value "todo_project_name", "Test Foo"
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
open "/projects/1"
|
||||
include_partial 'project_detail/add_deferred_todo'
|
||||
click "xpath=//div[@id='tickler'] //div[@id='todo_15'] //input[@class='item-checkbox']"
|
||||
wait_for_element_present "xpath=//div[@id='completed_container'] //div[@id='todo_15']"
|
||||
assert_not_visible "tickler-empty-nd"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
open "/projects/1"
|
||||
click "xpath=//div[@id='tickler'] //div[@id='todo_15'] //input[@class='item-checkbox']"
|
||||
wait_for_visible "tickler-empty-nd"
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
|
||||
#first, defer a todo
|
||||
open "/projects/1"
|
||||
click 'css=.project_settings a'
|
||||
wait_for_visible "project[default_context_name]"
|
||||
type "project_default_tags", "atag"
|
||||
click 'css=.positive'
|
||||
wait_for_value "tag_list", "atag"
|
||||
open "/projects/1"
|
||||
assert_value "tag_list", "atag"
|
||||
type "todo_description", "a new task"
|
||||
type "tag_list", "foo"
|
||||
click "todo_new_action_submit"
|
||||
wait_for_value "tag_list", "atag"
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
#Test for issue #952
|
||||
setup :fixtures => :all
|
||||
login :as => 'admin'
|
||||
open "/todos/tag/foo"
|
||||
click "css=#line_todo_2 .item-checkbox"
|
||||
wait_for_element_not_present "css=#c2 #line_todo_2"
|
||||
wait_for_not_visible "c2"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
setup :fixtures => [:users, :projects, :contexts, :todos, :notes]
|
||||
login :as => 'admin'
|
||||
open "/"
|
||||
click_and_wait "xpath=//a[@title='See your starred actions']"
|
||||
assert_title "exact:TRACKS::Tagged with 'starred'"
|
||||
verify_text_present "Currently there are no incomplete actions with the tag 'starred'"
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
class SeleniumHelperController < ActionController::Base
|
||||
def login
|
||||
if params[:as]
|
||||
user = User.find_by_login(params[:as].to_s)
|
||||
session['user_id'] = user
|
||||
user.contexts.each do |c|
|
||||
cookies["tracks_#{user.login}_context_c#{c.id}_collapsed"] = nil
|
||||
end
|
||||
end
|
||||
|
||||
render :text => "Logged in as #{params[:as]}"
|
||||
end
|
||||
end
|
||||
|
||||
module SeleniumOnRails::TestBuilderActions
|
||||
def login options = {}
|
||||
options = {options => nil} unless options.is_a? Hash
|
||||
opts = {:controller => 'selenium_helper', :action => 'login'}.merge(options)
|
||||
open opts
|
||||
end
|
||||
end
|
||||
|
||||
# The accessors available for SeleniumOnRails::TestBuilder tests.
|
||||
#
|
||||
# For each +store_foo+ there's +assert_foo+, +assert_not_foo+, +verify_foo+,
|
||||
# +verify_not_foo+, +wait_for_foo+, +wait_for_not_foo+.
|
||||
module SeleniumOnRails::TestBuilderAccessors
|
||||
|
||||
# How many elements with the class "context" are present on the page?
|
||||
#
|
||||
# Related Assertions, automatically generated:
|
||||
# * +assert_context_count+
|
||||
# * +assert_not_context_count+
|
||||
# * +verify_context_count+
|
||||
# * +verify_not_context_count+
|
||||
# * +wait_for_context_count+
|
||||
# * +wait_for_not_context_count+
|
||||
def store_context_count variable_name
|
||||
command 'storeContextCount', variable_name
|
||||
end
|
||||
|
||||
each_assertion 'store_context_count' do |assertion_method, command_name|
|
||||
define_method assertion_method do |expected_count|
|
||||
command command_name, expected_count
|
||||
end
|
||||
end
|
||||
|
||||
def drag_todo_to(id1, id2)
|
||||
mouse_down_at "css=#line_todo_#{id1} img.grip", "4,4"
|
||||
mouse_move_at "line_todo_#{id2}", '20,3'
|
||||
mouse_over "line_todo_#{id2}"
|
||||
mouse_up_at "line_todo_#{id2}", '20,3'
|
||||
end
|
||||
|
||||
def assert_context_count_incremented(&block)
|
||||
store_context_count 'initial_context_count'
|
||||
store_eval "${initial_context_count} + 1", 'expected_context_count'
|
||||
yield
|
||||
wait_for_context_count "${expected_context_count}"
|
||||
end
|
||||
|
||||
def click_and_wait clickable
|
||||
click clickable
|
||||
wait_for_page_to_load 3000
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue