@applitools/nml-client 1.5.17 → 1.6.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,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.6.0](https://github.com/applitools/eyes.sdk.javascript1/compare/js/nml-client@1.5.17...js/nml-client@1.6.0) (2023-12-12)
4
+
5
+
6
+ ### Features
7
+
8
+ * support updated applitools lib protocol ([#2086](https://github.com/applitools/eyes.sdk.javascript1/issues/2086)) ([31b49fc](https://github.com/applitools/eyes.sdk.javascript1/commit/31b49fc411c452d0b3da341fd701309714484485))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/driver bumped to 1.15.3
14
+ #### Bug Fixes
15
+
16
+ * layout breakpoints reload and lazy load ([#2073](https://github.com/applitools/eyes.sdk.javascript1/issues/2073)) ([ab2c49e](https://github.com/applitools/eyes.sdk.javascript1/commit/ab2c49ea1ecff3fef337637a83aa5bef755a7b01))
17
+ * @applitools/spec-driver-webdriver bumped to 1.0.52
18
+
19
+
3
20
  ## [1.5.17](https://github.com/applitools/eyes.sdk.javascript1/compare/js/nml-client@1.5.16...js/nml-client@1.5.17) (2023-12-05)
4
21
 
5
22
 
@@ -91,11 +91,25 @@ function makeNMLRequests({ settings, logger: mainLogger, }) {
91
91
  });
92
92
  const result = await response.json();
93
93
  brokerUrl = result.nextPath;
94
- const screenshots = localEnvironment
95
- ? [{ image: result.payload.result.screenshotUrl, environment: localEnvironment }]
96
- : renderEnvironments.map((environment, index) => {
97
- return { image: result.payload[index].result.screenshotUrl, environment };
98
- });
94
+ let screenshots;
95
+ if (Number(result.protocolVersion) >= 2) {
96
+ logger.log(`Request "takeScreenshots" was performed on applitools lib v${result.nmlVersion} through protocol v${result.protocolVersion} on device`, result.payload.debugInfo);
97
+ screenshots = localEnvironment
98
+ ? [{ image: result.payload.result[0].result.screenshotUrl, environment: localEnvironment }]
99
+ : renderEnvironments.map((environment, index) => {
100
+ if (result.payload.result[index].error) {
101
+ 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}"`);
102
+ }
103
+ return { image: result.payload.result[index].result.screenshotUrl, environment };
104
+ });
105
+ }
106
+ else {
107
+ screenshots = localEnvironment
108
+ ? [{ image: result.payload.result.screenshotUrl, environment: localEnvironment }]
109
+ : renderEnvironments.map((environment, index) => {
110
+ return { image: result.payload[index].result.screenshotUrl, environment };
111
+ });
112
+ }
99
113
  logger.log('Request "takeScreenshots" finished successfully with body', screenshots);
100
114
  return screenshots;
101
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/nml-client",
3
- "version": "1.5.17",
3
+ "version": "1.6.0",
4
4
  "description": "Client to integrate the SDKs to the Native Mobile Library (NML)",
5
5
  "homepage": "https://applitools.com",
6
6
  "bugs": {
@@ -41,7 +41,7 @@
41
41
  "@applitools/utils": "1.7.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@applitools/spec-driver-webdriver": "^1.0.51",
44
+ "@applitools/spec-driver-webdriver": "^1.0.52",
45
45
  "@applitools/test-server": "^1.2.2",
46
46
  "@applitools/test-utils": "^1.5.17",
47
47
  "@types/node": "^12.20.55",