Skip to content

Commit 095e216

Browse files
authored
Use browser pools by default (opt-out) (#99)
1 parent b9204e2 commit 095e216

25 files changed

+399
-366
lines changed

.github/workflows/elixir.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@ jobs:
3535
run: mix credo
3636
- name: Compiles without warnings
3737
run: mix compile --warnings-as-errors
38-
- name: Build assets for browser tests
39-
run: mix do assets.setup, assets.build
40-
- name: Install JS dependencies
41-
run: npm ci --prefix priv/static/assets
42-
- name: Install chromium browser
43-
run: npm exec --prefix priv/static/assets -- playwright install chromium --with-deps --only-shell
38+
- name: Install JS dependencies, build assets and install browsers
39+
run: mix setup
4440
- name: Run tests
4541
run: "mix test --warnings-as-errors || if [[ $? = 2 ]]; then PW_TRACE=true mix test --failed; else false; fi"
4642
- name: Fail if screenshot on exit failed

config/config.exs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
import Config
22

3-
config :phoenix_test,
4-
endpoint: PhoenixTest.Endpoint
5-
63
import_config "#{config_env()}.exs"

config/test.exs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,21 @@ config :phoenix_test,
1818
headless: System.get_env("PW_HEADLESS", "true") in ~w(t true),
1919
screenshot: System.get_env("PW_SCREENSHOT", "false") in ~w(t true),
2020
trace: System.get_env("PW_TRACE", "false") in ~w(t true),
21-
timeout: String.to_integer(System.get_env("PW_TIMEOUT", "500"))
21+
timeout: String.to_integer(System.get_env("PW_TIMEOUT", "500")),
22+
browser_pool: :chromium_pool,
23+
browser_pools: [
24+
[id: :chromium_pool, browser: :chromium],
25+
[id: :firefox_pool, browser: :firefox]
26+
]
2227
]
2328

2429
config :phoenix_test_playwright, PhoenixTest.Endpoint,
2530
server: true,
2631
http: [port: 4002],
2732
live_view: [signing_salt: "112345678212345678312345678412"],
2833
secret_key_base: String.duplicate("57689", 50),
29-
pubsub_server: PhoenixTest.PubSub
34+
pubsub_server: PhoenixTest.PubSub,
35+
render_errors: [
36+
formats: [html: PhoenixTest.WebApp.ErrorView],
37+
layout: false
38+
]

0 commit comments

Comments
 (0)