@applitools/driver
Advanced tools
Comparing version 1.11.25 to 1.11.26
@@ -18,3 +18,3 @@ "use strict"; | ||
isChrome: isChrome(capabilities), | ||
isExecutionGridClient: Boolean(capabilities.applitools), | ||
isECClient: Boolean(capabilities['applitools:isECClient']), | ||
}; | ||
@@ -21,0 +21,0 @@ if (info.isMobile) { |
@@ -162,2 +162,9 @@ "use strict"; | ||
} | ||
get isECClient() { | ||
var _a; | ||
return !!((_a = this._driverInfo) === null || _a === void 0 ? void 0 : _a.isECClient); | ||
} | ||
get isEC() { | ||
return this.isECClient || (!!this.remoteHostname && /exec-wus.applitools.com/.test(this.remoteHostname)); | ||
} | ||
get sessionId() { | ||
@@ -167,12 +174,6 @@ var _a; | ||
} | ||
get isExecutionGridClient() { | ||
get remoteHostname() { | ||
var _a; | ||
return !!((_a = this._driverInfo) === null || _a === void 0 ? void 0 : _a.isExecutionGridClient); | ||
return (_a = this._driverInfo) === null || _a === void 0 ? void 0 : _a.remoteHostname; | ||
} | ||
get isExecutionGrid() { | ||
var _a, _b; | ||
if (this.isExecutionGridClient) | ||
return true; | ||
return /exec-wus.applitools.com/.test((_b = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.extractHostName) === null || _b === void 0 ? void 0 : _b.call(_a, this.target)); | ||
} | ||
updateCurrentContext(context) { | ||
@@ -182,4 +183,4 @@ this._currentContext = context; | ||
async init() { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18; | ||
var _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21; | ||
var _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38; | ||
// NOTE: this is here because saucelabs does not provide right capabilities for the first call | ||
@@ -192,5 +193,6 @@ await ((_b = (_a = this._spec).getCapabilities) === null || _b === void 0 ? void 0 : _b.call(_a, this.target)); | ||
this._driverInfo = { ...capabilitiesInfo, ...driverInfo }; | ||
(_g = (_22 = this._driverInfo).remoteHostname) !== null && _g !== void 0 ? _g : (_22.remoteHostname = (_j = (_h = this._spec).extractHostName) === null || _j === void 0 ? void 0 : _j.call(_h, this.target)); | ||
if (this.isMobile) { | ||
this._driverInfo.orientation = | ||
(_g = (await this.getOrientation().catch(() => undefined))) !== null && _g !== void 0 ? _g : this._driverInfo.orientation; | ||
(_k = (await this.getOrientation().catch(() => undefined))) !== null && _k !== void 0 ? _k : this._driverInfo.orientation; | ||
const world = await this.getCurrentWorld(); | ||
@@ -201,14 +203,14 @@ this._driverInfo.isWebView = !!(world === null || world === void 0 ? void 0 : world.isWebView); | ||
const browserInfo = await this.currentContext.executePoll(snippets.getBrowserInfo); | ||
(_h = (_19 = this._driverInfo).userAgent) !== null && _h !== void 0 ? _h : (_19.userAgent = browserInfo.userAgent); | ||
(_j = (_20 = this._driverInfo).pixelRatio) !== null && _j !== void 0 ? _j : (_20.pixelRatio = browserInfo.pixelRatio); | ||
(_k = (_21 = this._driverInfo).viewportScale) !== null && _k !== void 0 ? _k : (_21.viewportScale = browserInfo.viewportScale); | ||
(_l = (_23 = this._driverInfo).userAgent) !== null && _l !== void 0 ? _l : (_23.userAgent = browserInfo.userAgent); | ||
(_m = (_24 = this._driverInfo).pixelRatio) !== null && _m !== void 0 ? _m : (_24.pixelRatio = browserInfo.pixelRatio); | ||
(_o = (_25 = this._driverInfo).viewportScale) !== null && _o !== void 0 ? _o : (_25.viewportScale = browserInfo.viewportScale); | ||
if (browserInfo.userAgentData) { | ||
(_l = (_22 = this._driverInfo).isMobile) !== null && _l !== void 0 ? _l : (_22.isMobile = this._driverInfo.isMobile); | ||
(_m = (_23 = this._driverInfo).isChromium) !== null && _m !== void 0 ? _m : (_23.isChromium = this._driverInfo.isChromium); | ||
(_p = (_26 = this._driverInfo).isMobile) !== null && _p !== void 0 ? _p : (_26.isMobile = this._driverInfo.isMobile); | ||
(_q = (_27 = this._driverInfo).isChromium) !== null && _q !== void 0 ? _q : (_27.isChromium = this._driverInfo.isChromium); | ||
if (this.isChromium) { | ||
if (this.isWindows && Number.parseInt(this.browserVersion) >= 107) { | ||
this._driverInfo.platformVersion = (_o = browserInfo.platformVersion) !== null && _o !== void 0 ? _o : this._driverInfo.platformVersion; | ||
this._driverInfo.platformVersion = (_r = browserInfo.platformVersion) !== null && _r !== void 0 ? _r : this._driverInfo.platformVersion; | ||
} | ||
else if (this.isMac && Number.parseInt(this.browserVersion) >= 90) { | ||
this._driverInfo.platformVersion = (_p = browserInfo.platformVersion) !== null && _p !== void 0 ? _p : this._driverInfo.platformVersion; | ||
this._driverInfo.platformVersion = (_s = browserInfo.platformVersion) !== null && _s !== void 0 ? _s : this._driverInfo.platformVersion; | ||
} | ||
@@ -221,16 +223,16 @@ } | ||
this._driverInfo.browserName = | ||
(_r = (_q = userAgentInfo.browserName) !== null && _q !== void 0 ? _q : userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.browserName) !== null && _r !== void 0 ? _r : this._driverInfo.browserName; | ||
(_u = (_t = userAgentInfo.browserName) !== null && _t !== void 0 ? _t : userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.browserName) !== null && _u !== void 0 ? _u : this._driverInfo.browserName; | ||
this._driverInfo.browserVersion = | ||
(_t = (_s = userAgentInfo.browserVersion) !== null && _s !== void 0 ? _s : userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.browserVersion) !== null && _t !== void 0 ? _t : this._driverInfo.browserVersion; | ||
(_u = (_24 = this._driverInfo).isMobile) !== null && _u !== void 0 ? _u : (_24.isMobile = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.isMobile); | ||
(_v = (_25 = this._driverInfo).isChromium) !== null && _v !== void 0 ? _v : (_25.isChromium = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.isChromium); | ||
(_w = (_v = userAgentInfo.browserVersion) !== null && _v !== void 0 ? _v : userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.browserVersion) !== null && _w !== void 0 ? _w : this._driverInfo.browserVersion; | ||
(_x = (_28 = this._driverInfo).isMobile) !== null && _x !== void 0 ? _x : (_28.isMobile = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.isMobile); | ||
(_y = (_29 = this._driverInfo).isChromium) !== null && _y !== void 0 ? _y : (_29.isChromium = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.isChromium); | ||
if (this._driverInfo.isMobile) { | ||
(_w = (_26 = this._driverInfo).platformName) !== null && _w !== void 0 ? _w : (_26.platformName = (_x = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.platformName) !== null && _x !== void 0 ? _x : userAgentInfo.platformName); | ||
(_y = (_27 = this._driverInfo).platformVersion) !== null && _y !== void 0 ? _y : (_27.platformVersion = (_z = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.platformVersion) !== null && _z !== void 0 ? _z : userAgentInfo.platformVersion); | ||
(_z = (_30 = this._driverInfo).platformName) !== null && _z !== void 0 ? _z : (_30.platformName = (_0 = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.platformName) !== null && _0 !== void 0 ? _0 : userAgentInfo.platformName); | ||
(_1 = (_31 = this._driverInfo).platformVersion) !== null && _1 !== void 0 ? _1 : (_31.platformVersion = (_2 = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.platformVersion) !== null && _2 !== void 0 ? _2 : userAgentInfo.platformVersion); | ||
} | ||
else { | ||
this._driverInfo.platformName = | ||
(_1 = (_0 = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.platformName) !== null && _0 !== void 0 ? _0 : userAgentInfo.platformName) !== null && _1 !== void 0 ? _1 : this._driverInfo.platformName; | ||
(_4 = (_3 = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.platformName) !== null && _3 !== void 0 ? _3 : userAgentInfo.platformName) !== null && _4 !== void 0 ? _4 : this._driverInfo.platformName; | ||
this._driverInfo.platformVersion = | ||
(_3 = (_2 = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.platformVersion) !== null && _2 !== void 0 ? _2 : userAgentInfo.platformVersion) !== null && _3 !== void 0 ? _3 : this._driverInfo.platformVersion; | ||
(_6 = (_5 = userAgentDataInfo === null || userAgentDataInfo === void 0 ? void 0 : userAgentDataInfo.platformVersion) !== null && _5 !== void 0 ? _5 : userAgentInfo.platformVersion) !== null && _6 !== void 0 ? _6 : this._driverInfo.platformVersion; | ||
} | ||
@@ -242,4 +244,4 @@ } | ||
} | ||
(_4 = (_28 = this._driverInfo).features) !== null && _4 !== void 0 ? _4 : (_28.features = {}); | ||
(_5 = (_29 = this._driverInfo.features).allCookies) !== null && _5 !== void 0 ? _5 : (_29.allCookies = this._driverInfo.isChrome || (/chrome/i.test(this._driverInfo.browserName) && !this._driverInfo.isMobile)); | ||
(_7 = (_32 = this._driverInfo).features) !== null && _7 !== void 0 ? _7 : (_32.features = {}); | ||
(_8 = (_33 = this._driverInfo.features).allCookies) !== null && _8 !== void 0 ? _8 : (_33.allCookies = this._driverInfo.isChrome || (/chrome/i.test(this._driverInfo.browserName) && !this._driverInfo.isMobile)); | ||
} | ||
@@ -249,4 +251,4 @@ else { | ||
let windowSize = await this._spec.getWindowSize(this.target); | ||
(_6 = (_30 = this._driverInfo).displaySize) !== null && _6 !== void 0 ? _6 : (_30.displaySize = windowSize); | ||
if (((_7 = this.orientation) === null || _7 === void 0 ? void 0 : _7.startsWith('landscape')) && | ||
(_9 = (_34 = this._driverInfo).displaySize) !== null && _9 !== void 0 ? _9 : (_34.displaySize = windowSize); | ||
if (((_10 = this.orientation) === null || _10 === void 0 ? void 0 : _10.startsWith('landscape')) && | ||
this._driverInfo.displaySize.height > this._driverInfo.displaySize.width) { | ||
@@ -260,3 +262,3 @@ this._driverInfo.displaySize = { | ||
// bar sizes could be extracted only on android | ||
const systemBars = await ((_9 = (_8 = this._spec).getSystemBars) === null || _9 === void 0 ? void 0 : _9.call(_8, this.target).catch(() => null)); | ||
const systemBars = await ((_12 = (_11 = this._spec).getSystemBars) === null || _12 === void 0 ? void 0 : _12.call(_11, this.target).catch(() => null)); | ||
const { statusBar, navigationBar } = systemBars !== null && systemBars !== void 0 ? systemBars : {}; | ||
@@ -268,3 +270,3 @@ if (statusBar === null || statusBar === void 0 ? void 0 : statusBar.visible) { | ||
if (statusBarSize < this._driverInfo.displaySize.height) { | ||
this._driverInfo.statusBarSize = Math.max((_10 = this._driverInfo.statusBarSize) !== null && _10 !== void 0 ? _10 : 0, statusBarSize); | ||
this._driverInfo.statusBarSize = Math.max((_13 = this._driverInfo.statusBarSize) !== null && _13 !== void 0 ? _13 : 0, statusBarSize); | ||
} | ||
@@ -278,7 +280,7 @@ } | ||
// navigation bar size could be its height or width depending on screen orientation | ||
const navigationBarSize = navigationBar[((_11 = this.orientation) === null || _11 === void 0 ? void 0 : _11.startsWith('landscape')) ? 'width' : 'height']; | ||
const navigationBarSize = navigationBar[((_14 = this.orientation) === null || _14 === void 0 ? void 0 : _14.startsWith('landscape')) ? 'width' : 'height']; | ||
// when navigation bar is invisible on android it returns navigation bar size equal to display size | ||
if (navigationBarSize < | ||
this._driverInfo.displaySize[((_12 = this.orientation) === null || _12 === void 0 ? void 0 : _12.startsWith('landscape')) ? 'width' : 'height']) { | ||
this._driverInfo.navigationBarSize = Math.max((_13 = this._driverInfo.navigationBarSize) !== null && _13 !== void 0 ? _13 : 0, navigationBarSize); | ||
this._driverInfo.displaySize[((_15 = this.orientation) === null || _15 === void 0 ? void 0 : _15.startsWith('landscape')) ? 'width' : 'height']) { | ||
this._driverInfo.navigationBarSize = Math.max((_16 = this._driverInfo.navigationBarSize) !== null && _16 !== void 0 ? _16 : 0, navigationBarSize); | ||
} | ||
@@ -290,13 +292,13 @@ else { | ||
// bar sizes have to be scaled on android | ||
(_31 = this._driverInfo).statusBarSize && (_31.statusBarSize = this._driverInfo.statusBarSize / this.pixelRatio); | ||
(_32 = this._driverInfo).navigationBarSize && (_32.navigationBarSize = this._driverInfo.navigationBarSize / this.pixelRatio); | ||
(_35 = this._driverInfo).statusBarSize && (_35.statusBarSize = this._driverInfo.statusBarSize / this.pixelRatio); | ||
(_36 = this._driverInfo).navigationBarSize && (_36.navigationBarSize = this._driverInfo.navigationBarSize / this.pixelRatio); | ||
windowSize = utils.geometry.scale(windowSize, 1 / this.pixelRatio); | ||
(_33 = this._driverInfo).displaySize && (_33.displaySize = utils.geometry.scale(this._driverInfo.displaySize, 1 / this.pixelRatio)); | ||
(_37 = this._driverInfo).displaySize && (_37.displaySize = utils.geometry.scale(this._driverInfo.displaySize, 1 / this.pixelRatio)); | ||
} | ||
if (this.isIOS) { | ||
if ((_14 = this.orientation) === null || _14 === void 0 ? void 0 : _14.startsWith('landscape')) | ||
if ((_17 = this.orientation) === null || _17 === void 0 ? void 0 : _17.startsWith('landscape')) | ||
this._driverInfo.statusBarSize = 0; | ||
} | ||
// calculate viewport location | ||
(_15 = (_34 = this._driverInfo).viewportLocation) !== null && _15 !== void 0 ? _15 : (_34.viewportLocation = { | ||
(_18 = (_38 = this._driverInfo).viewportLocation) !== null && _18 !== void 0 ? _18 : (_38.viewportLocation = { | ||
x: this.orientation === 'landscape' ? this.navigationBarSize : 0, | ||
@@ -310,3 +312,3 @@ y: this.statusBarSize, | ||
if (this.isAndroid) { | ||
this._driverInfo.viewportSize[((_16 = this.orientation) === null || _16 === void 0 ? void 0 : _16.startsWith('landscape')) ? 'width' : 'height'] -= | ||
this._driverInfo.viewportSize[((_19 = this.orientation) === null || _19 === void 0 ? void 0 : _19.startsWith('landscape')) ? 'width' : 'height'] -= | ||
this.navigationBarSize; | ||
@@ -334,3 +336,3 @@ } | ||
// init helper lib | ||
if (!((_17 = this._customConfig) === null || _17 === void 0 ? void 0 : _17.disableHelper)) { | ||
if (!((_20 = this._customConfig) === null || _20 === void 0 ? void 0 : _20.disableHelper)) { | ||
this._helper = this.isIOS | ||
@@ -340,3 +342,3 @@ ? await helper_ios_1.HelperIOS.make({ spec: this._spec, driver: this, logger: this._logger }) | ||
} | ||
this._logger.log(`Helper set to ${(_18 = this._helper) === null || _18 === void 0 ? void 0 : _18.name}`); | ||
this._logger.log(`Helper set to ${(_21 = this._helper) === null || _21 === void 0 ? void 0 : _21.name}`); | ||
} | ||
@@ -429,3 +431,3 @@ this._logger.log('Combined driver info', this._driverInfo); | ||
var _a; | ||
if (this.isExecutionGridClient) | ||
if (this.isECClient) | ||
return await ((_a = this._spec) === null || _a === void 0 ? void 0 : _a.getSessionMetadata(this.target)); | ||
@@ -432,0 +434,0 @@ } |
{ | ||
"name": "@applitools/driver", | ||
"version": "1.11.25", | ||
"version": "1.11.26", | ||
"description": "Applitools universal framework wrapper", | ||
@@ -90,9 +90,9 @@ "keywords": [ | ||
"dependencies": { | ||
"@applitools/logger": "1.1.40", | ||
"@applitools/snippets": "2.4.13", | ||
"@applitools/utils": "1.3.26", | ||
"@applitools/logger": "1.1.42", | ||
"@applitools/snippets": "2.4.14", | ||
"@applitools/utils": "1.3.28", | ||
"semver": "7.3.7" | ||
}, | ||
"devDependencies": { | ||
"@applitools/bongo": "^2.2.0", | ||
"@applitools/bongo": "^2.2.2", | ||
"@applitools/scripts": "^1.2.0", | ||
@@ -99,0 +99,0 @@ "@types/mocha": "^9.1.1", |
@@ -63,5 +63,6 @@ /// <reference types="node" /> | ||
get isEdgeLegacy(): boolean; | ||
get isECClient(): boolean; | ||
get isEC(): boolean; | ||
get sessionId(): string; | ||
get isExecutionGridClient(): boolean; | ||
get isExecutionGrid(): boolean; | ||
get remoteHostname(): string | undefined; | ||
updateCurrentContext(context: Context<TDriver, TContext, TElement, TSelector>): void; | ||
@@ -68,0 +69,0 @@ init(): Promise<this>; |
@@ -7,2 +7,3 @@ /// <reference types="node" /> | ||
sessionId?: string; | ||
remoteHostname?: string; | ||
browserName?: string; | ||
@@ -34,2 +35,3 @@ browserVersion?: string; | ||
isWebView?: boolean; | ||
isECClient?: boolean; | ||
features?: { | ||
@@ -40,3 +42,2 @@ shadowSelector?: boolean; | ||
}; | ||
isExecutionGridClient?: boolean; | ||
}; | ||
@@ -43,0 +44,0 @@ export declare type WaitOptions = { |
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
240628
3932
+ Added@applitools/logger@1.1.42(transitive)
+ Added@applitools/snippets@2.4.14(transitive)
+ Added@applitools/utils@1.3.28(transitive)
+ Addeddebug@4.3.3(transitive)
+ Addedms@2.1.2(transitive)
- Removed@applitools/logger@1.1.40(transitive)
- Removed@applitools/snippets@2.4.13(transitive)
- Removed@applitools/utils@1.3.26(transitive)
Updated@applitools/logger@1.1.42
Updated@applitools/snippets@2.4.14
Updated@applitools/utils@1.3.28