Socket
Socket
Sign inDemoInstall

@applitools/eyes-api

Package Overview
Dependencies
224
Maintainers
34
Versions
95
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.13.1 to 1.13.2

10

dist/BatchClose.js

@@ -36,7 +36,2 @@ "use strict";

class BatchClose {
constructor(options) {
this._settings = {};
if (options)
this._settings = options;
}
get _spec() {

@@ -49,2 +44,7 @@ return this.constructor._spec;

}
constructor(options) {
this._settings = {};
if (options)
this._settings = options;
}
async close() {

@@ -51,0 +51,0 @@ utils.guard.notNull(this._settings.batchIds, { name: 'batchIds' });

@@ -37,4 +37,3 @@ "use strict";

super(message);
if (results)
this._result = results;
this._result = results;
}

@@ -41,0 +40,0 @@ get testResults() {

@@ -43,2 +43,18 @@ "use strict";

class Eyes {
get _spec() {
return this.constructor._spec;
}
static async getExecutionCloudUrl(config) {
const client = await this._spec.makeECClient({
settings: {
proxy: config === null || config === void 0 ? void 0 : config.proxy,
capabilities: { eyesServerUrl: config === null || config === void 0 ? void 0 : config.serverUrl, apiKey: config === null || config === void 0 ? void 0 : config.apiKey },
},
});
return client.url;
}
static async setViewportSize(driver, size) {
var _a, _b;
await ((_b = (_a = this._spec).setViewportSize) === null || _b === void 0 ? void 0 : _b.call(_a, { target: driver, size }));
}
constructor(runnerOrConfig, config) {

@@ -60,17 +76,2 @@ this._state = {};

}
get _spec() {
return this.constructor._spec;
}
static async getExecutionCloudUrl(config) {
const client = await this._spec.makeECClient({
settings: {
proxy: config === null || config === void 0 ? void 0 : config.proxy,
capabilities: { eyesServerUrl: config === null || config === void 0 ? void 0 : config.serverUrl, apiKey: config === null || config === void 0 ? void 0 : config.apiKey },
},
});
return client.url;
}
static async setViewportSize(driver, size) {
await this._spec.setViewportSize({ target: driver, size });
}
get logger() {

@@ -86,3 +87,3 @@ return this._logger;

getRunner() {
return this._runner;
return this.runner;
}

@@ -93,3 +94,3 @@ get driver() {

getDriver() {
return this._driver;
return this.driver;
}

@@ -137,3 +138,4 @@ get configuration() {

async open(driverOrConfigOrAppName, configOrAppNameOrTestName, testNameOrViewportSize, viewportSizeOrSessionType, sessionType) {
var _a, _b, _c;
var _a, _b, _c, _d;
var _e;
if ((_b = (_a = this._spec).isDriver) === null || _b === void 0 ? void 0 : _b.call(_a, driverOrConfigOrAppName)) {

@@ -170,8 +172,10 @@ this._driver = driverOrConfigOrAppName;

config.open.testName = testNameOrViewportSize;
if (utils.types.has(viewportSizeOrSessionType, ['width', 'height']))
if (utils.types.has(viewportSizeOrSessionType, ['width', 'height'])) {
(_c = (_e = config.open).environment) !== null && _c !== void 0 ? _c : (_e.environment = {});
config.open.environment.viewportSize = viewportSizeOrSessionType;
}
if (utils.types.isEnumValue(sessionType, SessionType_1.SessionTypeEnum))
config.open.sessionType = sessionType;
config.open.keepPlatformNameAsIs = true;
this._state.appName = (_c = config.open) === null || _c === void 0 ? void 0 : _c.appName;
this._state.appName = (_d = config.open) === null || _d === void 0 ? void 0 : _d.appName;
this._eyes = await this._runner.openEyes({

@@ -294,3 +298,3 @@ target: this._driver,

const config = this._config.toJSON();
return this._eyes.locateText({ target, settings, config });
return this._eyes.locateText({ target, settings: settings, config });
}

@@ -321,3 +325,3 @@ async extractText(targetOrSettings, settings) {

return results.then(async (results) => {
return results.concat(await this._eyes.extractText({ target: targets[index], settings, config }));
return results.concat(await this._eyes.extractText({ target: targets[index], settings: settings, config }));
});

@@ -347,17 +351,18 @@ }, Promise.resolve([]));

catch (err) {
if (!((_a = err.info) === null || _a === void 0 ? void 0 : _a.result))
throw err;
const result = new TestResults_1.TestResultsData({ result: err.info.result, deleteTest });
if (err.reason === 'test failed') {
throw new TestFailedError_1.TestFailedError(err.message, result);
if ((_a = err.info) === null || _a === void 0 ? void 0 : _a.result) {
const result = new TestResults_1.TestResultsData({ result: err.info.result, deleteTest });
if (err.reason === 'test failed') {
throw new TestFailedError_1.TestFailedError(err.message, result);
}
else if (err.reason === 'test different') {
throw new DiffsFoundError_1.DiffsFoundError(err.message, result);
}
else if (err.reason === 'test new') {
throw new NewTestError_1.NewTestError(err.message, result);
}
}
else if (err.reason === 'test different') {
throw new DiffsFoundError_1.DiffsFoundError(err.message, result);
}
else if (err.reason === 'test new') {
throw new NewTestError_1.NewTestError(err.message, result);
}
throw err;
}
finally {
this._eyes = null;
this._eyes = undefined;
}

@@ -372,5 +377,4 @@ }

return null;
return this._eyes
.abort()
.then(([result]) => {
try {
const [result] = await this._eyes.abort();
return new TestResults_1.TestResultsData({

@@ -388,4 +392,6 @@ result,

});
})
.finally(() => (this._eyes = null));
}
finally {
this._eyes = undefined;
}
}

@@ -402,5 +408,9 @@ /** @deprecated */

async getViewportSize() {
return (this._config.getViewportSize() || new RectangleSize_1.RectangleSizeData(await this._spec.getViewportSize({ target: this._driver })));
var _a;
return ((_a = this._config.getViewportSize()) !== null && _a !== void 0 ? _a : (this._spec.getViewportSize
? new RectangleSize_1.RectangleSizeData(await this._spec.getViewportSize({ target: this._driver }))
: undefined));
}
async setViewportSize(size) {
var _a, _b;
utils.guard.notNull(size, { name: 'size' });

@@ -412,8 +422,9 @@ if (!this._driver) {

try {
await this._spec.setViewportSize({ target: this._driver, size });
await ((_b = (_a = this._spec).setViewportSize) === null || _b === void 0 ? void 0 : _b.call(_a, { target: this._driver, size }));
this._config.setViewportSize(size);
}
catch (err) {
this._config.setViewportSize(await this._spec.getViewportSize({ target: this._driver }));
throw new TestFailedError_1.TestFailedError('Failed to set the viewport size');
if (this._spec.getViewportSize)
this._config.setViewportSize(await this._spec.getViewportSize({ target: this._driver }));
throw new EyesError_1.EyesError('Failed to set the viewport size');
}

@@ -433,14 +444,14 @@ }

const handler = this._logger.getLogHandler();
if (!handler) {
return new LogHandler_1.NullLogHandlerData();
if (handler) {
if (!utils.types.has(handler, 'type')) {
return handler;
}
else if (handler.type === 'file') {
return new LogHandler_1.FileLogHandlerData(true, handler.filename, handler.append);
}
else if (handler.type === 'console') {
return new LogHandler_1.ConsoleLogHandlerData(true);
}
}
else if (!utils.types.has(handler, 'type')) {
return handler;
}
else if (handler.type === 'file') {
return new LogHandler_1.FileLogHandlerData(true, handler.filename, handler.append);
}
else if (handler.type === 'console') {
return new LogHandler_1.ConsoleLogHandlerData(true);
}
return new LogHandler_1.NullLogHandlerData();
}

@@ -686,8 +697,3 @@ setCutProvider(cutProvider) {

addSessionEventHandler(handler) {
if (handler instanceof SessionEventHandlers_1.RemoteSessionEventHandler) {
this._config.setRemoteEvents(handler.toJSON());
}
else {
this._handlers.addEventHandler(handler);
}
this._handlers.addEventHandler(handler);
}

@@ -699,8 +705,3 @@ /**

removeSessionEventHandler(handler) {
if (handler instanceof SessionEventHandlers_1.RemoteSessionEventHandler) {
this._config.setRemoteEvents(null);
}
else {
this._handlers.removeEventHandler(handler);
}
this._handlers.removeEventHandler(handler);
}

@@ -707,0 +708,0 @@ /**

@@ -32,11 +32,15 @@ "use strict";

constructor(settingsOrRegionOrX, y, width, height, type) {
this._settings = {};
let settings;
if (utils.types.isNumber(settingsOrRegionOrX)) {
return new AccessibilityMatchSettingsData({ region: { x: settingsOrRegionOrX, y, width, height }, type });
settings = { region: { x: settingsOrRegionOrX, y: y, width: width, height: height }, type };
}
else if (!utils.types.has(settingsOrRegionOrX, 'region')) {
return new AccessibilityMatchSettingsData({ region: settingsOrRegionOrX });
settings = { region: settingsOrRegionOrX };
}
this.region = settingsOrRegionOrX.region;
this.type = settingsOrRegionOrX.type;
else {
settings = settingsOrRegionOrX;
}
utils.guard.isEnumValue(settings.type, AccessibilityRegionType_1.AccessibilityRegionTypeEnum, { name: 'type', strict: false });
utils.guard.isObject(settings.region, { name: 'region' });
this._settings = settings;
}

@@ -43,0 +47,0 @@ get region() {

@@ -32,13 +32,18 @@ "use strict";

var _a, _b, _c, _d, _e, _f, _g;
this._batch = {};
if (utils.types.isNull(batchOrName) || utils.types.isString(batchOrName)) {
return new BatchInfoData({ name: batchOrName, id, startedAt });
}
this.id = (_b = (_a = batchOrName.id) !== null && _a !== void 0 ? _a : utils.general.getEnvValue('BATCH_ID')) !== null && _b !== void 0 ? _b : `generated-${utils.general.guid()}`;
this.name = (_c = batchOrName.name) !== null && _c !== void 0 ? _c : utils.general.getEnvValue('BATCH_NAME');
this.sequenceName = (_d = batchOrName.sequenceName) !== null && _d !== void 0 ? _d : utils.general.getEnvValue('BATCH_SEQUENCE');
this.startedAt = (_e = batchOrName.startedAt) !== null && _e !== void 0 ? _e : new Date();
this.notifyOnCompletion =
(_g = (_f = batchOrName.notifyOnCompletion) !== null && _f !== void 0 ? _f : utils.general.getEnvValue('BATCH_NOTIFY', 'boolean')) !== null && _g !== void 0 ? _g : false;
this.properties = batchOrName.properties;
const batch = utils.types.isNull(batchOrName) || utils.types.isString(batchOrName)
? { name: batchOrName, id, startedAt }
: batchOrName;
utils.guard.isString(batch.id, { name: 'id', strict: false });
utils.guard.isString(batch.name, { name: 'name', strict: false });
utils.guard.isString(batch.sequenceName, { name: 'sequenceName', strict: false });
utils.guard.isBoolean(batch.notifyOnCompletion, { name: 'notifyOnCompletion', strict: false });
utils.guard.isArray(batch.properties, { name: 'properties', strict: false });
this._batch = {
id: (_b = (_a = batch.id) !== null && _a !== void 0 ? _a : utils.general.getEnvValue('BATCH_ID')) !== null && _b !== void 0 ? _b : `generated-${utils.general.guid()}`,
name: (_c = batch.name) !== null && _c !== void 0 ? _c : utils.general.getEnvValue('BATCH_NAME'),
sequenceName: (_d = batch.sequenceName) !== null && _d !== void 0 ? _d : utils.general.getEnvValue('BATCH_SEQUENCE'),
startedAt: (_e = batch.startedAt) !== null && _e !== void 0 ? _e : new Date(),
notifyOnCompletion: (_g = (_f = batch.notifyOnCompletion) !== null && _f !== void 0 ? _f : utils.general.getEnvValue('BATCH_NOTIFY', 'boolean')) !== null && _g !== void 0 ? _g : false,
properties: batch.properties,
};
}

@@ -130,3 +135,3 @@ get id() {

addProperty(propOrName, value) {
const property = utils.types.isString(propOrName) ? { name: propOrName, value } : propOrName;
const property = utils.types.isString(propOrName) ? { name: propOrName, value: value } : propOrName;
if (!this.properties)

@@ -133,0 +138,0 @@ this.properties = [];

@@ -309,19 +309,15 @@ "use strict";

class CheckSettingsAutomationFluent extends CheckSettingsBaseFluent {
constructor(settings, spec) {
super(settings);
this._spec = spec;
}
_isElementReference(value) {
var _a;
var _a, _b;
const spec = (_a = this._spec) !== null && _a !== void 0 ? _a : this.constructor._spec;
return spec.isElement(value) || this._isSelectorReference(value);
return !!((_b = spec.isElement) === null || _b === void 0 ? void 0 : _b.call(spec, value)) || this._isSelectorReference(value);
}
_isSelectorReference(selector) {
var _a;
var _a, _b, _c;
const spec = (_a = this._spec) !== null && _a !== void 0 ? _a : this.constructor._spec;
return (spec.isSelector(selector) ||
return (!!((_b = spec.isSelector) === null || _b === void 0 ? void 0 : _b.call(spec, selector)) ||
utils.types.isString(selector) ||
(utils.types.isPlainObject(selector) &&
utils.types.has(selector, 'selector') &&
(utils.types.isString(selector.selector) || spec.isSelector(selector.selector))));
(utils.types.isString(selector.selector) || !!((_c = spec.isSelector) === null || _c === void 0 ? void 0 : _c.call(spec, selector.selector)))));
}

@@ -331,2 +327,8 @@ _isFrameReference(value) {

}
constructor(settings, spec) {
var _a;
super(settings);
this._spec = spec;
(_a = this._settings) !== null && _a !== void 0 ? _a : (this._settings = {});
}
region(region) {

@@ -333,0 +335,0 @@ if (this._isSelectorReference(region) &&

@@ -39,28 +39,25 @@ "use strict";

class ConfigurationData {
constructor(config, spec) {
this._config = {};
if (!config)
return this;
if (config instanceof ConfigurationData)
config = config.toObject();
this._spec = spec;
for (const [key, value] of Object.entries(config)) {
;
this[key] = value;
}
}
_isElementReference(value) {
var _a;
var _a, _b;
const spec = (_a = this._spec) !== null && _a !== void 0 ? _a : this.constructor._spec;
return spec.isElement(value) || this._isSelectorReference(value);
return !!((_b = spec.isElement) === null || _b === void 0 ? void 0 : _b.call(spec, value)) || this._isSelectorReference(value);
}
_isSelectorReference(selector) {
var _a;
var _a, _b, _c;
const spec = (_a = this._spec) !== null && _a !== void 0 ? _a : this.constructor._spec;
return (spec.isSelector(selector) ||
return (!!((_b = spec.isSelector) === null || _b === void 0 ? void 0 : _b.call(spec, selector)) ||
utils.types.isString(selector) ||
(utils.types.isPlainObject(selector) &&
utils.types.has(selector, 'selector') &&
(utils.types.isString(selector.selector) || spec.isSelector(selector.selector))));
(utils.types.isString(selector.selector) || !!((_c = spec.isSelector) === null || _c === void 0 ? void 0 : _c.call(spec, selector.selector)))));
}
constructor(config, spec) {
this._config = {};
config = utils.types.instanceOf(config, ConfigurationData) ? config.toObject() : config !== null && config !== void 0 ? config : {};
this._spec = spec;
for (const [key, value] of Object.entries(config)) {
;
this[key] = value;
}
}
/** @undocumented */

@@ -86,4 +83,3 @@ get debugScreenshots() {

getDebugScreenshotsPath() {
var _a;
return (_a = this.debugScreenshots) === null || _a === void 0 ? void 0 : _a.path;
return this.debugScreenshots.path;
}

@@ -97,4 +93,3 @@ /** @undocumented */

getDebugScreenshotsPrefix() {
var _a;
return (_a = this.debugScreenshots) === null || _a === void 0 ? void 0 : _a.prefix;
return this.debugScreenshots.prefix;
}

@@ -255,3 +250,3 @@ /** @undocumented */

}
setProxy(proxyOrUrlOrIsEnabled, username, password, isHttpOnly) {
setProxy(proxyOrUrlOrIsEnabled, username, password) {
if (proxyOrUrlOrIsEnabled === false) {

@@ -261,3 +256,3 @@ this.proxy = undefined;

else if (utils.types.isString(proxyOrUrlOrIsEnabled)) {
this.proxy = { url: proxyOrUrlOrIsEnabled, username, password, isHttpOnly };
this.proxy = { url: proxyOrUrlOrIsEnabled, username, password };
}

@@ -318,19 +313,2 @@ else {

}
/** @undocumented */
get remoteEvents() {
return this._config.remoteEvents;
}
/** @undocumented */
set remoteEvents(remoteEvents) {
this._config.remoteEvents = remoteEvents;
}
/** @undocumented */
getRemoteEvents() {
return this.remoteEvents;
}
/** @undocumented */
setRemoteEvents(remoteEvents) {
this.remoteEvents = remoteEvents;
return this;
}
get batch() {

@@ -365,3 +343,3 @@ return this._config.batch;

addProperty(propOrName, value) {
const property = utils.types.isString(propOrName) ? { name: propOrName, value } : propOrName;
const property = utils.types.isString(propOrName) ? { name: propOrName, value: value } : propOrName;
if (!this.properties)

@@ -606,3 +584,3 @@ this.properties = [];

getDeviceInfo() {
return this._config.deviceInfo;
return this.deviceInfo;
}

@@ -638,4 +616,3 @@ setDeviceInfo(deviceInfo) {

getAccessibilityValidation() {
var _a;
return (_a = this.defaultMatchSettings) === null || _a === void 0 ? void 0 : _a.accessibilitySettings;
return this.defaultMatchSettings.accessibilitySettings;
}

@@ -649,4 +626,3 @@ setAccessibilityValidation(accessibilityValidation) {

getUseDom() {
var _a;
return (_a = this.defaultMatchSettings) === null || _a === void 0 ? void 0 : _a.useDom;
return this.defaultMatchSettings.useDom;
}

@@ -660,4 +636,3 @@ setUseDom(useDom) {

getEnablePatterns() {
var _a;
return (_a = this.defaultMatchSettings) === null || _a === void 0 ? void 0 : _a.enablePatterns;
return this.defaultMatchSettings.enablePatterns;
}

@@ -671,4 +646,3 @@ setEnablePatterns(enablePatterns) {

getIgnoreDisplacements() {
var _a;
return (_a = this.defaultMatchSettings) === null || _a === void 0 ? void 0 : _a.ignoreDisplacements;
return this.defaultMatchSettings.ignoreDisplacements;
}

@@ -682,4 +656,3 @@ setIgnoreDisplacements(ignoreDisplacements) {

getIgnoreCaret() {
var _a;
return (_a = this.defaultMatchSettings) === null || _a === void 0 ? void 0 : _a.ignoreCaret;
return this.defaultMatchSettings.ignoreCaret;
}

@@ -889,3 +862,3 @@ setIgnoreCaret(ignoreCaret) {

else
return this.addBrowsers({ width: browserInfoOrWidth, height, name });
return this.addBrowsers({ width: browserInfoOrWidth, height: height, name });
}

@@ -892,0 +865,0 @@ addDeviceEmulation(deviceName, screenOrientation = ScreenOrientation_1.ScreenOrientationEnum.PORTRAIT) {

@@ -31,5 +31,5 @@ "use strict";

if (utils.types.isNumber(rectOrRegionOrTop)) {
return new CutProviderData({ top: rectOrRegionOrTop, bottom, left, right });
this._rect = { top: rectOrRegionOrTop, bottom: bottom, left: left, right: right };
}
if (utils.types.has(rectOrRegionOrTop, ['top', 'right', 'bottom', 'left'])) {
else if (utils.types.has(rectOrRegionOrTop, ['top', 'right', 'bottom', 'left'])) {
this._rect = rectOrRegionOrTop;

@@ -42,23 +42,39 @@ }

get top() {
if (!this._rect)
return undefined;
return this._rect.top;
}
get right() {
if (!this._rect)
return undefined;
return this._rect.right;
}
get bottom() {
if (!this._rect)
return undefined;
return this._rect.bottom;
}
get left() {
if (!this._rect)
return undefined;
return this._rect.left;
}
get width() {
if (!this._region)
return undefined;
return this._region.width;
}
get height() {
if (!this._region)
return undefined;
return this._region.height;
}
get x() {
if (!this._region)
return undefined;
return this._region.x;
}
get y() {
if (!this._region)
return undefined;
return this._region.y;

@@ -89,7 +105,9 @@ }

toObject() {
return this._region ? this._region : this._rect;
var _a;
return ((_a = this._region) !== null && _a !== void 0 ? _a : this._rect);
}
/** @internal */
toJSON() {
return utils.general.toJSON(this._region ? this._region : this._rect);
var _a;
return utils.general.toJSON(((_a = this._region) !== null && _a !== void 0 ? _a : this._rect));
}

@@ -96,0 +114,0 @@ /** @internal */

@@ -32,5 +32,6 @@ "use strict";

constructor(settingsOrRegionOrX, y, width, height, maxUpOffset, maxDownOffset, maxLeftOffset, maxRightOffset) {
let settings;
if (utils.types.isNumber(settingsOrRegionOrX)) {
return new FloatingMatchSettingsData({
region: { x: settingsOrRegionOrX, y, width, height },
settings = {
region: { x: settingsOrRegionOrX, y: y, width: width, height: height },
maxUpOffset,

@@ -40,12 +41,11 @@ maxDownOffset,

maxRightOffset,
});
};
}
else if (!utils.types.has(settingsOrRegionOrX, 'region')) {
return new FloatingMatchSettingsData({ region: settingsOrRegionOrX });
settings = { region: settingsOrRegionOrX };
}
this.region = settingsOrRegionOrX.region;
this.maxUpOffset = maxUpOffset;
this.maxDownOffset = maxDownOffset;
this.maxLeftOffset = maxLeftOffset;
this.maxRightOffset = maxRightOffset;
else {
settings = settingsOrRegionOrX;
}
this._settings = settings;
}

@@ -52,0 +52,0 @@ get region() {

@@ -30,3 +30,4 @@ "use strict";

constructor(rotation) {
this.rotation = rotation;
utils.guard.isOneOf(rotation, [-270, -180, -90, 0, 90, 180, 270], { name: 'rotation' });
this._rotation = rotation;
}

@@ -33,0 +34,0 @@ get rotation() {

@@ -30,8 +30,6 @@ "use strict";

constructor(locationOrX, y) {
if (utils.types.isNumber(locationOrX)) {
return new LocationData({ x: locationOrX, y });
}
this._location = {};
this.x = locationOrX.x;
this.y = locationOrX.y;
const location = utils.types.isNumber(locationOrX) ? { x: locationOrX, y: y } : locationOrX;
utils.guard.isNumber(location.x, { name: 'x' });
utils.guard.isNumber(location.y, { name: 'y' });
this._location = location;
}

@@ -38,0 +36,0 @@ get x() {

@@ -32,3 +32,3 @@ "use strict";

utils.guard.isString(propertyOrName, { name: 'name' });
this._property = { name: propertyOrName, value };
this._property = { name: propertyOrName, value: value };
}

@@ -35,0 +35,0 @@ else {

@@ -29,7 +29,7 @@ "use strict";

class ProxySettingsData {
constructor(proxyOrUrl, username, password, isHttpOnly) {
constructor(proxyOrUrl, username, password) {
this._proxy = {};
utils.guard.notNull(proxyOrUrl, { name: 'proxyOrUrl' });
if (utils.types.isString(proxyOrUrl)) {
return new ProxySettingsData({ url: proxyOrUrl, username, password, isHttpOnly });
return new ProxySettingsData({ url: proxyOrUrl, username, password });
}

@@ -60,3 +60,3 @@ this._proxy = proxyOrUrl;

get isHttpOnly() {
return this._proxy.isHttpOnly;
return undefined;
}

@@ -63,0 +63,0 @@ getIsHttpOnly() {

@@ -30,8 +30,6 @@ "use strict";

constructor(sizeOrWidth, height) {
this._size = {};
if (utils.types.isNumber(sizeOrWidth)) {
return new RectangleSizeData({ width: sizeOrWidth, height });
}
this.width = sizeOrWidth.width;
this.height = sizeOrWidth.height;
const size = utils.types.isNumber(sizeOrWidth) ? { width: sizeOrWidth, height: height } : sizeOrWidth;
utils.guard.isNumber(size.width, { name: 'width', gte: 0 });
utils.guard.isNumber(size.height, { name: 'height', gte: 0 });
this._size = size;
}

@@ -38,0 +36,0 @@ get width() {

@@ -30,13 +30,17 @@ "use strict";

constructor(regionOrLocationOrX, sizeOrY, width, height) {
this._region = {};
let region;
if (utils.types.isNumber(regionOrLocationOrX)) {
return new RegionData({ x: regionOrLocationOrX, y: sizeOrY, width, height });
region = { x: regionOrLocationOrX, y: sizeOrY, width: width, height: height };
}
else if (!utils.types.has(regionOrLocationOrX, ['width', 'height'])) {
return new RegionData({ ...regionOrLocationOrX, ...sizeOrY });
region = { ...regionOrLocationOrX, ...sizeOrY };
}
this.x = regionOrLocationOrX.x;
this.y = regionOrLocationOrX.y;
this.width = regionOrLocationOrX.width;
this.height = regionOrLocationOrX.height;
else {
region = regionOrLocationOrX;
}
utils.guard.isNumber(region.x, { name: 'x' });
utils.guard.isNumber(region.y, { name: 'y' });
utils.guard.isNumber(region.width, { name: 'width', gte: 0 });
utils.guard.isNumber(region.height, { name: 'height', gte: 0 });
this._region = region;
}

@@ -43,0 +47,0 @@ get x() {

@@ -31,3 +31,13 @@ "use strict";

class Logger {
_makeLogger() {
return (0, logger_1.makeLogger)({
handler: this._options.handler && this._options.handler instanceof LogHandler_1.LogHandlerData
? this._options.handler.toJSON()
: this._options.handler,
level: this._options.show || utils.general.getEnvValue('SHOW_LOGS', 'boolean') ? 'info' : 'silent',
label: this._options.label,
});
}
constructor(loggerOrOptionsOrShow = false) {
this._options = {};
/** @internal */

@@ -42,14 +52,5 @@ this.isLogger = true;

else {
this._show = loggerOrOptionsOrShow.show;
this._label = loggerOrOptionsOrShow.label;
this._handler = loggerOrOptionsOrShow.handler;
this._options = loggerOrOptionsOrShow;
}
}
_makeLogger() {
return (0, logger_1.makeLogger)({
handler: this._handler instanceof LogHandler_1.LogHandlerData ? this._handler.toJSON() : this._handler,
level: this._show || utils.general.getEnvValue('SHOW_LOGS', 'boolean') ? 'info' : 'silent',
label: this._label,
});
}
/** @internal */

@@ -62,18 +63,18 @@ getLogger() {

getLogHandler() {
if (!this._handler) {
return new LogHandler_1.NullLogHandlerData();
if (this._options.handler) {
if (!utils.types.has(this._options.handler, 'type')) {
return this._options.handler;
}
else if (this._options.handler.type === 'file') {
return new LogHandler_1.FileLogHandlerData(true, this._options.handler.filename, this._options.handler.append);
}
else if (this._options.handler.type === 'console') {
return new LogHandler_1.ConsoleLogHandlerData(true);
}
}
else if (!utils.types.has(this._handler, 'type')) {
return this._handler;
}
else if (this._handler.type === 'file') {
return new LogHandler_1.FileLogHandlerData(true, this._handler.filename, this._handler.append);
}
else if (this._handler.type === 'console') {
return new LogHandler_1.ConsoleLogHandlerData(true);
}
return new LogHandler_1.NullLogHandlerData();
}
setLogHandler(handler) {
this._show = true;
this._handler = handler;
this._options.handler = handler;
this._options.show = true;
}

@@ -106,9 +107,12 @@ verbose(...messages) {

open() {
this._logger.open();
var _a;
(_a = this._logger) === null || _a === void 0 ? void 0 : _a.open();
}
close() {
this._logger.open();
var _a;
(_a = this._logger) === null || _a === void 0 ? void 0 : _a.close();
}
tag(name, value) {
this._logger.tag(name, value);
var _a;
(_a = this._logger) === null || _a === void 0 ? void 0 : _a.tag(name, value);
}

@@ -121,5 +125,9 @@ extend(optionsOrLabel) {

return new Logger(this._logger.extend(optionsOrLabel));
return new Logger({ show: this._show, label: (_a = optionsOrLabel === null || optionsOrLabel === void 0 ? void 0 : optionsOrLabel.label) !== null && _a !== void 0 ? _a : this._label, handler: this._handler });
return new Logger({
show: this._options.show,
label: (_a = optionsOrLabel === null || optionsOrLabel === void 0 ? void 0 : optionsOrLabel.label) !== null && _a !== void 0 ? _a : this._options.label,
handler: this._options.handler,
});
}
}
exports.Logger = Logger;

@@ -31,5 +31,2 @@ "use strict";

constructor(urls) {
this._urls = {};
if (!urls)
return this;
this._urls = urls instanceof ApiUrlsData ? urls.toJSON() : urls;

@@ -36,0 +33,0 @@ }

@@ -31,5 +31,2 @@ "use strict";

constructor(urls) {
this._urls = {};
if (!urls)
return this;
this._urls = urls instanceof AppUrlsData ? urls.toJSON() : urls;

@@ -36,0 +33,0 @@ }

@@ -31,5 +31,2 @@ "use strict";

constructor(result) {
this._result = {};
if (!result)
return this;
this._result = result instanceof MatchResultData ? result.toJSON() : result;

@@ -36,0 +33,0 @@ }

@@ -31,5 +31,2 @@ "use strict";

constructor(urls) {
this._urls = {};
if (!urls)
return this;
this._urls = urls instanceof SessionUrlsData ? urls.toJSON() : urls;

@@ -36,0 +33,0 @@ }

@@ -33,5 +33,2 @@ "use strict";

constructor(info) {
this._info = {};
if (!info)
return this;
this._info = info instanceof StepInfoData ? info.toJSON() : info;

@@ -38,0 +35,0 @@ }

@@ -8,4 +8,2 @@ "use strict";

constructor(options) {
if (!options)
return this;
this._container = options.container;

@@ -12,0 +10,0 @@ this._deleteTest = options.deleteTest;

@@ -35,7 +35,5 @@ "use strict";

constructor(options) {
this._result = {};
if (!options)
return this;
var _a;
this._deleteTest = options.deleteTest;
this._result = options.result;
this._result = (_a = options.result) !== null && _a !== void 0 ? _a : {};
}

@@ -346,5 +344,4 @@ get id() {

async delete() {
if (!this._deleteTest)
return;
return this._deleteTest({
var _a;
return (_a = this._deleteTest) === null || _a === void 0 ? void 0 : _a.call(this, {
settings: { serverUrl: '', apiKey: '', testId: this.id, batchId: this.batchId, secretToken: this.secretToken },

@@ -351,0 +348,0 @@ });

@@ -8,7 +8,4 @@ "use strict";

constructor(options) {
if (!options)
return;
const { summary, deleteTest } = options;
this._summary = summary;
this._deleteTest = deleteTest;
this._summary = options === null || options === void 0 ? void 0 : options.summary;
this._deleteTest = options === null || options === void 0 ? void 0 : options.deleteTest;
}

@@ -29,22 +26,23 @@ getAllResults() {

toJSON() {
var _a;
return (_a = this._summary) === null || _a === void 0 ? void 0 : _a.results;
var _a, _b;
return (_b = (_a = this._summary) === null || _a === void 0 ? void 0 : _a.results) !== null && _b !== void 0 ? _b : [];
}
/** @internal */
toString() {
var _a, _b, _c, _d, _e, _f, _g;
return ('result summary {' +
'\n\tpassed=' +
this._summary.passed +
((_a = this._summary) === null || _a === void 0 ? void 0 : _a.passed) +
'\n\tunresolved=' +
this._summary.unresolved +
((_b = this._summary) === null || _b === void 0 ? void 0 : _b.unresolved) +
'\n\tfailed=' +
this._summary.failed +
((_c = this._summary) === null || _c === void 0 ? void 0 : _c.failed) +
'\n\texceptions=' +
this._summary.exceptions +
((_d = this._summary) === null || _d === void 0 ? void 0 : _d.exceptions) +
'\n\tmismatches=' +
this._summary.mismatches +
((_e = this._summary) === null || _e === void 0 ? void 0 : _e.mismatches) +
'\n\tmissing=' +
this._summary.missing +
((_f = this._summary) === null || _f === void 0 ? void 0 : _f.missing) +
'\n\tmatches=' +
this._summary.matches +
((_g = this._summary) === null || _g === void 0 ? void 0 : _g.matches) +
'\n}');

@@ -51,0 +49,0 @@ }

@@ -69,14 +69,15 @@ "use strict";

catch (err) {
if (!((_a = err.info) === null || _a === void 0 ? void 0 : _a.result))
throw err;
const testResult = new TestResults_1.TestResultsData({ result: err.info.result, deleteTest });
if (err.reason === 'test failed') {
throw new TestFailedError_1.TestFailedError(err.message, testResult);
if ((_a = err.info) === null || _a === void 0 ? void 0 : _a.result) {
const result = new TestResults_1.TestResultsData({ result: err.info.result, deleteTest });
if (err.reason === 'test failed') {
throw new TestFailedError_1.TestFailedError(err.message, result);
}
else if (err.reason === 'test different') {
throw new DiffsFoundError_1.DiffsFoundError(err.message, result);
}
else if (err.reason === 'test new') {
throw new NewTestError_1.NewTestError(err.message, result);
}
}
else if (err.reason === 'test different') {
throw new DiffsFoundError_1.DiffsFoundError(err.message, testResult);
}
else if (err.reason === 'test new') {
throw new NewTestError_1.NewTestError(err.message, testResult);
}
throw err;
}

@@ -83,0 +84,0 @@ }

@@ -117,8 +117,8 @@ "use strict";

super();
if (utils.types.isString(optionsOrServerUrl)) {
return new RemoteSessionEventHandler({ serverUrl: optionsOrServerUrl, accessKey, timeout });
}
this._serverUrl = optionsOrServerUrl.serverUrl;
this._accessKey = optionsOrServerUrl.accessKey;
this._timeout = optionsOrServerUrl.timeout;
const options = utils.types.isObject(optionsOrServerUrl)
? optionsOrServerUrl
: { serverUrl: optionsOrServerUrl, accessKey, timeout };
this._serverUrl = options.serverUrl;
this._accessKey = options.accessKey;
this._timeout = options.timeout;
}

@@ -125,0 +125,0 @@ get serverUrl() {

{
"name": "@applitools/eyes-api",
"version": "1.13.1",
"version": "1.13.2",
"keywords": [

@@ -46,4 +46,4 @@ "applitools",

"scripts": {
"lint": "eslint '**/*.ts'",
"build": "tsc",
"lint": "node ../../node_modules/.bin/eslint '**/*.ts'",
"build": "node ../../node_modules/.bin/tsc --project ./tsconfig.build.json",
"test": "yarn test:unit",

@@ -54,3 +54,3 @@ "test:sanity": "yarn test:unit",

"deps": "bongo deps",
"preversion": "bongo preversion && yarn build",
"preversion": "bongo preversion",
"version": "bongo version",

@@ -60,23 +60,12 @@ "postversion": "bongo postversion --skip-release-notification"

"dependencies": {
"@applitools/core": "1.4.6",
"@applitools/logger": "1.1.42",
"@applitools/utils": "1.3.28"
"@applitools/core": "1.4.7",
"@applitools/logger": "1.1.45",
"@applitools/utils": "1.3.30"
},
"devDependencies": {
"@applitools/bongo": "^2.2.2",
"@applitools/scripts": "^1.2.0",
"@applitools/req": "^1.1.30",
"@types/mocha": "^9.0.0",
"@types/node": "12",
"@typescript-eslint/eslint-plugin": "^4.7.0",
"@typescript-eslint/parser": "^4.7.0",
"eslint": "^7.25.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-mocha-no-only": "^1.1.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.1.4",
"mocha": "^9.2.2",
"node-fetch": "^2.6.7",
"prettier": "^2.1.2",
"ts-node": "^10.2.1",
"typescript": "^4.8.4"
"mocha": "^9.2.2"
},

@@ -83,0 +72,0 @@ "engines": {

import { type Logger } from '@applitools/logger';
import { type MaybeArray } from '@applitools/utils';
import { ProxySettings } from './input/ProxySettings';
declare type BatchCloseOptions = {
type BatchCloseOptions = {
batchIds: string[];

@@ -10,3 +10,3 @@ serverUrl: string;

};
declare type BatchCloseSpec = {
type BatchCloseSpec = {
closeBatch(options: {

@@ -13,0 +13,0 @@ settings: MaybeArray<{

import type { Core, EyesManager, Eyes, ImageTarget, Config, CheckSettings, TestResultSummary, TestResultContainer, TestResult } from '@applitools/core';
export declare type CoreSpec<TDriver = unknown, TElement = unknown, TSelector = unknown> = Core<TDriver, unknown, TElement, TSelector>;
export declare type CoreEyes<TDriver = unknown, TElement = unknown, TSelector = unknown> = Eyes<TDriver, unknown, TElement, TSelector, 'classic' | 'ufg'>;
export declare type CoreEyesManager<TDriver = unknown, TElement = unknown, TSelector = unknown> = EyesManager<TDriver, unknown, TElement, TSelector, 'classic' | 'ufg'>;
export declare type CoreTargetImage = ImageTarget;
export declare type CoreConfig<TElement = unknown, TSelector = unknown> = Config<TElement, TSelector, 'classic'> & Config<TElement, TSelector, 'ufg'>;
export declare type CoreCheckSettingsAutomation<TElement = unknown, TSelector = unknown> = CheckSettings<TElement, TSelector, 'classic'> & CheckSettings<TElement, TSelector, 'ufg'>;
export declare type CoreCheckSettingsImage = CheckSettings<never, never, 'classic'>;
export declare type CoreTestResultSummary = TestResultSummary<'classic' | 'ufg'>;
export declare type CoreTestResultContainer = TestResultContainer<'classic' | 'ufg'>;
export declare type CoreTestResult = TestResult<'classic' | 'ufg'>;
export type CoreSpec<TDriver = unknown, TElement = unknown, TSelector = unknown> = Core<TDriver, unknown, TElement, TSelector>;
export type CoreEyes<TDriver = unknown, TElement = unknown, TSelector = unknown> = Eyes<TDriver, unknown, TElement, TSelector, 'classic' | 'ufg'>;
export type CoreEyesManager<TDriver = unknown, TElement = unknown, TSelector = unknown> = EyesManager<TDriver, unknown, TElement, TSelector, 'classic' | 'ufg'>;
export type CoreTargetImage = ImageTarget;
export type CoreConfig<TElement = unknown, TSelector = unknown> = Config<TElement, TSelector, 'classic'> & Config<TElement, TSelector, 'ufg'>;
export type CoreCheckSettingsAutomation<TElement = unknown, TSelector = unknown> = CheckSettings<TElement, TSelector, 'classic'> & CheckSettings<TElement, TSelector, 'ufg'>;
export type CoreCheckSettingsImage = CheckSettings<never, never, 'classic'>;
export type CoreTestResultSummary = TestResultSummary<'classic' | 'ufg'>;
export type CoreTestResultContainer = TestResultContainer<'classic' | 'ufg'>;
export type CoreTestResult = TestResult<'classic' | 'ufg'>;

@@ -5,2 +5,2 @@ export declare enum AccessibilityGuidelinesVersionEnum {

}
export declare type AccessibilityGuidelinesVersion = `${AccessibilityGuidelinesVersionEnum}`;
export type AccessibilityGuidelinesVersion = `${AccessibilityGuidelinesVersionEnum}`;

@@ -5,2 +5,2 @@ export declare enum AccessibilityLevelEnum {

}
export declare type AccessibilityLevel = `${AccessibilityLevelEnum}`;
export type AccessibilityLevel = `${AccessibilityLevelEnum}`;

@@ -8,2 +8,2 @@ export declare enum AccessibilityRegionTypeEnum {

}
export declare type AccessibilityRegionType = `${AccessibilityRegionTypeEnum}`;
export type AccessibilityRegionType = `${AccessibilityRegionTypeEnum}`;

@@ -5,2 +5,2 @@ export declare enum AccessibilityStatusEnum {

}
export declare type AccessibilityStatus = `${AccessibilityStatusEnum}`;
export type AccessibilityStatus = `${AccessibilityStatusEnum}`;

@@ -28,2 +28,2 @@ export declare enum AndroidDeviceNameEnum {

}
export declare type AndroidDeviceName = `${AndroidDeviceNameEnum}`;
export type AndroidDeviceName = `${AndroidDeviceNameEnum}`;

@@ -5,2 +5,2 @@ export declare enum AndroidVersionEnum {

}
export declare type AndroidVersion = `${AndroidVersionEnum}`;
export type AndroidVersion = `${AndroidVersionEnum}`;

@@ -20,2 +20,2 @@ export declare enum BrowserTypeEnum {

}
export declare type BrowserType = `${BrowserTypeEnum}`;
export type BrowserType = `${BrowserTypeEnum}`;

@@ -7,2 +7,2 @@ /** @undocumented */

}
export declare type CorsIframeHandle = `${CorsIframeHandleEnum}`;
export type CorsIframeHandle = `${CorsIframeHandleEnum}`;

@@ -70,2 +70,2 @@ export declare enum DeviceNameEnum {

}
export declare type DeviceName = `${DeviceNameEnum}`;
export type DeviceName = `${DeviceNameEnum}`;

@@ -5,2 +5,2 @@ export declare enum FailureReportEnum {

}
export declare type FailureReport = `${FailureReportEnum}`;
export type FailureReport = `${FailureReportEnum}`;

@@ -28,2 +28,2 @@ export declare enum IosDeviceNameEnum {

}
export declare type IosDeviceName = `${IosDeviceNameEnum}`;
export type IosDeviceName = `${IosDeviceNameEnum}`;

@@ -7,2 +7,2 @@ export declare enum IosVersionEnum {

}
export declare type IosVersion = `${IosVersionEnum}`;
export type IosVersion = `${IosVersionEnum}`;

@@ -11,2 +11,2 @@ export declare enum MatchLevelEnum {

}
export declare type MatchLevel = `${MatchLevelEnum}`;
export type MatchLevel = `${MatchLevelEnum}`;

@@ -5,2 +5,2 @@ export declare enum ScreenOrientationEnum {

}
export declare type ScreenOrientation = `${ScreenOrientationEnum}`;
export type ScreenOrientation = `${ScreenOrientationEnum}`;

@@ -5,2 +5,2 @@ export declare enum SessionTypeEnum {

}
export declare type SessionType = `${SessionTypeEnum}`;
export type SessionType = `${SessionTypeEnum}`;

@@ -5,2 +5,2 @@ export declare enum StitchModeEnum {

}
export declare type StitchMode = `${StitchModeEnum}`;
export type StitchMode = `${StitchModeEnum}`;

@@ -6,2 +6,2 @@ export declare enum TestResultsStatusEnum {

}
export declare type TestResultsStatus = `${TestResultsStatusEnum}`;
export type TestResultsStatus = `${TestResultsStatusEnum}`;

@@ -5,3 +5,3 @@ import { EyesError } from './EyesError';

private _result;
constructor(message: string, results?: TestResults);
constructor(message: string, results: TestResults);
constructor(results: TestResults);

@@ -8,0 +8,0 @@ get testResults(): TestResults;

/// <reference types="node" />
/// <reference types="node" />
import { CoreSpec, CoreTargetImage } from './Core';

@@ -36,4 +35,4 @@ import { EyesSelector } from './input/EyesSelector';

private _runner;
private _driver;
private _eyes;
private _driver?;
private _eyes?;
private _events;

@@ -40,0 +39,0 @@ private _handlers;

import { AccessibilityRegionType, AccessibilityRegionTypeEnum } from '../enums/AccessibilityRegionType';
import { Region, RegionData } from './Region';
export declare type AccessibilityMatchSettings = {
export type AccessibilityMatchSettings = {
region: Region;

@@ -5,0 +5,0 @@ type?: AccessibilityRegionType;

import { AccessibilityLevel } from '../enums/AccessibilityLevel';
import { AccessibilityGuidelinesVersion } from '../enums/AccessibilityGuidelinesVersion';
export declare type AccessibilitySettings = {
export type AccessibilitySettings = {
level?: AccessibilityLevel;
guidelinesVersion?: AccessibilityGuidelinesVersion;
};
import { ProxySettings } from './ProxySettings';
export declare type AUTProxySettings = ProxySettings & {
export type AUTProxySettings = ProxySettings & {
mode?: 'Allow' | 'Block';
domains?: string[];
};
import { PropertyData, PropertyDataData } from './PropertyData';
export declare type BatchInfo = {
export type BatchInfo = {
id?: string;

@@ -4,0 +4,0 @@ name?: string;

/// <reference types="node" />
/// <reference types="node" />
import { CoreCheckSettingsAutomation, CoreCheckSettingsImage } from '../Core';

@@ -11,11 +10,11 @@ import { EyesSelector } from './EyesSelector';

import { LazyLoadOptions } from './LazyLoadOptions';
declare type RegionReference<TElement, TSelector> = Region | ElementReference<TElement, TSelector>;
declare type ElementReference<TElement, TSelector> = TElement | SelectorReference<TSelector>;
declare type SelectorReference<TSelector> = EyesSelector<TSelector>;
declare type FrameReference<TElement, TSelector> = ElementReference<TElement, TSelector> | string | number;
declare type ContextReference<TElement, TSelector> = {
type RegionReference<TElement, TSelector> = Region | ElementReference<TElement, TSelector>;
type ElementReference<TElement, TSelector> = TElement | SelectorReference<TSelector>;
type SelectorReference<TSelector> = EyesSelector<TSelector>;
type FrameReference<TElement, TSelector> = ElementReference<TElement, TSelector> | string | number;
type ContextReference<TElement, TSelector> = {
frame: FrameReference<TElement, TSelector>;
scrollRootElement?: ElementReference<TElement, TSelector>;
};
declare type CodedRegion<TRegion = never> = {
type CodedRegion<TRegion = never> = {
region: Region | TRegion;

@@ -30,3 +29,3 @@ padding?: number | {

};
declare type CodedFloatingRegion<TRegion = never> = CodedRegion<TRegion> & {
type CodedFloatingRegion<TRegion = never> = CodedRegion<TRegion> & {
offset?: {

@@ -40,3 +39,3 @@ top?: number;

/** @deprecated */
declare type LegacyCodedFloatingRegion<TRegion = never> = CodedRegion<TRegion> & {
type LegacyCodedFloatingRegion<TRegion = never> = CodedRegion<TRegion> & {
maxUpOffset?: number;

@@ -47,6 +46,6 @@ maxDownOffset?: number;

};
declare type CodedAccessibilityRegion<TRegion = never> = CodedRegion<TRegion> & {
type CodedAccessibilityRegion<TRegion = never> = CodedRegion<TRegion> & {
type?: AccessibilityRegionType;
};
export declare type CheckSettingsBase<TRegion = never> = {
export type CheckSettingsBase<TRegion = never> = {
name?: string;

@@ -70,4 +69,4 @@ region?: Region | TRegion;

};
export declare type CheckSettingsImage = CheckSettingsBase;
export declare type CheckSettingsAutomation<TElement, TSelector> = CheckSettingsBase<RegionReference<TElement, TSelector>> & {
export type CheckSettingsImage = CheckSettingsBase;
export type CheckSettingsAutomation<TElement, TSelector> = CheckSettingsBase<RegionReference<TElement, TSelector>> & {
frames?: (ContextReference<TElement, TSelector> | FrameReference<TElement, TSelector>)[];

@@ -148,3 +147,2 @@ webview?: boolean | string;

export declare class CheckSettingsImageFluent extends CheckSettingsBaseFluent {
protected _settings: CheckSettingsImage;
protected _target: Image;

@@ -166,5 +164,5 @@ constructor(settings?: CheckSettingsImage | CheckSettingsImageFluent, target?: Image);

}
declare type CheckSettingsAutomationSpec<TElement = unknown, TSelector = unknown> = {
isElement(value: any): value is TElement;
isSelector(value: any): value is TSelector;
type CheckSettingsAutomationSpec<TElement = unknown, TSelector = unknown> = {
isElement?(value: any): value is TElement;
isSelector?(value: any): value is TSelector;
};

@@ -218,3 +216,3 @@ export declare class CheckSettingsAutomationFluent<TElement = unknown, TSelector = unknown> extends CheckSettingsBaseFluent<RegionReference<TElement, TSelector>> {

}
export declare type TargetImage = {
export type TargetImage = {
image(image: Buffer | URL | string): CheckSettingsImageFluent;

@@ -226,3 +224,3 @@ buffer(imageBuffer: Buffer): CheckSettingsImageFluent;

};
export declare type TargetAutomation<TElement, TSelector> = {
export type TargetAutomation<TElement, TSelector> = {
window(): CheckSettingsAutomationFluent<TElement, TSelector>;

@@ -235,3 +233,3 @@ region(region: RegionReference<TElement, TSelector> | LegacyRegion): CheckSettingsAutomationFluent<TElement, TSelector>;

};
export declare type Target<TElement, TSelector> = TargetImage & TargetAutomation<TElement, TSelector>;
export type Target<TElement, TSelector> = TargetImage & TargetAutomation<TElement, TSelector>;
export declare const Target: Target<unknown, unknown> & {

@@ -238,0 +236,0 @@ spec?: CheckSettingsAutomationSpec;

@@ -24,8 +24,8 @@ import { EyesSelector } from './EyesSelector';

import { ImageMatchSettings } from './ImageMatchSettings';
declare type RenderInfo = DesktopBrowserInfo | ChromeEmulationInfo | IOSDeviceInfo | AndroidDeviceInfo | ChromeEmulationInfoLegacy;
declare type ConfigurationSpec<TElement = unknown, TSelector = unknown> = {
isElement(element: any): element is TElement;
isSelector(selector: any): selector is TSelector;
type RenderInfo = DesktopBrowserInfo | ChromeEmulationInfo | IOSDeviceInfo | AndroidDeviceInfo | ChromeEmulationInfoLegacy;
type ConfigurationSpec<TElement = unknown, TSelector = unknown> = {
isElement?(element: any): element is TElement;
isSelector?(selector: any): selector is TSelector;
};
export declare type GeneralConfiguration = {
export type GeneralConfiguration = {
/** @undocumented */

@@ -43,10 +43,4 @@ debugScreenshots?: DebugScreenshotProvider;

removeSession?: boolean;
/** @undocumented */
remoteEvents?: {
serverUrl: string;
accessKey?: string;
timeout?: number;
};
};
export declare type OpenConfiguration = {
export type OpenConfiguration = {
appName?: string;

@@ -79,3 +73,3 @@ testName?: string;

};
export declare type CheckConfiguration = {
export type CheckConfiguration = {
sendDom?: boolean;

@@ -85,3 +79,3 @@ matchTimeout?: number;

};
export declare type ClassicConfiguration<TElement = unknown, TSelector = unknown> = {
export type ClassicConfiguration<TElement = unknown, TSelector = unknown> = {
waitBeforeScreenshots?: number;

@@ -98,3 +92,3 @@ stitchMode?: StitchMode;

};
export declare type VGConfiguration = {
export type VGConfiguration = {
/** @undocumented */

@@ -108,3 +102,3 @@ concurrentSessions?: number;

};
export declare type Configuration<TElement = unknown, TSelector = unknown> = GeneralConfiguration & OpenConfiguration & CheckConfiguration & ClassicConfiguration<TElement, TSelector> & VGConfiguration;
export type Configuration<TElement = unknown, TSelector = unknown> = GeneralConfiguration & OpenConfiguration & CheckConfiguration & ClassicConfiguration<TElement, TSelector> & VGConfiguration;
export declare class ConfigurationData<TElement = unknown, TSelector = unknown> implements Required<Configuration<TElement, TSelector>> {

@@ -177,3 +171,3 @@ protected static readonly _spec: ConfigurationSpec<any, any>;

setProxy(proxy: ProxySettings): this;
setProxy(url: string, username?: string, password?: string, isHttpOnly?: boolean): this;
setProxy(url: string, username?: string, password?: string, deprecatedIsHttpOnly?: boolean): this;
setProxy(isEnabled: false): this;

@@ -200,26 +194,2 @@ get autProxy(): AUTProxySettings;

setRemoveSession(removeSession: boolean): this;
/** @undocumented */
get remoteEvents(): {
serverUrl: string;
accessKey?: string;
timeout?: number;
};
/** @undocumented */
set remoteEvents(remoteEvents: {
serverUrl: string;
accessKey?: string;
timeout?: number;
});
/** @undocumented */
getRemoteEvents(): {
serverUrl: string;
accessKey?: string;
timeout?: number;
};
/** @undocumented */
setRemoteEvents(remoteEvents: {
serverUrl: string;
accessKey?: string;
timeout?: number;
}): this;
get batch(): BatchInfo;

@@ -226,0 +196,0 @@ set batch(batch: BatchInfo);

@@ -1,2 +0,2 @@

declare type CutProviderRect = {
type CutProviderRect = {
top: number;

@@ -7,3 +7,3 @@ right: number;

};
declare type CutProviderRegion = {
type CutProviderRegion = {
x: number;

@@ -14,6 +14,6 @@ y: number;

};
export declare type CutProvider = CutProviderRect | CutProviderRegion;
export type CutProvider = CutProviderRect | CutProviderRegion;
export declare class CutProviderData implements Required<CutProviderRegion & CutProviderRect> {
private _region;
private _rect;
private _region?;
private _rect?;
constructor(rectOrRegion: CutProvider);

@@ -20,0 +20,0 @@ constructor(top: number, bottom: number, left: number, right: number);

@@ -1,2 +0,2 @@

export declare type DebugScreenshotProvider = {
export type DebugScreenshotProvider = {
save: boolean;

@@ -3,0 +3,0 @@ path?: string;

/** @undocumented */
export declare type ExactMatchSettings = {
export type ExactMatchSettings = {
minDiffIntensity: number;

@@ -4,0 +4,0 @@ minDiffWidth: number;

@@ -1,2 +0,2 @@

export declare type EyesSelector<TSelector = never> = TSelector | string | {
export type EyesSelector<TSelector = never> = TSelector | string | {
selector: TSelector | string;

@@ -3,0 +3,0 @@ type?: string;

import { Region, RegionData } from './Region';
/** @undocumented */
export declare type FloatingMatchSettings = {
export type FloatingMatchSettings = {
region: Region;

@@ -5,0 +5,0 @@ maxUpOffset?: number;

/// <reference types="node" />
/// <reference types="node" />
import { RectangleSize } from './RectangleSize';
import { Location } from './Location';
export declare type Image = {
export type Image = {
image: Buffer | URL | string;

@@ -7,0 +6,0 @@ name?: string;

@@ -8,3 +8,3 @@ import { MatchLevel, MatchLevelEnum } from '../enums/MatchLevel';

/** @undocumented */
export declare type ImageMatchSettings = {
export type ImageMatchSettings = {
exact?: ExactMatchSettings;

@@ -11,0 +11,0 @@ matchLevel?: MatchLevel;

@@ -1,2 +0,2 @@

export declare type ImageRotation = -270 | -180 | -90 | 0 | 90 | 180 | 270;
export type ImageRotation = -270 | -180 | -90 | 0 | 90 | 180 | 270;
export declare class ImageRotationData {

@@ -3,0 +3,0 @@ private _rotation;

@@ -1,2 +0,2 @@

export declare type LazyLoadOptions = {
export type LazyLoadOptions = {
scrollLength?: number;

@@ -3,0 +3,0 @@ waitingTime?: number;

@@ -1,2 +0,2 @@

export declare type Location = {
export type Location = {
x: number;

@@ -3,0 +3,0 @@ y: number;

import * as logger from '@applitools/logger';
export declare type LogHandler = CustomLogHandler | FileLogHandler | ConsoleLogHandler;
export declare type CustomLogHandler = logger.CustomHandler;
export declare type FileLogHandler = logger.FileHandler;
export declare type ConsoleLogHandler = logger.ConsoleHandler;
export type LogHandler = CustomLogHandler | FileLogHandler | ConsoleLogHandler;
export type CustomLogHandler = logger.CustomHandler;
export type FileLogHandler = logger.FileHandler;
export type ConsoleLogHandler = logger.ConsoleHandler;
export declare abstract class LogHandlerData implements CustomLogHandler {

@@ -7,0 +7,0 @@ private _verbose;

import { EyesSelector } from './EyesSelector';
import { Region } from './Region';
export declare type OCRRegion<TElement = unknown, TSelector = unknown> = {
export type OCRRegion<TElement = unknown, TSelector = unknown> = {
target: Region | TElement | EyesSelector<TSelector>;

@@ -5,0 +5,0 @@ hint?: string;

@@ -1,2 +0,2 @@

export declare type OCRSettings<TPattern extends string = string> = {
export type OCRSettings<TPattern extends string = string> = {
patterns: TPattern[];

@@ -3,0 +3,0 @@ ignoreCase?: boolean;

@@ -1,2 +0,2 @@

export declare type PropertyData = {
export type PropertyData = {
name: string;

@@ -3,0 +3,0 @@ value: string;

@@ -1,6 +0,5 @@

export declare type ProxySettings = {
export type ProxySettings = {
url: string;
username?: string;
password?: string;
isHttpOnly?: boolean;
};

@@ -10,3 +9,3 @@ export declare class ProxySettingsData implements Required<ProxySettings> {

constructor(proxy: ProxySettings);
constructor(url: string, username?: string, password?: string, isHttpOnly?: boolean);
constructor(url: string, username?: string, password?: string, deprecatedIsHttpOnly?: boolean);
get url(): string;

@@ -13,0 +12,0 @@ getUri(): string;

@@ -1,2 +0,2 @@

export declare type RectangleSize = {
export type RectangleSize = {
width: number;

@@ -3,0 +3,0 @@ height: number;

import { Location } from './Location';
import { RectangleSize } from './RectangleSize';
/** @deprecated */
export declare type LegacyRegion = {
export type LegacyRegion = {
left: number;

@@ -10,3 +10,3 @@ top: number;

};
export declare type Region = Location & RectangleSize;
export type Region = Location & RectangleSize;
export declare class RegionData implements Required<Region> {

@@ -13,0 +13,0 @@ private _region;

@@ -8,3 +8,3 @@ import { BrowserType } from '../enums/BrowserType';

import { ScreenOrientation } from '../enums/ScreenOrientation';
export declare type DesktopBrowserInfo = {
export type DesktopBrowserInfo = {
name?: BrowserType;

@@ -14,3 +14,3 @@ width: number;

};
export declare type ChromeEmulationInfo = {
export type ChromeEmulationInfo = {
chromeEmulationInfo: {

@@ -22,7 +22,7 @@ deviceName: DeviceName;

/** @deprecated */
export declare type ChromeEmulationInfoLegacy = {
export type ChromeEmulationInfoLegacy = {
deviceName: DeviceName;
screenOrientation?: ScreenOrientation;
};
export declare type IOSDeviceInfo = {
export type IOSDeviceInfo = {
iosDeviceInfo: {

@@ -34,3 +34,3 @@ deviceName: IosDeviceName;

};
export declare type AndroidDeviceInfo = {
export type AndroidDeviceInfo = {
androidDeviceInfo: {

@@ -37,0 +37,0 @@ deviceName: AndroidDeviceName;

@@ -1,2 +0,2 @@

export declare type RunnerOptions = {
export type RunnerOptions = {
testConcurrency?: number;

@@ -3,0 +3,0 @@ };

@@ -1,4 +0,4 @@

export declare type VisualLocatorSettings<TLocator extends string = string> = {
export type VisualLocatorSettings<TLocator extends string = string> = {
locatorNames: TLocator[];
firstOnly: boolean;
};
import type * as logger from '@applitools/logger';
import { LogHandler, LogHandlerData, FileLogHandlerData, ConsoleLogHandlerData } from './input/LogHandler';
export declare class Logger {
private _logger;
private _handler;
private _show;
private _label;
private _logger?;
private _options;
private _makeLogger;

@@ -9,0 +7,0 @@ /** @internal */

@@ -1,2 +0,2 @@

export declare type ApiUrls = {
export type ApiUrls = {
readonly baselineImage?: string;

@@ -11,3 +11,3 @@ readonly currentImage?: string;

/** @internal */
constructor(urls?: ApiUrls);
constructor(urls: ApiUrls);
get baselineImage(): string;

@@ -14,0 +14,0 @@ getBaselineImage(): string;

@@ -1,2 +0,2 @@

export declare type AppUrls = {
export type AppUrls = {
readonly step?: string;

@@ -8,3 +8,3 @@ readonly stepEditor?: string;

/** @internal */
constructor(urls?: AppUrls);
constructor(urls: AppUrls);
get step(): string;

@@ -11,0 +11,0 @@ getStep(): string;

@@ -1,2 +0,2 @@

export declare type MatchResult = {
export type MatchResult = {
readonly asExpected?: boolean;

@@ -8,3 +8,3 @@ readonly windowId?: number;

/** @internal */
constructor(result?: MatchResult);
constructor(result: MatchResult);
get asExpected(): boolean;

@@ -11,0 +11,0 @@ getAsExpected(): boolean;

@@ -1,2 +0,2 @@

export declare type SessionUrls = {
export type SessionUrls = {
readonly batch?: string;

@@ -8,3 +8,3 @@ readonly session?: string;

/** @internal */
constructor(urls?: SessionUrls);
constructor(urls: SessionUrls);
get batch(): string;

@@ -11,0 +11,0 @@ getBatch(): string;

import { AppUrls, AppUrlsData } from './AppUrls';
import { ApiUrls, ApiUrlsData } from './ApiUrls';
export declare type StepInfo = {
export type StepInfo = {
readonly name?: string;

@@ -15,3 +15,3 @@ readonly isDifferent?: boolean;

/** @internal */
constructor(info?: StepInfo);
constructor(info: StepInfo);
get name(): string;

@@ -18,0 +18,0 @@ getName(): string;

import { AccessibilityStatus } from '../enums/AccessibilityStatus';
import { AccessibilityLevel } from '../enums/AccessibilityLevel';
import { AccessibilityGuidelinesVersion } from '../enums/AccessibilityGuidelinesVersion';
export declare type TestAccessibilityStatus = {
export type TestAccessibilityStatus = {
readonly status: AccessibilityStatus;

@@ -6,0 +6,0 @@ readonly level: AccessibilityLevel;

import { CoreSpec, CoreTestResultContainer } from '../Core';
import { TestResults, TestResultsData } from './TestResults';
import { AndroidDeviceInfo, ChromeEmulationInfo, ChromeEmulationInfoLegacy, DesktopBrowserInfo, IOSDeviceInfo } from '../input/RenderInfo';
declare type RenderInfo = DesktopBrowserInfo | ChromeEmulationInfo | IOSDeviceInfo | AndroidDeviceInfo | ChromeEmulationInfoLegacy;
export declare type TestResultContainer = {
readonly exception: Error;
readonly testResults: TestResults;
readonly browserInfo: RenderInfo;
type RenderInfo = DesktopBrowserInfo | ChromeEmulationInfo | IOSDeviceInfo | AndroidDeviceInfo | ChromeEmulationInfoLegacy;
export type TestResultContainer = {
readonly exception?: Error;
readonly testResults?: TestResults;
readonly browserInfo?: RenderInfo;
};
export declare class TestResultContainerData implements Required<TestResultContainer> {
private _container;
private _deleteTest;
private _deleteTest?;
/** @internal */
constructor(options?: {
constructor(options: {
container: CoreTestResultContainer;
deleteTest: CoreSpec['deleteTest'];
deleteTest?: CoreSpec['deleteTest'];
});

@@ -18,0 +18,0 @@ get testResults(): TestResults;

@@ -7,3 +7,3 @@ import { CoreSpec, CoreTestResult } from '../Core';

import { StepInfo, StepInfoData } from './StepInfo';
export declare type TestResults = {
export type TestResults = {
readonly id?: string;

@@ -42,5 +42,5 @@ readonly name?: string;

private _result;
private readonly _deleteTest;
private _deleteTest?;
/** @internal */
constructor(options?: {
constructor(options: {
result?: CoreTestResult;

@@ -47,0 +47,0 @@ deleteTest?: CoreSpec['deleteTest'];

import { CoreSpec, CoreTestResultContainer, CoreTestResultSummary } from '../Core';
import { TestResultContainer, TestResultContainerData } from './TestResultContainer';
export declare type TestResultsSummary = Iterable<TestResultContainer>;
export type TestResultsSummary = Iterable<TestResultContainer>;
export declare class TestResultsSummaryData implements Iterable<TestResultContainerData> {
private _summary;
private _deleteTest;
private _summary?;
private _deleteTest?;
/** @internal */
constructor(options?: {
summary: CoreTestResultSummary;
deleteTest: CoreSpec['deleteTest'];
summary?: CoreTestResultSummary;
deleteTest?: CoreSpec['deleteTest'];
});

@@ -12,0 +12,0 @@ getAllResults(): TestResultContainerData[];

@@ -1,2 +0,2 @@

export declare type TextRegion = {
export type TextRegion = {
x: number;

@@ -3,0 +3,0 @@ y: number;

/** @undocumented */
export declare type ValidationInfo = {
export type ValidationInfo = {
readonly validationId: number;

@@ -4,0 +4,0 @@ readonly tag: string;

/** @undocumented */
export declare type ValidationResult = {
export type ValidationResult = {
readonly asExpected: boolean;

@@ -4,0 +4,0 @@ };

@@ -7,4 +7,4 @@ import { CoreSpec, CoreEyes, CoreConfig } from './Core';

export declare abstract class EyesRunner {
protected _spec: CoreSpec;
private _manager;
protected _spec?: CoreSpec;
private _manager?;
private _eyes;

@@ -27,4 +27,4 @@ /** @internal */

export declare class VisualGridRunner extends EyesRunner {
private _testConcurrency;
private _legacyConcurrency;
private _testConcurrency?;
private _legacyConcurrency?;
constructor(options?: RunnerOptions);

@@ -38,10 +38,10 @@ /** @deprecated */

type: "ufg";
concurrency: number;
legacyConcurrency: number;
concurrency: number | undefined;
legacyConcurrency: number | undefined;
};
get testConcurrency(): number;
get testConcurrency(): number | undefined;
/** @deprecated */
get legacyConcurrency(): number;
get legacyConcurrency(): number | undefined;
/** @deprecated */
getConcurrentSessions(): number;
getConcurrentSessions(): number | undefined;
}

@@ -48,0 +48,0 @@ export declare class ClassicRunner extends EyesRunner {

@@ -16,3 +16,3 @@ import type { Eyes } from './Eyes';

abstract validationEnded(sessionId: string, validationId: number, validationResult: ValidationResultData): any;
private _detach;
private _detach?;
/** @internal */

@@ -44,4 +44,4 @@ attach(eyes: Eyes): void;

private _serverUrl;
private _accessKey;
private _timeout;
private _accessKey?;
private _timeout?;
constructor(options: {

@@ -57,10 +57,10 @@ serverUrl: string;

setServerUrl(serverUrl: string): void;
get accessKey(): string;
set accessKey(accessKey: string);
getAccessKey(): string;
get accessKey(): string | undefined;
set accessKey(accessKey: string | undefined);
getAccessKey(): string | undefined;
setAccessKey(accessKey: string): void;
get timeout(): number;
set timeout(timeout: number);
get timeout(): number | undefined;
set timeout(timeout: number | undefined);
setTimeout(timeout: number): void;
getTimeout(): number;
getTimeout(): number | undefined;
initStarted(): void;

@@ -77,3 +77,3 @@ initEnded(): void;

serverUrl: string;
accessKey: string;
accessKey?: string;
};

@@ -80,0 +80,0 @@ /** @internal */

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc