Esempio n. 1
0
 beforeEach(function () {
     var wdIoOptions = {
         desiredCapabilities: {browserName: 'chrome'},
     };
     client = webdriverio.remote(wdIoOptions);
     client.init();
     var wdCssOptions = {
         screenshotRoot: 'spec/e2e/screenshots',
         failedComparisonsRoot: 'spec/e2e/screenshots/diff',
     };
     webdrivercss.init(client, wdCssOptions);
 });
Esempio n. 2
0
        fse.mkdirs(path.join(storyRoot, 'diff'), function create(err) {
            webdrivercss.init(client, {
                screenshotRoot: storyRoot,
                api: adminPanel,
                updateBaseline: updateBaseline,
                screenWidth: screenshotWidth.slice(0) // clone the array
            });
            debug('setup webdrivercss "%s"', storyTitle);
            if (adminPanel) {
                client.sync();
            }

            // register only once
            if (!client._currentStory) {
                client.eventHandler.on('end', function () {
                    tearDownWebdrivercss(client);
                });
            }

            cb(err);
        });
Esempio n. 3
0
browsers.forEach(function (element) {
    var client = webdriverio.remote({
        desiredCapabilities: {
            browserName: element
        }
    });

    webdrivercss.init(client, {
        screenshotRoot: ['frontend-testing-comparative-',element].join(''),
        api: 'http://localhost:8080/api/repositories/'
    });

    client
        .init()
        .url('http://localhost:3000')
        .webdrivercss('login form', [{
            name: 'title',
            elem: 'h1'
        }])
        .sync()
        .end();
});
browsers.forEach(function (element) {
    var client = webdriverio.remote({
        desiredCapabilities: {
            browserName: element
        }
    });

    webdrivercss.init(client, {
        screenshotRoot: ['css','regression','test',element].join('-'),
        api: 'http://localhost:8080/api/repositories/'
    });

    client
        .init()
        .url('http://localhost:63342/frontend-testing-comparative/src/index.html')
        .click('#gridNode-1')
        .click('#gridNode-1')
        .webdrivercss('gridx', [{
            name: 'grid',
            elem: 'div'
        }])
        .sync()
        .end();
});
Esempio n. 5
0
var wdio = require("webdriverio");
var webdrivercss = require("webdrivercss");
var assert = require("assert");

var options = {
  desiredCapabilities: {
    browserName: "chrome"
  }
}
var browser = wdio.remote(options);
webdrivercss.init(browser, {
  screenshotRoot: "tests/screenshots"
});

function assertShots (err, shots) {
  assert.ifError(err);

  Object.keys(shots).forEach(function(element) {
    shots[element].forEach(function(shot) {
      assert.ok(shot.isWithinMisMatchTolerance, shot.message);
    })
  });
};

browser
    .init()
    .url("http://testing-d8-theme.dd:8083/cards")
    .webdrivercss("cards", [
      {
        name: "cards",
        elem: ".cards"
	beforeEach(function(){
		jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
		// Initialize webdrivercss
		webdrivercss.init(browser);
	});
Esempio n. 7
0
    yaml = require('js-yaml');

var client = WebdriverIO.remote({
    desiredCapabilities: {
        browserName: 'phantomjs',
        'phantomjs.binary.path': '/opt/phantomjs/bin/phantomjs'
    }
});

var configTargets = yaml.safeLoad(fs.readFileSync('targets.yml', 'utf8'));
var project = configTargets['project'];
var baseUrl = configTargets['baseurl'];
var pages = configTargets['pages'];

WebdriverCSS.init(client, {
    screenshotRoot: project + '_regression_tests',
    misMatchTolerance: 0.09
});

client.init();
_gotoPage(0);

function _gotoPage(index) {
    var page = pages[index];
    if (typeof page === 'undefined') {
        return;
    }
    client.url( baseUrl + page['url'], function( err, res ) {
        client.title(function (err, res) {
            console.log( 'Processing page:',
                         index, '|',
                         'NAME:', page['data']['name'], '|',
Esempio n. 8
0
	function loadClient(config) {
	var client = webdriverio.remote(config.browser);
	webdrivercss.init(client, config.webdrivercss);

	return client;
}