ClientUtils.JourneyStage (client_utils v0.7.0)

View Source

A walk's visits, which wait for the LiveView socket, and its slides: with CMS_JOURNEY_SLIDES_DIR set, each stage's screenshot and the journey's slideshow <dir>/<journey>.html (each stage's name above its image, in stage order). A session that is not a browser takes no screenshot, and with the variable unset nothing is saved.

Summary

Functions

Waits until the page's LiveView has joined; any session but a Playwright one comes back as it was.

With CMS_JOURNEY_SLIDES_DIR set and a browser session, saves its screenshot as journey's next slide, <dir>/<journey>/NN-<name>.png, and rewrites <dir>/<journey>.html. Returns the slides so far; slides is what the last call returned, [] for a journey's first, which starts its folder afresh so a rerun never shows an earlier run's pictures.

PhoenixTest.visit/2, then connected/1: the visit a stage's action should use.

Functions

connected(session)

Waits until the page's LiveView has joined; any session but a Playwright one comes back as it was.

An action that visits and then interacts needs this after the visit: visit/2 resolves on page load, before the socket joins, and a select/3 or click sent in that gap is dropped.

slide(slides, session, journey, name)

With CMS_JOURNEY_SLIDES_DIR set and a browser session, saves its screenshot as journey's next slide, <dir>/<journey>/NN-<name>.png, and rewrites <dir>/<journey>.html. Returns the slides so far; slides is what the last call returned, [] for a journey's first, which starts its folder afresh so a rerun never shows an earlier run's pictures.

visit(session, path)

PhoenixTest.visit/2, then connected/1: the visit a stage's action should use.