Skip to content

Commit

Permalink
chore: Add helper to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
route committed Jan 26, 2025
1 parent 27c7cd6 commit 804eace
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions spec/page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@
end

page.evaluate("console.log('hello')")
wait_a_bit
expect(message).to eq("hello")
end
end
Expand Down
4 changes: 4 additions & 0 deletions spec/support/global_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ def web_socket_debugger_url(url)
rescue JSON::ParserError
# nop
end

def wait_a_bit(duration = 0.2)
Thread.pass && sleep(duration)
end
end

0 comments on commit 804eace

Please sign in to comment.