Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eyes.selenium

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eyes.selenium - npm Package Compare versions

Comparing version 0.0.2 to 0.0.4

4

package.json
{
"name": "eyes.selenium",
"version": "0.0.2",
"version": "0.0.4",
"description": "Applitools Eyes SDK For Selenium JavaScript WebDriver",

@@ -28,3 +28,3 @@ "author": "Applitools Team <team@applitools.com> (http://www.applitools.com/)",

"dependencies": {
"eyes.sdk": "0.0.1",
"eyes.sdk": "0.0.2",
"selenium-webdriver": "~2.42.1"

@@ -31,0 +31,0 @@ },

@@ -11,3 +11,3 @@ eyes.selenium

npm install eyes.selenium --save-dev
npm install eyes.selenium

@@ -14,0 +14,0 @@ Add Eyes to your tests, for example - when directly using selenium-webdriver:

@@ -29,8 +29,7 @@ /*

* @param {String} serverUrl
* @param {Number} matchTimeout
* @param {Boolean} isDisabled - set to true to disable Applitools Eyes and use the webdriver directly.
*
**/
function Eyes(serverUrl, matchTimeout, isDisabled) {
EyesBase.call(this, serverUrl || EyesBase.DEFAULT_EYES_SERVER, matchTimeout || 2000, isDisabled);
function Eyes(serverUrl, isDisabled) {
EyesBase.call(this, serverUrl || EyesBase.DEFAULT_EYES_SERVER, isDisabled);
}

@@ -48,3 +47,3 @@

Eyes.prototype.open = function (driver, appName, testName, viewportSize, matchLevel, failureReports) {
Eyes.prototype.open = function (driver, appName, testName, viewportSize) {
var flow = this._flow = driver.controlFlow();

@@ -62,3 +61,3 @@ PromiseFactory.setPromiseHandler(function (asyncAction) {

try {
EyesBase.prototype.open.call(this, appName, testName, viewportSize, matchLevel, failureReports)
EyesBase.prototype.open.call(this, appName, testName, viewportSize)
.then(function () {

@@ -96,3 +95,3 @@ console.log('inner eyes open returned - fulfilling');

Eyes.prototype.checkWindow = function (tag) {
Eyes.prototype.checkWindow = function (tag, matchTimeout) {
return this._flow.execute(function () {

@@ -102,3 +101,3 @@ var deferred = webdriver.promise.defer();

try {
EyesBase.prototype.checkWindow.call(this, tag, false).then(function () {
EyesBase.prototype.checkWindow.call(this, tag, false, matchTimeout).then(function () {
console.log('inner eyes check window returned - fulfilling');

@@ -121,2 +120,83 @@ deferred.fulfill();

Eyes.prototype.checkRegion = function (region, tag, matchTimeout) {
return this._flow.execute(function () {
var deferred = webdriver.promise.defer();
console.log('execution began for eyes check region');
try {
EyesBase.prototype.checkWindow.call(this, tag, false, matchTimeout, region).then(function () {
console.log('inner eyes check region returned - fulfilling');
deferred.fulfill();
}.bind(this),
function (err) {
console.log(err);
deferred.reject(err);
});
} catch (err) {
console.log(err);
deferred.reject(err);
}
console.log('returning check window promise');
return deferred.promise;
}.bind(this));
};
Eyes.prototype.checkRegionByElement = function (element, tag, matchTimeout) {
return this._flow.execute(function () {
var deferred = webdriver.promise.defer();
console.log('execution began for eyes check region');
try {
element.getSize().then(function(size) {
element.getLocation().then(function(point) {
var region = {height: size.height, width: size.width, left: point.x, top: point.y};
EyesBase.prototype.checkWindow.call(this, tag, false, matchTimeout, region).then(function () {
console.log('inner eyes check region returned - fulfilling');
deferred.fulfill();
}.bind(this),
function (err) {
console.log(err);
deferred.reject(err);
});
}.bind(this));
}.bind(this));
} catch (err) {
console.log(err);
deferred.reject(err);
}
console.log('returning check window promise');
return deferred.promise;
}.bind(this));
};
Eyes.prototype.checkRegionBy = function (by, tag, matchTimeout) {
return this._flow.execute(function () {
var deferred = webdriver.promise.defer();
console.log('execution began for eyes check region');
try {
this._driver.findElement(by).then(function(element) {
element.getSize().then(function(size) {
element.getLocation().then(function(point) {
var region = {height: size.height, width: size.width, left: point.x, top: point.y};
EyesBase.prototype.checkWindow.call(this, tag, false, matchTimeout, region).then(function () {
console.log('inner eyes check region returned - fulfilling');
deferred.fulfill();
}.bind(this),
function (err) {
console.log(err);
deferred.reject(err);
});
}.bind(this));
}.bind(this));
}.bind(this));
} catch (err) {
console.log(err);
deferred.reject(err);
}
console.log('returning check window promise');
return deferred.promise;
}.bind(this));
};
Eyes.prototype._waitTimeout = function (ms) {

@@ -123,0 +203,0 @@ return this._flow.timeout(ms);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc