diff --git a/example_project/README.md b/example_project/README.md index 79f5959..9d22e3f 100644 --- a/example_project/README.md +++ b/example_project/README.md @@ -9,10 +9,10 @@ Now you can visit [`localhost:4000`](http://localhost:4000) from your browser. ## Testing -- Run all tests: `mix test` +- Run all tests: `mix test` (by default this excludes E2E tests; use `mix test --only e2e` to run browser tests). - Run only E2E (browser) tests: `mix test --only e2e` -E2E tests use [Wallaby](https://hexdocs.pm/wallaby) and serve the app from **built** assets (`priv/static`). After changing Svelte (or other frontend) code, rebuild before E2E so tests see your changes: +E2E test modules must use `@moduletag :e2e`. E2E tests use [Wallaby](https://hexdocs.pm/wallaby) and serve the app from **built** assets (`priv/static`). After changing Svelte (or other frontend) code, rebuild before E2E so tests see your changes: ```bash mix assets.js && mix test --only e2e diff --git a/example_project/config/test.exs b/example_project/config/test.exs index b8acaaf..4ecf92a 100644 --- a/example_project/config/test.exs +++ b/example_project/config/test.exs @@ -17,8 +17,10 @@ config :example, ExampleWeb.Endpoint, secret_key_base: "XvZC2gcAePazgtLhJ+/kX9NxRrJA9HBGVxRjfVHW7f//XBDiDpQJ4/ot6N3llQjW", server: true -# Wallaby E2E: base URL must match endpoint port -config :wallaby, base_url: "http://localhost:4002" +# Wallaby E2E: base URL must match endpoint port; explicit driver for clarity and CI +config :wallaby, + base_url: "http://localhost:4002", + driver: Wallaby.Chrome # PhoenixTest: lightweight server-side testing (no browser needed) config :phoenix_test, :endpoint, ExampleWeb.Endpoint