Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@qavajs/steps-visual-testing

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qavajs/steps-visual-testing

steps to perform visual testing

latest
Source
npmnpm
Version
2.1.1
Version published
Maintainers
1
Created
Source

@qavajs/steps-visual-testing

Cucumber step library to perform visual (screenshot) testing using pixelmatch.

Installation

npm install @qavajs/steps-visual-testing

Configuration

Register the steps in your qavajs config:

import Memory from './memory';

export default {
    require: [
        '@qavajs/steps-visual-testing/index.js'
    ],
    memory: new Memory()
}

Usage

Screenshots passed to the steps can be either a Buffer or a base64-encoded PNG string. They must be stored in memory under an alias before being referenced in a step.

Compare two screenshots

Then I expect '$actual' screenshot to equal '$expected'

Compares $actual against $expected using the default threshold of 0.1.

Compare two screenshots with custom parameters

Then I expect '$actual' screenshot to equal '$expected':
  | threshold | 0.4 |
ParameterTypeDefaultDescription
thresholdnumber0.1Matching threshold (0–1). Lower values require a closer match; higher values allow more difference.

Failure attachments

When images do not match (or cannot be compared, e.g. size mismatch), the step automatically attaches three images to the Cucumber report:

  • actual — the actual screenshot
  • expected — the expected screenshot
  • delta — a diff image highlighting pixel differences

Changelog

See CHANGELOG.md for release history.

FAQs

Package last updated on 11 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts