@applitools/ec-client 1.2.25 → 1.2.27
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.
|
@@ -61,7 +61,6 @@ function makeExecuteScript({ req, core }) {
|
|
|
61
61
|
proxy: session.proxy,
|
|
62
62
|
appName: (_g = (_f = options === null || options === void 0 ? void 0 : options.appName) !== null && _f !== void 0 ? _f : session.options.appName) !== null && _g !== void 0 ? _g : ((await driver.getTitle()) || 'default'),
|
|
63
63
|
testName: (_h = options === null || options === void 0 ? void 0 : options.testName) !== null && _h !== void 0 ? _h : session.options.testName,
|
|
64
|
-
properties: [{ name: 'Execution Cloud', value: 'Yes' }],
|
|
65
64
|
batch: { ...session.options.batch, ...options === null || options === void 0 ? void 0 : options.batch },
|
|
66
65
|
environment: {
|
|
67
66
|
hostingApp: `${(_j = environment.browserName) !== null && _j !== void 0 ? _j : ''} ${(_k = environment.browserVersion) !== null && _k !== void 0 ? _k : ''}`.trim(),
|
|
@@ -34,10 +34,19 @@ const RETRY_BACKOFF = [
|
|
|
34
34
|
function makeStartSession({ settings, req, tunnels }) {
|
|
35
35
|
const queues = new Map();
|
|
36
36
|
return async function createSession({ request, response, logger, }) {
|
|
37
|
-
var _a, _b, _c;
|
|
37
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
38
38
|
const requestBody = await utils.streams.toJSON(request);
|
|
39
39
|
logger.log(`Request was intercepted with body:`, requestBody);
|
|
40
|
-
|
|
40
|
+
let capabilities = {};
|
|
41
|
+
if (!utils.types.isEmpty(requestBody.desiredCapabilities)) {
|
|
42
|
+
capabilities = requestBody.desiredCapabilities;
|
|
43
|
+
}
|
|
44
|
+
else if (!utils.types.isEmpty((_a = requestBody.capabilities) === null || _a === void 0 ? void 0 : _a.alwaysMatch)) {
|
|
45
|
+
capabilities = requestBody.capabilities.alwaysMatch;
|
|
46
|
+
}
|
|
47
|
+
else if (!utils.types.isEmpty((_c = (_b = requestBody.capabilities) === null || _b === void 0 ? void 0 : _b.firstMatch) === null || _c === void 0 ? void 0 : _c[0])) {
|
|
48
|
+
capabilities = (_e = (_d = requestBody.capabilities) === null || _d === void 0 ? void 0 : _d.firstMatch) === null || _e === void 0 ? void 0 : _e[0];
|
|
49
|
+
}
|
|
41
50
|
const options = {
|
|
42
51
|
...settings.options,
|
|
43
52
|
...capabilities === null || capabilities === void 0 ? void 0 : capabilities['applitools:options'],
|
|
@@ -55,12 +64,18 @@ function makeStartSession({ settings, req, tunnels }) {
|
|
|
55
64
|
});
|
|
56
65
|
}
|
|
57
66
|
const applitoolsCapabilities = Object.fromEntries(Object.entries(options).map(([key, value]) => [`applitools:${key}`, value]));
|
|
58
|
-
if (requestBody.
|
|
59
|
-
requestBody.capabilities.alwaysMatch = { ...(_c = requestBody.capabilities) === null || _c === void 0 ? void 0 : _c.alwaysMatch, ...applitoolsCapabilities };
|
|
60
|
-
}
|
|
61
|
-
if (requestBody.desiredCapabilities) {
|
|
67
|
+
if (!utils.types.isEmpty(requestBody.desiredCapabilities)) {
|
|
62
68
|
requestBody.desiredCapabilities = { ...requestBody.desiredCapabilities, ...applitoolsCapabilities };
|
|
63
69
|
}
|
|
70
|
+
else if (!utils.types.isEmpty((_f = requestBody.capabilities) === null || _f === void 0 ? void 0 : _f.alwaysMatch)) {
|
|
71
|
+
requestBody.capabilities.alwaysMatch = { ...(_g = requestBody.capabilities) === null || _g === void 0 ? void 0 : _g.alwaysMatch, ...applitoolsCapabilities };
|
|
72
|
+
}
|
|
73
|
+
else if (!utils.types.isEmpty((_j = (_h = requestBody.capabilities) === null || _h === void 0 ? void 0 : _h.firstMatch) === null || _j === void 0 ? void 0 : _j[0])) {
|
|
74
|
+
requestBody.capabilities.firstMatch = [{ ...requestBody.capabilities.firstMatch[0], ...applitoolsCapabilities }];
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
requestBody.desiredCapabilities = { ...applitoolsCapabilities };
|
|
78
|
+
}
|
|
64
79
|
logger.log('Request body has modified:', requestBody);
|
|
65
80
|
const queueKey = JSON.stringify(session.credentials);
|
|
66
81
|
let queue = queues.get(queueKey);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/ec-client",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.27",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@applitools/core-base": "1.1.53",
|
|
67
|
-
"@applitools/driver": "1.11.
|
|
67
|
+
"@applitools/driver": "1.11.47",
|
|
68
68
|
"@applitools/execution-grid-tunnel": "1.0.24",
|
|
69
69
|
"@applitools/logger": "1.1.52",
|
|
70
70
|
"@applitools/req": "1.2.5",
|
|
71
71
|
"@applitools/socket": "1.0.13",
|
|
72
|
-
"@applitools/spec-driver-webdriver": "1.0.
|
|
72
|
+
"@applitools/spec-driver-webdriver": "1.0.28",
|
|
73
73
|
"@applitools/utils": "1.3.35",
|
|
74
74
|
"abort-controller": "3.0.0",
|
|
75
75
|
"webdriver": "7",
|