mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 16:20:12 +01:00
fix a lot of selenium tests to pass again
This commit is contained in:
parent
df26cf6e87
commit
09f0322d45
11 changed files with 30 additions and 19 deletions
|
|
@ -19,3 +19,6 @@ wait_for_not_visible "todo_9"
|
||||||
|
|
||||||
# check that newly added action is not there
|
# check that newly added action is not there
|
||||||
wait_for_not_visible "xpath=//span[text()='a new action']"
|
wait_for_not_visible "xpath=//span[text()='a new action']"
|
||||||
|
|
||||||
|
# toggle c1 back. Selenium does not reset cookies
|
||||||
|
click "css=#toggle_c1"
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ login :as => 'admin'
|
||||||
|
|
||||||
open "/"
|
open "/"
|
||||||
# we should start with 10 actions on home page
|
# we should start with 10 actions on home page
|
||||||
assert_text 'badge_count', '10'
|
assert_text 'badge_count', '11'
|
||||||
|
|
||||||
# set project to hidden state
|
# set project to hidden state
|
||||||
open "/projects/2"
|
open "/projects/2"
|
||||||
|
|
|
||||||
|
|
@ -6,4 +6,4 @@ wait_for_element_present "show_from_todo_9"
|
||||||
type "show_from_todo_9", "1/1/2030"
|
type "show_from_todo_9", "1/1/2030"
|
||||||
click "css=#submit_todo_9"
|
click "css=#submit_todo_9"
|
||||||
wait_for_element_not_present "todo_9"
|
wait_for_element_not_present "todo_9"
|
||||||
assert_text 'badge_count', '9'
|
assert_text 'badge_count', '10'
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,5 @@ wait_for_element_present "show_from_todo_5"
|
||||||
type "show_from_todo_5", "1/1/2030"
|
type "show_from_todo_5", "1/1/2030"
|
||||||
click "css=#submit_todo_5"
|
click "css=#submit_todo_5"
|
||||||
wait_for_element_not_present "todo_5"
|
wait_for_element_not_present "todo_5"
|
||||||
assert_text 'badge_count', '9'
|
assert_text 'badge_count', '10'
|
||||||
wait_for_not_visible "c5"
|
wait_for_not_visible "c5"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
setup :fixtures => :all
|
setup :fixtures => :all
|
||||||
login :as => 'admin'
|
login :as => 'admin'
|
||||||
open "/"
|
open "/"
|
||||||
wait_for_element_present '//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"]/..'
|
click '//div[@id="line_todo_5"]//img[@alt="Defer 1 day"]/..'
|
||||||
wait_for_element_not_present "todo_5"
|
wait_for_element_not_present "todo_5"
|
||||||
assert_text 'badge_count', '9'
|
assert_text 'badge_count', '10'
|
||||||
wait_for_not_visible "c5"
|
wait_for_not_visible "c5"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ setup :fixtures => :all
|
||||||
login :as => 'admin'
|
login :as => 'admin'
|
||||||
|
|
||||||
open '/m'
|
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"
|
click_and_wait "link=0-Add new action"
|
||||||
|
|
||||||
|
|
@ -15,4 +15,4 @@ select "todo_due_2i", "label=January"
|
||||||
select "todo_due_1i", "label=2009"
|
select "todo_due_1i", "label=2009"
|
||||||
click_and_wait "//input[@value='Create']"
|
click_and_wait "//input[@value='Create']"
|
||||||
|
|
||||||
wait_for_text 'css=h1 span.count', '11'
|
wait_for_text 'css=h1 span.count', '12'
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,12 @@ setup :fixtures => :all
|
||||||
login :as => 'admin'
|
login :as => 'admin'
|
||||||
|
|
||||||
open '/m'
|
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 "done"
|
||||||
click_and_wait "//input[@value='Update']"
|
click_and_wait "//input[@value='Update']"
|
||||||
|
|
||||||
wait_for_text 'css=h1 span.count', '9'
|
wait_for_text 'css=h1 span.count', '10'
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,14 @@ login :as => 'admin'
|
||||||
# open home page
|
# open home page
|
||||||
open '/m'
|
open '/m'
|
||||||
wait_for_title "All actions"
|
wait_for_title "All actions"
|
||||||
wait_for_text 'css=h1 span.count', '10'
|
wait_for_text 'css=h1 span.count', '11'
|
||||||
|
|
||||||
# open context page
|
# open context page
|
||||||
click_and_wait "link=2-Contexts"
|
click_and_wait "link=2-Contexts"
|
||||||
# verify_title "All actions in context agenda"
|
# verify_title "All actions in context agenda"
|
||||||
# choose agenda context
|
# choose agenda context
|
||||||
click_and_wait "link=agenda"
|
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 on tag foo to go to tag page
|
||||||
click_and_wait "link=foo"
|
click_and_wait "link=foo"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
setup :fixtures => :all
|
setup :fixtures => :all
|
||||||
login :as => 'admin'
|
login :as => 'admin'
|
||||||
open '/projects/1'
|
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 .active span', 'class', 'active_state'
|
||||||
assert_attribute 'css=#project_status .hidden span', 'class', 'inactive_state'
|
assert_attribute 'css=#project_status .hidden span', 'class', 'inactive_state'
|
||||||
assert_text 'badge_count', '2'
|
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'
|
assert_text 'badge_count', '2'
|
||||||
open '/projects/1'
|
open '/projects/1'
|
||||||
assert_text 'badge_count', '2'
|
assert_text 'badge_count', '2'
|
||||||
assert_checked 'project_state_hidden', 'ignored'
|
assert_checked 'project_state_hidden'
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,4 @@ assert_text 'badge_count', '4'
|
||||||
|
|
||||||
open '/projects/1'
|
open '/projects/1'
|
||||||
assert_text 'badge_count', '4'
|
assert_text 'badge_count', '4'
|
||||||
assert_checked 'project_state_hidden', 'ignored'
|
assert_checked 'project_state_hidden'
|
||||||
|
|
|
||||||
|
|
@ -51,4 +51,10 @@ module SeleniumOnRails::TestBuilderAccessors
|
||||||
yield
|
yield
|
||||||
wait_for_context_count "${expected_context_count}"
|
wait_for_context_count "${expected_context_count}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def click_and_wait clickable
|
||||||
|
click clickable
|
||||||
|
wait_for_page_to_load 3000
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue