@applitools/spec-driver-selenium 1.3.6 → 1.3.7
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/dist/index.js +6 -2
- package/dist/spec-driver.js +13 -23
- package/package.json +26 -23
package/dist/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -29,7 +33,7 @@ if (!process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION) {
|
|
|
29
33
|
const [major] = version.split('.', 1);
|
|
30
34
|
process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION = major;
|
|
31
35
|
}
|
|
32
|
-
catch
|
|
36
|
+
catch {
|
|
33
37
|
// NOTE: ignore error
|
|
34
38
|
}
|
|
35
39
|
}
|
package/dist/spec-driver.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -18,17 +22,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
22
|
__setModuleDefault(result, mod);
|
|
19
23
|
return result;
|
|
20
24
|
};
|
|
21
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
-
var t = {};
|
|
23
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
-
t[p] = s[p];
|
|
25
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
-
t[p[i]] = s[p[i]];
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
};
|
|
32
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
26
|
exports.build = exports.performAction = exports.getElementText = exports.getElementAttribute = exports.getElementRegion = exports.getOrientation = exports.setOrientation = exports.getBarsSize = exports.waitUntilDisplayed = exports.scrollIntoView = exports.type = exports.hover = exports.click = exports.takeScreenshot = exports.visit = exports.getUrl = exports.getTitle = exports.getCapabilities = exports.getDriverInfo = exports.getCookies = exports.setWindowSize = exports.getWindowSize = exports.waitForSelector = exports.findElements = exports.findElement = exports.childContext = exports.parentContext = exports.mainContext = exports.executeScript = exports.isEqualElements = exports.isStaleElementError = exports.transformSelector = exports.transformDriver = exports.isSelector = exports.isElement = exports.isDriver = void 0;
|
|
34
27
|
const Selenium = __importStar(require("selenium-webdriver"));
|
|
@@ -167,7 +160,7 @@ async function getWindowSize(driver) {
|
|
|
167
160
|
const rect = await driver.manage().window().getRect();
|
|
168
161
|
return { width: rect.width, height: rect.height };
|
|
169
162
|
}
|
|
170
|
-
catch
|
|
163
|
+
catch {
|
|
171
164
|
const { Command } = require('selenium-webdriver/lib/command');
|
|
172
165
|
const getWindowSizeCommand = new Command('getWindowSize');
|
|
173
166
|
const size = driver.manage().window().getSize
|
|
@@ -181,14 +174,14 @@ async function setWindowSize(driver, size) {
|
|
|
181
174
|
try {
|
|
182
175
|
await driver.manage().window().setRect({ x: 0, y: 0, width: size.width, height: size.height });
|
|
183
176
|
}
|
|
184
|
-
catch
|
|
177
|
+
catch {
|
|
185
178
|
const { Command } = require('selenium-webdriver/lib/command');
|
|
186
179
|
const setWindowPositionCommand = new Command('setWindowPosition').setParameters({ x: 0, y: 0 });
|
|
187
180
|
if (driver.manage().window().setPosition)
|
|
188
181
|
await driver.manage().window().setPosition(0, 0);
|
|
189
182
|
else
|
|
190
183
|
await driver.execute(setWindowPositionCommand);
|
|
191
|
-
const setWindowSizeCommand = new Command('setWindowSize').setParameters(
|
|
184
|
+
const setWindowSizeCommand = new Command('setWindowSize').setParameters({ ...size });
|
|
192
185
|
if (driver.manage().window().setSize)
|
|
193
186
|
await driver.manage().window().setSize(size.width, size.height);
|
|
194
187
|
else
|
|
@@ -215,7 +208,7 @@ async function getCookies(driver, context) {
|
|
|
215
208
|
cookies = response.cookies;
|
|
216
209
|
}
|
|
217
210
|
return cookies.map((cookie) => {
|
|
218
|
-
const copy =
|
|
211
|
+
const copy = { ...cookie, expiry: cookie.expires };
|
|
219
212
|
delete copy.expires;
|
|
220
213
|
delete copy.size;
|
|
221
214
|
delete copy.priority;
|
|
@@ -240,7 +233,7 @@ async function getCapabilities(driver) {
|
|
|
240
233
|
? await driver.schedule(getSessionDetailsCommand)
|
|
241
234
|
: await driver.execute(getSessionDetailsCommand);
|
|
242
235
|
}
|
|
243
|
-
catch
|
|
236
|
+
catch {
|
|
244
237
|
const capabilities = await driver.getCapabilities();
|
|
245
238
|
return Array.from(capabilities.keys()).reduce((obj, key) => Object.assign(obj, { key: capabilities.get(key) }), {});
|
|
246
239
|
}
|
|
@@ -352,10 +345,7 @@ exports.getElementText = getElementText;
|
|
|
352
345
|
async function performAction(driver, steps) {
|
|
353
346
|
const { Command } = require('selenium-webdriver/lib/command');
|
|
354
347
|
const performTouchCommand = new Command('performTouch').setParameters({
|
|
355
|
-
actions: steps.map((
|
|
356
|
-
var { action } = _a, options = __rest(_a, ["action"]);
|
|
357
|
-
return ({ action, options });
|
|
358
|
-
}),
|
|
348
|
+
actions: steps.map(({ action, ...options }) => ({ action, options })),
|
|
359
349
|
});
|
|
360
350
|
if (process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION === '3') {
|
|
361
351
|
await driver.schedule(performTouchCommand);
|
|
@@ -374,8 +364,8 @@ const browserOptionsNames = {
|
|
|
374
364
|
async function build(env) {
|
|
375
365
|
var _a;
|
|
376
366
|
const parseEnv = require('@applitools/test-utils/src/parse-env');
|
|
377
|
-
const { browser, capabilities, url, attach, proxy, configurable = true, appium = false, args = [], headless, } = parseEnv(
|
|
378
|
-
const desiredCapabilities =
|
|
367
|
+
const { browser, capabilities, url, attach, proxy, configurable = true, appium = false, args = [], headless, } = parseEnv({ ...env, legacy: (_a = env.legacy) !== null && _a !== void 0 ? _a : process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION === '3' });
|
|
368
|
+
const desiredCapabilities = { ...capabilities };
|
|
379
369
|
if (configurable) {
|
|
380
370
|
const browserOptionsName = browserOptionsNames[browser || desiredCapabilities.browserName];
|
|
381
371
|
if (browserOptionsName) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/spec-driver-selenium",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"selenium",
|
|
6
6
|
"selenium-webdriver",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"name": "Applitools Team",
|
|
26
26
|
"email": "team@applitools.com"
|
|
27
27
|
},
|
|
28
|
-
"main": "./dist/index.js",
|
|
29
|
-
"types": "./types/index.d.ts",
|
|
30
28
|
"exports": {
|
|
31
29
|
".": {
|
|
32
|
-
"
|
|
33
|
-
"
|
|
30
|
+
"types": "./types/index.d.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
34
32
|
}
|
|
35
33
|
},
|
|
34
|
+
"main": "./dist/index.js",
|
|
35
|
+
"types": "./types/index.d.ts",
|
|
36
36
|
"files": [
|
|
37
37
|
"dist",
|
|
38
38
|
"types"
|
|
@@ -58,33 +58,36 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@applitools/types": "1.
|
|
62
|
-
"@applitools/utils": "1.
|
|
61
|
+
"@applitools/types": "1.4.4",
|
|
62
|
+
"@applitools/utils": "1.3.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@applitools/api-extractor": "^1.2.7",
|
|
66
|
-
"@applitools/bongo": "2.
|
|
66
|
+
"@applitools/bongo": "2.1.1",
|
|
67
67
|
"@applitools/scripts": "1.1.0",
|
|
68
|
-
"@applitools/test-utils": "1.3.
|
|
69
|
-
"@types/mocha": "^9.
|
|
70
|
-
"@types/node": "
|
|
71
|
-
"@types/selenium-webdriver": "^4.
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
73
|
-
"@typescript-eslint/parser": "^
|
|
74
|
-
"eslint": "^
|
|
75
|
-
"eslint-config-prettier": "^
|
|
68
|
+
"@applitools/test-utils": "1.3.2",
|
|
69
|
+
"@types/mocha": "^9.1.1",
|
|
70
|
+
"@types/node": "12",
|
|
71
|
+
"@types/selenium-webdriver": "^4.1.1",
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
73
|
+
"@typescript-eslint/parser": "^5.27.0",
|
|
74
|
+
"eslint": "^8.16.0",
|
|
75
|
+
"eslint-config-prettier": "^8.5.0",
|
|
76
76
|
"eslint-plugin-mocha-no-only": "^1.1.1",
|
|
77
77
|
"eslint-plugin-node": "^11.1.0",
|
|
78
|
-
"eslint-plugin-prettier": "^
|
|
78
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
79
79
|
"husky": "^4.3.7",
|
|
80
|
-
"mocha": "^9.
|
|
81
|
-
"prettier": "^2.
|
|
82
|
-
"selenium-webdriver": "^4.
|
|
83
|
-
"ts-node": "^10.
|
|
84
|
-
"ttypescript": "^1.5.
|
|
85
|
-
"typescript": "^4.
|
|
80
|
+
"mocha": "^9.2.2",
|
|
81
|
+
"prettier": "^2.6.2",
|
|
82
|
+
"selenium-webdriver": "^4.2.0",
|
|
83
|
+
"ts-node": "^10.8.0",
|
|
84
|
+
"ttypescript": "^1.5.13",
|
|
85
|
+
"typescript": "^4.7.2"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"selenium-webdriver": ">=3.6.0"
|
|
89
|
+
},
|
|
90
|
+
"engines": {
|
|
91
|
+
"node": ">=12.13.0"
|
|
89
92
|
}
|
|
90
93
|
}
|