A browser-based visual test runner that lets you step through elm-pages test snapshots in your browser. Displays a Cypress-style command log sidebar alongside the rendered page view.
module TestViewer exposing (main)
import Test.PagesProgram as PagesProgram
import Test.PagesProgram.Viewer as Viewer
main =
Viewer.app
[ ( "Blog loads posts"
, myBlogTest |> PagesProgram.toSnapshots
)
, ( "Counter increments"
, myCounterTest |> PagesProgram.toSnapshots
)
]Open the compiled HTML in your browser, then use arrow keys to step through.
The Cookies sidebar (c) displays signed session cookies with the secret
that was used. Note: the in-memory "checksum" shown next to the secret is a
fast non-cryptographic FNV1a hash, not a real HMAC-SHA256 — it only exists
so the visual runner can distinguish different secrets and detect
test-time tampering of signed-cookie payloads.
Flags for the viewer app. Currently unused.
The viewer's model.
The viewer's messages.
Create a visual test runner application. Pass a list of named tests with their snapshots.