Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkDocument is not a function #101

Open
Wexx opened this issue Jul 31, 2019 · 1 comment
Open

checkDocument is not a function #101

Wexx opened this issue Jul 31, 2019 · 1 comment

Comments

@Wexx
Copy link

Wexx commented Jul 31, 2019

Trying to write my first tests with this tool (seems really neat), but I'm running into some issues recreating the example projects I've seen (mainly this one: https://github.com/zinserjan/webdriverio-example/blob/master/test/diff-test.js).

relevant package.json items:

"wdio-visual-regression-service": "^0.9.0",
"webdriverio": "^5.11.6"

Posting the configuration below, let me know if anything else helps.

var path = require('path');
var VisualRegressionCompare = require('wdio-visual-regression-service/compare');

function getScreenshotName(basePath) {
    return function(context) {
        var testName = context.test.title;
        var resolution = context.meta.width || context.meta.orientation || 'unknown';
        var browserVersion = parseInt(/\d+/.exec(context.browser.version)[0]);
        var browserName = context.browser.name;
    
        return path.join(basePath, `${testName}_${resolution}_${browserName}_v${browserVersion}.png`);
      };
}

exports.config = {
    runner: 'local',
    path: '/',
    specs: [
       // 'test/specs/basic.js',
        'test/specs/visualRegression.js'
    ],
    exclude: [
    ],
    //
    maxInstances: 10,
    //
    capabilities: [{
        maxInstances: 5,
        browserName: 'chrome',
    }],
    logLevel: 'info',
    bail: 0,
    screenshotPath: './errorShots/',
    baseUrl: 'http://locally.hostedurl.com',
    waitforTimeout: 10000,
    connectionRetryTimeout: 90000,
    connectionRetryCount: 3,
    services: ['chromedriver', 'visual-regression'],
    visualRegression: {
        compare: new VisualRegressionCompare.LocalCompare({
            referenceName: getScreenshotName(path.join(process.cwd(), 'screenshots/reference')),
            screenshotName: getScreenshotName(path.join(process.cwd(), 'screenshots/screen')),
            diffName: getScreenshotName(path.join(process.cwd(), 'screenshots/diff')),
            misMatchTolerance: 0.11
          }),
          viewportChangePause: 1000,
          viewports: [{ width: 320, height: 480 }, { width: 480, height: 320 }, { width: 1024, height: 768 }],
          orientations: ['landscape', 'portrait'],
    },
    plugins: {
        'wdio-screenshot': {},
    },
    framework: 'mocha',
    reporters: ['spec'],
    mochaOpts: {
        ui: 'bdd',
        timeout: 60000
    }

}
@araratmartirossyan
Copy link

Same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants