Skip to content
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
21 changes: 0 additions & 21 deletions .editorconfig

This file was deleted.

6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Project
.eslintcache
.idea/
*.js
node_modules
package-lock.json
8 changes: 0 additions & 8 deletions .eslintrc

This file was deleted.

26 changes: 26 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"plugins": ["prettier", "@typescript-eslint"],
"extends": [
"plugin:prettier/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"env": {
"node": true,
"es6": true,
"browser": true
},
"rules": {
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/consistent-type-definitions": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"no-unused-vars": "off",
"no-console": "off",
"prettier/prettier": "error",
"quote-props": ["error", "always"],
"semi": "error"
},
"parserOptions": {
"ecmaVersion": 2021
}
}
60 changes: 57 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,60 @@
node_modules
yarn.lock
reports
package-lock.json
selenium-debug.log
.DS_Store

#NPM package-lock.json
package-lock.json

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# Project
.idea/
*.iml
tasks.xml
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org/
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Project
.eslintcache
.idea/
node_modules
package-lock.json
17 changes: 17 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"quoteProps": "preserve",
"semi": true,
"singleQuote": false,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": true,
"xmlWhitespaceSensitivity": "strict",
"overrides": [
{
"files": "*.json",
"options": { "parser": "json" }
}
]
}
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

74 changes: 37 additions & 37 deletions assertions/screenshotIdenticalToBaseline.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'
"use strict";

const compareWithBaseline = require('../lib/compare-with-baseline')
const compareWithBaseline = require("../lib/compare-with-baseline");

/**
* Asserts if a screenshot that captures the visual representation of
Expand All @@ -22,44 +22,44 @@ const compareWithBaseline = require('../lib/compare-with-baseline')
* @param {String} message Optional message for `nightwatch` to log upon completion
*/
exports.assertion = function screenshotIdenticalToBaseline(
elementId,
fileName = elementId,
settings,
message
elementId,
fileName = elementId,
settings,
message
) {
this.message =
message || `Visual regression test results for element <${elementId}>.`;
this.expected = true;

this.message = message || `Visual regression test results for element <${elementId}>.`
this.expected = true
this.pass = function pass(value) {
return value === this.expected;
};

this.pass = function pass(value) {
return value === this.expected
}
this.value = function value(result) {
return result;
};

this.value = function value(result) {
return result
}
this.command = function command(callback) {
let screenshot, comparisonResult;

this.command = function command(callback) {
let screenshot,
comparisonResult
this.api
.waitForElementVisible(elementId, 5000)
.captureElementScreenshot(elementId, (elementScreenshot) => {
screenshot = elementScreenshot;
})
.perform((done) => {
compareWithBaseline(this.api, screenshot, fileName, settings).then(
(result) => {
comparisonResult = result;
done();
}
);
})
.perform((done) => {
callback(comparisonResult);
done();
});

this
.api
.waitForElementVisible(elementId, 5000)
.captureElementScreenshot(elementId, (elementScreenshot) => {
screenshot = elementScreenshot
})
.perform((done) => {
compareWithBaseline(this.api, screenshot, fileName, settings).then((result) => {
comparisonResult = result
done()
})
})
.perform((done) => {
callback(comparisonResult)
done()
})

return this
}
}
return this;
};
};
Loading