Socket
Book a DemoInstallSign in
Socket

mugshot-webdriverio

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mugshot-webdriverio

Adapter for WebDriverIO.

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
-50%
Maintainers
1
Weekly downloads
 
Created
Source

Mugshot-WebdriverIO

WebdriverIO adapter for the Mugshot Visual regression testing lib.

Usage

'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();
  });
});

FAQs

Package last updated on 29 Jul 2016

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