@applitools/eyes-webdriverio 5.32.10 → 5.34.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 +26 -2
- package/dist/api.js +2 -2
- package/dist/index.js +0 -9
- package/dist/legacy.js +1 -188
- package/dist/service.js +9 -8
- package/dist/spec-driver.js +3 -393
- package/package.json +69 -37
- package/types/index.d.ts +1377 -2024
- package/types/service.d.ts +31 -0
- package/types/v5-async.d.ts +1 -0
- package/types/v5-sync.d.ts +1 -0
- package/types/v6.d.ts +1 -0
- package/types/v7.d.ts +1 -0
- package/types/v5/async.d.ts +0 -22
- package/types/v5/index.d.ts +0 -1
- package/types/v5/sync.d.ts +0 -22
- package/types/v6/index.d.ts +0 -9
- package/types/v7/index.d.ts +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,32 @@
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
## 5.34.0 - 2021/11/10
|
|
7
|
+
|
|
8
|
+
- support cookies
|
|
9
|
+
- updated to @applitools/eyes-api@1.1.6 (from 1.1.4)
|
|
10
|
+
- updated to @applitools/eyes-sdk-core@12.24.0 (from 12.23.16)
|
|
11
|
+
- updated to @applitools/visual-grid-client@15.8.44 (from 15.8.35)
|
|
12
|
+
|
|
13
|
+
## 5.33.0 - 2021/11/5
|
|
14
|
+
|
|
15
|
+
- updated to @applitools/eyes-api@1.1.5 (from 1.1.4)
|
|
16
|
+
- updated to @applitools/eyes-sdk-core@12.23.24 (from 12.23.18)
|
|
17
|
+
- updated to @applitools/utils@1.2.4 (from 1.2.3)
|
|
18
|
+
- updated to @applitools/visual-grid-client@15.8.43 (from 15.8.37)
|
|
19
|
+
|
|
20
|
+
## 5.32.12 - 2021/10/20
|
|
21
|
+
|
|
22
|
+
- updated to @applitools/dom-snapshot@4.5.10 (from 4.5.9)
|
|
23
|
+
- updated to @applitools/eyes-sdk-core@12.23.18 (from 12.23.17)
|
|
24
|
+
- updated to @applitools/visual-grid-client@15.8.37 (from 15.8.36)
|
|
25
|
+
|
|
26
|
+
## 5.32.11 - 2021/10/20
|
|
27
|
+
|
|
28
|
+
- updated to @applitools/dom-snapshot@4.5.9 (from 4.5.8)
|
|
29
|
+
- updated to @applitools/eyes-sdk-core@12.23.17 (from 12.23.16)
|
|
30
|
+
- updated to @applitools/visual-grid-client@15.8.36 (from 15.8.35)
|
|
31
|
+
|
|
6
32
|
## 5.32.10 - 2021/10/13
|
|
7
33
|
|
|
8
34
|
- updated to @applitools/eyes-sdk-core@12.23.16 (from 12.23.15)
|
|
@@ -57,7 +83,6 @@
|
|
|
57
83
|
- updated to @applitools/eyes-api@1.0.12 (from 1.0.11)
|
|
58
84
|
- updated to @applitools/eyes-sdk-core@12.22.6 (from 12.22.4)
|
|
59
85
|
- updated to @applitools/visual-grid-client@15.8.20 (from 15.8.18)
|
|
60
|
-
|
|
61
86
|
## 5.32.1 - 2021/8/9
|
|
62
87
|
|
|
63
88
|
- updated to @applitools/eyes-sdk-core@12.22.4 (from 12.22.2)
|
|
@@ -76,7 +101,6 @@
|
|
|
76
101
|
- updated to @applitools/eyes-api@1.0.7 (from 1.0.5)
|
|
77
102
|
- updated to @applitools/eyes-sdk-core@12.21.3 (from 12.21.1)
|
|
78
103
|
- updated to @applitools/visual-grid-client@15.8.12 (from 15.8.11)
|
|
79
|
-
|
|
80
104
|
## 5.31.8 - 2021/6/15
|
|
81
105
|
|
|
82
106
|
- added full typescript support
|
package/dist/api.js
CHANGED
|
@@ -25,8 +25,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
exports.BatchClose = exports.Target = exports.CheckSettings = exports.Configuration = exports.Eyes = exports.By = void 0;
|
|
26
26
|
const eyes_sdk_core_1 = require("@applitools/eyes-sdk-core");
|
|
27
27
|
const api = __importStar(require("@applitools/eyes-api"));
|
|
28
|
-
const spec = __importStar(require("
|
|
29
|
-
const sdk = eyes_sdk_core_1.makeSDK({
|
|
28
|
+
const spec = __importStar(require("@applitools/spec-driver-webdriverio"));
|
|
29
|
+
const sdk = (0, eyes_sdk_core_1.makeSDK)({
|
|
30
30
|
name: 'eyes.webdriverio',
|
|
31
31
|
version: require('../package.json').version,
|
|
32
32
|
spec,
|
package/dist/index.js
CHANGED
|
@@ -10,13 +10,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
if (!process.env.APPLITOOLS_WEBDRIVERIO_MAJOR_VERSION) {
|
|
14
|
-
try {
|
|
15
|
-
const { version } = require('webdriverio/package.json');
|
|
16
|
-
const [major] = version.split('.', 1);
|
|
17
|
-
process.env.APPLITOOLS_WEBDRIVERIO_MAJOR_VERSION = major;
|
|
18
|
-
}
|
|
19
|
-
catch (_a) {
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
13
|
__exportStar(require("./api"), exports);
|
package/dist/legacy.js
CHANGED
|
@@ -1,26 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
23
|
-
const utils = __importStar(require("@applitools/utils"));
|
|
3
|
+
exports.By = void 0;
|
|
24
4
|
class By {
|
|
25
5
|
constructor(value, using = 'css selector') {
|
|
26
6
|
this.value = value;
|
|
@@ -58,170 +38,3 @@ class By {
|
|
|
58
38
|
}
|
|
59
39
|
}
|
|
60
40
|
exports.By = By;
|
|
61
|
-
function wrapDriver(browser) {
|
|
62
|
-
const api = {
|
|
63
|
-
get remoteWebDriver() {
|
|
64
|
-
return browser;
|
|
65
|
-
},
|
|
66
|
-
async executeScript(script, ...args) {
|
|
67
|
-
if (utils.types.isFunction(script) || args.length > 1 || !utils.types.isArray(args[0])) {
|
|
68
|
-
return browser.execute(script, ...args);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
return browser.executeScript(script, args[0]);
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
async executeAsyncScript(script, ...args) {
|
|
75
|
-
if (utils.types.isFunction(script) || args.length > 1 || !utils.types.isArray(args[0])) {
|
|
76
|
-
return browser.executeAsync(script, ...args);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
return browser.executeAsyncScript(script, args[0]);
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
async findElement(usingOrLocator, value) {
|
|
83
|
-
if (usingOrLocator instanceof By) {
|
|
84
|
-
const element = await browser.$(usingOrLocator.toString());
|
|
85
|
-
return !element.error ? wrapElement(element, this) : null;
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
return browser.findElement(usingOrLocator, value);
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
async findElements(usingOrLocator, value) {
|
|
92
|
-
if (usingOrLocator instanceof By) {
|
|
93
|
-
const elements = await browser.$$(usingOrLocator.toString());
|
|
94
|
-
return Array.from(elements, element => wrapElement(element, this));
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
return browser.findElements(usingOrLocator, value);
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
async findElementById(id) {
|
|
101
|
-
return this.findElement(By.id(id));
|
|
102
|
-
},
|
|
103
|
-
async findElementsById(id) {
|
|
104
|
-
return this.findElements(By.id(id));
|
|
105
|
-
},
|
|
106
|
-
async findElementByName(name) {
|
|
107
|
-
return this.findElement(By.name(name));
|
|
108
|
-
},
|
|
109
|
-
async findElementsByName(name) {
|
|
110
|
-
return this.findElements(By.name(name));
|
|
111
|
-
},
|
|
112
|
-
async findElementByCssSelector(cssSelector) {
|
|
113
|
-
return this.findElement(By.cssSelector(cssSelector));
|
|
114
|
-
},
|
|
115
|
-
async findElementsByCssSelector(cssSelector) {
|
|
116
|
-
return this.findElements(By.cssSelector(cssSelector));
|
|
117
|
-
},
|
|
118
|
-
async findElementByClassName() {
|
|
119
|
-
throw new TypeError('findElementByClassName method is not implemented!');
|
|
120
|
-
},
|
|
121
|
-
async findElementsByClassName() {
|
|
122
|
-
throw new TypeError('findElementsByClassName method is not implemented!');
|
|
123
|
-
},
|
|
124
|
-
async findElementByLinkText() {
|
|
125
|
-
throw new TypeError('findElementByLinkText method is not implemented!');
|
|
126
|
-
},
|
|
127
|
-
async findElementsByLinkText() {
|
|
128
|
-
throw new TypeError('findElementsByLinkText method is not implemented!');
|
|
129
|
-
},
|
|
130
|
-
async findElementByPartialLinkText() {
|
|
131
|
-
throw new TypeError('findElementByPartialLinkText method is not implemented!');
|
|
132
|
-
},
|
|
133
|
-
async findElementsByPartialLinkText() {
|
|
134
|
-
throw new TypeError('findElementsByPartialLinkText method is not implemented!');
|
|
135
|
-
},
|
|
136
|
-
async findElementByTagName(tagName) {
|
|
137
|
-
return this.findElement(By.tagName(tagName));
|
|
138
|
-
},
|
|
139
|
-
async findElementsByTagName(tagName) {
|
|
140
|
-
return this.findElements(By.tagName(tagName));
|
|
141
|
-
},
|
|
142
|
-
async findElementByXPath(xpath) {
|
|
143
|
-
return this.findElement(By.xPath(xpath));
|
|
144
|
-
},
|
|
145
|
-
async findElementsByXPath(xpath) {
|
|
146
|
-
return this.findElements(By.xPath(xpath));
|
|
147
|
-
},
|
|
148
|
-
switchTo() {
|
|
149
|
-
return {
|
|
150
|
-
defaultContent: () => browser.switchToFrame(null),
|
|
151
|
-
frame: arg => browser.switchToFrame(arg),
|
|
152
|
-
parentFrame: () => browser.switchToParentFrame(),
|
|
153
|
-
};
|
|
154
|
-
},
|
|
155
|
-
async end() {
|
|
156
|
-
return browser.deleteSession();
|
|
157
|
-
},
|
|
158
|
-
async close() {
|
|
159
|
-
return browser.deleteSession();
|
|
160
|
-
},
|
|
161
|
-
async sleep(ms) {
|
|
162
|
-
return browser.pause(ms);
|
|
163
|
-
},
|
|
164
|
-
async getCapabilities() {
|
|
165
|
-
return browser.capabilities;
|
|
166
|
-
},
|
|
167
|
-
async getCurrentUrl() {
|
|
168
|
-
return browser.getUrl();
|
|
169
|
-
},
|
|
170
|
-
async getBrowserName() {
|
|
171
|
-
return browser.capabilities.browserName;
|
|
172
|
-
},
|
|
173
|
-
};
|
|
174
|
-
return new Proxy(browser, {
|
|
175
|
-
get(target, key, receiver) {
|
|
176
|
-
if (Object.hasOwnProperty.call(api, key)) {
|
|
177
|
-
return Reflect.get(api, key, receiver);
|
|
178
|
-
}
|
|
179
|
-
return Reflect.get(target, key);
|
|
180
|
-
},
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
exports.wrapDriver = wrapDriver;
|
|
184
|
-
function wrapElement(element, driver) {
|
|
185
|
-
const api = {
|
|
186
|
-
get element() {
|
|
187
|
-
return element;
|
|
188
|
-
},
|
|
189
|
-
get locator() {
|
|
190
|
-
return this.selector;
|
|
191
|
-
},
|
|
192
|
-
getDriver() {
|
|
193
|
-
return driver;
|
|
194
|
-
},
|
|
195
|
-
getId() {
|
|
196
|
-
return this.elementId;
|
|
197
|
-
},
|
|
198
|
-
async executeScript(script) {
|
|
199
|
-
return driver.execute(script, this);
|
|
200
|
-
},
|
|
201
|
-
async findElement(locator) {
|
|
202
|
-
const extendedParentElement = await this.$(this);
|
|
203
|
-
const element = await extendedParentElement.$(locator instanceof By ? locator.toString() : locator);
|
|
204
|
-
return !element.error ? wrapElement(element, driver) : null;
|
|
205
|
-
},
|
|
206
|
-
async findElements(locator) {
|
|
207
|
-
const elements = await this.$$(locator instanceof By ? locator.toString() : locator);
|
|
208
|
-
return Array.from(elements, element => wrapElement(element, driver));
|
|
209
|
-
},
|
|
210
|
-
async sendKeys(keysToSend) {
|
|
211
|
-
await driver.elementClick(this.elementId);
|
|
212
|
-
return driver.keys(keysToSend);
|
|
213
|
-
},
|
|
214
|
-
async click() {
|
|
215
|
-
return driver.elementClick(this.elementId);
|
|
216
|
-
},
|
|
217
|
-
};
|
|
218
|
-
return new Proxy(element, {
|
|
219
|
-
get(target, key, receiver) {
|
|
220
|
-
if (Object.hasOwnProperty.call(api, key)) {
|
|
221
|
-
return Reflect.get(api, key, receiver);
|
|
222
|
-
}
|
|
223
|
-
return Reflect.get(target, key);
|
|
224
|
-
},
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
exports.wrapElement = wrapElement;
|
package/dist/service.js
CHANGED
|
@@ -41,7 +41,7 @@ if (!process.env.APPLITOOLS_WEBDRIVERIO_MAJOR_VERSION) {
|
|
|
41
41
|
catch (_a) {
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
const sdk = eyes_sdk_core_1.makeSDK({
|
|
44
|
+
const sdk = (0, eyes_sdk_core_1.makeSDK)({
|
|
45
45
|
name: 'eyes-webdriverio-service',
|
|
46
46
|
version: require('../package.json').version,
|
|
47
47
|
spec,
|
|
@@ -50,7 +50,7 @@ const sdk = eyes_sdk_core_1.makeSDK({
|
|
|
50
50
|
class EyesOverride extends api_1.Eyes {
|
|
51
51
|
}
|
|
52
52
|
EyesOverride._spec = sdk;
|
|
53
|
-
|
|
53
|
+
class EyesService {
|
|
54
54
|
constructor(_a) {
|
|
55
55
|
var { useVisualGrid, concurrency, eyes } = _a, config = __rest(_a, ["useVisualGrid", "concurrency", "eyes"]);
|
|
56
56
|
const wdioMajorVersion = Number(process.env.APPLITOOLS_WEBDRIVERIO_MAJOR_VERSION);
|
|
@@ -113,13 +113,13 @@ module.exports = class EyesService {
|
|
|
113
113
|
}
|
|
114
114
|
this._eyes.setConfiguration(configuration);
|
|
115
115
|
}
|
|
116
|
-
afterTest() {
|
|
116
|
+
async afterTest() {
|
|
117
117
|
this._eyes.getConfiguration().setScrollRootElement(null);
|
|
118
|
-
|
|
118
|
+
await this._eyesClose();
|
|
119
119
|
}
|
|
120
|
-
after() {
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
async after() {
|
|
121
|
+
await this._eyes.runner.getAllTestResults(false);
|
|
122
|
+
await this._eyes.abort();
|
|
123
123
|
}
|
|
124
124
|
async _eyesOpen() {
|
|
125
125
|
if (!this._eyes.isOpen) {
|
|
@@ -132,4 +132,5 @@ module.exports = class EyesService {
|
|
|
132
132
|
this._testResults = await this._eyes.close(false);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
}
|
|
135
|
+
}
|
|
136
|
+
module.exports = EyesService;
|