elixir-wallaby / wallaby

Concurrent browser tests for your Elixir web apps.
https://twitter.com/elixir_wallaby
MIT License
1.68k stars 198 forks source link

Is it possible to configure "headless: true | false" at session opening? #747

Closed thbar closed 1 year ago

thbar commented 1 year ago

I am using Wallaby via Mix.install/2 like this:

Mix.install([
  {:wallaby, "~> 0.30.6"}
], config: [
  wallaby: [chromedriver: [headless: true]]
])

I quite often need to switch to headless: false, which causes a re-compilation in that case.

What is the recommended way to configure this at runtime? Should I pass "capabilities" (with the headless flag) to the Chrome driver, or is there something doable at the session level?

Thanks!

mhanberg commented 1 year ago

I believe you can use Application.put_env instead of passing the config into Mix.install

thbar commented 1 year ago

You are right - in some cases I believe I had issues with that, so didn't try, but it works perfectly for wallaby! Thanks.

Mix.install([
  {:wallaby, "~> 0.30.6"}
])

Application.put_env(:wallaby, :chromedriver, [headless: false])