@applitools/eyes-selenium 4.56.3 → 4.58.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 +29 -0
- package/dist/api.js +1 -1
- package/dist/index.js +0 -5
- package/dist/spec-driver.js +3 -342
- package/package.json +20 -23
- package/types/index.d.ts +1362 -1997
- package/dist/legacy.js +0 -78
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,35 @@
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
## 4.58.0 - 2021/11/10
|
|
7
|
+
|
|
8
|
+
- support cookies
|
|
9
|
+
- updated to @applitools/eyes-api@1.1.6 (from 1.1.5)
|
|
10
|
+
- updated to @applitools/eyes-sdk-core@12.24.0 (from 12.23.24)
|
|
11
|
+
- updated to @applitools/spec-driver-selenium@1.2.0 (from 1.1.1)
|
|
12
|
+
- updated to @applitools/visual-grid-client@15.8.44 (from 15.8.43)
|
|
13
|
+
|
|
14
|
+
## 4.57.0 - 2021/11/5
|
|
15
|
+
|
|
16
|
+
- updated to @applitools/eyes-api@1.1.5 (from 1.1.4)
|
|
17
|
+
- updated to @applitools/eyes-sdk-core@12.23.24 (from 12.23.18)
|
|
18
|
+
- updated to @applitools/visual-grid-client@15.8.43 (from 15.8.37)
|
|
19
|
+
|
|
20
|
+
## 4.56.5 - 2021/10/20
|
|
21
|
+
|
|
22
|
+
- updated to @applitools/eyes-sdk-core@12.23.18 (from 12.23.15)
|
|
23
|
+
- updated to @applitools/spec-driver-selenium@1.1.1 (from 1.1.0)
|
|
24
|
+
- updated to @applitools/visual-grid-client@15.8.37 (from 15.8.34)
|
|
25
|
+
|
|
26
|
+
## 4.56.4 - 2021/10/12
|
|
27
|
+
|
|
28
|
+
- move spec driver implementation to the separate package
|
|
29
|
+
- updated to @applitools/eyes-api@1.1.4 (from 1.1.3)
|
|
30
|
+
- updated to @applitools/eyes-sdk-core@12.23.15 (from 12.23.14)
|
|
31
|
+
- updated to @applitools/spec-driver-selenium@1.0.2 (from 1.0.1)
|
|
32
|
+
- updated to @applitools/visual-grid-client@15.8.34 (from 15.8.33)
|
|
33
|
+
- updated to @applitools/spec-driver-selenium@1.1.0 (from 1.0.2)
|
|
34
|
+
|
|
6
35
|
## 4.56.3 - 2021/10/7
|
|
7
36
|
|
|
8
37
|
- 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("
|
|
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);
|
package/dist/spec-driver.js
CHANGED
|
@@ -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
|
|
10
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "4.58.0",
|
|
4
4
|
"description": "Applitools Eyes SDK for Selenium WebDriver",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eyes-selenium",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
|
-
"url": "git://github.com/applitools/eyes.sdk.javascript1.git"
|
|
26
|
+
"url": "git://github.com/applitools/eyes.sdk.javascript1.git",
|
|
27
|
+
"directory": "packages/eyes-selenium"
|
|
27
28
|
},
|
|
28
29
|
"license": "SEE LICENSE IN LICENSE",
|
|
29
30
|
"author": {
|
|
@@ -42,21 +43,17 @@
|
|
|
42
43
|
"types"
|
|
43
44
|
],
|
|
44
45
|
"scripts": {
|
|
45
|
-
"lint": "eslint '**/*.ts'
|
|
46
|
-
"build": "
|
|
47
|
-
"doc": "typedoc ./types/index.d.ts --theme minimal --tsconfig ./tsconfig.doc.json",
|
|
48
|
-
"build:dist": "tsc",
|
|
49
|
-
"build:types": "api-extractor ./src/index.ts --out ./types/index.d.ts --external-modules selenium-webdriver",
|
|
46
|
+
"lint": "eslint '**/*.ts'",
|
|
47
|
+
"build": "ttsc",
|
|
50
48
|
"generate:tests": "coverage-tests generate https://raw.githubusercontent.com/applitools/sdk.coverage.tests/master/js/config.js --name 'eyes-selenium'",
|
|
51
|
-
"test": "yarn
|
|
52
|
-
"test:it": "mocha --no-timeouts './test/it/**/*.spec.js'",
|
|
49
|
+
"test": "yarn test:coverage",
|
|
53
50
|
"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
51
|
"report": "coverage-tests report https://raw.githubusercontent.com/applitools/sdk.coverage.tests/master/js/config.js --name 'eyes-selenium'",
|
|
55
52
|
"setup": "yarn docker:setup",
|
|
56
53
|
"docker:setup": "node ../scripts/scripts/generate-docker-compose-config.js && docker-compose up -d",
|
|
57
54
|
"docker:teardown": "docker-compose down",
|
|
58
55
|
"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
|
|
56
|
+
"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
57
|
"gh:publish": "gh workflow run publish.yml --ref $(git rev-parse --abbrev-ref HEAD) -f packages='selenium'",
|
|
61
58
|
"preversion": "bongo preversion && yarn build",
|
|
62
59
|
"version": "bongo version",
|
|
@@ -68,18 +65,18 @@
|
|
|
68
65
|
}
|
|
69
66
|
},
|
|
70
67
|
"dependencies": {
|
|
71
|
-
"@applitools/eyes-api": "1.1.
|
|
72
|
-
"@applitools/eyes-sdk-core": "12.
|
|
73
|
-
"@applitools/
|
|
74
|
-
"@applitools/visual-grid-client": "15.8.
|
|
68
|
+
"@applitools/eyes-api": "1.1.6",
|
|
69
|
+
"@applitools/eyes-sdk-core": "12.24.0",
|
|
70
|
+
"@applitools/spec-driver-selenium": "1.2.0",
|
|
71
|
+
"@applitools/visual-grid-client": "15.8.44"
|
|
75
72
|
},
|
|
76
73
|
"devDependencies": {
|
|
77
|
-
"@applitools/api-extractor": "1.
|
|
74
|
+
"@applitools/api-extractor": "1.2.2",
|
|
78
75
|
"@applitools/scripts": "1.0.1",
|
|
79
|
-
"@applitools/sdk-coverage-tests": "2.3.
|
|
80
|
-
"@applitools/sdk-release-kit": "0.13.
|
|
81
|
-
"@applitools/sdk-shared": "0.9.
|
|
82
|
-
"@applitools/test-utils": "1.0.
|
|
76
|
+
"@applitools/sdk-coverage-tests": "2.3.16",
|
|
77
|
+
"@applitools/sdk-release-kit": "0.13.4",
|
|
78
|
+
"@applitools/sdk-shared": "0.9.8",
|
|
79
|
+
"@applitools/test-utils": "1.0.9",
|
|
83
80
|
"@types/selenium-webdriver": "^4.0.11",
|
|
84
81
|
"@typescript-eslint/eslint-plugin": "^4.15.1",
|
|
85
82
|
"@typescript-eslint/parser": "^4.15.1",
|
|
@@ -90,12 +87,12 @@
|
|
|
90
87
|
"eslint-plugin-node": "^11.1.0",
|
|
91
88
|
"eslint-plugin-prettier": "^3.3.1",
|
|
92
89
|
"husky": "^4.3.8",
|
|
93
|
-
"mocha": "^
|
|
94
|
-
"ncp": "^2.0.0",
|
|
90
|
+
"mocha": "^9.1.2",
|
|
95
91
|
"prettier": "^2.1.2",
|
|
96
|
-
"selenium-webdriver": "^4.0.0
|
|
92
|
+
"selenium-webdriver": "^4.0.0",
|
|
97
93
|
"spec-xunit-file": "0.0.1-3",
|
|
98
|
-
"
|
|
94
|
+
"ttypescript": "^1.5.12",
|
|
95
|
+
"typescript": "^4.5.1-rc"
|
|
99
96
|
},
|
|
100
97
|
"peerDependencies": {
|
|
101
98
|
"selenium-webdriver": ">=3.6.0"
|