eyes.selenium
Advanced tools
Comparing version 0.0.11 to 0.0.12
{ | ||
"name": "eyes.selenium", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Applitools Eyes SDK For Selenium JavaScript WebDriver", | ||
@@ -26,6 +26,7 @@ "author": "Applitools Team <team@applitools.com> (http://www.applitools.com/)", | ||
"license": "Apache-2.0", | ||
"main": "./src/Eyes", | ||
"main": "index", | ||
"dependencies": { | ||
"eyes.sdk": "0.0.8", | ||
"selenium-webdriver": "~2.42.1" | ||
"eyes.sdk": "0.0.9", | ||
"selenium-webdriver": "~2.42.1", | ||
"winston": "*" | ||
}, | ||
@@ -32,0 +33,0 @@ "devDependencies": { |
@@ -21,3 +21,3 @@ eyes.selenium | ||
var Eyes = require('eyes.selenium'); | ||
var Eyes = require('eyes.selenium').Eyes; | ||
var eyes = new Eyes(); | ||
@@ -31,5 +31,5 @@ eyes.setApiKey("<YOUR_API_KEY>"); | ||
eyes.checkWindow("NBA"); | ||
eyes.close(true); | ||
eyes.close(); | ||
driver.quit(); | ||
}); | ||
``` |
@@ -41,3 +41,3 @@ /* | ||
Eyes.prototype._getBaseAgentId = function () { | ||
return 'selenium-js/0.0.8'; | ||
return 'selenium-js/0.0.12'; | ||
}; | ||
@@ -58,7 +58,5 @@ | ||
var deferred = webdriver.promise.defer(); | ||
console.log('execution began for eyes open'); | ||
try { | ||
EyesBase.prototype.open.call(this, appName, testName, viewportSize) | ||
.then(function () { | ||
console.log('inner eyes open returned - fulfilling'); | ||
this._driver = driver; //TODO: new EyesWebDriver(driver, this); | ||
@@ -70,3 +68,3 @@ // this._driver.init().then(function () { | ||
} catch (err) { | ||
console.log(err); | ||
this._logger.log(err.toString()); | ||
deferred.reject(err); | ||
@@ -80,14 +78,24 @@ } | ||
Eyes.prototype.close = function (throwEx) { | ||
if (typeof throwEx === 'undefined') { | ||
throwEx = true; | ||
} | ||
return this._flow.execute(function () { | ||
var deferred = webdriver.promise.defer(); | ||
console.log('execution began for eyes close'); | ||
EyesBase.prototype.close.call(this, throwEx) | ||
.then(function (results) { | ||
console.log('inner eyes close returned - fulfilling'); | ||
deferred.fulfill(results); | ||
}.bind(this), function (err) { | ||
deferred.reject(err); | ||
}); | ||
try { | ||
EyesBase.prototype.close.call(this, throwEx) | ||
.then(function (results) { | ||
deferred.fulfill(results); | ||
}.bind(this), function (err) { | ||
deferred.reject(err); | ||
}); | ||
} catch (err) { | ||
deferred.reject(err); | ||
if (throwEx) { | ||
throw new Error(err.message); | ||
} | ||
} | ||
return deferred.promise; | ||
}.bind(this)); | ||
@@ -99,18 +107,15 @@ }; | ||
var deferred = webdriver.promise.defer(); | ||
console.log('execution began for eyes check window'); | ||
try { | ||
EyesBase.prototype.checkWindow.call(this, tag, false, matchTimeout).then(function () { | ||
console.log('inner eyes check window returned - fulfilling'); | ||
deferred.fulfill(); | ||
}.bind(this), | ||
function (err) { | ||
console.log(err); | ||
this._logger.log(err.toString()); | ||
deferred.reject(err); | ||
}); | ||
}.bind(this)); | ||
} catch (err) { | ||
console.log(err); | ||
this._logger.log(err.toString()); | ||
deferred.reject(err); | ||
} | ||
console.log('returning check window promise'); | ||
return deferred.promise; | ||
@@ -123,18 +128,15 @@ }.bind(this)); | ||
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); | ||
this._logger.log(err.toString()); | ||
deferred.reject(err); | ||
}); | ||
}.bind(this)); | ||
} catch (err) { | ||
console.log(err); | ||
this._logger.log(err.toString()); | ||
deferred.reject(err); | ||
} | ||
console.log('returning check window promise'); | ||
return deferred.promise; | ||
@@ -147,3 +149,2 @@ }.bind(this)); | ||
var deferred = webdriver.promise.defer(); | ||
console.log('execution began for eyes check region'); | ||
try { | ||
@@ -154,17 +155,15 @@ element.getSize().then(function(size) { | ||
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); | ||
this._logger.log(err.toString()); | ||
deferred.reject(err); | ||
}); | ||
}.bind(this)); | ||
}.bind(this)); | ||
}.bind(this)); | ||
} catch (err) { | ||
console.log(err); | ||
this._logger.log(err.toString()); | ||
deferred.reject(err); | ||
} | ||
console.log('returning check window promise'); | ||
return deferred.promise; | ||
@@ -177,3 +176,2 @@ }.bind(this)); | ||
var deferred = webdriver.promise.defer(); | ||
console.log('execution began for eyes check region'); | ||
try { | ||
@@ -185,9 +183,8 @@ this._driver.findElement(by).then(function(element) { | ||
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); | ||
this._logger.log(err.toString()); | ||
deferred.reject(err); | ||
}); | ||
}.bind(this)); | ||
}.bind(this)); | ||
@@ -197,7 +194,6 @@ }.bind(this)); | ||
} catch (err) { | ||
console.log(err); | ||
this._logger.log(err.toString()); | ||
deferred.reject(err); | ||
} | ||
console.log('returning check window promise'); | ||
return deferred.promise; | ||
@@ -204,0 +200,0 @@ }.bind(this)); |
@@ -40,10 +40,6 @@ /* | ||
ViewportSize.getViewportSize = function (driver) { | ||
console.log('ViewportSize.getViewportSize called'); | ||
return PromiseFactory.makePromise(function (resolve, reject) { | ||
try { | ||
console.log('ViewportSize.getViewportSize - executing scripts'); | ||
driver.executeScript(_GET_VIEWPORT_SIZE_JAVASCRIPT_FOR_NORMAL_BROWSER).then(function(size) { | ||
if (size.width > 0 && size.height > 0) { | ||
console.log('ViewportSize.getViewportSize - normal script returned size: w', size.width, | ||
' h', size.height); | ||
resolve(size); | ||
@@ -53,16 +49,8 @@ return; | ||
console.log('ViewportSize.getViewportSize - normal script returned bad size - calling old script'); | ||
driver.executeScript(_GET_VIEWPORT_SIZE_JAVASCRIPT_FOR_BAD_BROWSERS).then(function(size) { | ||
console.log('ViewportSize.getViewportSize - old script returned size: w', size.width, | ||
' h', size.height); | ||
resolve(size); | ||
}); | ||
}, | ||
function(err){ | ||
console.log('ViewportSize.getViewportSize - error while getting viewport size - ' + | ||
'attempting old browser script', err); | ||
function(){ | ||
driver.executeScript(_GET_VIEWPORT_SIZE_JAVASCRIPT_FOR_BAD_BROWSERS).then(function(size) { | ||
console.log('ViewportSize.getViewportSize - old script returned size: w', size.width, | ||
' h', size.height); | ||
resolve(size); | ||
@@ -72,6 +60,3 @@ }); | ||
} catch (err) { | ||
console.log('ViewportSize.getViewportSize - exception - so using window size', err); | ||
new Window(driver).getSize().then(function(size){ | ||
console.log('ViewportSize.getViewportSize - window returned size: w', size.width, | ||
' h', size.height); | ||
resolve(size); | ||
@@ -85,3 +70,2 @@ }); | ||
ViewportSize.setViewportSize = function (driver, size) { | ||
console.log('ViewportSize.setViewportSize called for size', size); | ||
// first we will set the window size to the required size. Then we'll check the viewport size and increase the | ||
@@ -99,3 +83,2 @@ // window size accordingly. | ||
height: ((2 * size.height) - viewportSize.height)}; | ||
console.log('initial viewport size:', viewportSize, 'setting to:', computedSize); | ||
driver.manage().window().setSize(computedSize.width, computedSize.height) | ||
@@ -107,4 +90,3 @@ .then(function () { | ||
}, function (err) { | ||
console.error('Failed to set browser size!'); | ||
reject(Error(err)); | ||
reject(err); | ||
}); | ||
@@ -114,8 +96,6 @@ }); | ||
}, function (err) { | ||
console.error('Failed to set browser size!'); | ||
reject(Error(err)); | ||
reject(err); | ||
}); | ||
}); | ||
} catch (err) { | ||
console.log('ViewportSize.setViewportSize - exception:', err); | ||
reject(Error(err)); | ||
@@ -131,3 +111,2 @@ } | ||
if (winSize.width == size.width && winSize.height == size.height) { | ||
console.log('window size successfully set'); | ||
resolve(retries); | ||
@@ -138,3 +117,2 @@ return; | ||
if (retries == 0) { | ||
console.error('no more retries to set window size'); | ||
reject(Error('no more retries to set window size')); | ||
@@ -144,3 +122,2 @@ return; | ||
console.log('window size still not set - timeout and rechecking'); | ||
driver.controlFlow().timeout(1000).then(function() { | ||
@@ -150,3 +127,3 @@ _retryCheckWindowSize(driver, size, retries - 1).then(function (retriesLeft){ | ||
}, function(err) { | ||
reject(Error(err)); | ||
reject(err); | ||
}); | ||
@@ -163,3 +140,2 @@ }); | ||
if (viewportSize.width == size.width && viewportSize.height == size.height) { | ||
console.log('viewport size successfully set'); | ||
resolve(retries); | ||
@@ -170,3 +146,2 @@ return; | ||
if (retries == 0) { | ||
console.error('no more retries to set viewport size'); | ||
reject(Error('no more retries to set viewport size')); | ||
@@ -176,3 +151,2 @@ return; | ||
console.log('viewport size still not set - timeout and rechecking'); | ||
driver.controlFlow().timeout(1000).then(function() { | ||
@@ -182,3 +156,3 @@ _retryCheckViewportSize(driver, size, retries - 1).then(function (retriesLeft){ | ||
}, function(err) { | ||
reject(Error(err)); | ||
reject(err); | ||
}); | ||
@@ -185,0 +159,0 @@ }); |
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
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
32700
9
491
3
1
+ Addedwinston@*
+ Added@colors/colors@1.6.0(transitive)
+ Added@dabh/diagnostics@2.0.3(transitive)
+ Added@types/triple-beam@1.3.5(transitive)
+ Addedasync@3.2.6(transitive)
+ Addedcolor@3.2.1(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcolor-string@1.9.1(transitive)
+ Addedcolorspace@1.1.4(transitive)
+ Addedenabled@2.0.0(transitive)
+ Addedeyes.sdk@0.0.9(transitive)
+ Addedfecha@4.2.3(transitive)
+ Addedfn.name@1.1.0(transitive)
+ Addedis-arrayish@0.3.2(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedkuler@2.0.0(transitive)
+ Addedlogform@2.7.0(transitive)
+ Addedms@2.1.3(transitive)
+ Addedone-time@1.0.0(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafe-stable-stringify@2.5.0(transitive)
+ Addedsimple-swizzle@0.2.2(transitive)
+ Addedstack-trace@0.0.10(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedtext-hex@1.0.0(transitive)
+ Addedtriple-beam@1.4.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwinston@3.17.0(transitive)
+ Addedwinston-transport@4.9.0(transitive)
- Removedeyes.sdk@0.0.8(transitive)
Updatedeyes.sdk@0.0.9