testaro 77.0.3 → 77.1.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/package.json +1 -1
- package/procs/catalog.js +12 -0
- package/procs/doActs.js +12 -1
package/package.json
CHANGED
package/procs/catalog.js
CHANGED
|
@@ -44,6 +44,18 @@ exports.getCatalog = async report => {
|
|
|
44
44
|
});
|
|
45
45
|
// If the launch and navigation succeeded:
|
|
46
46
|
if (page) {
|
|
47
|
+
// Expand closed details elements before the page image and the box measurements, so
|
|
48
|
+
// both see the same fully disclosed state. Chromium lays out the content of a closed
|
|
49
|
+
// details element (content-visibility: hidden) without painting it and without
|
|
50
|
+
// shifting the content after it, so getBoundingClientRect returns coordinates that
|
|
51
|
+
// overlap unrelated visible elements, making box IDs disagree with the page image.
|
|
52
|
+
await page.evaluate(() => {
|
|
53
|
+
document.querySelectorAll('details:not([open])').forEach(details => {
|
|
54
|
+
details.setAttribute('open', '');
|
|
55
|
+
});
|
|
56
|
+
}).catch(error => {
|
|
57
|
+
console.log(`ERROR: Expanding details elements failed (${error.message})`);
|
|
58
|
+
});
|
|
47
59
|
// If a page image is required:
|
|
48
60
|
if ([0, 2, 4, 6].includes(report.imageColor)) {
|
|
49
61
|
// Create one and add it to the report.
|
package/procs/doActs.js
CHANGED
|
@@ -69,7 +69,18 @@ const errorStart = error => error.message.replace(/\n.+/s, '');
|
|
|
69
69
|
const isTrue = (object, specs) => {
|
|
70
70
|
const property = specs[0];
|
|
71
71
|
const propertyTree = property.split('.');
|
|
72
|
-
|
|
72
|
+
// Test-act expectations reference results by property path. Most fixtures use the
|
|
73
|
+
// bare standardResult.* path, whose value lives at act.result.standardResult; a few
|
|
74
|
+
// use result.* directly on the act. Resolve against act.result when the first segment
|
|
75
|
+
// is absent on the act but present on act.result, so both conventions work.
|
|
76
|
+
let base = object;
|
|
77
|
+
if (
|
|
78
|
+
property.length && object && object[propertyTree[0]] === undefined
|
|
79
|
+
&& object.result && object.result[propertyTree[0]] !== undefined
|
|
80
|
+
) {
|
|
81
|
+
base = object.result;
|
|
82
|
+
}
|
|
83
|
+
let actual = property.length ? base[propertyTree[0]] : base;
|
|
73
84
|
// Identify the actual value of the specified property.
|
|
74
85
|
while (propertyTree.length > 1 && actual !== undefined) {
|
|
75
86
|
propertyTree.shift();
|