Skip to content

Commit 804eace

Browse files
committed
chore: Add helper to tests
1 parent 27c7cd6 commit 804eace

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

spec/page_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206
end
207207

208208
page.evaluate("console.log('hello')")
209+
wait_a_bit
209210
expect(message).to eq("hello")
210211
end
211212
end

spec/support/global_helpers.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,8 @@ def web_socket_debugger_url(url)
6666
rescue JSON::ParserError
6767
# nop
6868
end
69+
70+
def wait_a_bit(duration = 0.2)
71+
Thread.pass && sleep(duration)
72+
end
6973
end

0 commit comments

Comments
 (0)