Skip to content

Instantly share code, notes, and snippets.

@NiGhTTraX
Last active June 19, 2019 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NiGhTTraX/3a14d9213e8332bb86258926460dc762 to your computer and use it in GitHub Desktop.
Save NiGhTTraX/3a14d9213e8332bb86258926460dc762 to your computer and use it in GitHub Desktop.
Visual test with Mugshot
import Mugshot from 'mugshot';
import WebdriverIOAdapter from '@mugshot/webdriverio';
describe('Mugshot README', () => {
/* BROWSER SETUP */
/* Identical setup from previous example omitted.
/* ENDBROWSER SETUP */
it('should have a logo', async () => {
await browser.url('https://github.com/NiGhTTraX/mugshot/blob/master/README.md');
const mugshot = new Mugshot(
new WebdriverIOAdapter(browser),
'/tmp/screenshots'
);
const result = await mugshot.check('logo', 'img[alt=logo]');
expect(result.matches).to.be.true;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment