Skip to content

Commit

Permalink
Setting the remote debug port for headless chrome (#159)
Browse files Browse the repository at this point in the history
* Fixing hanging specs by specifying the remote debug port. You can use an ENV to override it if you need. Fixes #158

* updating Ameba
  • Loading branch information
jwoertink committed Oct 22, 2023
1 parent 39efab6 commit a05bc7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ license: MIT
dependencies:
selenium:
github: crystal-loot/selenium.cr
version: ~> 0.12.0
version: ~> 0.12
webdrivers:
github: crystal-loot/webdrivers.cr
version: ~> 0.4.2
version: ~> 0.4
habitat:
github: luckyframework/habitat
version: ~> 0.4.7
Expand All @@ -27,4 +27,4 @@ dependencies:
development_dependencies:
ameba:
github: crystal-ameba/ameba
version: ~> 1.4.3
version: ~> 1.5
3 changes: 2 additions & 1 deletion src/lucky_flow/selenium/chrome/driver.cr
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ end

LuckyFlow::Registry.register :headless_chrome do
LuckyFlow::Selenium::Chrome::Driver.new do |config|
config.chrome_options.args = ["no-sandbox", "headless", "disable-gpu"]
remote_debuggin_port = ENV["CHROME_REMOTE_DEBUGGING_PORT"]? || 9222
config.chrome_options.args = ["no-sandbox", "headless", "disable-gpu", "remote-debugging-port=#{remote_debuggin_port}"]
end
end

0 comments on commit a05bc7a

Please sign in to comment.