summaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-02-12 22:03:49 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-02-12 22:03:49 +0800
commit2f34ef34fa230c1954e47504cd8ead1a6ab019fe (patch)
tree36987fa079eff08d167715164a06b5fd58d33959 /qa
parent338bb2ac975bb5c4a7d8074c126029d86074e251 (diff)
downloadgitlab-ce-2f34ef34fa230c1954e47504cd8ead1a6ab019fe.tar.gz
Make wait return the value we yielded when
it's not nil nor false.
Diffstat (limited to 'qa')
-rw-r--r--qa/qa/page/base.rb3
-rw-r--r--qa/qa/page/project/pipeline/index.rb5
2 files changed, 4 insertions, 4 deletions
diff --git a/qa/qa/page/base.rb b/qa/qa/page/base.rb
index 5c3af4b9115..7924479e2a1 100644
--- a/qa/qa/page/base.rb
+++ b/qa/qa/page/base.rb
@@ -17,7 +17,8 @@ module QA
start = Time.now
while Time.now - start < max
- return true if yield
+ result = yield
+ return result if result
sleep(time)
diff --git a/qa/qa/page/project/pipeline/index.rb b/qa/qa/page/project/pipeline/index.rb
index 466010935b1..ce430a2a6ee 100644
--- a/qa/qa/page/project/pipeline/index.rb
+++ b/qa/qa/page/project/pipeline/index.rb
@@ -7,10 +7,9 @@ module QA::Page
def go_to_latest_pipeline
css = '.js-pipeline-url-link'
- link = nil
- wait(reload: false) do
- link = first(css)
+ link = wait(reload: false) do
+ first(css)
end
link.click