@applitools/eyes-selenium 4.56.3 → 4.56.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 CHANGED
@@ -3,6 +3,15 @@
3
3
  ## Unreleased
4
4
 
5
5
 
6
+ ## 4.56.4 - 2021/10/12
7
+
8
+ - move spec driver implementation to the separate package
9
+ - updated to @applitools/eyes-api@1.1.4 (from 1.1.3)
10
+ - updated to @applitools/eyes-sdk-core@12.23.15 (from 12.23.14)
11
+ - updated to @applitools/spec-driver-selenium@1.0.2 (from 1.0.1)
12
+ - updated to @applitools/visual-grid-client@15.8.34 (from 15.8.33)
13
+ - updated to @applitools/spec-driver-selenium@1.1.0 (from 1.0.2)
14
+
6
15
  ## 4.56.3 - 2021/10/7
7
16
 
8
17
  - updated to @applitools/eyes-api@1.1.3 (from 1.1.1)
package/dist/api.js CHANGED
@@ -25,7 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.BatchClose = exports.Target = exports.CheckSettings = exports.Configuration = exports.Eyes = 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("./spec-driver"));
28
+ const spec = __importStar(require("@applitools/spec-driver-selenium"));
29
29
  const sdk = (0, eyes_sdk_core_1.makeSDK)({
30
30
  name: 'eyes.selenium',
31
31
  version: `${require('../package.json').version}--${process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION}`,
package/dist/index.js CHANGED
@@ -10,9 +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_SELENIUM_MAJOR_VERSION) {
14
- const { version } = require('selenium-webdriver/package.json');
15
- const [major] = version.split('.', 1);
16
- process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION = major;
17
- }
18
13
  __exportStar(require("./api"), exports);
@@ -6,347 +6,8 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
6
6
  if (k2 === undefined) k2 = k;
7
7
  o[k2] = m[k];
8
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
- 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;
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
31
11
  };
32
12
  Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.wrapDriver = exports.build = exports.performAction = exports.getElementText = exports.getElementAttribute = exports.getElementRegion = exports.getOrientation = exports.waitUntilDisplayed = exports.scrollIntoView = exports.type = exports.hover = exports.click = exports.takeScreenshot = exports.visit = exports.getUrl = exports.getTitle = exports.getDriverInfo = exports.setWindowSize = exports.getWindowSize = 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
