File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
rb/spec/integration/selenium/webdriver Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -337,7 +337,7 @@ module WebDriver
337337
338338 it 'is able to pass element arguments' do
339339 driver . navigate . to url_for ( 'javascriptPage.html' )
340- button = driver . find_element ( id : 'plainButton' )
340+ button = short_wait { driver . find_element ( id : 'plainButton' ) }
341341 js = "arguments[0]['flibble'] = arguments[0].getAttribute('id'); return arguments[0]['flibble'];"
342342 expect ( driver . execute_script ( js , button ) )
343343 . to eq ( 'plainButton' )
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ module Selenium
2323 module WebDriver
2424 module Support
2525 describe Select , exclusive : { bidi : false , reason : 'Not yet implemented with BiDi' } do
26- let ( :select ) { described_class . new ( driver . find_element ( name : 'selectomatic' ) ) }
26+ let ( :selectomatic ) { short_wait { driver . find_element ( name : 'selectomatic' ) } }
27+ let ( :select ) { described_class . new ( selectomatic ) }
2728 let ( :multi_select ) { described_class . new ( driver . find_element ( id : 'multi' ) ) }
2829 let ( :single_disabled ) { described_class . new ( driver . find_element ( name : 'single_disabled' ) ) }
2930 let ( :multi_disabled ) { described_class . new ( driver . find_element ( name : 'multi_disabled' ) ) }
Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ def long_wait
6060
6161 def short_wait
6262 @short_wait ||= Wait . new ( timeout : 3 )
63+
64+ return @short_wait unless block_given?
65+
66+ result = nil
67+ @short_wait . until { result = yield }
68+ result
6369 end
6470
6571 def wait_for_alert
You can’t perform that action at this time.
0 commit comments