summaryrefslogtreecommitdiff
path: root/qa/qa/page/base.rb
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2018-01-25 23:03:14 -0800
committerMichael Kozono <mkozono@gmail.com>2018-01-26 09:30:32 -0800
commit09a7a1f0767285d59855bc3722ed838672c78c7f (patch)
tree0e42f8106cece0a4c7a5e2ef34265e79c53ed2e6 /qa/qa/page/base.rb
parent6c978c8f287d2fc61c58ab59973e0015bfc2ac58 (diff)
downloadgitlab-ce-qa/mk-fix-element-is-not-clickable-at-point.tar.gz
Diffstat (limited to 'qa/qa/page/base.rb')
-rw-r--r--qa/qa/page/base.rb16
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)