@applitools/core 4.74.0 → 4.74.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 +23 -0
- package/dist/ufg/utils/take-dom-snapshots.js +36 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.74.1](https://github.com/Applitools-Dev/sdk/compare/js/core@4.74.0...js/core@4.74.1) (2026-11-02)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* restore the viewport and tear down the media guard when a breakpoint snapshot fails | FLD-4800 ([#4355](https://github.com/Applitools-Dev/sdk/issues/4355)) ([fac0583](https://github.com/Applitools-Dev/sdk/commit/fac0583425f2e5714ab9ed3c7afcb79ea85c6e6f))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* @applitools/nml-client bumped to 1.12.11
|
|
14
|
+
|
|
15
|
+
* @applitools/tunnel-client bumped to 1.12.9
|
|
16
|
+
#### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* stop leaking tunnel services and sessions | FLD-5000 ([#4344](https://github.com/Applitools-Dev/sdk/issues/4344)) ([0dd225d](https://github.com/Applitools-Dev/sdk/commit/0dd225d95382d32ebcc03e8a85b23a176bf75d6a))
|
|
19
|
+
* @applitools/core-base bumped to 1.41.4
|
|
20
|
+
#### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* mask presigned URL credentials from renderinfo when MASK_LOG is on | AD-17356 ([#4385](https://github.com/Applitools-Dev/sdk/issues/4385)) ([7dceaf6](https://github.com/Applitools-Dev/sdk/commit/7dceaf67410bd46cc9e356de14abe0024f326d4f))
|
|
23
|
+
* @applitools/ec-client bumped to 1.12.55
|
|
24
|
+
|
|
25
|
+
|
|
3
26
|
## [4.74.0](https://github.com/Applitools-Dev/sdk/compare/js/core@4.73.3...js/core@4.74.0) (2026-11-01)
|
|
4
27
|
|
|
5
28
|
|
|
@@ -39,6 +39,8 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
39
39
|
const utils = __importStar(require("@applitools/utils"));
|
|
40
40
|
const lang = __importStar(require("../../lang"));
|
|
41
41
|
__exportStar(require("./take-dom-snapshot"), exports);
|
|
42
|
+
/** Time limit for each cleanup step after a snapshot error. The call is not cancelled and may finish later. */
|
|
43
|
+
const CLEANUP_TIMEOUT_MS = 3000;
|
|
42
44
|
async function takeDomSnapshots({ driver, settings, hooks, provides, logger, }) {
|
|
43
45
|
var _a, _b;
|
|
44
46
|
// calculating cookies here once so that we (a) don't do it for each dom snapshot, and (b) do it before generating safe selectors
|
|
@@ -93,6 +95,7 @@ async function takeDomSnapshots({ driver, settings, hooks, provides, logger, })
|
|
|
93
95
|
// that rebuilds content on resize would otherwise be captured at the previous breakpoint's width.
|
|
94
96
|
const previousFocusEmulation = await driver.setFocusEmulation(true);
|
|
95
97
|
const snapshots = Array(settings.environments.length);
|
|
98
|
+
let loopFailed = false;
|
|
96
99
|
try {
|
|
97
100
|
for (const [index, { viewportSize, browsers }] of entries.entries()) {
|
|
98
101
|
logger.log(`Taking dom snapshot for viewport size ${viewportSize}`);
|
|
@@ -135,17 +138,47 @@ async function takeDomSnapshots({ driver, settings, hooks, provides, logger, })
|
|
|
135
138
|
browsers.forEach(({ index }) => (snapshots[index] = snapshot));
|
|
136
139
|
await mediaGuard.afterSnapshot();
|
|
137
140
|
}
|
|
138
|
-
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
loopFailed = true;
|
|
144
|
+
throw error;
|
|
139
145
|
}
|
|
140
146
|
finally {
|
|
141
|
-
|
|
147
|
+
if (loopFailed) {
|
|
148
|
+
// the tab may be stuck, so no cleanup step may hide the error that stopped the loop or block it
|
|
149
|
+
await cleanupAfterError('restore viewport size', () => driver.setViewportSize(initialViewportSize));
|
|
150
|
+
await cleanupAfterError('restore focus emulation', () => driver.setFocusEmulation(previousFocusEmulation));
|
|
151
|
+
await cleanupAfterError('tear down media guard', () => mediaGuard.teardown());
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
try {
|
|
155
|
+
await driver.setViewportSize(initialViewportSize);
|
|
156
|
+
}
|
|
157
|
+
finally {
|
|
158
|
+
await driver.setFocusEmulation(previousFocusEmulation);
|
|
159
|
+
await mediaGuard.teardown();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
142
162
|
}
|
|
143
|
-
await mediaGuard.teardown();
|
|
144
163
|
if (settings.layoutBreakpoints.reload) {
|
|
145
164
|
await driver.reloadPage();
|
|
146
165
|
await beforeEachSnapshot();
|
|
147
166
|
}
|
|
148
167
|
return snapshots;
|
|
168
|
+
async function cleanupAfterError(name, step) {
|
|
169
|
+
let timer;
|
|
170
|
+
const run = Promise.resolve()
|
|
171
|
+
.then(step)
|
|
172
|
+
.catch(error => logger.error(`Failed to ${name} after a snapshot error`, error));
|
|
173
|
+
const limit = new Promise(resolve => {
|
|
174
|
+
timer = setTimeout(() => {
|
|
175
|
+
logger.warn(`Stopped waiting to ${name} after the time limit of ${CLEANUP_TIMEOUT_MS} ms`);
|
|
176
|
+
resolve();
|
|
177
|
+
}, CLEANUP_TIMEOUT_MS);
|
|
178
|
+
});
|
|
179
|
+
await Promise.race([run, limit]);
|
|
180
|
+
clearTimeout(timer);
|
|
181
|
+
}
|
|
149
182
|
async function beforeEachSnapshot() {
|
|
150
183
|
var _a, _b;
|
|
151
184
|
await ((_a = hooks === null || hooks === void 0 ? void 0 : hooks.beforeEachSnapshot) === null || _a === void 0 ? void 0 : _a.call(hooks));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/core",
|
|
3
|
-
"version": "4.74.
|
|
3
|
+
"version": "4.74.1",
|
|
4
4
|
"homepage": "https://applitools.com",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": {
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
"test:ios-simulator": "MOCHA_ONLY_TAGS=ios-simulator MOCHA_GROUP=ios-simulator run --top-level mocha ./test/e2e/classic/webview.spec.ts --exit --require ./test/mocha-global-setup.js"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@applitools/core-base": "1.41.
|
|
58
|
+
"@applitools/core-base": "1.41.4",
|
|
59
59
|
"@applitools/dom-capture": "11.8.10",
|
|
60
60
|
"@applitools/dom-snapshot": "4.18.8",
|
|
61
61
|
"@applitools/driver": "1.26.14",
|
|
62
|
-
"@applitools/ec-client": "1.12.
|
|
62
|
+
"@applitools/ec-client": "1.12.55",
|
|
63
63
|
"@applitools/image": "1.3.4",
|
|
64
64
|
"@applitools/logger": "2.3.2",
|
|
65
|
-
"@applitools/nml-client": "1.12.
|
|
65
|
+
"@applitools/nml-client": "1.12.11",
|
|
66
66
|
"@applitools/req": "1.11.6",
|
|
67
67
|
"@applitools/screenshoter": "3.12.36",
|
|
68
68
|
"@applitools/snippets": "2.9.10",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@applitools/spec-driver-webdriver": "^1.6.14",
|
|
86
86
|
"@applitools/test-server": "^1.4.8",
|
|
87
87
|
"@applitools/test-utils": "^1.5.17",
|
|
88
|
-
"@applitools/tunnel-client": "^1.12.
|
|
88
|
+
"@applitools/tunnel-client": "^1.12.9",
|
|
89
89
|
"@swc-node/register": "^1.6.8",
|
|
90
90
|
"@types/mocha": "^10.0.7",
|
|
91
91
|
"@types/node": "^12.20.55",
|