webdriverio-boneyard / webdrivercss

Regression testing tool for WebdriverIO v4
http://webdriver.io
MIT License
616 stars 106 forks source link

Example does not work #161

Open j-5-s opened 8 years ago

j-5-s commented 8 years ago

Is anyone else having issues with the example? It looks like the webdrivercss callback is getting called before it completes. The err and the res objects are undefined and no screenshot is saved. I've created an example repo here to reproduce.

https://github.com/jamescharlesworth/webdrivercssexample

niedzielski commented 8 years ago

@jamescharlesworth, maybe related to #156. I was able to get WebdriverCSS v1.1.10 and WebdriverIO v2.4.5 to work with ChromeDriver. PhantomCSS took a screenshot but didn't render well, but that might have something to do with the Polymer element I'm testing.

http-server -c-1&
chromedriver --url-base=wd/hub& # phantomjs -w&

From the example, test.js something like:

#!/usr/bin/env node
var webdriverio = require('webdriverio');
var webdrivercss = require('webdrivercss');

var client = webdriverio.remote({
  desiredCapabilities: {
    browserName: 'phantomjs'
  },
  port: 8910
}).init();

webdrivercss.init(client, {
  screenshotRoot: 'my-shots',
  failedComparisonsRoot: 'diffs',
  misMatchTolerance: 0.05,
});

client
  .url('http://localhost:8080/fixture.html')
  .webdrivercss('startpage', [
    {
      name: 'body',
      elem: 'body'
    }], function(err, res) {
    console.log(err);
    console.log(res);
  })
  .end();
./test.js
hstorc commented 7 years ago

@jamescharlesworth I am having the same issue. The Selenium ends before any search for element. The webdriverio without webdrivercss work well, though. Did you solve this issue?

hstorc commented 7 years ago

if anyone else ever gets here.. I ignored the bold "WebdriverCSS isn't yet compatible with WebdriverIO v3.0" so stuff weren't happening.. I added "webdriverio":"^v2.4.5" to the package.json dependancies and everything worked fine. Nice tool BTW :)