- const utils = __importStar(require("@applitools/utils"));
35
- const legacy = __importStar(require("./legacy"));
36
- const byHash = ['className', 'css', 'id', 'js', 'linkText', 'name', 'partialLinkText', 'tagName', 'xpath'];
37
- function extractElementId(element) {
38
- return element.getId();
39
- }
40
- function isDriver(driver) {
41
- return utils.types.instanceOf(driver, 'WebDriver');
42
- }
43
- exports.isDriver = isDriver;
44
- function isElement(element) {
45
- return utils.types.instanceOf(element, 'WebElement');
46
- }
47
- exports.isElement = isElement;
48
- function isSelector(selector) {
49
- if (!selector)
50
- return false;
51
- return utils.types.has(selector, ['using', 'value']) || byHash.includes(Object.keys(selector)[0]);
52
- }
53
- exports.isSelector = isSelector;
54
- function transformDriver(driver) {
55
- driver.getExecutor().defineCommand('getSessionDetails', 'GET', '/session/:sessionId');
56
- driver.getExecutor().defineCommand('getOrientation', 'GET', '/session/:sessionId/orientation');
57
- driver.getExecutor().defineCommand('getSystemBars', 'GET', '/session/:sessionId/appium/device/system_bars');
58
- driver.getExecutor().defineCommand('performTouch', 'POST', '/session/:sessionId/touch/perform');
59
- if (process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION === '3') {
60
- driver.getExecutor().defineCommand('switchToParentFrame', 'POST', '/session/:sessionId/frame/parent');
61
- }
62
- return driver;
63
- }
64
- exports.transformDriver = transformDriver;
65
- function transformSelector(selector) {
66
- if (utils.types.isString(selector)) {
67
- return { css: selector };
68
- }
69
- else if (utils.types.has(selector, 'selector')) {
70
- if (!utils.types.isString(selector.selector))
71
- return selector.selector;
72
- if (!utils.types.has(selector, 'type'))
73
- return { css: selector.selector };
74
- if (selector.type === 'css')
75
- return { css: selector.selector };
76
- else
77
- return { using: selector.type, value: selector.selector };
78
- }
79
- return selector;
80
- }
81
- exports.transformSelector = transformSelector;
82
- function isStaleElementError(error) {
83
- if (!error)
84
- return false;
85
- error = error.originalError || error;
86
- return error instanceof Error && error.name === 'StaleElementReferenceError';
87
- }
88
- exports.isStaleElementError = isStaleElementError;
89
- async function isEqualElements(_driver, element1, element2) {
90
- if (!element1 || !element2)
91
- return false;
92
- const elementId1 = await extractElementId(element1);
93
- const elementId2 = await extractElementId(element2);
94
- return elementId1 === elementId2;
95
- }
96
- exports.isEqualElements = isEqualElements;
97
- async function executeScript(driver, script, arg) {
98
- return driver.executeScript(script, arg);
99
- }
100
- exports.executeScript = executeScript;
101
- async function mainContext(driver) {
102
- await driver.switchTo().defaultContent();
103
- return driver;
104
- }
105
- exports.mainContext = mainContext;
106
- async function parentContext(driver) {
107
- if (process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION === '3') {
108
- const { Command } = require('selenium-webdriver/lib/command');
109
- await driver.schedule(new Command('switchToParentFrame'));
110
- return driver;
111
- }
112
- await driver.switchTo().parentFrame();
113
- return driver;
114
- }
115
- exports.parentContext = parentContext;
116
- async function childContext(driver, element) {
117
- await driver.switchTo().frame(element);
118
- return driver;
119
- }
120
- exports.childContext = childContext;
121
- async function findElement(driver, selector, parent) {
122
- try {
123
- const root = parent !== null && parent !== void 0 ? parent : driver;
124
- return await root.findElement(selector);
125
- }
126
- catch (err) {
127
- if (err.name === 'NoSuchElementError')
128
- return null;
129
- else
130
- throw err;
131
- }
132
- }
133
- exports.findElement = findElement;
134
- async function findElements(driver, selector, parent) {
135
- const root = parent !== null && parent !== void 0 ? parent : driver;
136
- return root.findElements(selector);
137
- }
138
- exports.findElements = findElements;
139
- async function getWindowSize(driver) {
140
- try {
141
- const window = driver.manage().window();
142
- if (utils.types.isFunction(window.getSize)) {
143
- return await window.getSize();
144
- }
145
- else if (utils.types.isFunction(window.getRect)) {
146
- const rect = await window.getRect();
147
- return { width: rect.width, height: rect.height };
148
- }
149
- }
150
- catch (err) {
151
- const cmd = require('selenium-webdriver/lib/command');
152
- return driver.execute(new cmd.Command(cmd.Name.GET_WINDOW_SIZE).setParameter('windowHandle', 'current'));
153
- }
154
- }
155
- exports.getWindowSize = getWindowSize;
156
- async function setWindowSize(driver, size) {
157
- const window = driver.manage().window();
158
- if (utils.types.isFunction(window.setRect)) {
159
- await window.setRect({ x: 0, y: 0, width: size.width, height: size.height });
160
- }
161
- else {
162
- await window.setPosition(0, 0);
163
- await window.setSize(size.width, size.height);
164
- }
165
- }
166
- exports.setWindowSize = setWindowSize;
167
- async function getDriverInfo(driver) {
168
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
169
- const session = await driver.getSession();
170
- const capabilities = await driver.getCapabilities();
171
- const desiredCapabilities = (_a = capabilities.get('desired')) !== null && _a !== void 0 ? _a : {};
172
- const platformName = (_c = (_b = capabilities.get('platformName')) !== null && _b !== void 0 ? _b : capabilities.get('platform')) !== null && _c !== void 0 ? _c : desiredCapabilities.platformName;
173
- const isMobile = ['android', 'ios'].includes(platformName === null || platformName === void 0 ? void 0 : platformName.toLowerCase());
174
- const info = {
175
- sessionId: session.getId(),
176
- isMobile,
177
- isNative: isMobile && !capabilities.get('browserName'),
178
- deviceName: (_d = desiredCapabilities.deviceName) !== null && _d !== void 0 ? _d : capabilities.get('deviceName'),
179
- platformName,
180
- platformVersion: capabilities.get('platformVersion'),
181
- browserName: (_e = capabilities.get('browserName')) !== null && _e !== void 0 ? _e : desiredCapabilities === null || desiredCapabilities === void 0 ? void 0 : desiredCapabilities.browserName,
182
- browserVersion: (_f = capabilities.get('browserVersion')) !== null && _f !== void 0 ? _f : capabilities.get('version'),
183
- };
184
- if (info.isNative) {
185
- const { Command } = require('selenium-webdriver/lib/command');
186
- let details;
187
- if (capabilities.has('viewportRect') && capabilities.has('pixelRatio') && capabilities.has('statBarHeight')) {
188
- details = {
189
- viewportRect: capabilities.get('viewportRect'),
190
- pixelRatio: capabilities.get('pixelRatio'),
191
- statBarHeight: capabilities.get('statBarHeight'),
192
- };
193
- }
194
- else {
195
- const getSessionDetailsCommand = new Command('getSessionDetails');
196
- details =
197
- process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION === '3'
198
- ? await driver.schedule(getSessionDetailsCommand)
199
- : await driver.execute(getSessionDetailsCommand);
200
- }
201
- info.pixelRatio = details.pixelRatio;
202
- try {
203
- const getSystemBars = new Command('getSystemBars');
204
- const { statusBar, navigationBar } = process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION === '3'
205
- ? await driver.schedule(getSystemBars)
206
- : await driver.execute(getSystemBars);
207
- info.statusBarHeight = statusBar.visible ? statusBar.height : 0;
208
- info.navigationBarHeight = navigationBar.visible ? navigationBar.height : 0;
209
- }
210
- catch (err) {
211
- info.statusBarHeight = (_j = (_g = details.statBarHeight) !== null && _g !== void 0 ? _g : (_h = details.viewportRect) === null || _h === void 0 ? void 0 : _h.top) !== null && _j !== void 0 ? _j : 0;
212
- info.navigationBarHeight = 0;
213
- }
214
- }
215
- return info;
216
- }
217
- exports.getDriverInfo = getDriverInfo;
218
- async function getTitle(driver) {
219
- return driver.getTitle();
220
- }
221
- exports.getTitle = getTitle;
222
- async function getUrl(driver) {
223
- return driver.getCurrentUrl();
224
- }
225
- exports.getUrl = getUrl;
226
- async function visit(driver, url) {
227
- await driver.get(url);
228
- }
229
- exports.visit = visit;
230
- async function takeScreenshot(driver) {
231
- return driver.takeScreenshot();
232
- }
233
- exports.takeScreenshot = takeScreenshot;
234
- async function click(driver, element) {
235
- if (isSelector(element))
236
- element = await findElement(driver, element);
237
- await element.click();
238
- }
239
- exports.click = click;
240
- async function hover(driver, element) {
241
- if (isSelector(element))
242
- element = await findElement(driver, element);
243
- if (process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION === '3') {
244
- const { ActionSequence } = require('selenium-webdriver');
245
- const action = new ActionSequence(driver);
246
- await action.mouseMove(element).perform();
247
- }
248
- else {
249
- await driver.actions().move({ origin: element }).perform();
250
- }
251
- }
252
- exports.hover = hover;
253
- async function type(driver, element, keys) {
254
- if (isSelector(element))
255
- element = await findElement(driver, element);
256
- await element.sendKeys(keys);
257
- }
258
- exports.type = type;
259
- async function scrollIntoView(driver, element, align = false) {
260
- if (isSelector(element))
261
- element = await findElement(driver, element);
262
- await driver.executeScript('arguments[0].scrollIntoView(arguments[1])', element, align);
263
- }
264
- exports.scrollIntoView = scrollIntoView;
265
- async function waitUntilDisplayed(driver, selector, timeout) {
266
- const { until } = require('selenium-webdriver');
267
- const element = await findElement(driver, selector);
268
- await driver.wait(until.elementIsVisible(element), timeout);
269
- }
270
- exports.waitUntilDisplayed = waitUntilDisplayed;
271
- async function getOrientation(driver) {
272
- const { Command } = require('selenium-webdriver/lib/command');
273
- const getOrientationCommand = new Command('getOrientation');
274
- const orientation = process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION === '3'
275
- ? await driver.schedule(getOrientationCommand)
276
- : await driver.execute(getOrientationCommand);
277
- return orientation.toLowerCase();
278
- }
279
- exports.getOrientation = getOrientation;
280
- async function getElementRegion(_driver, element) {
281
- return element.getRect();
282
- }
283
- exports.getElementRegion = getElementRegion;
284
- async function getElementAttribute(_driver, element, attr) {
285
- return element.getAttribute(attr);
286
- }
287
- exports.getElementAttribute = getElementAttribute;
288
- async function getElementText(_driver, element) {
289
- return element.getText();
290
- }
291
- exports.getElementText = getElementText;
292
- async function performAction(driver, steps) {
293
- const { Command } = require('selenium-webdriver/lib/command');
294
- const performTouchCommand = new Command('performTouch').setParameters({
295
- actions: steps.map((_a) => {
296
- var { action } = _a, options = __rest(_a, ["action"]);
297
- return ({ action, options });
298
- }),
299
- });
300
- if (process.env.APPLITOOLS_SELENIUM_MAJOR_VERSION === '3') {
301
- await driver.schedule(performTouchCommand);
302
- }
303
- else {
304
- await driver.execute(performTouchCommand);
305
- }
306
- }
307
- exports.performAction = performAction;
308
- const browserOptionsNames = {
309
- chrome: 'goog:chromeOptions',
310
- firefox: 'moz:firefoxOptions',
311
- };
312
- async function build(env) {
313
- var _a;
314
- const { Builder } = require('selenium-webdriver');
315
- const parseEnv = require('@applitools/test-utils/src/parse-env');
316
- 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' }));
317
- const desiredCapabilities = Object.assign({}, capabilities);
318
- if (configurable) {
319
- const browserOptionsName = browserOptionsNames[browser || desiredCapabilities.browserName];
320
- if (browserOptionsName) {
321
- const browserOptions = desiredCapabilities[browserOptionsName] || {};
322
- browserOptions.args = [...(browserOptions.args || []), ...args];
323
- if (headless)
324
- browserOptions.args.push('headless');
325
- if (attach) {
326
- browserOptions.debuggerAddress = attach === true ? 'localhost:9222' : attach;
327
- if (browser !== 'firefox')
328
- browserOptions.w3c = false;
329
- }
330
- desiredCapabilities[browserOptionsName] = browserOptions;
331
- }
332
- }
333
- if (appium && browser === 'chrome') {
334
- desiredCapabilities['appium:chromeOptions'] = { w3c: false };
335
- }
336
- const builder = new Builder().withCapabilities(desiredCapabilities);
337
- if (url && !attach)
338
- builder.usingServer(url.href);
339
- if (proxy) {
340
- builder.setProxy({
341
- proxyType: 'manual',
342
- httpProxy: proxy.http || proxy.server,
343
- sslProxy: proxy.https || proxy.server,
344
- ftpProxy: proxy.ftp,
345
- noProxy: proxy.bypass,
346
- });
347
- }
348
- const driver = await builder.build();
349
- return [driver, () => driver.quit()];
350
- }
351
- exports.build = build;
352
- exports.wrapDriver = legacy.wrapDriver;
13
+ __exportStar(require("@applitools/spec-driver-selenium"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/eyes-selenium",
3
- "version": "4.56.3",
3
+ "version": "4.56.4",
4
4
  "description": "Applitools Eyes SDK for Selenium WebDriver",
5
5
  "keywords": [
6
6
  "eyes-selenium",
@@ -42,21 +42,19 @@
42
42
  "types"
43
43
  ],
44
44
  "scripts": {
45
- "lint": "eslint '**/*.ts' '**/*.js'",
45
+ "lint": "eslint '**/*.ts'",
46
46
  "build": "yarn build:dist && yarn build:types",
47
- "doc": "typedoc ./types/index.d.ts --theme minimal --tsconfig ./tsconfig.doc.json",
48
47
  "build:dist": "tsc",
49
48
  "build:types": "api-extractor ./src/index.ts --out ./types/index.d.ts --external-modules selenium-webdriver",
50
49
  "generate:tests": "coverage-tests generate https://raw.githubusercontent.com/applitools/sdk.coverage.tests/master/js/config.js --name 'eyes-selenium'",
51
- "test": "yarn build:dist && yarn test:it && yarn test:coverage",
52
- "test:it": "mocha --no-timeouts './test/it/**/*.spec.js'",
50
+ "test": "yarn test:coverage",
53
51
  "test:coverage": "yarn generate:tests && APPLITOOLS_BATCH_NAME='JS Coverage Tests: eyes-selenium' APPLITOOLS_BATCH_ID=$(uuidgen) XUNIT_FILE=coverage-test-report.xml mocha --config .mocharc.cvg.js",
54
52
  "report": "coverage-tests report https://raw.githubusercontent.com/applitools/sdk.coverage.tests/master/js/config.js --name 'eyes-selenium'",
55
53
  "setup": "yarn docker:setup",
56
54
  "docker:setup": "node ../scripts/scripts/generate-docker-compose-config.js && docker-compose up -d",
57
55
  "docker:teardown": "docker-compose down",
58
56
  "deps": "bongo deps",
59
- "gh:test": "gh workflow run test.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='selenium selenium@3' -f links='eyes-sdk-core eyes-api types test-utils utils driver snippets screenshoter sdk-shared visual-grid-client' -f linking-depth=3",
57
+ "gh:test": "gh workflow run test.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='selenium selenium@3' -f links='types test-utils sdk-shared eyes-sdk-core visual-grid-client eyes-api spec-driver-selenium utils driver snippets screenshoter' -f linking-depth=3",
60
58
  "gh:publish": "gh workflow run publish.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='selenium'",
61
59
  "preversion": "bongo preversion && yarn build",
62
60
  "version": "bongo version",
@@ -68,10 +66,10 @@
68
66
  }
69
67
  },
70
68
  "dependencies": {
71
- "@applitools/eyes-api": "1.1.3",
72
- "@applitools/eyes-sdk-core": "12.23.14",
73
- "@applitools/utils": "1.2.3",
74
- "@applitools/visual-grid-client": "15.8.33"
69
+ "@applitools/eyes-api": "1.1.4",
70
+ "@applitools/eyes-sdk-core": "12.23.15",
71
+ "@applitools/spec-driver-selenium": "1.1.0",
72
+ "@applitools/visual-grid-client": "15.8.34"
75
73
  },
76
74
  "devDependencies": {
77
75
  "@applitools/api-extractor": "1.1.3",
@@ -79,7 +77,7 @@
79
77
  "@applitools/sdk-coverage-tests": "2.3.15",
80
78
  "@applitools/sdk-release-kit": "0.13.3",
81
79
  "@applitools/sdk-shared": "0.9.6",
82
- "@applitools/test-utils": "1.0.7",
80
+ "@applitools/test-utils": "1.0.9",
83
81
  "@types/selenium-webdriver": "^4.0.11",
84
82
  "@typescript-eslint/eslint-plugin": "^4.15.1",
85
83
  "@typescript-eslint/parser": "^4.15.1",
@@ -90,10 +88,9 @@
90
88
  "eslint-plugin-node": "^11.1.0",
91
89
  "eslint-plugin-prettier": "^3.3.1",
92
90
  "husky": "^4.3.8",
93
- "mocha": "^8.0.1",
94
- "ncp": "^2.0.0",
91
+ "mocha": "^9.1.2",
95
92
  "prettier": "^2.1.2",
96
- "selenium-webdriver": "^4.0.0-beta.4",
93
+ "selenium-webdriver": "^4.0.0-rc-2",
97
94
  "spec-xunit-file": "0.0.1-3",
98
95
  "typescript": "^4.1.3"
99
96
  },
package/types/index.d.ts CHANGED
@@ -471,6 +471,7 @@ export class CheckSettings {
471
471
  variationGroupId(variationGroupId: string): this;
472
472
  visualGridOption(key: string, value: any): this;
473
473
  visualGridOptions(options: {[key: string]: any}): this;
474
+ waitBeforeCapture(waitBeforeCapture: number): this;
474
475
  /** @deprecated */
475
476
  webHook(script: string): this;
476
477
  withName(name: string): this;
@@ -594,6 +595,8 @@ export class Configuration {
594
595
  set viewportSize(viewportSize: RectangleSizePlain);
595
596
  get visualGridOptions(): {[key: string]: any};
596
597
  set visualGridOptions(visualGridOptions: {[key: string]: any});
598
+ get waitBeforeCapture(): number;
599
+ set waitBeforeCapture(waitBeforeCapture: number);
597
600
  get waitBeforeScreenshots(): number;
598
601
  set waitBeforeScreenshots(waitBeforeScreenshots: number);
599
602
  addBrowser(browserInfo: DesktopBrowserInfo): this;
@@ -687,6 +690,7 @@ export class Configuration {
687
690
  getUseDom(): boolean;
688
691
  getViewportSize(): RectangleSize;
689
692
  getVisualGridOptions(): {[key: string]: any};
693
+ getWaitBeforeCapture(): number;
690
694
  getWaitBeforeScreenshots(): number;
691
695
  setAccessibilityValidation(accessibilityValidation: AccessibilitySettings): this;
692
696
  setAgentId(agentId: string): this;
@@ -770,6 +774,7 @@ export class Configuration {
770
774
  setViewportSize(viewportSize: RectangleSizePlain): this;
771
775
  setVisualGridOption(key: string, value: any): this;
772
776
  setVisualGridOptions(visualGridOptions: {[key: string]: any}): this;
777
+ setWaitBeforeCapture(waitBeforeCapture: number): this;
773
778
  setWaitBeforeScreenshots(waitBeforeScreenshots: number): this;
774
779
  }
775
780
 
@@ -1716,6 +1721,7 @@ export type CheckSettingsPlain = {
1716
1721
  renderId?: string;
1717
1722
  variationGroupId?: string;
1718
1723
  timeout?: number;
1724
+ waitBeforeCapture?: number;
1719
1725
  };
1720
1726
 
1721
1727
  export type ChromeEmulationInfo = {
@@ -1768,12 +1774,14 @@ export type ConfigurationPlain = {
1768
1774
  cut?: CutProviderPlain;
1769
1775
  rotation?: ImageRotationPlain;
1770
1776
  scaleRatio?: number;
1777
+ waitBeforeCapture?: number;
1771
1778
  } & {
1772
1779
  /** @undocumented */ concurrentSessions?: number;
1773
1780
  browsersInfo?: (DesktopBrowserInfo | ChromeEmulationInfo | IOSDeviceInfo)[];
1774
1781
  visualGridOptions?: Record<string, any>;
1775
1782
  layoutBreakpoints?: boolean | number[];
1776
1783
  disableBrowserFetching?: boolean;
1784
+ waitBeforeCapture?: number;
1777
1785
  };
1778
1786
 
1779
1787
  export type ConsoleLogHandlerPlain = {type: 'console'};
package/dist/legacy.js DELETED
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wrapDriver = void 0;
4
- function wrapDriver(driver) {
5
- const api = {
6
- get remoteWebDriver() {
7
- return driver;
8
- },
9
- getRemoteWebDriver() {
10
- return driver;
11
- },
12
- async findElementById(id) {
13
- return driver.findElement({ id });
14
- },
15
- async findElementsById(id) {
16
- return driver.findElements({ id });
17
- },
18
- async findElementByName(name) {
19
- return driver.findElement({ name });
20
- },
21
- async findElementsByName(name) {
22
- return driver.findElements({ name });
23
- },
24
- async findElementByCssSelector(css) {
25
- return driver.findElement({ css });
26
- },
27
- async findElementsByCssSelector(css) {
28
- return driver.findElements({ css });
29
- },
30
- async findElementByClassName(className) {
31
- throw driver.findElement({ className });
32
- },
33
- async findElementsByClassName(className) {
34
- throw driver.findElements({ className });
35
- },
36
- async findElementByLinkText(linkText) {
37
- throw driver.findElement({ linkText });
38
- },
39
- async findElementsByLinkText(linkText) {
40
- throw driver.findElements({ linkText });
41
- },
42
- async findElementByPartialLinkText(partialLinkText) {
43
- throw driver.findElement({ partialLinkText });
44
- },
45
- async findElementsByPartialLinkText(partialLinkText) {
46
- throw driver.findElements({ partialLinkText });
47
- },
48
- async findElementByTagName(tagName) {
49
- return driver.findElement({ tagName });
50
- },
51
- async findElementsByTagName(tagName) {
52
- return driver.findElements({ tagName });
53
- },
54
- async findElementByXPath(xpath) {
55
- return driver.findElement({ xpath });
56
- },
57
- async findElementsByXPath(xpath) {
58
- return driver.findElements({ xpath });
59
- },
60
- async getBrowserName() {
61
- const capabilities = await driver.getCapabilities();
62
- return capabilities.getBrowserName();
63
- },
64
- async getBrowserVersion() {
65
- const capabilities = await driver.getCapabilities();
66
- return capabilities.getBrowserVersion();
67
- },
68
- };
69
- return new Proxy(driver, {
70
- get(target, key, receiver) {
71
- if (Object.hasOwnProperty.call(api, key)) {
72
- return Reflect.get(api, key, receiver);
73
- }
74
- return Reflect.get(target, key);
75
- },
76
- });
77
- }
78
- exports.wrapDriver = wrapDriver;