From fabc5d8d0d856a8c5cd7f0cee0031aa7a221657e Mon Sep 17 00:00:00 2001 From: lrbalt Date: Sat, 5 Apr 2008 14:09:30 +0000 Subject: [PATCH] fixed a startup warning with TRACKS_VERSION, fix selenium tests for slow updates and add a new selenium test for #688 git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@799 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/config/environment.rb.tmpl | 6 ++++-- .../change_todo_context_to_new_context.rsel | 21 +++++++++++++++++++ .../create_todo_in_completed_project.rsel | 7 +++++++ .../home/create_todo_in_hidden_project.rsel | 3 +++ .../no_script_if_no_contexts.rsel | 3 +++ tracks/test/selenium/notes/badge_count.rsel | 4 ++++ .../change_default_context.rsel | 1 + 7 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 tracks/test/selenium/home/change_todo_context_to_new_context.rsel diff --git a/tracks/config/environment.rb.tmpl b/tracks/config/environment.rb.tmpl index 499289fd..28ff4ec6 100644 --- a/tracks/config/environment.rb.tmpl +++ b/tracks/config/environment.rb.tmpl @@ -85,8 +85,10 @@ end MOBILE_CONTENT_TYPE = 'tracks/mobile' Mime::Type.register(MOBILE_CONTENT_TYPE, :m) -TRACKS_VERSION = '1.5-trunk' +tracks_version = '1.5-trunk' info = `svn info #{RAILS_ROOT} --config-dir /etc/subversion`[/Last Changed Rev: (.*?)\n/] if info - TRACKS_VERSION += '-rev'+info[/(\d+)/] + tracks_version += '-rev'+info[/(\d+)/] end + +TRACKS_VERSION=tracks_version diff --git a/tracks/test/selenium/home/change_todo_context_to_new_context.rsel b/tracks/test/selenium/home/change_todo_context_to_new_context.rsel new file mode 100644 index 00000000..b4de8755 --- /dev/null +++ b/tracks/test/selenium/home/change_todo_context_to_new_context.rsel @@ -0,0 +1,21 @@ +# when you change a todo to a new context, the new context must show with +# the new todo +setup :fixtures => :all +login :as => 'admin' +open "/" + +# change context of todo to new context +click "edit_icon_todo_12" +wait_for_visible "context_name_todo_12" +type "context_name_todo_12", "new context" +click "submit_todo_12" + +# check that todo is removed from old context +wait_for_element_not_present "css=#c1 #todo_12" + +# check if new context is shown and that the todo is also shown +wait_for_text_present 'new context' +# TODO: this check only looks for todo_12 but does not check if it is contained +# within the new context. +wait_for_element_not_present "#todo_12" + diff --git a/tracks/test/selenium/home/create_todo_in_completed_project.rsel b/tracks/test/selenium/home/create_todo_in_completed_project.rsel index 2755adad..d1c90d2d 100644 --- a/tracks/test/selenium/home/create_todo_in_completed_project.rsel +++ b/tracks/test/selenium/home/create_todo_in_completed_project.rsel @@ -1,12 +1,19 @@ setup :fixtures => :all login :as => 'admin' +open "/" +# we should start with 10 actions on home page +assert_text 'badge_count', '10' + # set project to hidden state open "/projects/2" click 'project_state_completed' +# 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 diff --git a/tracks/test/selenium/home/create_todo_in_hidden_project.rsel b/tracks/test/selenium/home/create_todo_in_hidden_project.rsel index 9c039336..95f31cd9 100644 --- a/tracks/test/selenium/home/create_todo_in_hidden_project.rsel +++ b/tracks/test/selenium/home/create_todo_in_hidden_project.rsel @@ -4,6 +4,9 @@ login :as => 'admin' # set project to hidden state open "/projects/2" click 'project_state_hidden' +# 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 "/" diff --git a/tracks/test/selenium/integrations/no_script_if_no_contexts.rsel b/tracks/test/selenium/integrations/no_script_if_no_contexts.rsel index 37278953..4da2ea76 100644 --- a/tracks/test/selenium/integrations/no_script_if_no_contexts.rsel +++ b/tracks/test/selenium/integrations/no_script_if_no_contexts.rsel @@ -6,6 +6,9 @@ wait_for_element_present "no_context_msg" open "/contexts" type "context_name", "my first context" click "context_new_submit" +# wait for new context to appear before navigating away from project page to +# make sure that the changes have been saved +wait_for_text_present 'DRAG' open "/integrations" wait_for_element_present "applescript1-contexts" diff --git a/tracks/test/selenium/notes/badge_count.rsel b/tracks/test/selenium/notes/badge_count.rsel index 7bb0c442..ace3d85d 100644 --- a/tracks/test/selenium/notes/badge_count.rsel +++ b/tracks/test/selenium/notes/badge_count.rsel @@ -9,6 +9,10 @@ click "css=#add_note_href" type "css=#new_note_body", "new note" click "add-new-note" +# wait until new note is saved +wait_for_text_not_present "new note" +wait_for_text_present "new note" + # check badge count is one more open "/notes/" assert_text 'badge_count', '3' diff --git a/tracks/test/selenium/project_detail/change_default_context.rsel b/tracks/test/selenium/project_detail/change_default_context.rsel index 1e757acd..0daec49b 100644 --- a/tracks/test/selenium/project_detail/change_default_context.rsel +++ b/tracks/test/selenium/project_detail/change_default_context.rsel @@ -17,6 +17,7 @@ wait_for_not_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"