docs/plugins/screenshot.md
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.
plugins: {
screenshot: {
enabled: true,
on: 'fail',
}
}
on= modespath=...[;line=...]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 (requires on=step). Default: false.deleteSuccessful: when slides=true, drop slideshow directories of passing tests. Default: true.animateSlides: when slides=true, animate transitions between slides. Default: true.ignoreSteps: when slides=true, RegExps of step names to skip in the slideshow.CLI examples:
npx codeceptjs run -p screenshot
npx codeceptjs run -p screenshot:on=step
npx codeceptjs run -p screenshot:on=step;slides=true
npx codeceptjs run -p screenshot:on=file:path=tests/login_test.js
npx codeceptjs run -p screenshot:on=url:pattern=/users/*
config