Comparing version 0.0.45 to 0.0.46
10
index.js
@@ -12,1 +12,11 @@ exports.EyesBase = require('./src/EyesBase'); | ||
exports.Triggers = require('./src/Triggers'); | ||
exports.CoordinatesType = require('./src/CoordinatesType'); | ||
exports.RectangleSize = require('./src/RectangleSize'); | ||
exports.Region = require('./src/Region'); | ||
exports.Location = require('./src/Location'); | ||
exports.EyesScreenshot = require('./src/EyesScreenshot'); | ||
exports.PositionMemento = require('./src/PositionMemento'); | ||
exports.PositionProvider = require('./src/PositionProvider'); | ||
exports.ScaleProvider = require('./src/ScaleProvider'); | ||
exports.SessionEventHandler = require('./src/SessionEventHandler'); | ||
exports.RemoteSessionEventHandler = require('./src/RemoteSessionEventHandler'); |
{ | ||
"name": "eyes.sdk", | ||
"version": "0.0.45", | ||
"version": "0.0.46", | ||
"description": "Applitools Eyes SDK For JavaScript", | ||
@@ -25,3 +25,3 @@ "author": "Applitools Team <team@applitools.com> (http://www.applitools.com/)", | ||
"request": "^2.69.0", | ||
"eyes.utils": "0.0.16" | ||
"eyes.utils": "0.0.17" | ||
}, | ||
@@ -28,0 +28,0 @@ "devDependencies": { |
@@ -16,2 +16,4 @@ /* | ||
MatchWindowTask = require('./MatchWindowTask'), | ||
SessionEventHandler = require('./SessionEventHandler'), | ||
RemoteSessionEventHandler = require('./RemoteSessionEventHandler'), | ||
Triggers = require('./Triggers'), | ||
@@ -102,5 +104,12 @@ Logger = require('./Logger'); | ||
this._appName = null; | ||
this.validationId = -1; | ||
this._sessionEventHandlers = []; | ||
} | ||
} | ||
EyesBase.prototype.addSessionEventHandler = function (eventHandler) { | ||
eventHandler.promiseFactory = this._promiseFactory; | ||
this._sessionEventHandlers.push(eventHandler); | ||
}; | ||
/** | ||
@@ -523,2 +532,3 @@ * Set the log handler | ||
this._appName = appName; | ||
this._validationId = -1; | ||
resolve(); | ||
@@ -576,2 +586,4 @@ }.bind(this)); | ||
* @param {Object} runningSession The running session data received from the server. | ||
* @param {string} autSessionId The AUT session ID. | ||
* @param {SessionEventHandler[]} sessionEventHandlers The list of session event handlers. | ||
* @param {boolean} isAborted Whether or not the test was aborted. | ||
@@ -590,4 +602,4 @@ * @param {boolean} save Whether or not the test should automatically be saved. | ||
*/ | ||
var _endSession = function (logger, testName, appName, runningSession, isAborted, save, endSession, throwEx, | ||
resolve, reject) { | ||
var _endSession = function (logger, testName, appName, runningSession, autSessionId, sessionEventHandlers, | ||
isAborted, save, endSession, throwEx, resolve, reject) { | ||
var testResults; | ||
@@ -598,2 +610,6 @@ logger.verbose('Ending server session...'); | ||
.then(function (serverResults) { | ||
//noinspection JSLint | ||
for (var i = 0; i < sessionEventHandlers.length; ++i) { | ||
sessionEventHandlers[i].testEnded(autSessionId,serverResults); | ||
} | ||
testResults = _buildTestResults(logger, testName, appName, runningSession, serverResults, save, | ||
@@ -672,3 +688,4 @@ isAborted); | ||
//noinspection JSUnresolvedFunction | ||
return _endSession(this._logger, this._testName, this._appName, this._runningSession, false, save, | ||
return _endSession(this._logger, this._testName, this._appName, | ||
this._runningSession, this._sessionStartInfo.autSessionId, this._sessionEventHandlers, false, save, | ||
this._serverConnector.endSession.bind(this._serverConnector), throwEx, resolve, reject) | ||
@@ -701,3 +718,4 @@ .then(function () { | ||
//noinspection JSUnresolvedFunction | ||
return _endSession(this._logger, this._testName, this._appName, this._runningSession, true, false, | ||
return _endSession(this._logger, this._testName, this._appName, this._runningSession, | ||
this._sessionStartInfo.autSessionId, this._sessionEventHandlers, true, false, | ||
this._serverConnector.endSession.bind(this._serverConnector), false, resolve, reject) | ||
@@ -774,2 +792,10 @@ .then(function () { | ||
//noinspection JSLint | ||
var validationInfo = new SessionEventHandler.ValidationInfo(); | ||
validationInfo.validationId = ++this._validationId; | ||
validationInfo.tag = tag; | ||
for (var i = 0; i < this._sessionEventHandlers.length; ++i) { | ||
this._sessionEventHandlers[i].validationWillStart(this._sessionStartInfo.autSessionId, | ||
validationInfo); | ||
} | ||
this._logger.verbose("EyesBase.checkWindow - calling matchWindowTask.matchWindow"); | ||
@@ -782,2 +808,9 @@ return this._matchWindowTask.matchWindow(this._userInputs, region, tag, | ||
var validationResult = new SessionEventHandler.ValidationResult(); | ||
validationResult.asExpected = result.asExpected; | ||
for (var i = 0; i < this._sessionEventHandlers.length; ++i) { | ||
this._sessionEventHandlers[i].validationEnded(this._sessionStartInfo.autSessionId, | ||
validationInfo.validationId, validationResult); | ||
} | ||
if (!ignoreMismatch) { | ||
@@ -875,11 +908,16 @@ this._userInputs = []; | ||
var promise; | ||
var autSessionId; | ||
var vpSizePromise; | ||
if (!this._viewportSize) { | ||
promise = this.getViewportSize(); | ||
vpSizePromise = this.getViewportSize(); | ||
} else { | ||
promise = this.setViewportSize(this._viewportSize); | ||
vpSizePromise = this.setViewportSize(this._viewportSize); | ||
} | ||
return promise.then(function (result) { | ||
this._viewportSize = this._viewportSize || result; | ||
return vpSizePromise.then(function (result) { | ||
this._viewportSize = this._viewportSize || result; | ||
}.bind(this)).then(function () { | ||
return this.getAUTSessionId(); | ||
}.bind(this)).then(function(autSessionId_) { | ||
autSessionId = autSessionId_; | ||
var testBatch = this._batch; | ||
@@ -927,3 +965,4 @@ if (!testBatch) { | ||
branchName: this._branchName || null, | ||
parentBranchName: this._parentBranchName || null | ||
parentBranchName: this._parentBranchName || null, | ||
autSessionId: autSessionId | ||
}; | ||
@@ -935,2 +974,5 @@ | ||
this._shouldMatchWindowRunOnceOnTimeout = result.isNewSession; | ||
for (var i = 0; i < this._sessionEventHandlers.length; ++i) { | ||
this._sessionEventHandlers[i].testStarted(this._sessionStartInfo); | ||
} | ||
resolve(); | ||
@@ -937,0 +979,0 @@ }.bind(this), function (err) { |
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
121574
24
2659
+ Addedeyes.utils@0.0.17(transitive)
- Removedeyes.utils@0.0.16(transitive)
Updatedeyes.utils@0.0.17