testaro 77.0.2 → 77.0.4
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/doActs.js +12 -1
- package/procs/launch.js +6 -1
package/package.json
CHANGED
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();
|
package/procs/launch.js
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
// IMPORTS
|
|
18
18
|
|
|
19
19
|
const {addError} = require('./error');
|
|
20
|
+
const {posix: posixPath} = require('path');
|
|
20
21
|
const headedBrowser = process.env.HEADED_BROWSER === 'true';
|
|
21
22
|
// Two flavors of Playwright:
|
|
22
23
|
// - `playwrightCore`: the upstream Playwright SDK with no plugins attached.
|
|
@@ -106,8 +107,12 @@ const normalizeURL = url => {
|
|
|
106
107
|
if (url.toLowerCase().startsWith('file:')) {
|
|
107
108
|
let path = url.replace(/^file:\/+/i, '');
|
|
108
109
|
path = path.replace(/\\/g, '/');
|
|
110
|
+
// Collapse redundant slashes and resolve . and .. segments, so a URL built
|
|
111
|
+
// with a relative prefix (e.g. .../procs/../target) compares equal to the
|
|
112
|
+
// absolute URL the browser reports.
|
|
113
|
+
path = posixPath.normalize('/' + path).replace(/^\//, '');
|
|
109
114
|
// Return the URL normalized.
|
|
110
|
-
return 'file:///' + path
|
|
115
|
+
return 'file:///' + path;
|
|
111
116
|
}
|
|
112
117
|
// Otherwise, i.e. if it is not that of a local file:
|
|
113
118
|
else {
|