https://github.com/nighttrax/mugshot-webdriverio
WebdriverIO adapter to use with Mugshot
https://github.com/nighttrax/mugshot-webdriverio
Last synced: 7 months ago
JSON representation
WebdriverIO adapter to use with Mugshot
- Host: GitHub
- URL: https://github.com/nighttrax/mugshot-webdriverio
- Owner: NiGhTTraX
- Created: 2016-07-26T12:26:43.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-03T11:39:17.000Z (about 9 years ago)
- Last Synced: 2025-01-24T02:16:02.173Z (9 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 1
- Watchers: 16
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mugshot-WebdriverIO
[WebdriverIO](http://webdriver.io/) adapter for the [Mugshot](https://github.com/uberVU/mugshot) Visual regression testing lib.
## Usage
```sh
'use strict';
const chai = require('chai');
const expect = require('chai').expect;
const Mugshot = require('mugshot');
const chaiMugshot = require('chai-mugshot');
const webdriverio = require('webdriverio');
const WebdriverIOAdapter = require('mugshot-webdriverio');const BROWSER = {
desiredCapabilities: {
browserName: 'chrome'
}
};describe('Visual test suite', function() {
let mugshotOptions = {
acceptFirstBaseline: true
},
webdriverioInstance, browser;before(function(done) {
webdriverioInstance = webdriverio.remote(BROWSER).init()
.then(function() {
browser = new WebdriverIOAdapter(webdriverioInstance);
done();
});
});it(`should look OK`, function() {
let captureItem = {
name: 'screenshot'
};return webdriverioInstance.url('www.example.com')
.then(function() {
let mugshot = new Mugshot(browser, mugshotOptions);
chai.use(chaiMugshot(mugshot));
return expect(captureItem).to.be.identical;
});
});after(function() {
return webdriverioInstance.end();
});
});
```