diff --git a/rb/spec/integration/selenium/webdriver/spec_support/helpers.rb b/rb/spec/integration/selenium/webdriver/spec_support/helpers.rb index bbe0cd79b54ae..ed4ed13f17b9d 100644 --- a/rb/spec/integration/selenium/webdriver/spec_support/helpers.rb +++ b/rb/spec/integration/selenium/webdriver/spec_support/helpers.rb @@ -25,8 +25,8 @@ def driver GlobalTestEnv.driver_instance end - def reset_driver!(**opts) - GlobalTestEnv.reset_driver!(**opts) + def reset_driver!(**opts, &block) + GlobalTestEnv.reset_driver!(**opts, &block) end def quit_driver diff --git a/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb b/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb index 514fc7ba2d8f4..bcdc8f9f12134 100644 --- a/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb +++ b/rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb @@ -51,14 +51,14 @@ def browser driver == :remote ? ENV.fetch('WD_REMOTE_BROWSER', 'chrome').to_sym : driver end - def driver_instance(**opts) - @driver_instance || create_driver!(**opts) + def driver_instance(**opts, &block) + @driver_instance || create_driver!(**opts, &block) end - def reset_driver!(time: 0, **opts) + def reset_driver!(time: 0, **opts, &block) quit_driver sleep time - driver_instance(**opts) + driver_instance(**opts, &block) end def quit_driver