mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-14 03:14:22 +01:00
Make the selenium tests more elegant.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@586 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
5cb42946c1
commit
4f3762a64c
5 changed files with 30 additions and 28 deletions
|
|
@ -22,7 +22,8 @@ end
|
|||
# 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
|
||||
# Has an alert occurred?
|
||||
|
||||
# How many elements with the class "context" are present on the page?
|
||||
#
|
||||
# Related Assertions, automatically generated:
|
||||
# * +assert_context_count+
|
||||
|
|
@ -41,4 +42,10 @@ module SeleniumOnRails::TestBuilderAccessors
|
|||
end
|
||||
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
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue