Updated selenium WEB_DRIVER_WAIT, the feature until_when now use a

predicate. Updated the related example.
This commit is contained in:
jvelilla
2013-05-13 10:47:46 -03:00
parent 30663dc9fb
commit e0c3c783fa
3 changed files with 26 additions and 19 deletions

View File

@@ -23,7 +23,7 @@ feature {NONE} -- Initialization
feature -- Access
-- create another feature to accept a predicate
until_when (condition : STRING)
until_when (condition : PREDICATE[ANY, TUPLE])
--Evaluate the condition until it's true or timing out .
local
found : BOOLEAN
@@ -34,20 +34,17 @@ feature -- Access
create l_time1.make_now
create l_duration.make_by_seconds (duration.as_integer_32)
condition.to_lower
from
create l_time2.make_now
if attached {STRING_32} web_driver.get_page_tile as l_title then
l_title.to_lower
found := l_title.has_substring (condition)
if condition.item([]) then
found := True
end
until
found or
l_time2.relative_duration (l_time1).fine_seconds_count > l_duration.fine_seconds_count
loop
if attached web_driver.get_page_tile as l_title then
l_title.to_lower
found := l_title.has_substring (condition)
if condition.item([]) then
found := True
end
create l_time2.make_now
end