Skip to content
This repository was archived by the owner on Dec 18, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
{ "presets": ["es2015"] }
{
"plugins": [
"check-es2015-constants",
"transform-es2015-arrow-functions",
"transform-es2015-block-scoped-functions",
"transform-es2015-block-scoping",
"transform-es2015-classes",
"transform-es2015-computed-properties",
"transform-es2015-destructuring",
"transform-es2015-duplicate-keys",
"transform-es2015-for-of",
"transform-es2015-function-name",
"transform-es2015-literals",
"transform-es2015-modules-commonjs",
"transform-es2015-object-super",
"transform-es2015-parameters",
"transform-es2015-shorthand-properties",
"transform-es2015-spread",
"transform-es2015-sticky-regex",
"transform-es2015-template-literals",
"transform-es2015-typeof-symbol",
"transform-es2015-unicode-regex"
]
}
3 changes: 1 addition & 2 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = function (grunt) {
files: [{
expand: true,
cwd: './lib',
src: ['*.js'],
src: ['**/*.js'],
dest: 'build',
ext: '.js'
}]
Expand Down Expand Up @@ -55,7 +55,6 @@ module.exports = function (grunt) {
})

require('load-grunt-tasks')(grunt)
grunt.loadTasks('build')
grunt.registerTask('default', ['build'])
grunt.registerTask('build', 'Build grunt-webdriver', function () {
grunt.task.run([
Expand Down
2 changes: 1 addition & 1 deletion lib/documentScreenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import getPageInfo from './scripts/getPageInfo'

const CAPS_TAKING_FULLSIZE_SHOTS = ['firefox']

export async function documentScreenshot (fileName) {
export default async function documentScreenshot (fileName) {
let ErrorHandler = this.instance.ErrorHandler

/*!
Expand Down
2 changes: 1 addition & 1 deletion lib/viewportScreenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import gm from 'gm'
import ErrorHandler from 'webdriverio/lib/utils/ErrorHandler'
import { ErrorHandler } from 'webdriverio'

import getScrollingPosition from './scripts/getScrollingPosition'
import getScreenDimension from './scripts/getScreenDimension'
Expand Down
3 changes: 2 additions & 1 deletion lib/webdrivercss.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const DEFAULT_PROPERTIES = {
screenWidth: [],
warning: [],
resultObject: {},
updateBaseline: false
updateBaseline: false,
applitools: {}
}

/**
Expand Down
6 changes: 5 additions & 1 deletion test/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ afterHook = function(done) {
* close browser and clean up created directories
*/
async.parallel([
function(done) { browser.end(done); },
function(done) {
browser.end()
.then(done.bind(null, null))
.catch(done);
},
function(done) { fs.remove(failedComparisonsRootDefault,done); },
function(done) { fs.remove(screenshotRootDefault,done); },
function(done) { fs.remove(failedComparisonsRootCustom,done); },
Expand Down
16 changes: 8 additions & 8 deletions test/spec/instantiation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

describe('WebdriverCSS plugin as WebdriverIO enhancement', function() {

before(function(done) {
this.browser = WebdriverIO.remote(capabilities).init(done);
before(function() {
return this.browser = WebdriverIO.remote(capabilities).init();
});

it('should not exist as command in WebdriverIO instance without initialization', function() {
Expand Down Expand Up @@ -32,9 +32,9 @@ describe('WebdriverCSS plugin as WebdriverIO enhancement', function() {
it('should contain some default values', function() {
var plugin = WebdriverCSS.init(this.browser);

expect(plugin).to.have.property('screenshotRoot').to.equal('webdrivercss');
expect(plugin).to.have.property('failedComparisonsRoot').to.equal('webdrivercss/diff');
expect(plugin).to.have.property('misMatchTolerance').to.equal(0.05);
expect(plugin.options).to.have.property('screenshotRoot').to.equal('webdrivercss');
expect(plugin.options).to.have.property('failedComparisonsRoot').to.equal('webdrivercss/diff');
expect(plugin.options).to.have.property('misMatchTolerance').to.equal(0.05);

});

Expand All @@ -45,9 +45,9 @@ describe('WebdriverCSS plugin as WebdriverIO enhancement', function() {
misMatchTolerance: 50
});

expect(plugin).to.have.property('screenshotRoot').to.equal('__screenshotRoot__');
expect(plugin).to.have.property('failedComparisonsRoot').to.equal('__failedComparisonsRoot__');
expect(plugin).to.have.property('misMatchTolerance').to.equal(50);
expect(plugin.options).to.have.property('screenshotRoot').to.equal('__screenshotRoot__');
expect(plugin.options).to.have.property('failedComparisonsRoot').to.equal('__failedComparisonsRoot__');
expect(plugin.options).to.have.property('misMatchTolerance').to.equal(50);
});

it('should have a created "screenshotRoot" folder after initialization', function(done) {
Expand Down