@applitools/eyes-webdriverio 5.45.2 → 5.45.4
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 +203 -0
- package/dist/api.js +10 -7
- package/dist/extract-environment.js +7 -0
- package/dist/legacy.js +1 -1
- package/dist/spec-driver.js +265 -1
- package/package.json +20 -16
- package/types/index.d.ts +65 -26
- package/types/service.d.ts +19 -33
- package/types/v5-async.d.ts +32 -1
- package/types/v5-sync.d.ts +32 -1
- package/types/v6.d.ts +9 -1
- package/types/v7.d.ts +9 -1
- package/types/v8.d.ts +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,208 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.45.4](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-webdriverio@5.45.3...js/eyes-webdriverio@5.45.4) (2023-08-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Dependencies
|
|
7
|
+
|
|
8
|
+
* @applitools/utils bumped to 1.5.2
|
|
9
|
+
#### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fixed some types ([498b1d7](https://github.com/applitools/eyes.sdk.javascript1/commit/498b1d7c547df04773b64b66ee39cccb402c093e))
|
|
12
|
+
* @applitools/nml-client bumped to 1.5.9
|
|
13
|
+
#### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* update broker url when server respond with error ([#1882](https://github.com/applitools/eyes.sdk.javascript1/issues/1882)) ([ab5a6ae](https://github.com/applitools/eyes.sdk.javascript1/commit/ab5a6ae8976b061bda8b56a9cc11c149e47d6dea))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
* @applitools/core bumped to 3.10.0
|
|
20
|
+
#### Features
|
|
21
|
+
|
|
22
|
+
* allowed running multiple classic test with different devices for applitoolsified native apps ([#1891](https://github.com/applitools/eyes.sdk.javascript1/issues/1891)) ([a84311f](https://github.com/applitools/eyes.sdk.javascript1/commit/a84311f88e6f532268543a96f841ae5ad87d5659))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
* @applitools/eyes bumped to 1.8.0
|
|
27
|
+
#### Features
|
|
28
|
+
|
|
29
|
+
* added more iOS devices ([a84311f](https://github.com/applitools/eyes.sdk.javascript1/commit/a84311f88e6f532268543a96f841ae5ad87d5659))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
* @applitools/logger bumped to 2.0.9
|
|
34
|
+
|
|
35
|
+
* @applitools/socket bumped to 1.1.9
|
|
36
|
+
|
|
37
|
+
* @applitools/req bumped to 1.5.4
|
|
38
|
+
|
|
39
|
+
* @applitools/image bumped to 1.1.4
|
|
40
|
+
|
|
41
|
+
* @applitools/spec-driver-webdriver bumped to 1.0.43
|
|
42
|
+
|
|
43
|
+
* @applitools/spec-driver-selenium bumped to 1.5.57
|
|
44
|
+
|
|
45
|
+
* @applitools/spec-driver-puppeteer bumped to 1.1.74
|
|
46
|
+
|
|
47
|
+
* @applitools/driver bumped to 1.13.6
|
|
48
|
+
|
|
49
|
+
* @applitools/screenshoter bumped to 3.8.9
|
|
50
|
+
|
|
51
|
+
* @applitools/tunnel-client bumped to 1.2.1
|
|
52
|
+
|
|
53
|
+
* @applitools/ufg-client bumped to 1.7.2
|
|
54
|
+
|
|
55
|
+
* @applitools/ec-client bumped to 1.7.6
|
|
56
|
+
|
|
57
|
+
* @applitools/core-base bumped to 1.5.2
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## [5.45.3](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-webdriverio@5.45.2...js/eyes-webdriverio@5.45.3) (2023-08-18)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### Code Refactoring
|
|
64
|
+
|
|
65
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### Dependencies
|
|
69
|
+
|
|
70
|
+
* @applitools/utils bumped to 1.5.1
|
|
71
|
+
#### Code Refactoring
|
|
72
|
+
|
|
73
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
74
|
+
* @applitools/logger bumped to 2.0.8
|
|
75
|
+
#### Code Refactoring
|
|
76
|
+
|
|
77
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
* @applitools/socket bumped to 1.1.8
|
|
82
|
+
#### Code Refactoring
|
|
83
|
+
|
|
84
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
* @applitools/req bumped to 1.5.3
|
|
89
|
+
#### Code Refactoring
|
|
90
|
+
|
|
91
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
* @applitools/image bumped to 1.1.3
|
|
96
|
+
#### Code Refactoring
|
|
97
|
+
|
|
98
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
* @applitools/snippets bumped to 2.4.23
|
|
103
|
+
#### Code Refactoring
|
|
104
|
+
|
|
105
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
106
|
+
* @applitools/spec-driver-webdriver bumped to 1.0.42
|
|
107
|
+
#### Code Refactoring
|
|
108
|
+
|
|
109
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
* @applitools/spec-driver-selenium bumped to 1.5.56
|
|
114
|
+
#### Code Refactoring
|
|
115
|
+
|
|
116
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
* @applitools/spec-driver-puppeteer bumped to 1.1.73
|
|
121
|
+
#### Code Refactoring
|
|
122
|
+
|
|
123
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
* @applitools/driver bumped to 1.13.5
|
|
128
|
+
#### Bug Fixes
|
|
129
|
+
|
|
130
|
+
* optimize driver usage in close ([#1867](https://github.com/applitools/eyes.sdk.javascript1/issues/1867)) ([60dff6b](https://github.com/applitools/eyes.sdk.javascript1/commit/60dff6b160e69d3893c91a1125d668fa18b43072))
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
#### Code Refactoring
|
|
134
|
+
|
|
135
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
* @applitools/screenshoter bumped to 3.8.8
|
|
140
|
+
#### Code Refactoring
|
|
141
|
+
|
|
142
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
* @applitools/nml-client bumped to 1.5.8
|
|
147
|
+
#### Code Refactoring
|
|
148
|
+
|
|
149
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
* @applitools/tunnel-client bumped to 1.2.0
|
|
154
|
+
#### Features
|
|
155
|
+
|
|
156
|
+
* replace and destroy tunnels by tunnel id ([#1878](https://github.com/applitools/eyes.sdk.javascript1/issues/1878)) ([22bcc15](https://github.com/applitools/eyes.sdk.javascript1/commit/22bcc15b31457e3da56cdb6f73bee3dcb7e051a1))
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
#### Code Refactoring
|
|
160
|
+
|
|
161
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
* @applitools/ufg-client bumped to 1.7.1
|
|
166
|
+
#### Code Refactoring
|
|
167
|
+
|
|
168
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
* @applitools/ec-client bumped to 1.7.5
|
|
173
|
+
#### Code Refactoring
|
|
174
|
+
|
|
175
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
* @applitools/core-base bumped to 1.5.1
|
|
180
|
+
#### Code Refactoring
|
|
181
|
+
|
|
182
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
* @applitools/core bumped to 3.9.1
|
|
187
|
+
#### Bug Fixes
|
|
188
|
+
|
|
189
|
+
* optimize driver usage in close ([#1867](https://github.com/applitools/eyes.sdk.javascript1/issues/1867)) ([60dff6b](https://github.com/applitools/eyes.sdk.javascript1/commit/60dff6b160e69d3893c91a1125d668fa18b43072))
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
#### Code Refactoring
|
|
193
|
+
|
|
194
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
* @applitools/eyes bumped to 1.7.3
|
|
199
|
+
#### Code Refactoring
|
|
200
|
+
|
|
201
|
+
* refactored spec driver interface ([#1839](https://github.com/applitools/eyes.sdk.javascript1/issues/1839)) ([aa49ec2](https://github.com/applitools/eyes.sdk.javascript1/commit/aa49ec2a7d14b8529acc3a8a4c2baecfa113d98a))
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
3
206
|
## [5.45.2](https://github.com/applitools/eyes.sdk.javascript1/compare/js/eyes-webdriverio@5.45.1...js/eyes-webdriverio@5.45.2) (2023-08-10)
|
|
4
207
|
|
|
5
208
|
|
package/dist/api.js
CHANGED
|
@@ -29,11 +29,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.closeBatch = exports.BatchClose = exports.Configuration = exports.Target = exports.TargetAutomation = exports.CheckSettings = exports.CheckSettingsAutomation = exports.Eyes = void 0;
|
|
30
30
|
const extract_environment_1 = require("./extract-environment");
|
|
31
31
|
const eyes = __importStar(require("@applitools/eyes"));
|
|
32
|
-
const spec = __importStar(require("
|
|
32
|
+
const spec = __importStar(require("./spec-driver"));
|
|
33
33
|
__exportStar(require("@applitools/eyes"), exports);
|
|
34
34
|
__exportStar(require("./legacy"), exports);
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const sdk = {
|
|
36
|
+
spec: spec,
|
|
37
|
+
agentId: `eyes-webdriverio/${require('../package.json').version}`,
|
|
38
|
+
environment: (0, extract_environment_1.extractEnvironment)(),
|
|
39
|
+
};
|
|
37
40
|
class Eyes extends eyes.Eyes {
|
|
38
41
|
}
|
|
39
42
|
exports.Eyes = Eyes;
|
|
@@ -41,16 +44,16 @@ Eyes._sdk = sdk;
|
|
|
41
44
|
class CheckSettingsAutomation extends eyes.CheckSettingsAutomation {
|
|
42
45
|
}
|
|
43
46
|
exports.CheckSettingsAutomation = CheckSettingsAutomation;
|
|
44
|
-
CheckSettingsAutomation._spec = spec;
|
|
47
|
+
CheckSettingsAutomation._spec = sdk.spec;
|
|
45
48
|
class CheckSettings extends CheckSettingsAutomation {
|
|
46
49
|
}
|
|
47
50
|
exports.CheckSettings = CheckSettings;
|
|
48
|
-
exports.TargetAutomation = { ...eyes.TargetAutomation, spec };
|
|
49
|
-
exports.Target = { ...eyes.Target, spec };
|
|
51
|
+
exports.TargetAutomation = { ...eyes.TargetAutomation, spec: sdk.spec };
|
|
52
|
+
exports.Target = { ...eyes.Target, spec: sdk.spec };
|
|
50
53
|
class Configuration extends eyes.Configuration {
|
|
51
54
|
}
|
|
52
55
|
exports.Configuration = Configuration;
|
|
53
|
-
Configuration._spec = spec;
|
|
56
|
+
Configuration._spec = sdk.spec;
|
|
54
57
|
class BatchClose extends eyes.BatchClose {
|
|
55
58
|
}
|
|
56
59
|
exports.BatchClose = BatchClose;
|
|
@@ -10,6 +10,13 @@ function extractEnvironment() {
|
|
|
10
10
|
catch {
|
|
11
11
|
// NOTE: ignore error
|
|
12
12
|
}
|
|
13
|
+
try {
|
|
14
|
+
const { name, version } = require('webdriver/package.json');
|
|
15
|
+
versions[name] = version;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// NOTE: ignore error
|
|
19
|
+
}
|
|
13
20
|
return { versions };
|
|
14
21
|
}
|
|
15
22
|
exports.extractEnvironment = extractEnvironment;
|
package/dist/legacy.js
CHANGED
package/dist/spec-driver.js
CHANGED
|
@@ -10,8 +10,272 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
13
25
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
27
|
};
|
|
16
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
29
|
+
exports.build = exports.findElements = exports.findElement = exports.executeScript = exports.extractSelector = exports.toSimpleCommonSelector = exports.toSelector = exports.toElement = exports.toDriver = exports.isSecondarySelector = exports.isSelector = exports.isSecondaryElement = exports.isSecondaryDriver = void 0;
|
|
30
|
+
const spec = __importStar(require("@applitools/spec-driver-webdriver"));
|
|
31
|
+
const utils = __importStar(require("@applitools/utils"));
|
|
32
|
+
__exportStar(require("@applitools/spec-driver-webdriver"), exports);
|
|
33
|
+
const LEGACY_ELEMENT_ID = 'ELEMENT';
|
|
34
|
+
const ELEMENT_ID = 'element-6066-11e4-a52e-4f735466cecf';
|
|
35
|
+
const SHADOW_ROOT_ID = 'shadow-6066-11e4-a52e-4f735466cecf';
|
|
36
|
+
const DIRECT_SELECTOR_REGEXP = /^(id|css selector|xpath|link text|partial link text|name|tag name|class name|-android uiautomator|-android datamatcher|-android viewmatcher|-android viewtag|-ios uiautomation|-ios predicate string|-ios class chain|accessibility id):(.+)/;
|
|
37
|
+
async function getSearchRoot(driver, parent) {
|
|
38
|
+
const root = driver.original;
|
|
39
|
+
if (parent) {
|
|
40
|
+
const elementId = parent[SHADOW_ROOT_ID] || parent[ELEMENT_ID] || parent[LEGACY_ELEMENT_ID];
|
|
41
|
+
return root.$({ [ELEMENT_ID]: elementId });
|
|
42
|
+
}
|
|
43
|
+
return root;
|
|
44
|
+
}
|
|
45
|
+
function isSecondaryDriver(driver) {
|
|
46
|
+
if (!driver)
|
|
47
|
+
return false;
|
|
48
|
+
return spec.isSecondaryDriver(driver) || utils.types.instanceOf(driver, 'Browser');
|
|
49
|
+
}
|
|
50
|
+
exports.isSecondaryDriver = isSecondaryDriver;
|
|
51
|
+
function isSecondaryElement(element) {
|
|
52
|
+
return !!(element === null || element === void 0 ? void 0 : element.elementId);
|
|
53
|
+
}
|
|
54
|
+
exports.isSecondaryElement = isSecondaryElement;
|
|
55
|
+
function isSelector(selector) {
|
|
56
|
+
return utils.types.isString(selector) || utils.types.has(selector, 'strategyName') || utils.types.isFunction(selector);
|
|
57
|
+
}
|
|
58
|
+
exports.isSelector = isSelector;
|
|
59
|
+
function isSecondarySelector(selector) {
|
|
60
|
+
return spec.isSelector(selector);
|
|
61
|
+
}
|
|
62
|
+
exports.isSecondarySelector = isSecondarySelector;
|
|
63
|
+
function toDriver(driver) {
|
|
64
|
+
if (spec.isSecondaryDriver(driver))
|
|
65
|
+
return spec.toDriver(driver);
|
|
66
|
+
if (driver.isDevTools) {
|
|
67
|
+
driver.addCommand('sendCommandAndGetResult', async (name, options) => {
|
|
68
|
+
const puppeteer = await driver.getPuppeteer();
|
|
69
|
+
const [page] = await puppeteer.pages();
|
|
70
|
+
const session = await page.target().createCDPSession();
|
|
71
|
+
return session.send(name, options);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const transformedDriver = Object.create(driver, {
|
|
75
|
+
original: { enumerable: false, get: () => driver },
|
|
76
|
+
});
|
|
77
|
+
return transformedDriver;
|
|
78
|
+
}
|
|
79
|
+
exports.toDriver = toDriver;
|
|
80
|
+
function toElement(element) {
|
|
81
|
+
if (utils.types.has(element, 'elementId')) {
|
|
82
|
+
return {
|
|
83
|
+
[ELEMENT_ID]: element.elementId,
|
|
84
|
+
[LEGACY_ELEMENT_ID]: element.elementId,
|
|
85
|
+
selector: isSelector(element.selector) ? element.selector : undefined,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return element;
|
|
89
|
+
}
|
|
90
|
+
exports.toElement = toElement;
|
|
91
|
+
function toSelector(selector) {
|
|
92
|
+
if (utils.types.has(selector, 'selector')) {
|
|
93
|
+
if (utils.types.has(selector, 'type') && selector.type && utils.types.isString(selector.selector)) {
|
|
94
|
+
return `${selector.type === 'css' ? 'css selector' : selector.type}:${selector.selector}`;
|
|
95
|
+
}
|
|
96
|
+
else if (isSelector(selector.selector)) {
|
|
97
|
+
return selector.selector;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
selector = selector.selector;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (utils.types.has(selector, ['using', 'value'])) {
|
|
104
|
+
return `${selector.using}:${selector.value}`;
|
|
105
|
+
}
|
|
106
|
+
return selector;
|
|
107
|
+
}
|
|
108
|
+
exports.toSelector = toSelector;
|
|
109
|
+
function toSimpleCommonSelector(selector) {
|
|
110
|
+
if (utils.types.isFunction(selector) || utils.types.has(selector, 'strategyName'))
|
|
111
|
+
return null;
|
|
112
|
+
else if (utils.types.isString(selector)) {
|
|
113
|
+
const match = selector.match(DIRECT_SELECTOR_REGEXP);
|
|
114
|
+
if (!match)
|
|
115
|
+
return { selector };
|
|
116
|
+
const [, using, value] = match;
|
|
117
|
+
return { type: using === 'css selector' ? 'css' : using, selector: value };
|
|
118
|
+
}
|
|
119
|
+
return selector;
|
|
120
|
+
}
|
|
121
|
+
exports.toSimpleCommonSelector = toSimpleCommonSelector;
|
|
122
|
+
function extractSelector(element) {
|
|
123
|
+
var _a;
|
|
124
|
+
return (_a = element.selector) !== null && _a !== void 0 ? _a : null;
|
|
125
|
+
}
|
|
126
|
+
exports.extractSelector = extractSelector;
|
|
127
|
+
async function executeScript(driver, script, arg) {
|
|
128
|
+
if (driver.original.isDevTools) {
|
|
129
|
+
script = script.toString();
|
|
130
|
+
script = script.startsWith('function') ? `return (${script}).apply(null, arguments)` : script;
|
|
131
|
+
return driver.original.execute(runner, script.toString(), ...unwrap(arg));
|
|
132
|
+
}
|
|
133
|
+
return spec.executeScript(driver, script, arg);
|
|
134
|
+
function runner(script, arg, ...elements) {
|
|
135
|
+
return new Function(script).call(null, wrap(arg));
|
|
136
|
+
function wrap(value) {
|
|
137
|
+
if (value === 'pptr-element-marker') {
|
|
138
|
+
return elements.shift();
|
|
139
|
+
}
|
|
140
|
+
else if (Array.isArray(value)) {
|
|
141
|
+
return value.map(wrap);
|
|
142
|
+
}
|
|
143
|
+
else if (value && typeof value === 'object') {
|
|
144
|
+
return Object.fromEntries(Object.entries(value).map(([key, value]) => [key, wrap(value)]));
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
return value;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function unwrap(arg) {
|
|
152
|
+
if (!arg)
|
|
153
|
+
return [];
|
|
154
|
+
const elements = [];
|
|
155
|
+
return [unwrap(arg), ...elements];
|
|
156
|
+
function unwrap(value) {
|
|
157
|
+
if (spec.isElement(value)) {
|
|
158
|
+
elements.push(value);
|
|
159
|
+
return 'pptr-element-marker';
|
|
160
|
+
}
|
|
161
|
+
else if (utils.types.isArray(value)) {
|
|
162
|
+
return value.map(unwrap);
|
|
163
|
+
}
|
|
164
|
+
else if (utils.types.isObject(value)) {
|
|
165
|
+
return Object.fromEntries(Object.entries(value).map(([key, value]) => [key, unwrap(value)]));
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
return value;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
exports.executeScript = executeScript;
|
|
174
|
+
async function findElement(driver, selector, parent) {
|
|
175
|
+
const root = await getSearchRoot(driver, parent);
|
|
176
|
+
try {
|
|
177
|
+
const element = await root.$(selector);
|
|
178
|
+
return !utils.types.has(element, 'error') ? spec.toElement(element) : null;
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
exports.findElement = findElement;
|
|
185
|
+
async function findElements(driver, selector, parent) {
|
|
186
|
+
const root = await getSearchRoot(driver, parent);
|
|
187
|
+
const elements = await root.$$(selector);
|
|
188
|
+
return Array.from(elements, spec.toElement);
|
|
189
|
+
}
|
|
190
|
+
exports.findElements = findElements;
|
|
191
|
+
const browserOptionsNames = {
|
|
192
|
+
chrome: 'goog:chromeOptions',
|
|
193
|
+
firefox: 'moz:firefoxOptions',
|
|
194
|
+
};
|
|
195
|
+
async function build(env) {
|
|
196
|
+
let frameworkPath;
|
|
197
|
+
try {
|
|
198
|
+
frameworkPath = require.resolve('webdriverio', { paths: [`${process.cwd()}/node_modules`] });
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
frameworkPath = 'webdriverio';
|
|
202
|
+
}
|
|
203
|
+
const { remote } = require(frameworkPath);
|
|
204
|
+
const chromedriver = require('chromedriver');
|
|
205
|
+
const parseEnv = require('@applitools/test-utils/src/parse-env');
|
|
206
|
+
const { protocol, browser = '', emulation, capabilities, url, attach, proxy, configurable = true, args = [], headless, logLevel = 'silent', } = parseEnv(env, process.env.APPLITOOLS_WEBDRIVERIO_PROTOCOL);
|
|
207
|
+
const options = {
|
|
208
|
+
capabilities: { browserName: browser, ...capabilities },
|
|
209
|
+
logLevel,
|
|
210
|
+
connectionRetryCount: 5,
|
|
211
|
+
connectionRetryTimeout: 180000,
|
|
212
|
+
};
|
|
213
|
+
if (browser === 'chrome' && protocol === 'cdp') {
|
|
214
|
+
options.automationProtocol = 'devtools';
|
|
215
|
+
options.capabilities[browserOptionsNames.chrome] = { args };
|
|
216
|
+
options.capabilities['wdio:devtoolsOptions'] = {
|
|
217
|
+
headless,
|
|
218
|
+
ignoreDefaultArgs: ['--hide-scrollbars'],
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
else if (protocol === 'wd') {
|
|
222
|
+
options.automationProtocol = 'webdriver';
|
|
223
|
+
options.protocol = url.protocol ? url.protocol.replace(/:$/, '') : undefined;
|
|
224
|
+
options.hostname = url.hostname;
|
|
225
|
+
if (url.port)
|
|
226
|
+
options.port = Number(url.port);
|
|
227
|
+
else if (options.protocol === 'http')
|
|
228
|
+
options.port = 80;
|
|
229
|
+
else if (options.protocol === 'https')
|
|
230
|
+
options.port = 443;
|
|
231
|
+
options.path = url.pathname;
|
|
232
|
+
if (configurable) {
|
|
233
|
+
if (browser === 'chrome' && attach) {
|
|
234
|
+
await chromedriver.start(['--port=9515'], true);
|
|
235
|
+
options.protocol = 'http';
|
|
236
|
+
options.hostname = 'localhost';
|
|
237
|
+
options.port = 9515;
|
|
238
|
+
options.path = '/';
|
|
239
|
+
}
|
|
240
|
+
const browserOptionsName = browserOptionsNames[browser || options.capabilities.browserName];
|
|
241
|
+
if (browserOptionsName) {
|
|
242
|
+
const browserOptions = options.capabilities[browserOptionsName] || {};
|
|
243
|
+
browserOptions.args = [...(browserOptions.args || []), ...args];
|
|
244
|
+
if (headless)
|
|
245
|
+
browserOptions.args.push('headless');
|
|
246
|
+
if (attach) {
|
|
247
|
+
browserOptions.debuggerAddress = attach === true ? 'localhost:9222' : attach;
|
|
248
|
+
if (browser !== 'firefox')
|
|
249
|
+
browserOptions.w3c = false;
|
|
250
|
+
}
|
|
251
|
+
options.capabilities[browserOptionsName] = browserOptions;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (proxy) {
|
|
256
|
+
options.capabilities.proxy = {
|
|
257
|
+
proxyType: 'manual',
|
|
258
|
+
httpProxy: proxy.http || proxy.server,
|
|
259
|
+
sslProxy: proxy.https || proxy.server,
|
|
260
|
+
ftpProxy: proxy.ftp,
|
|
261
|
+
noProxy: proxy.bypass.join(','),
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
const driver = await remote(options);
|
|
265
|
+
if (driver.isDevTools && emulation) {
|
|
266
|
+
const puppeteer = await driver.getPuppeteer();
|
|
267
|
+
const [page] = await puppeteer.pages();
|
|
268
|
+
if (emulation.deviceMetrics) {
|
|
269
|
+
await page.setViewport({
|
|
270
|
+
width: emulation.deviceMetrics.width,
|
|
271
|
+
height: emulation.deviceMetrics.height,
|
|
272
|
+
deviceScaleFactor: emulation.deviceMetrics.pixelRatio,
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
if (emulation.userAgent) {
|
|
276
|
+
await page.setUserAgent(emulation.userAgent);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return [driver, () => driver.deleteSession().then(() => chromedriver.stop())];
|
|
280
|
+
}
|
|
281
|
+
exports.build = build;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/eyes-webdriverio",
|
|
3
|
-
"version": "5.45.
|
|
3
|
+
"version": "5.45.4",
|
|
4
4
|
"description": "Applitools Eyes SDK for WebdriverIO",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eyes-webdriverio",
|
|
@@ -87,33 +87,37 @@
|
|
|
87
87
|
"lint": "run --top-level eslint '**/*.ts'",
|
|
88
88
|
"build": "run --top-level tspc --project tsconfig.build.v$([ ! -z $APPLITOOLS_FRAMEWORK_VERSION ] && echo $APPLITOOLS_FRAMEWORK_VERSION | cut -f1 -d'.' || echo 8).json",
|
|
89
89
|
"generate:tests": "NODE_OPTIONS='--experimental-import-meta-resolve --experimental-loader=@applitools/generic/dist/code-loader.js' generic ./test/generic/config.mjs",
|
|
90
|
-
"test": "run test:service && run test:coverage",
|
|
91
|
-
"test:
|
|
90
|
+
"test": "run test:it && run test:service && run test:coverage",
|
|
91
|
+
"test:it": "MOCHA_GROUP=it run --top-level mocha './test/it/*.spec.ts' -r @applitools/test-utils/mocha-hooks/docker",
|
|
92
|
+
"test:local": "run test:it && run test:service && MOCHA_OMIT_TAGS=sauce run test:coverage",
|
|
93
|
+
"test:local:cdp": "APPLITOOLS_WEBDRIVERIO_PROTOCOL=cdp run test:local",
|
|
92
94
|
"test:sauce": "MOCHA_ONLY_TAGS=sauce run test:coverage",
|
|
93
|
-
"test:service": "MOCHA_GROUP=service run --top-level mocha './test/service/unit/*.spec.js' && wdio run ./test/service/wdio.conf.js && wdio run ./test/service/no-config/wdio.no-config.conf.js && wdio run ./test/service/vg/wdio.vg.conf.js",
|
|
95
|
+
"test:service": "MOCHA_GROUP=service run --top-level mocha './test/service/unit/*.spec.js' && wdio run ./test/service/wdio.conf.js --autoCompileOpts.autoCompile=0 && wdio run ./test/service/no-config/wdio.no-config.conf.js --autoCompileOpts.autoCompile=0 && wdio run ./test/service/vg/wdio.vg.conf.js --autoCompileOpts.autoCompile=0",
|
|
94
96
|
"test:coverage": "APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-webdriverio' APPLITOOLS_BATCH_ID=$(uuidgen) MOCHA_GROUP=coverage run --top-level mocha './test/generated-coverage/*.spec.js' --parallel --jobs ${MOCHA_JOBS:-15} --exit",
|
|
95
97
|
"setup": "run --top-level browsers:setup",
|
|
96
|
-
"up:framework": "
|
|
98
|
+
"up:framework": "yarn add --dev --caret webdriverio${APPLITOOLS_FRAMEWORK_VERSION:+@$APPLITOOLS_FRAMEWORK_VERSION}"
|
|
97
99
|
},
|
|
98
100
|
"dependencies": {
|
|
99
|
-
"@applitools/
|
|
100
|
-
"@applitools/
|
|
101
|
+
"@applitools/driver": "1.13.6",
|
|
102
|
+
"@applitools/eyes": "1.8.0",
|
|
103
|
+
"@applitools/spec-driver-webdriver": "1.0.43"
|
|
101
104
|
},
|
|
102
105
|
"devDependencies": {
|
|
103
106
|
"@applitools/api-extractor": "^1.2.21",
|
|
104
|
-
"@applitools/bongo": "^5.
|
|
105
|
-
"@applitools/generic": "^3.3.
|
|
107
|
+
"@applitools/bongo": "^5.6.1",
|
|
108
|
+
"@applitools/generic": "^3.3.10",
|
|
106
109
|
"@applitools/test-utils": "^1.5.17",
|
|
107
110
|
"@types/node": "^16.18.14",
|
|
108
|
-
"@wdio/cli": "^8.
|
|
109
|
-
"@wdio/dot-reporter": "^8.
|
|
110
|
-
"@wdio/globals": "^8.3
|
|
111
|
-
"@wdio/local-runner": "^8.3
|
|
112
|
-
"@wdio/mocha-framework": "^8.
|
|
113
|
-
"chromedriver": "^
|
|
111
|
+
"@wdio/cli": "^8.14.4",
|
|
112
|
+
"@wdio/dot-reporter": "^8.14.0",
|
|
113
|
+
"@wdio/globals": "^8.14.3",
|
|
114
|
+
"@wdio/local-runner": "^8.14.3",
|
|
115
|
+
"@wdio/mocha-framework": "^8.14.0",
|
|
116
|
+
"chromedriver": "^115.0.1",
|
|
117
|
+
"devtools": "^8.15.4",
|
|
114
118
|
"expect-webdriverio": "^4.0.1",
|
|
115
119
|
"geckodriver": "^1.20.0",
|
|
116
|
-
"webdriverio": "^8.
|
|
120
|
+
"webdriverio": "^8.15.4"
|
|
117
121
|
},
|
|
118
122
|
"peerDependencies": {
|
|
119
123
|
"webdriverio": ">=5.0.0"
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
export type Driver = Applitools.WebdriverIO.Browser & { __applitoolsBrand?: undefined; };
|
|
2
|
-
export type Element =
|
|
3
|
-
export type Selector =
|
|
4
|
-
export type SpecType = {
|
|
2
|
+
export type Element = Applitools.WebdriverIO.Element & { __applitoolsBrand?: undefined; };
|
|
3
|
+
export type Selector = Applitools.WebdriverIO.Selector & { __applitoolsBrand?: undefined; };
|
|
4
|
+
export type SpecType = {
|
|
5
|
+
driver: Driver;
|
|
6
|
+
context: Driver;
|
|
7
|
+
element: Element;
|
|
8
|
+
selector: Selector;
|
|
9
|
+
secondary: never;
|
|
10
|
+
};
|
|
5
11
|
export class Eyes {
|
|
6
12
|
static setViewportSize: (driver: Driver, viewportSize: RectangleSize) => Promise<void>;
|
|
7
13
|
static getExecutionCloudUrl(config?: undefined | ConfigurationPlain): Promise<string>;
|
|
@@ -351,7 +357,7 @@ export type TargetAutomation = {
|
|
|
351
357
|
webview(webview?: undefined | string): CheckSettingsAutomation;
|
|
352
358
|
webview(webview?: undefined | boolean): CheckSettingsAutomation;
|
|
353
359
|
};
|
|
354
|
-
export
|
|
360
|
+
export type Target = TargetImage & TargetAutomation;
|
|
355
361
|
export type OCRRegion = { target: Element | RegionPlain | EyesSelector<Selector>; hint?: undefined | string; minMatch?: undefined | number; language?: undefined | string; };
|
|
356
362
|
export type ConfigurationPlain = {
|
|
357
363
|
debugScreenshots?: undefined | { save: boolean; path?: undefined | string; prefix?: undefined | string; };
|
|
@@ -664,7 +670,7 @@ export class BatchClose {
|
|
|
664
670
|
setProxy(proxy: ProxySettingsPlain): BatchClose;
|
|
665
671
|
}
|
|
666
672
|
export const closeBatch: (options: { batchIds: Array<string>; serverUrl: string; apiKey: string; proxy?: undefined | ProxySettingsPlain; }) => Promise<void>;
|
|
667
|
-
export type BrowserTypePlain = "chrome" | "chrome-one-version-back" | "chrome-two-versions-back" | "firefox
|
|
673
|
+
export type BrowserTypePlain = "chrome" | "firefox" | "chrome-one-version-back" | "chrome-two-versions-back" | "firefox-one-version-back" | "firefox-two-versions-back" | "ie" | "ie10" | "edge" | "edgechromium" | "edgelegacy" | "edgechromium-one-version-back" | "edgechromium-two-versions-back" | "safari" | "safari-earlyaccess" | "safari-one-version-back" | "safari-two-versions-back";
|
|
668
674
|
export enum BrowserType {
|
|
669
675
|
CHROME = 'chrome',
|
|
670
676
|
CHROME_ONE_VERSION_BACK = 'chrome-one-version-back',
|
|
@@ -768,33 +774,66 @@ export enum FailureReport {
|
|
|
768
774
|
IMMEDIATE = 'IMMEDIATE',
|
|
769
775
|
ON_CLOSE = 'ON_CLOSE'
|
|
770
776
|
}
|
|
771
|
-
export type IosDeviceNamePlain = "iPhone 11" | "iPhone 11 Pro" | "iPhone 11 Pro Max" | "iPhone X" | "iPhone XR" | "iPhone
|
|
777
|
+
export type IosDeviceNamePlain = "iPad Air 2" | "iPhone 11" | "iPhone 11 Pro" | "iPhone 11 Pro Max" | "iPhone X" | "iPhone XR" | "iPhone 6s" | "iPhone 6s Plus" | "iPhone 7" | "iPhone 7 Plus" | "iPhone 8" | "iPhone 8 Plus" | "iPhone Xs" | "iPhone Xs Max" | "iPhone 12" | "iPhone 12 mini" | "iPhone 12 Pro" | "iPhone 12 Pro Max" | "iPhone 13" | "iPhone 13 mini" | "iPhone 13 Pro" | "iPhone 13 Pro Max" | "iPhone 14" | "iPhone 14 Plus" | "iPhone 14 Pro" | "iPhone 14 Pro Max" | "iPhone SE (1st generation)" | "iPhone SE (2nd generation)" | "iPhone SE (3rd generation)" | "iPad (5th generation)" | "iPad (6th generation)" | "iPad (7th generation)" | "iPad (8th generation)" | "iPad (9th generation)" | "iPad (10th generation)" | "iPad Air (3rd generation)" | "iPad Air (4th generation)" | "iPad Air (5th generation)" | "iPad mini 4" | "iPad mini (5th generation)" | "iPad mini (6th generation)" | "iPad Pro (9.7-inch)" | "iPad Pro (10.5-inch)" | "iPad Pro (11-inch) (1st generation)" | "iPad Pro (12.9-inch) (1st generation)" | "iPad Pro (11-inch) (2nd generation)" | "iPad Pro (12.9-inch) (2nd generation)" | "iPad Pro (11-inch) (3rd generation)" | "iPad Pro (12.9-inch) (3rd generation)" | "iPad Pro (11-inch) (4th generation)" | "iPad Pro (12.9-inch) (4th generation)" | "iPad Pro (12.9-inch) (5th generation)" | "iPad Pro (12.9-inch) (6th generation)" | "iPod touch (7th generation)";
|
|
772
778
|
export enum IosDeviceName {
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
iPhone_13 = 'iPhone 13',
|
|
778
|
-
iPhone_12_Pro_Max = 'iPhone 12 Pro Max',
|
|
779
|
-
iPhone_12_Pro = 'iPhone 12 Pro',
|
|
780
|
-
iPhone_12 = 'iPhone 12',
|
|
781
|
-
iPhone_12_mini = 'iPhone 12 mini',
|
|
782
|
-
iPhone_11_Pro = 'iPhone 11 Pro',
|
|
783
|
-
iPhone_11_Pro_Max = 'iPhone 11 Pro Max',
|
|
784
|
-
iPhone_11 = 'iPhone 11',
|
|
785
|
-
iPhone_XR = 'iPhone XR',
|
|
786
|
-
iPhone_XS = 'iPhone Xs',
|
|
787
|
-
iPhone_X = 'iPhone X',
|
|
779
|
+
iPhone_6s = 'iPhone 6s',
|
|
780
|
+
iPhone_6s_Plus = 'iPhone 6s Plus',
|
|
781
|
+
iPhone_7 = 'iPhone 7',
|
|
782
|
+
iPhone_7_Plus = 'iPhone 7 Plus',
|
|
788
783
|
iPhone_8 = 'iPhone 8',
|
|
789
784
|
iPhone_8_Plus = 'iPhone 8 Plus',
|
|
790
|
-
|
|
785
|
+
iPhone_X = 'iPhone X',
|
|
786
|
+
iPhone_XR = 'iPhone XR',
|
|
787
|
+
iPhone_Xs = 'iPhone Xs',
|
|
788
|
+
iPhone_XS = 'iPhone Xs',
|
|
789
|
+
iPhone_Xs_Max = 'iPhone Xs Max',
|
|
790
|
+
iPhone_11 = 'iPhone 11',
|
|
791
|
+
iPhone_11_Pro = 'iPhone 11 Pro',
|
|
792
|
+
iPhone_11_Pro_Max = 'iPhone 11 Pro Max',
|
|
793
|
+
iPhone_12 = 'iPhone 12',
|
|
794
|
+
iPhone_12_mini = 'iPhone 12 mini',
|
|
795
|
+
iPhone_12_Pro = 'iPhone 12 Pro',
|
|
796
|
+
iPhone_12_Pro_Max = 'iPhone 12 Pro Max',
|
|
797
|
+
iPhone_13 = 'iPhone 13',
|
|
798
|
+
iPhone_13_mini = 'iPhone 13 mini',
|
|
799
|
+
iPhone_13_Pro = 'iPhone 13 Pro',
|
|
800
|
+
iPhone_13_Pro_Max = 'iPhone 13 Pro Max',
|
|
801
|
+
iPhone_14 = 'iPhone 14',
|
|
802
|
+
iPhone_14_Plus = 'iPhone 14 Plus',
|
|
803
|
+
iPhone_14_Pro = 'iPhone 14 Pro',
|
|
804
|
+
iPhone_14_Pro_Max = 'iPhone 14 Pro Max',
|
|
791
805
|
iPhone_SE = 'iPhone SE (1st generation)',
|
|
792
|
-
|
|
793
|
-
|
|
806
|
+
iPhone_SE_1 = 'iPhone SE (1st generation)',
|
|
807
|
+
iPhone_SE_2 = 'iPhone SE (2nd generation)',
|
|
808
|
+
iPhone_SE_3 = 'iPhone SE (3rd generation)',
|
|
809
|
+
iPad_5 = 'iPad (5th generation)',
|
|
810
|
+
iPad_6 = 'iPad (6th generation)',
|
|
794
811
|
iPad_7 = 'iPad (7th generation)',
|
|
812
|
+
iPad_8 = 'iPad (8th generation)',
|
|
795
813
|
iPad_9 = 'iPad (9th generation)',
|
|
796
|
-
|
|
797
|
-
|
|
814
|
+
iPad_10 = 'iPad (10th generation)',
|
|
815
|
+
iPad_Air_2 = 'iPad Air 2',
|
|
816
|
+
iPad_Air_3 = 'iPad Air (3rd generation)',
|
|
817
|
+
iPad_Air_4 = 'iPad Air (4th generation)',
|
|
818
|
+
iPad_Air_5 = 'iPad Air (5th generation)',
|
|
819
|
+
iPad_mini_4 = 'iPad mini 4',
|
|
820
|
+
iPad_mini_5 = 'iPad mini (5th generation)',
|
|
821
|
+
iPad_mini_6 = 'iPad mini (6th generation)',
|
|
822
|
+
iPad_Pro_9_7_inch_1 = 'iPad Pro (9.7-inch)',
|
|
823
|
+
iPad_Pro_10_5_inch_1 = 'iPad Pro (10.5-inch)',
|
|
824
|
+
iPad_Pro_11_inch_1 = 'iPad Pro (11-inch) (1st generation)',
|
|
825
|
+
iPad_Pro_12_9_inch_1 = 'iPad Pro (12.9-inch) (1st generation)',
|
|
826
|
+
iPad_Pro_11_inch_2 = 'iPad Pro (11-inch) (2nd generation)',
|
|
827
|
+
iPad_Pro_12_9_inch_2 = 'iPad Pro (12.9-inch) (2nd generation)',
|
|
828
|
+
iPad_Pro_11_inch_3 = 'iPad Pro (11-inch) (3rd generation)',
|
|
829
|
+
iPad_Pro_12_9_inch_3 = 'iPad Pro (12.9-inch) (3rd generation)',
|
|
830
|
+
iPad_Pro_3 = 'iPad Pro (12.9-inch) (3rd generation)',
|
|
831
|
+
iPad_Pro_11_inch_4 = 'iPad Pro (11-inch) (4th generation)',
|
|
832
|
+
iPad_Pro_4 = 'iPad Pro (11-inch) (4th generation)',
|
|
833
|
+
iPad_Pro_12_9_inch_4 = 'iPad Pro (12.9-inch) (4th generation)',
|
|
834
|
+
iPad_Pro_12_9_inch_5 = 'iPad Pro (12.9-inch) (5th generation)',
|
|
835
|
+
iPad_Pro_12_9_inch_6 = 'iPad Pro (12.9-inch) (6th generation)',
|
|
836
|
+
iPod_touch_7 = 'iPod touch (7th generation)'
|
|
798
837
|
}
|
|
799
838
|
export type IosVersionPlain = AndroidVersionPlain;
|
|
800
839
|
export enum IosVersion {
|
package/types/service.d.ts
CHANGED
|
@@ -1,34 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Configuration,
|
|
7
|
-
CheckSettingsPlain,
|
|
8
|
-
CheckSettings,
|
|
9
|
-
TestResults,
|
|
10
|
-
TestResultsSummary,
|
|
11
|
-
} from './index'
|
|
12
|
-
|
|
13
|
-
declare global {
|
|
14
|
-
namespace WebdriverIO {
|
|
15
|
-
interface ServiceOption extends ConfigurationPlain {
|
|
16
|
-
useVisualGrid?: boolean
|
|
17
|
-
concurrency?: number
|
|
18
|
-
eyes?: ServiceOption
|
|
19
|
-
}
|
|
20
|
-
interface Browser {
|
|
21
|
-
getEyes(): Eyes
|
|
22
|
-
eyesCheck(checkSettings?: CheckSettingsPlain): Promise<void>
|
|
23
|
-
eyesCheck(title: string, checkSettings: CheckSettings): Promise<void>
|
|
24
|
-
eyesSetScrollRootElement(element: Element | Selector): void
|
|
25
|
-
eyesAddProperty(key: string, value: string): void
|
|
26
|
-
eyesClearProperties(): void
|
|
27
|
-
eyesGetTestResults(): Promise<TestResults>
|
|
28
|
-
eyesSetConfiguration(configuration: ConfigurationPlain): void
|
|
29
|
-
eyesGetConfiguration(): Configuration
|
|
30
|
-
eyesGetIsOpen(): boolean
|
|
31
|
-
eyesGetAllTestResults(throwErr: boolean): Promise<TestResultsSummary>
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
import { ConfigurationPlain } from './api';
|
|
2
|
+
interface EyesServiceOptions extends ConfigurationPlain {
|
|
3
|
+
useVisualGrid?: boolean;
|
|
4
|
+
concurrency?: number;
|
|
5
|
+
eyes?: EyesServiceOptions;
|
|
34
6
|
}
|
|
7
|
+
declare class EyesService {
|
|
8
|
+
private _eyes;
|
|
9
|
+
private _appName?;
|
|
10
|
+
private _testResults?;
|
|
11
|
+
constructor({ useVisualGrid, concurrency, eyes, ...config }: EyesServiceOptions);
|
|
12
|
+
private _eyesOpen;
|
|
13
|
+
private _eyesClose;
|
|
14
|
+
beforeSession(config: Record<string, unknown>): void;
|
|
15
|
+
before(): void;
|
|
16
|
+
beforeTest(test: any): void;
|
|
17
|
+
afterTest(): Promise<void>;
|
|
18
|
+
after(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export = EyesService;
|
package/types/v5-async.d.ts
CHANGED
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
declare namespace Applitools {
|
|
4
|
+
namespace WebdriverIO {
|
|
5
|
+
interface Browser extends globalThis.WebdriverIOAsync.BrowserObject {
|
|
6
|
+
isDevTools: boolean,
|
|
7
|
+
getSession(): Promise<Record<string, any>>
|
|
8
|
+
getPuppeteer(): Promise<any>
|
|
9
|
+
getUrl(): Promise<string>
|
|
10
|
+
getTitle(): Promise<string>
|
|
11
|
+
getOrientation(): Promise<string>
|
|
12
|
+
setOrientation(orientation: string): Promise<void>
|
|
13
|
+
getSystemBars(): Promise<object[]>
|
|
14
|
+
getContext(): Promise<string>
|
|
15
|
+
getElementAttribute(elementId: string, attr: string): Promise<string>
|
|
16
|
+
getWindowRect(): Promise<{x: number; y: number; width: number; height: number}>
|
|
17
|
+
getWindowPosition(): Promise<{x: number; y: number}>
|
|
18
|
+
_getWindowSize(): Promise<{width: number; height: number}>
|
|
19
|
+
setWindowRect(x: number, y: number, width: number, height: number): Promise<void>
|
|
20
|
+
setWindowPosition(x: number, y: number): Promise<void>
|
|
21
|
+
_setWindowSize(width: number, height: number): Promise<void>
|
|
22
|
+
switchToFrame(frameId?: any): Promise<void>
|
|
23
|
+
switchToParentFrame(): Promise<void>
|
|
24
|
+
takeScreenshot(): Promise<string>
|
|
25
|
+
sendCommandAndGetResult(command: string, params: Record<string, any>): Promise<Record<string, any>>
|
|
26
|
+
switchContext(id: string): Promise<void>
|
|
27
|
+
getContexts(): Promise<string[]>
|
|
28
|
+
}
|
|
29
|
+
interface Element extends globalThis.WebdriverIOAsync.Element {}
|
|
30
|
+
type Selector = string | ((element: HTMLElement) => HTMLElement) | ((element: HTMLElement) => HTMLElement[])
|
|
31
|
+
}
|
|
32
|
+
}
|
package/types/v5-sync.d.ts
CHANGED
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
declare namespace Applitools {
|
|
4
|
+
namespace WebdriverIO {
|
|
5
|
+
interface Browser extends globalThis.WebdriverIO.BrowserObject {
|
|
6
|
+
isDevTools: boolean
|
|
7
|
+
getSession(): Record<string, any>
|
|
8
|
+
getPuppeteer(): any
|
|
9
|
+
getUrl(): string
|
|
10
|
+
getTitle(): string
|
|
11
|
+
getOrientation(): string
|
|
12
|
+
setOrientation(orientation: string): void
|
|
13
|
+
getSystemBars(): object[]
|
|
14
|
+
getContext(): string
|
|
15
|
+
getElementAttribute(elementId: string, attr: string): string
|
|
16
|
+
getWindowRect(): {x: number; y: number; width: number; height: number}
|
|
17
|
+
getWindowPosition(): {x: number; y: number}
|
|
18
|
+
_getWindowSize(): {width: number; height: number}
|
|
19
|
+
setWindowRect(x: number, y: number, width: number, height: number): void
|
|
20
|
+
setWindowPosition(x: number, y: number): void
|
|
21
|
+
_setWindowSize(width: number, height: number): void
|
|
22
|
+
switchToFrame(frameId?: any): void
|
|
23
|
+
switchToParentFrame(): void
|
|
24
|
+
takeScreenshot(): string
|
|
25
|
+
sendCommandAndGetResult(command: string, params: Record<string, any>): Record<string, any>
|
|
26
|
+
switchContext(id: string): void
|
|
27
|
+
getContexts(): string[]
|
|
28
|
+
}
|
|
29
|
+
interface Element extends globalThis.WebdriverIO.Element {}
|
|
30
|
+
type Selector = string | ((element: HTMLElement) => HTMLElement) | ((element: HTMLElement) => HTMLElement[])
|
|
31
|
+
}
|
|
32
|
+
}
|
package/types/v6.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
declare namespace Applitools {
|
|
4
|
+
namespace WebdriverIO {
|
|
5
|
+
interface Browser extends globalThis.WebdriverIO.BrowserObject {}
|
|
6
|
+
interface Element extends globalThis.WebdriverIO.Element {}
|
|
7
|
+
type Selector = string | ((element: HTMLElement) => HTMLElement) | ((element: HTMLElement) => HTMLElement[])
|
|
8
|
+
}
|
|
9
|
+
}
|
package/types/v7.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
declare namespace Applitools {
|
|
4
|
+
namespace WebdriverIO {
|
|
5
|
+
interface Browser extends globalThis.WebdriverIO.Browser {}
|
|
6
|
+
interface Element extends globalThis.WebdriverIO.Element {}
|
|
7
|
+
type Selector = string | ((element: HTMLElement) => HTMLElement) | ((element: HTMLElement) => HTMLElement[])
|
|
8
|
+
}
|
|
9
|
+
}
|
package/types/v8.d.ts
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
declare namespace Applitools {
|
|
4
|
+
namespace WebdriverIO {
|
|
5
|
+
interface Browser extends globalThis.WebdriverIO.Browser {}
|
|
6
|
+
interface Element extends globalThis.WebdriverIO.Element {}
|
|
7
|
+
type Selector = string | import('webdriverio').ElementFunction | import('webdriverio').CustomStrategyReference
|
|
8
|
+
}
|
|
9
|
+
}
|