@applitools/nml-client 1.3.29 → 1.3.30
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/client.js +14 -13
- package/dist/req-broker.js +7 -7
- package/package.json +11 -23
- package/types/client.d.ts +2 -2
- package/types/types.d.ts +1 -7
package/dist/client.js
CHANGED
|
@@ -71,19 +71,20 @@ async function takeSnapshots({ url, settings, logger, }) {
|
|
|
71
71
|
},
|
|
72
72
|
});
|
|
73
73
|
const snapshot = await response.json().then(({ payload }) => {
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
vhsType
|
|
86
|
-
}
|
|
74
|
+
const platformName = payload.result.resourceMap.metadata.platformName;
|
|
75
|
+
const snapshot = { platformName, vhsHash: payload.result.resourceMap.vhs };
|
|
76
|
+
if (platformName === 'ios') {
|
|
77
|
+
;
|
|
78
|
+
snapshot.vhsCompatibilityParams = {
|
|
79
|
+
UIKitLinkTimeVersionNumber: payload.result.metadata.UIKitLinkTimeVersionNumber,
|
|
80
|
+
UIKitRunTimeVersionNumber: payload.result.metadata.UIKitRunTimeVersionNumber,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
else if (platformName === 'android') {
|
|
84
|
+
;
|
|
85
|
+
snapshot.vhsType = 'android-x';
|
|
86
|
+
}
|
|
87
|
+
return snapshot;
|
|
87
88
|
});
|
|
88
89
|
return Array(settings.renderers.length).fill(snapshot);
|
|
89
90
|
}
|
package/dist/req-broker.js
CHANGED
|
@@ -47,18 +47,18 @@ function handleLogs({ logger: defaultLogger } = {}) {
|
|
|
47
47
|
return {
|
|
48
48
|
beforeRequest({ request, options }) {
|
|
49
49
|
var _a;
|
|
50
|
-
const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : defaultLogger;
|
|
51
|
-
logger === null || logger === void 0 ? void 0 : logger.log(`Broker request "${options.name}" will be sent to the address "[${request.method}]${request.url}" with body`, options.body);
|
|
50
|
+
const logger = (_a = options === null || options === void 0 ? void 0 : options.logger) !== null && _a !== void 0 ? _a : defaultLogger;
|
|
51
|
+
logger === null || logger === void 0 ? void 0 : logger.log(`Broker request "${options === null || options === void 0 ? void 0 : options.name}" will be sent to the address "[${request.method}]${request.url}" with body`, options === null || options === void 0 ? void 0 : options.body);
|
|
52
52
|
},
|
|
53
53
|
async afterResponse({ request, response, options }) {
|
|
54
54
|
var _a;
|
|
55
|
-
const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : defaultLogger;
|
|
56
|
-
logger === null || logger === void 0 ? void 0 : logger.log(`Broker request "${options.name}" that was sent to the address "[${request.method}]${request.url}" respond with ${response.statusText}(${response.status})`, response.status !== 200 ? `and body ${JSON.stringify(await response.clone().text())}` : '');
|
|
55
|
+
const logger = (_a = options === null || options === void 0 ? void 0 : options.logger) !== null && _a !== void 0 ? _a : defaultLogger;
|
|
56
|
+
logger === null || logger === void 0 ? void 0 : logger.log(`Broker request "${options === null || options === void 0 ? void 0 : options.name}" that was sent to the address "[${request.method}]${request.url}" respond with ${response.statusText}(${response.status})`, response.status !== 200 ? `and body ${JSON.stringify(await response.clone().text())}` : '');
|
|
57
57
|
},
|
|
58
58
|
afterError({ request, error, options }) {
|
|
59
59
|
var _a;
|
|
60
|
-
const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : defaultLogger;
|
|
61
|
-
logger === null || logger === void 0 ? void 0 : logger.error(`Broker request "${options.name}" that was sent to the address "[${request.method}]${request.url}" failed with error`, error);
|
|
60
|
+
const logger = (_a = options === null || options === void 0 ? void 0 : options.logger) !== null && _a !== void 0 ? _a : defaultLogger;
|
|
61
|
+
logger === null || logger === void 0 ? void 0 : logger.error(`Broker request "${options === null || options === void 0 ? void 0 : options.name}" that was sent to the address "[${request.method}]${request.url}" failed with error`, error);
|
|
62
62
|
},
|
|
63
63
|
};
|
|
64
64
|
}
|
|
@@ -67,7 +67,7 @@ function handleLongRequests({ req }) {
|
|
|
67
67
|
async afterResponse({ request, response, options }) {
|
|
68
68
|
if (response.status === 200) {
|
|
69
69
|
return req(request.url + '-response', {
|
|
70
|
-
proxy: options.proxy,
|
|
70
|
+
proxy: options === null || options === void 0 ? void 0 : options.proxy,
|
|
71
71
|
retry: {
|
|
72
72
|
// 1500 attempts x 200 ms = 5 minutes
|
|
73
73
|
limit: 1500,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/nml-client",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.30",
|
|
4
4
|
"description": "Client to integrate the SDKs to the Native Mobile Library (NML)",
|
|
5
5
|
"homepage": "https://applitools.com",
|
|
6
6
|
"bugs": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"./package.json": "./package.json"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
|
-
"lint": "eslint '**/*.ts'",
|
|
39
|
-
"build": "tsc",
|
|
38
|
+
"lint": "node ../../node_modules/.bin/eslint '**/*.ts'",
|
|
39
|
+
"build": "node ../../node_modules/.bin/tsc --project ./tsconfig.build.json",
|
|
40
40
|
"test": "mocha --no-timeouts -r ts-node/register 'test/**/*.spec.ts'",
|
|
41
41
|
"test:sanity": "yarn test",
|
|
42
42
|
"test:watch": "yarn test --watch --extension ts",
|
|
@@ -46,33 +46,21 @@
|
|
|
46
46
|
"postversion": "bongo postversion --skip-release-notification"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@applitools/logger": "1.1.
|
|
50
|
-
"@applitools/req": "1.1.
|
|
51
|
-
"@applitools/utils": "1.3.
|
|
49
|
+
"@applitools/logger": "1.1.45",
|
|
50
|
+
"@applitools/req": "1.1.30",
|
|
51
|
+
"@applitools/utils": "1.3.30"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@applitools/bongo": "^2.2.2",
|
|
55
|
-
"@applitools/
|
|
56
|
-
"@applitools/
|
|
57
|
-
"@applitools/test-
|
|
58
|
-
"@applitools/test-utils": "^1.5.10",
|
|
55
|
+
"@applitools/spec-driver-webdriverio": "^1.4.23",
|
|
56
|
+
"@applitools/test-server": "^1.1.24",
|
|
57
|
+
"@applitools/test-utils": "^1.5.12",
|
|
59
58
|
"@types/mocha": "^9.1.1",
|
|
60
59
|
"@types/node": "12",
|
|
61
|
-
"
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "^5.45.0",
|
|
63
|
-
"@typescript-eslint/parser": "^5.45.0",
|
|
64
|
-
"eslint": "^8.28.0",
|
|
65
|
-
"eslint-config-prettier": "^8.5.0",
|
|
66
|
-
"eslint-plugin-no-only-tests": "^3.0.0",
|
|
67
|
-
"eslint-plugin-node": "^11.1.0",
|
|
68
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
60
|
+
"chromedriver": "^109.0.0",
|
|
69
61
|
"mocha": "^10.0.0",
|
|
70
62
|
"nock": "^13.2.9",
|
|
71
|
-
"
|
|
72
|
-
"prettier": "^2.7.1",
|
|
73
|
-
"selenium-webdriver": "^4.4.0",
|
|
74
|
-
"ts-node": "^10.2.1",
|
|
75
|
-
"typescript": "^4.6.4"
|
|
63
|
+
"webdriverio": "^8.3.2"
|
|
76
64
|
},
|
|
77
65
|
"engines": {
|
|
78
66
|
"node": ">=12.13.0"
|
package/types/client.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export declare function takeScreenshot({ url, settings, logger, }: {
|
|
|
6
6
|
settings: ReqBrokerConfig & ScreenshotSettings;
|
|
7
7
|
logger?: Logger;
|
|
8
8
|
}): Promise<Screenshot>;
|
|
9
|
-
export declare function takeSnapshots({ url, settings, logger, }: {
|
|
9
|
+
export declare function takeSnapshots<TSnapshot extends IOSSnapshot | AndroidSnapshot = IOSSnapshot | AndroidSnapshot>({ url, settings, logger, }: {
|
|
10
10
|
url: string;
|
|
11
11
|
settings: ReqBrokerConfig & SnapshotSettings;
|
|
12
12
|
logger?: Logger;
|
|
13
|
-
}): Promise<
|
|
13
|
+
}): Promise<TSnapshot[]>;
|
package/types/types.d.ts
CHANGED
|
@@ -59,15 +59,9 @@ export type AndroidSnapshot = {
|
|
|
59
59
|
export type IOSSnapshot = {
|
|
60
60
|
platformName: 'ios';
|
|
61
61
|
vhsCompatibilityParams: Record<string, any>;
|
|
62
|
-
} & ({
|
|
63
|
-
resourceContents: Record<string, {
|
|
64
|
-
type: string;
|
|
65
|
-
value: Buffer;
|
|
66
|
-
}>;
|
|
67
|
-
} | {
|
|
68
62
|
vhsHash: {
|
|
69
63
|
hashFormat: string;
|
|
70
64
|
hash: string;
|
|
71
65
|
contentType: string;
|
|
72
66
|
};
|
|
73
|
-
}
|
|
67
|
+
};
|