Skip to content

Commit 6b73079

Browse files
committed
[rb] update spec helper methods to allow returning located elements
1 parent 583d1bc commit 6b73079

File tree

1 file changed

+12
-0
lines changed
  • rb/spec/integration/selenium/webdriver/spec_support

1 file changed

+12
-0
lines changed

rb/spec/integration/selenium/webdriver/spec_support/helpers.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,22 @@ def fix_windows_path(path)
5656

5757
def long_wait
5858
@long_wait ||= Wait.new(timeout: 30)
59+
60+
return @long_wait unless block_given?
61+
62+
result = nil
63+
@long_wait.until { result = yield }
64+
result
5965
end
6066

6167
def short_wait
6268
@short_wait ||= Wait.new(timeout: 3)
69+
70+
return @short_wait unless block_given?
71+
72+
result = nil
73+
@short_wait.until { result = yield }
74+
result
6375
end
6476

6577
def wait_for_alert

0 commit comments

Comments
 (0)