@codeceptjs-plugins/html-snapshot-on-fail
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

@codeceptjs-plugins/html-snapshot-on-fail

npm license

This plugin takes a snapshot of the current page HTML and saves it to a file when a test fails.

Installation

npm i --save-dev @codeceptjs-plugins/html-snapshot-on-fail
yarn add --dev @codeceptjs-plugins/html-snapshot-on-fail

Basic usage

exports.config = {
  plugins: {
    htmlSnapshotOnFail: {
      require: "@codeceptjs-plugins/html-snapshot-on-fail",
      enabled: true
    }
  }
}

configure custom output directory

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

exports.config = {
  plugins: {
    allure: {
      require: "<require path>",
    },
    htmlSnapshotOnFail: {
      require: "@codeceptjs-plugins/html-snapshot-on-fail",
      enabled: true,
      reporter: 'allure' // key of registered allure plugin in "exports.config.plugins"
    }
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @codeceptjs-plugins/html-snapshot-on-fail

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

11.6 kB

Total Files

17

Last publish

Collaborators

  • reutenkoivan