@applitools/driver 1.14.3 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/capabilities.js +20 -4
- package/dist/context.js +3 -1
- package/dist/driver.js +3 -2
- package/package.json +3 -3
- package/types/types.d.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.15.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/driver@1.14.4...js/driver@1.15.0) (2023-11-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* added warning when driver used with capabilities that may conflict with applitools lib workflow ([#2011](https://github.com/applitools/eyes.sdk.javascript1/issues/2011)) ([081006d](https://github.com/applitools/eyes.sdk.javascript1/commit/081006d879894db03a2713129b66586496b6eb02))
|
|
9
|
+
|
|
10
|
+
## [1.14.4](https://github.com/applitools/eyes.sdk.javascript1/compare/js/driver@1.14.3...js/driver@1.14.4) (2023-10-17)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Code Refactoring
|
|
14
|
+
|
|
15
|
+
* disallow usage of global Buffer ([#1957](https://github.com/applitools/eyes.sdk.javascript1/issues/1957)) ([adcc082](https://github.com/applitools/eyes.sdk.javascript1/commit/adcc082f20f6b92e819b96424e995d9a69d99758))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Dependencies
|
|
19
|
+
|
|
20
|
+
* @applitools/utils bumped to 1.6.2
|
|
21
|
+
#### Code Refactoring
|
|
22
|
+
|
|
23
|
+
* disallow usage of global Buffer ([#1957](https://github.com/applitools/eyes.sdk.javascript1/issues/1957)) ([adcc082](https://github.com/applitools/eyes.sdk.javascript1/commit/adcc082f20f6b92e819b96424e995d9a69d99758))
|
|
24
|
+
* @applitools/logger bumped to 2.0.12
|
|
25
|
+
#### Code Refactoring
|
|
26
|
+
|
|
27
|
+
* disallow usage of global Buffer ([#1957](https://github.com/applitools/eyes.sdk.javascript1/issues/1957)) ([adcc082](https://github.com/applitools/eyes.sdk.javascript1/commit/adcc082f20f6b92e819b96424e995d9a69d99758))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
3
32
|
## [1.14.3](https://github.com/applitools/eyes.sdk.javascript1/compare/js/driver@1.14.2...js/driver@1.14.3) (2023-09-29)
|
|
4
33
|
|
|
5
34
|
|
package/dist/capabilities.js
CHANGED
|
@@ -51,13 +51,29 @@ function extractCapabilitiesEnvironment(capabilities) {
|
|
|
51
51
|
environment.isAndroid = isAndroid(capabilities);
|
|
52
52
|
if (!environment.browserName) {
|
|
53
53
|
environment.isNative = true;
|
|
54
|
+
environment.applitoolsLib = { instrumented: false };
|
|
54
55
|
if (environment.isAndroid) {
|
|
55
|
-
|
|
56
|
+
const optionalIntentArguments = (_t = capabilities['appium:optionalIntentArguments']) !== null && _t !== void 0 ? _t : capabilities.optionalIntentArguments;
|
|
57
|
+
environment.applitoolsLib.instrumented = !!(optionalIntentArguments === null || optionalIntentArguments === void 0 ? void 0 : optionalIntentArguments.includes('APPLITOOLS_API_KEY'));
|
|
56
58
|
}
|
|
57
59
|
else if (environment.isIOS) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
const processArguments = (_u = capabilities['appium:processArguments']) !== null && _u !== void 0 ? _u : capabilities.processArguments;
|
|
61
|
+
environment.applitoolsLib.instrumented = utils.types.isString(processArguments)
|
|
62
|
+
? processArguments.includes('APPLITOOLS_API_KEY')
|
|
63
|
+
: !!((_v = processArguments === null || processArguments === void 0 ? void 0 : processArguments.env) === null || _v === void 0 ? void 0 : _v.APPLITOOLS_API_KEY);
|
|
64
|
+
}
|
|
65
|
+
if (environment.applitoolsLib.instrumented) {
|
|
66
|
+
const conflictingCapabilities = { fullReset: false, noReset: true, autoLaunch: false };
|
|
67
|
+
environment.applitoolsLib.conflictingCapabilities = Object.entries(conflictingCapabilities).reduce((conflictingCapabilities, [capability, value]) => {
|
|
68
|
+
;
|
|
69
|
+
[capability, `appium:${capability}`].forEach(capability => {
|
|
70
|
+
if (capabilities[capability] === value) {
|
|
71
|
+
conflictingCapabilities !== null && conflictingCapabilities !== void 0 ? conflictingCapabilities : (conflictingCapabilities = {});
|
|
72
|
+
conflictingCapabilities[capability] = value;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return conflictingCapabilities;
|
|
76
|
+
}, undefined);
|
|
61
77
|
}
|
|
62
78
|
}
|
|
63
79
|
else if (environment.isIOS &&
|
package/dist/context.js
CHANGED
|
@@ -145,7 +145,9 @@ class Context {
|
|
|
145
145
|
else if (selector.shadow && !features.nestedSelectors) {
|
|
146
146
|
elements = await elements.reduce((result, element) => {
|
|
147
147
|
return result.then(async (result) => {
|
|
148
|
-
const root = await this._spec.executeScript(this.target, snippets.getShadowRoot, [
|
|
148
|
+
const root = await this._spec.executeScript(this.target, snippets.getShadowRoot, [
|
|
149
|
+
element,
|
|
150
|
+
]);
|
|
149
151
|
return result.concat(root ? await this._findElements(selector.shadow, { parent: root, all, wait }) : []);
|
|
150
152
|
});
|
|
151
153
|
}, Promise.resolve([]));
|
package/dist/driver.js
CHANGED
|
@@ -27,6 +27,7 @@ exports.makeDriver = exports.isDriver = exports.isDriverInstance = exports.Drive
|
|
|
27
27
|
const logger_1 = require("@applitools/logger");
|
|
28
28
|
const context_1 = require("./context");
|
|
29
29
|
const selector_1 = require("./selector");
|
|
30
|
+
const buffer_1 = require("buffer");
|
|
30
31
|
const helper_ios_1 = require("./helper-ios");
|
|
31
32
|
const helper_android_1 = require("./helper-android");
|
|
32
33
|
const user_agent_1 = require("./user-agent");
|
|
@@ -512,7 +513,7 @@ class Driver {
|
|
|
512
513
|
}
|
|
513
514
|
try {
|
|
514
515
|
await this._spec.switchWorld(this.target, name);
|
|
515
|
-
this.refresh({ reset: true });
|
|
516
|
+
await this.refresh({ reset: true });
|
|
516
517
|
}
|
|
517
518
|
catch (error) {
|
|
518
519
|
this._logger.error('Unable to switch world due to the error', error);
|
|
@@ -639,7 +640,7 @@ class Driver {
|
|
|
639
640
|
async takeScreenshot() {
|
|
640
641
|
const image = await this._spec.takeScreenshot(this.target);
|
|
641
642
|
if (utils.types.isString(image)) {
|
|
642
|
-
return Buffer.from(image.replace(/[\r\n]+/g, ''), 'base64');
|
|
643
|
+
return buffer_1.Buffer.from(image.replace(/[\r\n]+/g, ''), 'base64');
|
|
643
644
|
}
|
|
644
645
|
return image;
|
|
645
646
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/driver",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "Applitools universal framework wrapper",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"applitools",
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"test": "run --top-level mocha './test/**/*.spec.ts'"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@applitools/logger": "2.0.
|
|
76
|
+
"@applitools/logger": "2.0.12",
|
|
77
77
|
"@applitools/snippets": "2.4.24",
|
|
78
|
-
"@applitools/utils": "1.6.
|
|
78
|
+
"@applitools/utils": "1.6.2",
|
|
79
79
|
"semver": "7.5.4"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
package/types/types.d.ts
CHANGED
|
@@ -32,7 +32,10 @@ export type Environment = {
|
|
|
32
32
|
isW3C?: boolean;
|
|
33
33
|
isEC?: boolean;
|
|
34
34
|
isECClient?: boolean;
|
|
35
|
-
|
|
35
|
+
applitoolsLib?: {
|
|
36
|
+
instrumented: boolean;
|
|
37
|
+
conflictingCapabilities?: Partial<Capabilities>;
|
|
38
|
+
};
|
|
36
39
|
isWeb?: boolean;
|
|
37
40
|
isNative?: boolean;
|
|
38
41
|
isMobile?: boolean;
|