screenshot
Saves screenshots from the browser at points triggered by on=.
Replaces the legacy screenshotOnFail plugin. Default on=fail preserves the
old behavior (screenshot when a test fails). Pass slides=true (with on=step)
to generate a step-by-step slideshow report — replaces the legacy
stepByStepReport plugin.
Configuration
Section titled “Configuration”plugins: { screenshot: { enabled: true, on: 'fail', }}on= modes
Section titled “on= modes”- fail — screenshot when a test fails (default)
- test — screenshot at the end of every test
- step — screenshot after every step
- file — screenshot for steps in
path=...[;line=...] - url — screenshot when the current browser URL matches
pattern=...
Other config options:
uniqueScreenshotNames: use unique names for screenshot. Default: false.fullPageScreenshots: make full page screenshots. Default: false.disableScreenshots: legacy switch to skip the plugin entirely.slides: generate a step-by-step slideshow report (requireson=step). Default: false.deleteSuccessful: whenslides=true, drop slideshow directories of passing tests. Default: true.animateSlides: whenslides=true, animate transitions between slides. Default: true.ignoreSteps: whenslides=true, RegExps of step names to skip in the slideshow.
CLI examples:
npx codeceptjs run -p screenshotnpx codeceptjs run -p screenshot:on=stepnpx codeceptjs run -p screenshot:on=step;slides=truenpx codeceptjs run -p screenshot:on=file:path=tests/login_test.jsnpx codeceptjs run -p screenshot:on=url:pattern=/users/*Parameters
Section titled “Parameters”config