Make wait return the value we yielded when

it's not nil nor false.
This commit is contained in:
Lin Jen-Shin 2018-02-12 22:03:49 +08:00
parent 338bb2ac97
commit 2f34ef34fa
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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