diff options
author | Michael Kozono <mkozono@gmail.com> | 2018-01-25 23:03:14 -0800 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2018-01-26 09:30:32 -0800 |
commit | 09a7a1f0767285d59855bc3722ed838672c78c7f (patch) | |
tree | 0e42f8106cece0a4c7a5e2ef34265e79c53ed2e6 /qa/qa/page/base.rb | |
parent | 6c978c8f287d2fc61c58ab59973e0015bfc2ac58 (diff) | |
download | gitlab-ce-qa/mk-fix-element-is-not-clickable-at-point.tar.gz |
Fix intermittent click errorqa/mk-fix-element-is-not-clickable-at-point
Diffstat (limited to 'qa/qa/page/base.rb')
-rw-r--r-- | qa/qa/page/base.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb index 81ba80cdbaf..fa7a3760057 100644 --- a/qa/qa/page/base.rb +++ b/qa/qa/page/base.rb @@ -13,16 +13,18 @@ module QA visit current_url end - def wait(css = '.application', time: 60) - Time.now.tap do |start| - while Time.now - start < time - break if page.has_css?(css, wait: 5) + def wait(max: 60, time: 1, reload: true) + start = Time.now - refresh - end + while Time.now - start < max + return true if yield + + sleep(time) + + refresh if reload end - yield if block_given? + false end def scroll_to(selector, text: nil) |