https://github.com/jvdieten/visual-check-testcafe
Testcafe plugin for testing visual regression testing multi-browser support
https://github.com/jvdieten/visual-check-testcafe
layout testcafe-plugin visual
Last synced: about 1 year ago
JSON representation
Testcafe plugin for testing visual regression testing multi-browser support
- Host: GitHub
- URL: https://github.com/jvdieten/visual-check-testcafe
- Owner: jvdieten
- License: mit
- Created: 2020-09-29T21:04:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-06T08:37:04.000Z (over 5 years ago)
- Last Synced: 2024-04-24T19:08:56.060Z (about 2 years ago)
- Topics: layout, testcafe-plugin, visual
- Language: TypeScript
- Homepage:
- Size: 927 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://nodei.co/npm/visual-check-testcafe/)
# visual-check-testcafe
Testcafe plugin for testing visual regression backed by resemblejs image compare
## Features
- Fully integrated in test run
- Concurrency support
- Multi-browser support
- Reporting including multi-browser
## Installation
```bash
npm install visual-check-testcafe --save-dev
```
## How to use
You can write a TestCafe test with automated visual testing like this.
```js
import { visualCheck } from 'visual-check-testcafe';
fixture `TestCafe tests with Visual compare`
.page `http://example.com`;
test('Automated visual testing', async t => {
await visualCheck(t, options);
});
```
### Reporting
Report will be located at .reports/visual-check-testcafe/report.html
### Options
```
visualCheck(t, options?)
```
- `options.label` — Custom name for the taken snapshot
- `options.timeout` — Waiting time before taking snapshots
- `options.selector` — String, or `Selector()` to match on the DOM
- `options.maxDiffPercentage`— Default is 0.1
### Setup
Each time you run tests with --setup-baseline it'll take the base screenshots.
It will report during test in the following way:
```bash
visual-check-testcafe: Baseline {path} created
```
During a test run it can occur a baseline is not there. If you haven't provided
the --setup-baseline your test will fail with the following message:
```bash
AssertionError: visual-check-testcafe: no baseline present, storing baseline for next run: expected 'no baseline' to be falsy
+ expected - actual
-'no baseline'
+undefined
```
## RoadMap
- Add configurable output folder
- Add custom typings for testcontroller testRun
- Add automated tests