eyes.selenium
Advanced tools
Comparing version 0.0.2 to 0.0.4
{ | ||
"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); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31092
382
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedeyes.sdk@0.0.2(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpng-js@0.1.1(transitive)
+ Addedrimraf@2.6.3(transitive)
+ Addedtemp@0.8.4(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedeyes.sdk@0.0.1(transitive)
Updatedeyes.sdk@0.0.2