diff --git a/test/selenium/home/create_new_todo_in_context_and_hide_context.rsel b/test/selenium/home/create_new_todo_in_context_and_hide_context.rsel index 4b8adbe7..8e540225 100644 --- a/test/selenium/home/create_new_todo_in_context_and_hide_context.rsel +++ b/test/selenium/home/create_new_todo_in_context_and_hide_context.rsel @@ -18,4 +18,7 @@ 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']" \ No newline at end of file +wait_for_not_visible "xpath=//span[text()='a new action']" + +# toggle c1 back. Selenium does not reset cookies +click "css=#toggle_c1" diff --git a/test/selenium/home/create_todo_in_completed_project.rsel b/test/selenium/home/create_todo_in_completed_project.rsel index d1c90d2d..c041c2c0 100644 --- a/test/selenium/home/create_todo_in_completed_project.rsel +++ b/test/selenium/home/create_todo_in_completed_project.rsel @@ -3,7 +3,7 @@ login :as => 'admin' open "/" # we should start with 10 actions on home page -assert_text 'badge_count', '10' +assert_text 'badge_count', '11' # set project to hidden state open "/projects/2" @@ -28,4 +28,4 @@ wait_for_visible "flash" verify_text_not_present 'should be hidden' # badge count should still be same -assert_text 'badge_count', '7' \ No newline at end of file +assert_text 'badge_count', '7' diff --git a/test/selenium/home/defer_todo.rsel b/test/selenium/home/defer_todo.rsel index b3687fd7..5bec1965 100644 --- a/test/selenium/home/defer_todo.rsel +++ b/test/selenium/home/defer_todo.rsel @@ -6,4 +6,4 @@ wait_for_element_present "show_from_todo_9" type "show_from_todo_9", "1/1/2030" click "css=#submit_todo_9" wait_for_element_not_present "todo_9" -assert_text 'badge_count', '9' +assert_text 'badge_count', '10' diff --git a/test/selenium/home/defer_todo_empty_context.rsel b/test/selenium/home/defer_todo_empty_context.rsel index afb56fd7..8b221be5 100644 --- a/test/selenium/home/defer_todo_empty_context.rsel +++ b/test/selenium/home/defer_todo_empty_context.rsel @@ -6,5 +6,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_not_present "todo_5" -assert_text 'badge_count', '9' +assert_text 'badge_count', '10' wait_for_not_visible "c5" diff --git a/test/selenium/home/defer_todo_with_button_empty_context.rsel b/test/selenium/home/defer_todo_with_button_empty_context.rsel index 3997c0fb..ede74b2a 100644 --- a/test/selenium/home/defer_todo_with_button_empty_context.rsel +++ b/test/selenium/home/defer_todo_with_button_empty_context.rsel @@ -1,8 +1,8 @@ setup :fixtures => :all login :as => 'admin' open "/" -wait_for_element_present '//div[@id="line_todo_5"]//img[@alt="Defer_1"]/..' -click '//div[@id="line_todo_5"]//img[@alt="Defer_1"]/..' +wait_for_element_present '//div[@id="line_todo_5"]//img[@alt="Defer 1 day"]/..' +click '//div[@id="line_todo_5"]//img[@alt="Defer 1 day"]/..' wait_for_element_not_present "todo_5" -assert_text 'badge_count', '9' +assert_text 'badge_count', '10' wait_for_not_visible "c5" diff --git a/test/selenium/mobile/create_new_action.rsel b/test/selenium/mobile/create_new_action.rsel index a8501da1..8756d3ea 100644 --- a/test/selenium/mobile/create_new_action.rsel +++ b/test/selenium/mobile/create_new_action.rsel @@ -2,7 +2,7 @@ setup :fixtures => :all login :as => 'admin' open '/m' -wait_for_text 'css=h1 span.count', '10' +wait_for_text 'css=h1 span.count', '11' click_and_wait "link=0-Add new action" @@ -15,4 +15,4 @@ select "todo_due_2i", "label=January" select "todo_due_1i", "label=2009" click_and_wait "//input[@value='Create']" -wait_for_text 'css=h1 span.count', '11' +wait_for_text 'css=h1 span.count', '12' diff --git a/test/selenium/mobile/mark_done.rsel b/test/selenium/mobile/mark_done.rsel index 82a9e3a6..d6643973 100644 --- a/test/selenium/mobile/mark_done.rsel +++ b/test/selenium/mobile/mark_done.rsel @@ -2,10 +2,12 @@ setup :fixtures => :all login :as => 'admin' open '/m' -wait_for_text 'css=h1 span.count', '10' +wait_for_text 'css=h1 span.count', '11' + +open '/todos/6.m' +wait_for_page_to_load 3000 -open_and_wait '/todos/6.m' click "done" click_and_wait "//input[@value='Update']" -wait_for_text 'css=h1 span.count', '9' +wait_for_text 'css=h1 span.count', '10' diff --git a/test/selenium/mobile/navigation.rsel b/test/selenium/mobile/navigation.rsel index 44bde92c..2d6efdb2 100644 --- a/test/selenium/mobile/navigation.rsel +++ b/test/selenium/mobile/navigation.rsel @@ -4,14 +4,14 @@ login :as => 'admin' # open home page open '/m' wait_for_title "All actions" -wait_for_text 'css=h1 span.count', '10' +wait_for_text 'css=h1 span.count', '11' # open context page click_and_wait "link=2-Contexts" # verify_title "All actions in context agenda" # choose agenda context click_and_wait "link=agenda" -wait_for_text 'css=h1 span.count', '5' +wait_for_text 'css=h1 span.count', '6' # click on tag foo to go to tag page click_and_wait "link=foo" diff --git a/test/selenium/project_detail/change_project_status.rsel b/test/selenium/project_detail/change_project_status.rsel index d6799762..c57f38fe 100644 --- a/test/selenium/project_detail/change_project_status.rsel +++ b/test/selenium/project_detail/change_project_status.rsel @@ -1,7 +1,7 @@ setup :fixtures => :all login :as => 'admin' open '/projects/1' -assert_checked 'project_state_active', 'ignored' +assert_checked 'project_state_active' assert_attribute 'css=#project_status .active span', 'class', 'active_state' assert_attribute 'css=#project_status .hidden span', 'class', 'inactive_state' assert_text 'badge_count', '2' @@ -11,4 +11,4 @@ wait_for_attribute 'css=#project_status .hidden span', 'class', 'active_state' assert_text 'badge_count', '2' open '/projects/1' assert_text 'badge_count', '2' -assert_checked 'project_state_hidden', 'ignored' +assert_checked 'project_state_hidden' diff --git a/test/selenium/project_detail/count_actions_in_hidden_project.rsel b/test/selenium/project_detail/count_actions_in_hidden_project.rsel index f0343e4b..f4bbd9e6 100644 --- a/test/selenium/project_detail/count_actions_in_hidden_project.rsel +++ b/test/selenium/project_detail/count_actions_in_hidden_project.rsel @@ -20,4 +20,4 @@ assert_text 'badge_count', '4' open '/projects/1' assert_text 'badge_count', '4' -assert_checked 'project_state_hidden', 'ignored' \ No newline at end of file +assert_checked 'project_state_hidden' diff --git a/test/selenium_helper.rb b/test/selenium_helper.rb index 31f462e4..a224ec57 100644 --- a/test/selenium_helper.rb +++ b/test/selenium_helper.rb @@ -51,4 +51,10 @@ module SeleniumOnRails::TestBuilderAccessors yield wait_for_context_count "${expected_context_count}" end -end \ No newline at end of file + + def click_and_wait clickable + click clickable + wait_for_page_to_load 3000 + end + +end