diff --git a/rb/spec/integration/selenium/webdriver/window_spec.rb b/rb/spec/integration/selenium/webdriver/window_spec.rb index d47fd3df08616..7cc1ac56db899 100644 --- a/rb/spec/integration/selenium/webdriver/window_spec.rb +++ b/rb/spec/integration/selenium/webdriver/window_spec.rb @@ -126,7 +126,9 @@ module WebDriver it 'can minimize the window', except: {browser: %i[chrome edge], headless: true} do window.minimize - expect(driver.execute_script('return document.hidden;')).to be true + expect { + wait.until { driver.execute_script('return document.hidden;') } + }.not_to raise_error end end end # WebDriver