CodeceptJS plugin for taking HTML snapshots on test fail
npm install @codeceptjs-plugins/html-snapshot-on-failThis plugin takes a snapshot of the current page HTML and saves it to a file when a test fails.
``bash`
npm i --save-dev @codeceptjs-plugins/html-snapshot-on-fail
`bash`
yarn add --dev @codeceptjs-plugins/html-snapshot-on-fail
`typescript`
exports.config = {
plugins: {
htmlSnapshotOnFail: {
require: "@codeceptjs-plugins/html-snapshot-on-fail",
enabled: true
}
}
}
typescript
const path = require('path')exports.config = {
plugins: {
htmlSnapshotOnFail: {
require: "@codeceptjs-plugins/html-snapshot-on-fail",
enabled: true,
rootDir: path.resolve('output'),
dirname: 'error-html-snapshots'
}
}
}
`connect to allure reporter
`typescript
exports.config = {
plugins: {
allure: {
require: "",
},
htmlSnapshotOnFail: {
require: "@codeceptjs-plugins/html-snapshot-on-fail",
enabled: true,
reporter: 'allure' // key of registered allure plugin in "exports.config.plugins"
}
}
}
``