@applitools/core 4.15.0 → 4.16.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 +195 -0
- package/dist/autonomous/core.js +1 -1
- package/dist/autonomous/create-render-results.js +17 -1
- package/dist/classic/check-and-close.js +27 -2
- package/dist/classic/check.js +41 -6
- package/dist/ufg/check-and-close.js +27 -2
- package/dist/ufg/check.js +27 -2
- package/dist/ufg/take-snapshots.js +8 -8
- package/package.json +18 -18
- package/types/autonomous/create-render-results.d.ts +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,200 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.16.1](https://github.com/Applitools-Dev/sdk/compare/js/core@4.16.0...js/core@4.16.1) (2024-05-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* @applitools/utils bumped to 1.7.3
|
|
14
|
+
#### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
17
|
+
* @applitools/logger bumped to 2.0.17
|
|
18
|
+
#### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
* @applitools/socket bumped to 1.1.17
|
|
25
|
+
#### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
* @applitools/req bumped to 1.7.1
|
|
32
|
+
#### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
* @applitools/image bumped to 1.1.12
|
|
39
|
+
#### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
* @applitools/snippets bumped to 2.4.26
|
|
46
|
+
#### Bug Fixes
|
|
47
|
+
|
|
48
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
49
|
+
* @applitools/css-tree bumped to 1.1.3
|
|
50
|
+
#### Bug Fixes
|
|
51
|
+
|
|
52
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
53
|
+
* @applitools/dom-shared bumped to 1.0.14
|
|
54
|
+
#### Bug Fixes
|
|
55
|
+
|
|
56
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
57
|
+
* @applitools/dom-capture bumped to 11.2.8
|
|
58
|
+
#### Bug Fixes
|
|
59
|
+
|
|
60
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
* @applitools/dom-snapshot bumped to 4.11.2
|
|
65
|
+
#### Bug Fixes
|
|
66
|
+
|
|
67
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
* @applitools/spec-driver-webdriver bumped to 1.1.8
|
|
72
|
+
#### Bug Fixes
|
|
73
|
+
|
|
74
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
* @applitools/spec-driver-selenium bumped to 1.5.79
|
|
79
|
+
#### Bug Fixes
|
|
80
|
+
|
|
81
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
* @applitools/spec-driver-puppeteer bumped to 1.4.8
|
|
86
|
+
#### Bug Fixes
|
|
87
|
+
|
|
88
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
* @applitools/driver bumped to 1.17.3
|
|
93
|
+
#### Bug Fixes
|
|
94
|
+
|
|
95
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
* @applitools/screenshoter bumped to 3.8.32
|
|
100
|
+
#### Bug Fixes
|
|
101
|
+
|
|
102
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
* @applitools/nml-client bumped to 1.8.6
|
|
107
|
+
#### Bug Fixes
|
|
108
|
+
|
|
109
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
* @applitools/tunnel-client bumped to 1.5.4
|
|
114
|
+
#### Bug Fixes
|
|
115
|
+
|
|
116
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
* @applitools/ufg-client bumped to 1.12.1
|
|
121
|
+
#### Bug Fixes
|
|
122
|
+
|
|
123
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
* @applitools/ec-client bumped to 1.8.7
|
|
128
|
+
#### Bug Fixes
|
|
129
|
+
|
|
130
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
* @applitools/core-base bumped to 1.15.1
|
|
135
|
+
#### Bug Fixes
|
|
136
|
+
|
|
137
|
+
* trigger release ([88c4f81](https://github.com/Applitools-Dev/sdk/commit/88c4f812bd92eae61ee8ebbee5da0d64ad8c8859))
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## [4.16.0](https://github.com/Applitools-Dev/sdk/compare/js/core@4.15.0...js/core@4.16.0) (2024-05-28)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
### Features
|
|
146
|
+
|
|
147
|
+
* tell Splunk when clients assume `Target`'s mutability ([#2266](https://github.com/Applitools-Dev/sdk/issues/2266)) ([d18a524](https://github.com/Applitools-Dev/sdk/commit/d18a52491fb6a64e780f84ccff1dcf945351bf95))
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
### Bug Fixes
|
|
151
|
+
|
|
152
|
+
* multiple heartbeats for multiple runners in the same process ([#2372](https://github.com/Applitools-Dev/sdk/issues/2372)) ([6ec0f0d](https://github.com/Applitools-Dev/sdk/commit/6ec0f0de7d69a69cdab8437df910a82df15479ea))
|
|
153
|
+
* throw from createRenderResults if rendering failed ([#2352](https://github.com/Applitools-Dev/sdk/issues/2352)) ([50b0394](https://github.com/Applitools-Dev/sdk/commit/50b0394f35464f4d61dd578bf7e84947af00b99b))
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
### Performance Improvements
|
|
157
|
+
|
|
158
|
+
* don't wait for ufg client when take-snapshots performed on non-… ([#2366](https://github.com/Applitools-Dev/sdk/issues/2366)) ([4d8ab41](https://github.com/Applitools-Dev/sdk/commit/4d8ab41a421ff9b7f6f7d107bc8c5e9647404430))
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
### Code Refactoring
|
|
162
|
+
|
|
163
|
+
* remove eyesServerUrl and apiKey when not necessary ([#2345](https://github.com/Applitools-Dev/sdk/issues/2345)) ([121ae5d](https://github.com/Applitools-Dev/sdk/commit/121ae5d00417d70d9857b8199b4bcfd92de353c6))
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
### Dependencies
|
|
167
|
+
|
|
168
|
+
* @applitools/req bumped to 1.7.0
|
|
169
|
+
#### Features
|
|
170
|
+
|
|
171
|
+
* dynamic timeout based on uploaded file size ([#2364](https://github.com/Applitools-Dev/sdk/issues/2364)) ([8a82d68](https://github.com/Applitools-Dev/sdk/commit/8a82d6839ace60fda27e153ba233019f137017fe))
|
|
172
|
+
* @applitools/ufg-client bumped to 1.12.0
|
|
173
|
+
#### Features
|
|
174
|
+
|
|
175
|
+
* dynamic timeout based on uploaded file size ([#2364](https://github.com/Applitools-Dev/sdk/issues/2364)) ([8a82d68](https://github.com/Applitools-Dev/sdk/commit/8a82d6839ace60fda27e153ba233019f137017fe))
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
* @applitools/nml-client bumped to 1.8.5
|
|
180
|
+
|
|
181
|
+
* @applitools/tunnel-client bumped to 1.5.3
|
|
182
|
+
|
|
183
|
+
* @applitools/ec-client bumped to 1.8.6
|
|
184
|
+
|
|
185
|
+
* @applitools/core-base bumped to 1.15.0
|
|
186
|
+
#### Features
|
|
187
|
+
|
|
188
|
+
* tell Splunk when clients assume `Target`'s mutability ([#2266](https://github.com/Applitools-Dev/sdk/issues/2266)) ([d18a524](https://github.com/Applitools-Dev/sdk/commit/d18a52491fb6a64e780f84ccff1dcf945351bf95))
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
#### Bug Fixes
|
|
192
|
+
|
|
193
|
+
* multiple heartbeats for multiple runners in the same process ([#2372](https://github.com/Applitools-Dev/sdk/issues/2372)) ([6ec0f0d](https://github.com/Applitools-Dev/sdk/commit/6ec0f0de7d69a69cdab8437df910a82df15479ea))
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
3
198
|
## [4.15.0](https://github.com/Applitools-Dev/sdk/compare/js/core@4.14.0...js/core@4.15.0) (2024-05-07)
|
|
4
199
|
|
|
5
200
|
|
package/dist/autonomous/core.js
CHANGED
|
@@ -18,7 +18,7 @@ function makeAutonomousCore({ spec, clients, base: defaultBase, asyncCache, agen
|
|
|
18
18
|
createRenderTarget: (0, create_render_target_1.makeCreateRenderTarget)({ core, logger }),
|
|
19
19
|
startRenders: (0, start_renders_1.makeStartRenders)({ core, logger }),
|
|
20
20
|
getRenderResults: (0, get_render_results_1.makeGetRenderResults)({ core, logger }),
|
|
21
|
-
createRenderResults: (0, create_render_results_1.makeCreateRenderResults)({
|
|
21
|
+
createRenderResults: (0, create_render_results_1.makeCreateRenderResults)({ logger }),
|
|
22
22
|
openEyes: (0, open_eyes_1.makeOpenEyes)({ core, logger }),
|
|
23
23
|
};
|
|
24
24
|
}
|
|
@@ -3,9 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.makeCreateRenderResults = void 0;
|
|
4
4
|
const ufg_client_1 = require("@applitools/ufg-client");
|
|
5
5
|
const to_base_check_settings_1 = require("../automation/utils/to-base-check-settings");
|
|
6
|
-
function makeCreateRenderResults(
|
|
6
|
+
function makeCreateRenderResults({ logger }) {
|
|
7
|
+
/**
|
|
8
|
+
* Autonomous should call this function to create render results after rendering is done.
|
|
9
|
+
* After the UFG finishes rendering, it creates a new message in azure service bus, containing the raw render results.
|
|
10
|
+
* This function is responsible for converting the raw render results into a format that can be used by the core.
|
|
11
|
+
* It assumes that the rendering is finished, and it will throw an error if the rendering failed.
|
|
12
|
+
*/
|
|
7
13
|
return async function createRenderResults({ renders, rawResults, }) {
|
|
8
14
|
const results = rawResults.map((rawResult, index) => (0, ufg_client_1.toRenderResult)(rawResult, { renderId: renders[index].render.renderId }));
|
|
15
|
+
results.forEach((result, index) => {
|
|
16
|
+
if (result.status === 'error') {
|
|
17
|
+
logger.error(`Render with id "${renders[index].render.renderId}" failed due to an error - ${result.error}`);
|
|
18
|
+
throw new Error(`Render with id "${renders[index].render.renderId}" failed due to an error - ${result.error}`);
|
|
19
|
+
}
|
|
20
|
+
else if (result.status !== 'rendered') {
|
|
21
|
+
// most probably rendering is still in progress
|
|
22
|
+
throw new Error(`Unexpected status ${result.status} in get render results response`);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
9
25
|
return results.map(({ selectorRegions, renderId, status, error, ...baseTarget }, index) => {
|
|
10
26
|
const { elementReferences: selectors, getBaseCheckSettings } = (0, to_base_check_settings_1.toBaseCheckSettings)({
|
|
11
27
|
settings: renders[index].settings,
|
|
@@ -155,7 +155,7 @@ function makeCheckAndClose({ eyes, target: defaultTarget, environments: defaultE
|
|
|
155
155
|
baseSettings.push(settings);
|
|
156
156
|
}
|
|
157
157
|
const promises = exactEnvironments.map(async (environment, index) => {
|
|
158
|
-
var _a, _b, _c;
|
|
158
|
+
var _a, _b, _c, _d;
|
|
159
159
|
const environmentLogger = logger.extend({ tags: [`environment-${utils.general.shortid()}`] });
|
|
160
160
|
try {
|
|
161
161
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
@@ -172,6 +172,31 @@ function makeCheckAndClose({ eyes, target: defaultTarget, environments: defaultE
|
|
|
172
172
|
environmentLogger.warn(`Check on environment with id "${(_a = baseEyes.test.environment) === null || _a === void 0 ? void 0 : _a.environmentId}" was aborted during one of the previous steps`);
|
|
173
173
|
throw new abort_error_1.AbortError(`Check on environment with id "${(_b = baseEyes.test.environment) === null || _b === void 0 ? void 0 : _b.environmentId}" was aborted during one of the previous steps`);
|
|
174
174
|
}
|
|
175
|
+
if (settings.assumesMutability) {
|
|
176
|
+
eyes.core.logEvent({
|
|
177
|
+
settings: {
|
|
178
|
+
level: 'Notice',
|
|
179
|
+
event: {
|
|
180
|
+
type: 'eyes.check',
|
|
181
|
+
message: 'Assuming mutability for check Target',
|
|
182
|
+
test: {
|
|
183
|
+
checkName: settings.name,
|
|
184
|
+
batchId: baseEyes.test.batchId,
|
|
185
|
+
sessionId: baseEyes.test.sessionId,
|
|
186
|
+
testName: baseEyes.test.testName,
|
|
187
|
+
testId: baseEyes.test.testId,
|
|
188
|
+
userTestId: baseEyes.test.userTestId,
|
|
189
|
+
appId: baseEyes.test.appId,
|
|
190
|
+
baselineId: baseEyes.test.baselineId,
|
|
191
|
+
environmentId: (_c = baseEyes.test.environment) === null || _c === void 0 ? void 0 : _c.environmentId,
|
|
192
|
+
},
|
|
193
|
+
isNew: baseEyes.test.isNew,
|
|
194
|
+
resultsUrl: baseEyes.test.resultsUrl,
|
|
195
|
+
},
|
|
196
|
+
...eyes.test.eyesServer,
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
}
|
|
175
200
|
await baseEyes.checkAndClose({
|
|
176
201
|
target: baseTargets[index],
|
|
177
202
|
settings: baseSettings[index],
|
|
@@ -179,7 +204,7 @@ function makeCheckAndClose({ eyes, target: defaultTarget, environments: defaultE
|
|
|
179
204
|
});
|
|
180
205
|
}
|
|
181
206
|
catch (error) {
|
|
182
|
-
environmentLogger.error(`Check on environment with id "${(
|
|
207
|
+
environmentLogger.error(`Check on environment with id "${(_d = baseEyes.test.environment) === null || _d === void 0 ? void 0 : _d.environmentId}" failed due to an error`, error);
|
|
183
208
|
if (baseEyes.running && !(signal === null || signal === void 0 ? void 0 : signal.aborted))
|
|
184
209
|
await baseEyes.abort({ logger: environmentLogger, settings: { reason: error } });
|
|
185
210
|
}
|
package/dist/classic/check.js
CHANGED
|
@@ -59,7 +59,11 @@ function makeCheck({ eyes, target: defaultTarget, environments: defaultEnvironme
|
|
|
59
59
|
// when retry timeout is set, retry checking until it passes or timeout is reached. This will stall the client test execution until it passes or timeout is reached to prevent the test from continuing and changing the state of the app
|
|
60
60
|
logger.log(`Retry timeout is set to ${settings.retryTimeout}ms - will retry checking until it passes or timeout is reached`);
|
|
61
61
|
const start = Date.now();
|
|
62
|
-
|
|
62
|
+
const environmentLogger = logger.extend({ tags: [`environment-${utils.general.shortid()}`] });
|
|
63
|
+
// this getter actually open the eyes session if it's not already open
|
|
64
|
+
const baseEyes = await Promise.all(uniqueEnvironments.map(environment => getBaseEyes({ environment, driver, logger: environmentLogger })));
|
|
65
|
+
// if the test is new for any of the environments, we wait for the page to stabaliize before starting the checks. This should prevent us from creating a baseline with a loading spinner or something similar
|
|
66
|
+
if (baseEyes.map(baseEye => baseEye.test.isNew).some(isNew => isNew)) {
|
|
63
67
|
await new Promise(resolve => setTimeout(resolve, settings.retryTimeout));
|
|
64
68
|
}
|
|
65
69
|
let asExpected = false, retries = 0;
|
|
@@ -117,13 +121,39 @@ function makeCheck({ eyes, target: defaultTarget, environments: defaultEnvironme
|
|
|
117
121
|
item.jobs.push(promise.then());
|
|
118
122
|
return item;
|
|
119
123
|
}
|
|
124
|
+
function getBaseEyes({ environment, driver, logger, }) {
|
|
125
|
+
return eyes.getBaseEyes({ settings: { environment, driver }, logger });
|
|
126
|
+
}
|
|
120
127
|
}
|
|
121
128
|
exports.makeCheck = makeCheck;
|
|
122
|
-
async function
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
async function logAmmutabilityIfNeeded({ eyes, baseEyes, settings, }) {
|
|
130
|
+
var _a;
|
|
131
|
+
if (settings.assumesMutability) {
|
|
132
|
+
await eyes.core.logEvent({
|
|
133
|
+
settings: {
|
|
134
|
+
level: 'Notice',
|
|
135
|
+
event: {
|
|
136
|
+
type: 'eyes.check',
|
|
137
|
+
message: 'Assuming mutability for check Target',
|
|
138
|
+
test: {
|
|
139
|
+
checkName: settings.name,
|
|
140
|
+
batchId: baseEyes.test.batchId,
|
|
141
|
+
sessionId: baseEyes.test.sessionId,
|
|
142
|
+
testName: baseEyes.test.testName,
|
|
143
|
+
testId: baseEyes.test.testId,
|
|
144
|
+
userTestId: baseEyes.test.userTestId,
|
|
145
|
+
appId: baseEyes.test.appId,
|
|
146
|
+
baselineId: baseEyes.test.baselineId,
|
|
147
|
+
environmentId: (_a = baseEyes.test.environment) === null || _a === void 0 ? void 0 : _a.environmentId,
|
|
148
|
+
},
|
|
149
|
+
isNew: baseEyes.test.isNew,
|
|
150
|
+
resultsUrl: baseEyes.test.resultsUrl,
|
|
151
|
+
},
|
|
152
|
+
...eyes.test.eyesServer,
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
settings.assumesMutability = false; // prevent from logging this message again for the same check
|
|
156
|
+
}
|
|
127
157
|
}
|
|
128
158
|
async function checkEnvironment({ eyes, driver, target, environment, signal, logger, settings, }) {
|
|
129
159
|
var _a, _b;
|
|
@@ -134,6 +164,11 @@ async function checkEnvironment({ eyes, driver, target, environment, signal, log
|
|
|
134
164
|
abortError({ logger: environmentLogger, message: 'Command "check" was aborted before checking' });
|
|
135
165
|
}
|
|
136
166
|
const baseEyes = await eyes.getBaseEyes({ settings: { environment, driver }, logger: environmentLogger });
|
|
167
|
+
void logAmmutabilityIfNeeded({
|
|
168
|
+
eyes,
|
|
169
|
+
baseEyes,
|
|
170
|
+
settings,
|
|
171
|
+
});
|
|
137
172
|
try {
|
|
138
173
|
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
139
174
|
abortError({
|
|
@@ -117,7 +117,7 @@ function makeCheckAndClose({ eyes, target: defaultTarget, environments: defaultE
|
|
|
117
117
|
}
|
|
118
118
|
const generatedSelectors = snapshots.map(snapshot => getGeneratedSelectors(utils.types.has(snapshot, 'generatedSelectors') ? snapshot.generatedSelectors : undefined));
|
|
119
119
|
const promises = uniqueEnvironments.map(async (environment, index) => {
|
|
120
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
120
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
121
121
|
const environmentLogger = logger.extend({ tags: [`environment-${utils.general.shortid()}`] });
|
|
122
122
|
const ufgEnvironment = environment;
|
|
123
123
|
if (utils.types.has(ufgEnvironment, 'name') && ufgEnvironment.name === 'edge') {
|
|
@@ -200,6 +200,31 @@ function makeCheckAndClose({ eyes, target: defaultTarget, environments: defaultE
|
|
|
200
200
|
environmentLogger.warn(`Render on environment with id "${(_f = baseEyes.test.environment) === null || _f === void 0 ? void 0 : _f.environmentId}" was aborted during one of the previous steps`);
|
|
201
201
|
throw new abort_error_1.AbortError(`Render on environment with id "${(_g = baseEyes.test.environment) === null || _g === void 0 ? void 0 : _g.environmentId}" was aborted during one of the previous steps`);
|
|
202
202
|
}
|
|
203
|
+
if (settings.assumesMutability) {
|
|
204
|
+
eyes.core.logEvent({
|
|
205
|
+
settings: {
|
|
206
|
+
level: 'Notice',
|
|
207
|
+
event: {
|
|
208
|
+
type: 'eyes.check',
|
|
209
|
+
message: 'Assuming mutability for check Target',
|
|
210
|
+
test: {
|
|
211
|
+
checkName: settings.name,
|
|
212
|
+
batchId: baseEyes.test.batchId,
|
|
213
|
+
sessionId: baseEyes.test.sessionId,
|
|
214
|
+
testName: baseEyes.test.testName,
|
|
215
|
+
testId: baseEyes.test.testId,
|
|
216
|
+
userTestId: baseEyes.test.userTestId,
|
|
217
|
+
appId: baseEyes.test.appId,
|
|
218
|
+
baselineId: baseEyes.test.baselineId,
|
|
219
|
+
environmentId: (_h = baseEyes.test.environment) === null || _h === void 0 ? void 0 : _h.environmentId,
|
|
220
|
+
},
|
|
221
|
+
isNew: baseEyes.test.isNew,
|
|
222
|
+
resultsUrl: baseEyes.test.resultsUrl,
|
|
223
|
+
},
|
|
224
|
+
...eyes.test.eyesServer,
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
}
|
|
203
228
|
await baseEyes.checkAndClose({
|
|
204
229
|
target: { ...baseTarget, isTransformed: true },
|
|
205
230
|
settings: baseSettings,
|
|
@@ -207,7 +232,7 @@ function makeCheckAndClose({ eyes, target: defaultTarget, environments: defaultE
|
|
|
207
232
|
});
|
|
208
233
|
}
|
|
209
234
|
catch (error) {
|
|
210
|
-
environmentLogger.error(`Render on environment with id "${(
|
|
235
|
+
environmentLogger.error(`Render on environment with id "${(_j = baseEyes.test.environment) === null || _j === void 0 ? void 0 : _j.environmentId}" failed due to an error`, error);
|
|
211
236
|
if (baseEyes.running && !(signal === null || signal === void 0 ? void 0 : signal.aborted))
|
|
212
237
|
await baseEyes.abort({ logger: environmentLogger, settings: { reason: error } });
|
|
213
238
|
}
|
package/dist/ufg/check.js
CHANGED
|
@@ -117,7 +117,7 @@ function makeCheck({ eyes, target: defaultTarget, environments: defaultEnvironme
|
|
|
117
117
|
}
|
|
118
118
|
const generatedSelectors = snapshots.map(snapshot => getGeneratedSelectors(utils.types.has(snapshot, 'generatedSelectors') ? snapshot.generatedSelectors : undefined));
|
|
119
119
|
const promises = uniqueEnvironments.map(async (environment, index) => {
|
|
120
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
120
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
121
121
|
const environmentLogger = logger.extend({ tags: [`environment-${utils.general.shortid()}`] });
|
|
122
122
|
const ufgEnvironment = environment;
|
|
123
123
|
if (utils.types.has(ufgEnvironment, 'name') && ufgEnvironment.name === 'edge') {
|
|
@@ -200,6 +200,31 @@ function makeCheck({ eyes, target: defaultTarget, environments: defaultEnvironme
|
|
|
200
200
|
environmentLogger.warn(`Render on environment with id "${(_f = baseEyes.test.environment) === null || _f === void 0 ? void 0 : _f.environmentId}" was aborted during one of the previous steps`);
|
|
201
201
|
throw new abort_error_1.AbortError(`Render on environment with id "${(_g = baseEyes.test.environment) === null || _g === void 0 ? void 0 : _g.environmentId}" was aborted during one of the previous steps`);
|
|
202
202
|
}
|
|
203
|
+
if (settings.assumesMutability) {
|
|
204
|
+
eyes.core.logEvent({
|
|
205
|
+
settings: {
|
|
206
|
+
level: 'Notice',
|
|
207
|
+
event: {
|
|
208
|
+
type: 'eyes.check',
|
|
209
|
+
message: 'Assuming mutability for check Target',
|
|
210
|
+
test: {
|
|
211
|
+
checkName: settings.name,
|
|
212
|
+
batchId: baseEyes.test.batchId,
|
|
213
|
+
sessionId: baseEyes.test.sessionId,
|
|
214
|
+
testName: baseEyes.test.testName,
|
|
215
|
+
testId: baseEyes.test.testId,
|
|
216
|
+
userTestId: baseEyes.test.userTestId,
|
|
217
|
+
appId: baseEyes.test.appId,
|
|
218
|
+
baselineId: baseEyes.test.baselineId,
|
|
219
|
+
environmentId: (_h = baseEyes.test.environment) === null || _h === void 0 ? void 0 : _h.environmentId,
|
|
220
|
+
},
|
|
221
|
+
isNew: baseEyes.test.isNew,
|
|
222
|
+
resultsUrl: baseEyes.test.resultsUrl,
|
|
223
|
+
},
|
|
224
|
+
...eyes.test.eyesServer,
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
}
|
|
203
228
|
await baseEyes.check({
|
|
204
229
|
target: { ...baseTarget, isTransformed: true },
|
|
205
230
|
settings: baseSettings,
|
|
@@ -207,7 +232,7 @@ function makeCheck({ eyes, target: defaultTarget, environments: defaultEnvironme
|
|
|
207
232
|
});
|
|
208
233
|
}
|
|
209
234
|
catch (error) {
|
|
210
|
-
environmentLogger.error(`Render on environment with id "${(
|
|
235
|
+
environmentLogger.error(`Render on environment with id "${(_j = baseEyes.test.environment) === null || _j === void 0 ? void 0 : _j.environmentId}" failed due to an error`, error);
|
|
211
236
|
if (baseEyes.running && !(signal === null || signal === void 0 ? void 0 : signal.aborted))
|
|
212
237
|
await baseEyes.abort({ logger: environmentLogger, settings: { reason: error } });
|
|
213
238
|
}
|
|
@@ -41,14 +41,6 @@ function makeTakeSnapshots({ core, spec, signal, logger: mainLogger }) {
|
|
|
41
41
|
throw new abort_error_1.AbortError('Command "takeSnapshots" was called after test was already aborted');
|
|
42
42
|
}
|
|
43
43
|
const uniqueEnvironments = (0, uniquify_environments_1.uniquifyEnvironments)((_a = settings.environments) !== null && _a !== void 0 ? _a : defaultEnvironments);
|
|
44
|
-
const ufgClient = await core.getUFGClient({
|
|
45
|
-
settings: {
|
|
46
|
-
...account.ufgServer,
|
|
47
|
-
eyesServerUrl: account.eyesServer.eyesServerUrl,
|
|
48
|
-
apiKey: account.eyesServer.apiKey,
|
|
49
|
-
},
|
|
50
|
-
logger,
|
|
51
|
-
});
|
|
52
44
|
const driver = spec && target ? await (0, driver_1.makeDriver)({ spec, driver: target, logger }) : null;
|
|
53
45
|
if (!driver)
|
|
54
46
|
throw new Error('Cannot create check snapshot without a driver');
|
|
@@ -62,6 +54,14 @@ function makeTakeSnapshots({ core, spec, signal, logger: mainLogger }) {
|
|
|
62
54
|
});
|
|
63
55
|
let snapshots;
|
|
64
56
|
if (environment.isWeb) {
|
|
57
|
+
const ufgClient = await core.getUFGClient({
|
|
58
|
+
settings: {
|
|
59
|
+
...account.ufgServer,
|
|
60
|
+
eyesServerUrl: account.eyesServer.eyesServerUrl,
|
|
61
|
+
apiKey: account.eyesServer.apiKey,
|
|
62
|
+
},
|
|
63
|
+
logger,
|
|
64
|
+
});
|
|
65
65
|
snapshots = await (0, take_dom_snapshots_1.takeDomSnapshots)({
|
|
66
66
|
driver,
|
|
67
67
|
settings: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.16.1",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1/issues"
|
|
@@ -74,20 +74,20 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@applitools/core-base": "1.
|
|
78
|
-
"@applitools/dom-capture": "11.2.
|
|
79
|
-
"@applitools/dom-snapshot": "4.11.
|
|
80
|
-
"@applitools/driver": "1.17.
|
|
81
|
-
"@applitools/ec-client": "1.8.
|
|
82
|
-
"@applitools/logger": "2.0.
|
|
83
|
-
"@applitools/nml-client": "1.8.
|
|
84
|
-
"@applitools/req": "1.
|
|
85
|
-
"@applitools/screenshoter": "3.8.
|
|
86
|
-
"@applitools/snippets": "2.4.
|
|
87
|
-
"@applitools/socket": "1.1.
|
|
88
|
-
"@applitools/spec-driver-webdriver": "1.1.
|
|
89
|
-
"@applitools/ufg-client": "1.
|
|
90
|
-
"@applitools/utils": "1.7.
|
|
77
|
+
"@applitools/core-base": "1.15.1",
|
|
78
|
+
"@applitools/dom-capture": "11.2.8",
|
|
79
|
+
"@applitools/dom-snapshot": "4.11.2",
|
|
80
|
+
"@applitools/driver": "1.17.3",
|
|
81
|
+
"@applitools/ec-client": "1.8.7",
|
|
82
|
+
"@applitools/logger": "2.0.17",
|
|
83
|
+
"@applitools/nml-client": "1.8.6",
|
|
84
|
+
"@applitools/req": "1.7.1",
|
|
85
|
+
"@applitools/screenshoter": "3.8.32",
|
|
86
|
+
"@applitools/snippets": "2.4.26",
|
|
87
|
+
"@applitools/socket": "1.1.17",
|
|
88
|
+
"@applitools/spec-driver-webdriver": "1.1.8",
|
|
89
|
+
"@applitools/ufg-client": "1.12.1",
|
|
90
|
+
"@applitools/utils": "1.7.3",
|
|
91
91
|
"@types/ws": "8.5.5",
|
|
92
92
|
"abort-controller": "3.0.0",
|
|
93
93
|
"chalk": "4.1.2",
|
|
@@ -100,11 +100,11 @@
|
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@applitools/bongo": "^5.10.0",
|
|
102
102
|
"@applitools/sea": "^1.0.0",
|
|
103
|
-
"@applitools/spec-driver-puppeteer": "^1.4.
|
|
104
|
-
"@applitools/spec-driver-selenium": "^1.5.
|
|
103
|
+
"@applitools/spec-driver-puppeteer": "^1.4.8",
|
|
104
|
+
"@applitools/spec-driver-selenium": "^1.5.79",
|
|
105
105
|
"@applitools/test-server": "^1.2.2",
|
|
106
106
|
"@applitools/test-utils": "^1.5.17",
|
|
107
|
-
"@applitools/tunnel-client": "^1.5.
|
|
107
|
+
"@applitools/tunnel-client": "^1.5.4",
|
|
108
108
|
"@types/node": "^12.20.55",
|
|
109
109
|
"@types/selenium-webdriver": "^4.1.2",
|
|
110
110
|
"@types/semver": "^7.5.4",
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type { Core as UFGCore } from '../ufg/types';
|
|
2
1
|
import type { StartedRender, RenderResult } from './types';
|
|
3
2
|
import { type Logger } from '@applitools/logger';
|
|
4
3
|
type Options = {
|
|
5
|
-
core: UFGCore<any>;
|
|
6
4
|
logger: Logger;
|
|
7
5
|
};
|
|
8
|
-
export declare function makeCreateRenderResults(
|
|
6
|
+
export declare function makeCreateRenderResults({ logger }: Options): ({ renders, rawResults, }: {
|
|
9
7
|
renders: StartedRender[];
|
|
10
8
|
rawResults: any[];
|
|
11
|
-
logger: Logger;
|
|
12
9
|
}) => Promise<RenderResult[]>;
|
|
13
10
|
export {};
|