@applitools/nml-client 1.8.26 → 1.9.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 CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## [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)
4
+
5
+
6
+ ### Features
7
+
8
+ * add accessibility field to screenshot ([#2815](https://github.com/Applitools-Dev/sdk/issues/2815)) ([3d111f3](https://github.com/Applitools-Dev/sdk/commit/3d111f354c5eedeb8914f18318ccecce5fd13002))
9
+
10
+ ## [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)
11
+
12
+
13
+ ### Dependencies
14
+
15
+ * @applitools/utils bumped to 1.8.0
16
+ #### Features
17
+
18
+ * allow sending callback functions to waitBeforeCapture ([#2780](https://github.com/Applitools-Dev/sdk/issues/2780)) ([4caa2e8](https://github.com/Applitools-Dev/sdk/commit/4caa2e8ae055d3dd48164eeceaa4c691eeadcdd4))
19
+ * @applitools/driver bumped to 1.21.0
20
+ #### Features
21
+
22
+ * allow sending callback functions to waitBeforeCapture ([#2780](https://github.com/Applitools-Dev/sdk/issues/2780)) ([4caa2e8](https://github.com/Applitools-Dev/sdk/commit/4caa2e8ae055d3dd48164eeceaa4c691eeadcdd4))
23
+
24
+
25
+
26
+ * @applitools/logger bumped to 2.1.2
27
+
28
+ * @applitools/req bumped to 1.7.9
29
+
30
+ * @applitools/spec-driver-webdriver bumped to 1.2.1
31
+
32
+
3
33
  ## [1.8.26](https://github.com/Applitools-Dev/sdk/compare/js/nml-client@1.8.25...js/nml-client@1.8.26) (2025-03-13)
4
34
 
5
35
 
@@ -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.26",
3
+ "version": "1.9.0",
4
4
  "description": "Client to integrate the SDKs to the Native Mobile Library (NML)",
5
5
  "homepage": "https://applitools.com",
6
6
  "bugs": {
@@ -36,12 +36,12 @@
36
36
  "test": "run --top-level mocha './test/**/*.spec.ts' --parallel --jobs ${MOCHA_JOBS:-15}"
37
37
  },
38
38
  "dependencies": {
39
- "@applitools/logger": "2.1.1",
40
- "@applitools/req": "1.7.8",
41
- "@applitools/utils": "1.7.8"
39
+ "@applitools/logger": "2.1.2",
40
+ "@applitools/req": "1.7.9",
41
+ "@applitools/utils": "1.8.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@applitools/spec-driver-webdriver": "^1.2.0",
44
+ "@applitools/spec-driver-webdriver": "^1.2.1",
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;