Sets up phx_demo in a Phoenix app
Automates the README's setup steps:
- adds
phoenix_test_playwright(test only) preferred_envsfordemo.recordandphx_demo.piper.setup- config/test.exs: endpoint
server: true,:sql_sandbox,:phoenix_testotp_app - Ecto sandbox for LiveView (if the app has a Repo): the
Phoenix.Ecto.SQL.Sandboxplug,:user_agentin the LiveView socket'sconnect_info, and anon_mounthook registered for every LiveView - test/test_helper.exs: starts Playwright, sets the base URL, and
excludes demos from plain
mix test - guards Phoenix 1.8's runtime.exs port config so it doesn't override the test port
- an example demo in test/demos/
Edits it can't make safely become notices with the manual step.
Example
MIX_ENV=test mix igniter.install phx_demo --only test