galen-visual
TypeScript icon, indicating that this package has built-in type declarations

0.0.9 • Public • Published

galen-visual execute visual validation using Galen in Selenium

This utility will enable you to integrate Galen visual tests into your selenium-webdriver or webdriverio tests.

To easily create your Galen tests use the following chrome extension:

Chrome Extension

Design a spec

It support both of the common node javacript selenium packages: selenium-webdriver and webdriverio.

To integrate into your tests first you need to create a page:

Create a page

To install:

npm install galen-visual

In short:

var visual = require('visual.js');
visual.init('K5pAdMqrNz7Lcz69jnB6WE8');
visual.verify(driver, 'login_page');

Full selenium example:

import {assert} from 'chai';
var webdriver = require('selenium-webdriver');
var visual = require('galen-visual');

const chrome = require('selenium-webdriver/chrome');

describe('visual tests', function(this: any) {
  this.timeout(20000);
  var driver: any;
  before(() => {
    visual.init('K5pAdMqrNz7Lcz69jnB6WE8');
    
  });

  it('#verify', async () => {
    driver = await new webdriver.Builder().usingServer().withCapabilities({'browserName': 'chrome' }).build();
    await driver.get("https://github.com/login");
    setDebug(true);
    const res  = await visual.verify(driver, 'login');
    assert.isTrue(res , 'all is good');
    console.log(getLastResultUrl());
  });
  
});

Note: Node 6.10 or higher runtime required.

Readme

Keywords

Package Sidebar

Install

npm i galen-visual

Weekly Downloads

0

Version

0.0.9

License

MIT

Unpacked Size

15.2 kB

Total Files

8

Last publish

Collaborators

  • guyarieli