From bf5d59248d13113c4fa1664ce0cc8ef728579840 Mon Sep 17 00:00:00 2001 From: titusfortner Date: Sun, 24 Sep 2023 13:34:26 -0500 Subject: [PATCH] [rb] fix flaky test --- .../integration/selenium/webdriver/action_builder_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rb/spec/integration/selenium/webdriver/action_builder_spec.rb b/rb/spec/integration/selenium/webdriver/action_builder_spec.rb index 6dd6f198d8ba3..db187bc696c22 100644 --- a/rb/spec/integration/selenium/webdriver/action_builder_spec.rb +++ b/rb/spec/integration/selenium/webdriver/action_builder_spec.rb @@ -382,8 +382,10 @@ module WebDriver iframe = driver.find_element(tag_name: 'iframe') driver.switch_to.frame(iframe) checkbox = driver.find_element(name: 'scroll_checkbox') - sleep 0.5 - expect(in_viewport?(checkbox)).to be true + + expect { + wait.until { in_viewport?(checkbox) } + }.not_to raise_error end it 'raises MoveTargetOutOfBoundsError when origin offset is out of viewport',