mugshot-webdriverio

    1.0.0 • Public • Published

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

    Keywords

    none

    Install

    npm i mugshot-webdriverio

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • flavius
    • ovidiu
    • valentin-radulescu-hs