@applitools/nml-client 1.8.27 → 1.9.1

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
@@ -1,5 +1,41 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.1](https://github.com/Applitools-Dev/sdk/compare/js/nml-client@1.9.0...js/nml-client@1.9.1) (2025-04-17)
4
+
5
+
6
+ ### Performance Improvements
7
+
8
+ * cachify http agent ([#2466](https://github.com/Applitools-Dev/sdk/issues/2466)) ([bc2f4a1](https://github.com/Applitools-Dev/sdk/commit/bc2f4a1fae3c379f061c9199edf4c5257769fb44))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/snippets bumped to 2.6.5
14
+ #### Performance Improvements
15
+
16
+ * cachify http agent ([#2466](https://github.com/Applitools-Dev/sdk/issues/2466)) ([bc2f4a1](https://github.com/Applitools-Dev/sdk/commit/bc2f4a1fae3c379f061c9199edf4c5257769fb44))
17
+ * @applitools/driver bumped to 1.21.1
18
+ #### Bug Fixes
19
+
20
+ * executePoll error logging FLD-2870 ([#2890](https://github.com/Applitools-Dev/sdk/issues/2890)) ([a8ff720](https://github.com/Applitools-Dev/sdk/commit/a8ff720efafacabe2023282748a6d8a0f1b3ff73))
21
+
22
+
23
+
24
+ * @applitools/spec-driver-webdriver bumped to 1.2.2
25
+ #### Performance Improvements
26
+
27
+ * cachify http agent ([#2466](https://github.com/Applitools-Dev/sdk/issues/2466)) ([bc2f4a1](https://github.com/Applitools-Dev/sdk/commit/bc2f4a1fae3c379f061c9199edf4c5257769fb44))
28
+
29
+
30
+
31
+
32
+ ## [1.9.0](https://github.com/Applitools-Dev/sdk/compare/js/nml-client@1.8.27...js/nml-client@1.9.0) (2025-03-31)
33
+
34
+
35
+ ### Features
36
+
37
+ * add accessibility field to screenshot ([#2815](https://github.com/Applitools-Dev/sdk/issues/2815)) ([3d111f3](https://github.com/Applitools-Dev/sdk/commit/3d111f354c5eedeb8914f18318ccecce5fd13002))
38
+
3
39
  ## [1.8.27](https://github.com/Applitools-Dev/sdk/compare/js/nml-client@1.8.26...js/nml-client@1.8.27) (2025-03-30)
4
40
 
5
41
 
@@ -59,7 +59,7 @@ function makeNMLRequests({ settings, logger: mainLogger, }) {
59
59
  brokerUrl = result.nextPath;
60
60
  }
61
61
  async function takeScreenshots({ settings, logger = mainLogger, }) {
62
- var _a, _b;
62
+ var _a;
63
63
  logger = logger.extend(mainLogger, { tags: [`nml-request-${utils.general.shortid()}`] });
64
64
  logger.log('Request "takeScreenshots" called with settings', settings);
65
65
  const { localEnvironment, renderEnvironments, environmentSettings } = await (0, get_environments_info_1.getNMLEnvironmentsInfo)({
@@ -81,6 +81,7 @@ function makeNMLRequests({ settings, logger: mainLogger, }) {
81
81
  deviceList: !localEnvironment ? environmentSettings : undefined,
82
82
  scrollRootElement: fallbackId(settings.scrollRootElement),
83
83
  region: fallbackId(settings.region),
84
+ sendDom: settings.sendDom,
84
85
  selectorsToFindRegionsFor: (_a = settings.selectorsToFindRegionsFor) === null || _a === void 0 ? void 0 : _a.map(selector => fallbackId(selector)),
85
86
  },
86
87
  },
@@ -96,26 +97,37 @@ function makeNMLRequests({ settings, logger: mainLogger, }) {
96
97
  {
97
98
  image: result.payload.result[0].result.screenshotUrl,
98
99
  environment: localEnvironment,
99
- calculateRegions: (_b = result.payload.result[0].result) === null || _b === void 0 ? void 0 : _b.selectorRegions,
100
+ calculateRegions: result.payload.result[0].result.selectorRegions,
101
+ dom: result.payload.result[0].result.dom,
100
102
  },
101
103
  ]
102
104
  : renderEnvironments.map((environment, index) => {
103
- var _a;
104
105
  if (result.payload.result[index].error) {
105
106
  throw new Error(`There was a problem in taking screenshot for environment ${JSON.stringify(environment)}. The provided error message was "${result.payload.result[index].error.message}" and had a stack trace of "${result.payload.result[index].error.stack}"`);
106
107
  }
107
108
  return {
108
109
  image: result.payload.result[index].result.screenshotUrl,
109
- calculateRegions: (_a = result.payload.result[index].result) === null || _a === void 0 ? void 0 : _a.selectorRegions,
110
+ calculateRegions: result.payload.result[index].result.selectorRegions,
111
+ dom: result.payload.result[index].result.dom,
110
112
  environment,
111
113
  };
112
114
  });
113
115
  }
114
116
  else {
115
117
  screenshots = localEnvironment
116
- ? [{ image: result.payload.result.screenshotUrl, environment: localEnvironment }]
118
+ ? [
119
+ {
120
+ image: result.payload.result.screenshotUrl,
121
+ environment: localEnvironment,
122
+ dom: result.payload.result.dom,
123
+ },
124
+ ]
117
125
  : renderEnvironments.map((environment, index) => {
118
- return { image: result.payload[index].result.screenshotUrl, environment };
126
+ return {
127
+ image: result.payload[index].result.screenshotUrl,
128
+ dom: result.payload[index].result.dom,
129
+ environment,
130
+ };
119
131
  });
120
132
  }
121
133
  logger.log('Request "takeScreenshots" finished successfully with body', screenshots);
package/dist/types.js CHANGED
@@ -1,2 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DomResult = void 0;
4
+ class DomResult {
5
+ }
6
+ exports.DomResult = DomResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/nml-client",
3
- "version": "1.8.27",
3
+ "version": "1.9.1",
4
4
  "description": "Client to integrate the SDKs to the Native Mobile Library (NML)",
5
5
  "homepage": "https://applitools.com",
6
6
  "bugs": {
@@ -37,11 +37,11 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@applitools/logger": "2.1.2",
40
- "@applitools/req": "1.7.9",
40
+ "@applitools/req": "1.7.10",
41
41
  "@applitools/utils": "1.8.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@applitools/spec-driver-webdriver": "^1.2.1",
44
+ "@applitools/spec-driver-webdriver": "^1.2.2",
45
45
  "@applitools/test-server": "^1.2.2",
46
46
  "@applitools/test-utils": "^1.5.17",
47
47
  "@types/node": "^12.20.55",
package/types/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Size, Location, Region } from '@applitools/utils';
2
+ import { TestError } from '@applitools/core-base';
2
3
  import { type Logger } from '@applitools/logger';
3
4
  import { type Proxy } from '@applitools/req';
4
5
  export interface NMLClient {
@@ -74,13 +75,18 @@ export type ScreenshotSettings = {
74
75
  };
75
76
  selectorsToFindRegionsFor?: Selector[];
76
77
  name?: string;
78
+ sendDom?: boolean;
77
79
  };
80
+ export declare class DomResult {
81
+ url?: string;
82
+ error?: TestError;
83
+ }
78
84
  export type Screenshot = {
79
85
  image: string;
80
86
  size?: Size;
81
87
  name?: string;
82
88
  source?: string;
83
- dom?: string;
89
+ dom?: DomResult;
84
90
  locationInViewport?: Location;
85
91
  locationInView?: Location;
86
92
  fullViewSize?: Size;