Excessibility.Snapshot (Excessibility v0.5.13)
View SourceCore snapshot generation and file management.
This module handles:
- Converting test sources to HTML snapshots
- Writing snapshots to the filesystem
- Screenshot generation via ChromicPDF
File Locations
Snapshots are stored in test/excessibility/html_snapshots/ by default.
Configure with :excessibility_output_path to change the base directory.
Workflow
- Run tests to generate snapshots
- Run
mix excessibility.baselineto lock in a known-good state - Run
mix excessibility.compareto diff against baseline after changes
This module is typically used via the Excessibility.html_snapshot/2 macro
rather than called directly.
Summary
Functions
Generates an HTML snapshot from a test source.
Functions
@spec html_snapshot(term(), Macro.Env.t(), module(), keyword()) :: term()
Generates an HTML snapshot from a test source.
Parameters
source- APlug.Conn,Wallaby.Session,Phoenix.LiveViewTest.View, orPhoenix.LiveViewTest.Elementenv- The__ENV__of the calling test (injected by macro)module- The__MODULE__of the calling test (injected by macro)opts- Keyword list of options
Options
:name- Custom filename (default:ModuleName_LineNumber.html):screenshot?- Generate PNG screenshots (default:false):open_browser?- Open snapshot in browser after writing (default:false):cleanup?- Delete existing snapshots for this module first (default:false)
Returns
The original source, unchanged (for pipeline compatibility).