@applitools/spec-driver-selenium 1.3.6 → 1.3.9

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 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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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 (_a) {
36
+ catch {
33
37
  // NOTE: ignore error
34
38
  }
35
39
  }
@@ -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.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
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 (_a) {
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 (_a) {
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(Object.assign({}, size));
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 = Object.assign(Object.assign({}, cookie), { expiry: cookie.expires });
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 (_a) {
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((_a) => {
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(Object.assign(Object.assign({}, env), { legacy: (_a = env.legacy) !== null && _a !== void 0 ? _a : process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION === '3' }));
378
- const desiredCapabilities = Object.assign({}, capabilities);
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.6",
3
+ "version": "1.3.9",
4
4
  "keywords": [
5
5
  "selenium",
6
6
  "selenium-webdriver",
@@ -25,14 +25,17 @@
25
25
  "name": "Applitools Team",
26
26
  "email": "team@applitools.com"
27
27
  },
28
- "main": "./dist/index.js",
29
- "types": "./types/index.d.ts",
28
+ "aliases": [
29
+ "spec-selenium"
30
+ ],
30
31
  "exports": {
31
32
  ".": {
32
- "default": "./dist/index.js",
33
- "types": "./types/index.d.ts"
33
+ "types": "./types/index.d.ts",
34
+ "default": "./dist/index.js"
34
35
  }
35
36
  },
37
+ "main": "./dist/index.js",
38
+ "types": "./types/index.d.ts",
36
39
  "files": [
37
40
  "dist",
38
41
  "types"
@@ -58,33 +61,36 @@
58
61
  }
59
62
  },
60
63
  "dependencies": {
61
- "@applitools/types": "1.3.2",
62
- "@applitools/utils": "1.2.14"
64
+ "@applitools/types": "1.5.2",
65
+ "@applitools/utils": "1.3.7"
63
66
  },
64
67
  "devDependencies": {
65
- "@applitools/api-extractor": "^1.2.7",
66
- "@applitools/bongo": "2.0.3",
68
+ "@applitools/api-extractor": "^1.2.8",
69
+ "@applitools/bongo": "2.1.5",
67
70
  "@applitools/scripts": "1.1.0",
68
- "@applitools/test-utils": "1.3.1",
69
- "@types/mocha": "^9.0.0",
70
- "@types/node": "^16.10.2",
71
- "@types/selenium-webdriver": "^4.0.15",
72
- "@typescript-eslint/eslint-plugin": "^4.15.1",
73
- "@typescript-eslint/parser": "^4.15.1",
74
- "eslint": "^7.9.0",
75
- "eslint-config-prettier": "^7.2.0",
71
+ "@applitools/test-utils": "1.3.3",
72
+ "@types/mocha": "^9.1.1",
73
+ "@types/node": "12",
74
+ "@types/selenium-webdriver": "^4.1.1",
75
+ "@typescript-eslint/eslint-plugin": "^5.27.0",
76
+ "@typescript-eslint/parser": "^5.27.0",
77
+ "eslint": "^8.16.0",
78
+ "eslint-config-prettier": "^8.5.0",
76
79
  "eslint-plugin-mocha-no-only": "^1.1.1",
77
80
  "eslint-plugin-node": "^11.1.0",
78
- "eslint-plugin-prettier": "^3.3.1",
81
+ "eslint-plugin-prettier": "^4.0.0",
79
82
  "husky": "^4.3.7",
80
- "mocha": "^9.1.2",
81
- "prettier": "^2.4.1",
82
- "selenium-webdriver": "^4.1.1",
83
- "ts-node": "^10.2.1",
84
- "ttypescript": "^1.5.12",
85
- "typescript": "^4.5.4"
83
+ "mocha": "^9.2.2",
84
+ "prettier": "^2.6.2",
85
+ "selenium-webdriver": "^4.2.0",
86
+ "ts-node": "^10.8.0",
87
+ "ttypescript": "^1.5.13",
88
+ "typescript": "^4.7.2"
86
89
  },
87
90
  "peerDependencies": {
88
91
  "selenium-webdriver": ">=3.6.0"
92
+ },
93
+ "engines": {
94
+ "node": ">=12.13.0"
89
95
  }
90
96
  }