Socket
Socket
Sign inDemoInstall

mugshot-webdriverio

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mugshot-webdriverio

Adapter for WebDriverIO.


Version published
Weekly downloads
6
increased by20%
Maintainers
1
Install size
10.6 kB
Created
Weekly downloads
 

Readme

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

Last updated on 29 Jul 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc