@applitools/eyes.sdk.core
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -72,3 +72,2 @@ 'use strict'; | ||
exports.RenderInfo = require('./lib/renderer/RenderInfo').RenderInfo; | ||
exports.RenderingInfo = require('./lib/renderer/RenderingInfo').RenderingInfo; | ||
exports.RenderRequest = require('./lib/renderer/RenderRequest').RenderRequest; | ||
@@ -95,2 +94,3 @@ exports.RenderStatus = require('./lib/renderer/RenderStatus').RenderStatus; | ||
exports.ProxySettings = require('./lib/server/ProxySettings').ProxySettings; | ||
exports.RenderingInfo = require('./lib/server/RenderingInfo').RenderingInfo; | ||
exports.RunningSession = require('./lib/server/RunningSession').RunningSession; | ||
@@ -97,0 +97,0 @@ exports.ServerConnector = require('./lib/server/ServerConnector').ServerConnector; |
@@ -14,5 +14,6 @@ 'use strict'; | ||
* @param {EyesScreenshot} lastScreenshot | ||
* @param {CheckSettings} checkSettings | ||
* @return {Promise<AppOutputWithScreenshot>} | ||
*/ | ||
getAppOutput(region, lastScreenshot) { | ||
getAppOutput(region, lastScreenshot, checkSettings) { | ||
throw new TypeError('The method `getAppOutput` from `AppOutputProvider` should be implemented!'); | ||
@@ -19,0 +20,0 @@ } |
@@ -20,5 +20,11 @@ 'use strict'; | ||
constructor(timeout = -1, region) { | ||
// /** @type {string} */ | ||
// this._name = undefined; | ||
/** @type {boolean} */ | ||
this._sendDom = undefined; | ||
/** @type {MatchLevel} */ | ||
this._matchLevel = undefined; | ||
/** @type {boolean} */ | ||
this._ignoreCaret = false; | ||
/** @type {boolean} */ | ||
this._stitchContent = false; | ||
@@ -35,4 +41,44 @@ this._timeout = timeout; | ||
// TODO: finish implementation withName | ||
// // noinspection JSUnusedGlobalSymbols | ||
// /** | ||
// * A setter for the checkpoint name. | ||
// * | ||
// * @param {string} name A name by which to identify the checkpoint. | ||
// * @return {CheckSettings} This instance of the settings object. | ||
// */ | ||
// withName(name) { | ||
// this._name = name; | ||
// return this; | ||
// } | ||
// | ||
// // noinspection JSUnusedGlobalSymbols | ||
// /** | ||
// * @return {string} | ||
// */ | ||
// getName() { | ||
// return this._name; | ||
// } | ||
// noinspection JSUnusedGlobalSymbols | ||
/** | ||
* Defines whether to send the document DOM or not. | ||
* | ||
* @param {boolean} sendDom When {@code true} sends the DOM to the server (the default). | ||
* @return {CheckSettings} This instance of the settings object. | ||
*/ | ||
sendDom(sendDom) { | ||
this._sendDom = sendDom; | ||
return this; | ||
} | ||
/** | ||
* @return {boolean} | ||
*/ | ||
getSendDom() { | ||
return this._sendDom; | ||
} | ||
// noinspection JSUnusedGlobalSymbols | ||
/** | ||
* Shortcut to set the match level to {@code MatchLevel.LAYOUT}. | ||
@@ -39,0 +85,0 @@ * |
@@ -56,3 +56,3 @@ 'use strict'; | ||
} | ||
// noinspection JSUnusedGlobalSymbols | ||
@@ -59,0 +59,0 @@ /** @return {string} */ |
@@ -14,7 +14,9 @@ 'use strict'; | ||
* @param {boolean} [ignoreCaret] | ||
* @param {boolean} [useDom] | ||
*/ | ||
constructor(matchLevel = MatchLevel.Strict, exact, ignoreCaret) { | ||
constructor(matchLevel = MatchLevel.Strict, exact, ignoreCaret, useDom) { | ||
this._matchLevel = matchLevel; | ||
this._exact = exact; | ||
this._ignoreCaret = ignoreCaret; | ||
this._useDom = useDom; | ||
@@ -83,2 +85,18 @@ /** @type {Region[]} */ | ||
/** | ||
* @return {boolean} | ||
*/ | ||
getUseDom() { | ||
return this._useDom; | ||
} | ||
// noinspection JSUnusedGlobalSymbols | ||
/** | ||
* @param {boolean} | ||
*/ | ||
setUseDom(value) { | ||
this._useDom = value; | ||
} | ||
// noinspection JSUnusedGlobalSymbols | ||
/** | ||
* Returns the array of regions to ignore. | ||
@@ -85,0 +103,0 @@ * @return {Region[]} the array of regions to ignore. |
@@ -40,4 +40,4 @@ 'use strict'; | ||
/** @type {MatchResult} */ this._matchResult = undefined; | ||
/** @type {EyesScreenshot} */ this._lastScreenshot = undefined; | ||
/** @type {MatchResult} */ this._matchResult = undefined; | ||
/** @type {Region} */ this._lastScreenshotBounds = undefined; | ||
@@ -333,3 +333,3 @@ } | ||
const that = this; | ||
return that._appOutputProvider.getAppOutput(region, that._lastScreenshot) | ||
return that._appOutputProvider.getAppOutput(region, that._lastScreenshot, checkSettings) | ||
.then(appOutput => { | ||
@@ -336,0 +336,0 @@ const screenshot = appOutput.getScreenshot(); |
@@ -19,2 +19,3 @@ 'use strict'; | ||
this._properties = undefined; | ||
this._render = undefined; | ||
} | ||
@@ -162,2 +163,14 @@ | ||
// noinspection JSUnusedGlobalSymbols | ||
/** @return {boolean} */ | ||
getRender() { | ||
return this._render; | ||
} | ||
// noinspection JSUnusedGlobalSymbols | ||
/** @param {boolean} value */ | ||
setRender(value) { | ||
this._render = value; | ||
} | ||
/** @override */ | ||
@@ -164,0 +177,0 @@ toJSON() { |
@@ -25,3 +25,3 @@ 'use strict'; | ||
if (object.emulationInfo) mapping.emulationInfo = EmulationInfo.fromObject; | ||
return GeneralUtils.assignTo(new RenderInfo(), object, mapping); | ||
@@ -108,3 +108,3 @@ } | ||
const obj = GeneralUtils.toPlain(this, ['_emulationInfo']); | ||
if (this._emulationInfo) { | ||
@@ -111,0 +111,0 @@ obj.emulationInfo = this._emulationInfo.toJSON(); |
@@ -34,3 +34,2 @@ 'use strict'; | ||
this._selectorsToFindRegionsFor = selectorsToFindRegionsFor; | ||
this._sendDom = sendDom; | ||
} | ||
@@ -91,3 +90,3 @@ | ||
} | ||
// noinspection JSUnusedGlobalSymbols | ||
@@ -117,12 +116,2 @@ /** @return {string} */ | ||
/** @return {boolean} */ | ||
getSendDom() { | ||
return this._sendDom; | ||
} | ||
/** @param {boolean} value */ | ||
setSendDom(value) { | ||
this._sendDom = value; | ||
} | ||
/** @override */ | ||
@@ -168,6 +157,2 @@ toJSON() { | ||
if (this._sendDom) { | ||
object.sendDom = this._sendDom; | ||
} | ||
return object; | ||
@@ -174,0 +159,0 @@ } |
'use strict'; | ||
const { GeneralUtils } = require('../utils/GeneralUtils'); | ||
const { RenderingInfo } = require('../renderer/RenderingInfo'); | ||
const { RenderingInfo } = require('./RenderingInfo'); | ||
@@ -6,0 +6,0 @@ /** |
'use strict'; | ||
const axios = require('axios'); | ||
const zlib = require('zlib'); | ||
const { ProxySettings } = require('./ProxySettings'); | ||
const { RenderingInfo } = require('./RenderingInfo'); | ||
const { RunningSession } = require('./RunningSession'); | ||
@@ -12,3 +14,2 @@ const { TestResults } = require('../TestResults'); | ||
const { RenderingInfo } = require('../renderer/RenderingInfo'); | ||
const { RunningRender } = require('../renderer/RunningRender'); | ||
@@ -54,3 +55,3 @@ const { RenderStatusResults } = require('../renderer/RenderStatusResults'); | ||
// https://github.com/axios/axios/issues/1701 | ||
options.data = '' | ||
options.data = ''; | ||
} | ||
@@ -752,4 +753,36 @@ // eslint-disable-next-line max-len | ||
} | ||
/** | ||
* @param {string} domJson | ||
* @return {Promise<string>} | ||
*/ | ||
postDomSnapshot(domJson) { | ||
ArgumentGuard.notNull(domJson, 'domJson'); | ||
this._logger.verbose('ServerConnector.postDomSnapshot called'); | ||
const that = this; | ||
const options = GeneralUtils.mergeDeep(that._httpOptions, { | ||
method: 'POST', | ||
url: GeneralUtils.urlConcat(this._serverUrl, EYES_API_PATH, '/running/data'), | ||
params: { | ||
apiKey: that.getApiKey(), | ||
}, | ||
headers: { | ||
'Content-Type': 'application/octet-stream', | ||
}, | ||
}); | ||
options.data = zlib.gzipSync(Buffer.from(domJson)); | ||
return sendRequest(that, 'postDomSnapshot', options).then(response => { | ||
const validStatusCodes = [HTTP_STATUS_CODES.OK, HTTP_STATUS_CODES.CREATED]; | ||
if (validStatusCodes.includes(response.status)) { | ||
that._logger.verbose('ServerConnector.postDomSnapshot - post succeeded'); | ||
return response.headers.location; | ||
} | ||
throw new Error(`ServerConnector.postDomSnapshot - unexpected status (${response.statusText})`); | ||
}); | ||
} | ||
} | ||
exports.ServerConnector = ServerConnector; |
{ | ||
"name": "@applitools/eyes.sdk.core", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Applitools Eyes SDK Core", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
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
436993
12850