testaro 77.0.1 → 77.0.3
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/launch.js +16 -9
package/package.json
CHANGED
package/procs/launch.js
CHANGED
|
@@ -17,15 +17,8 @@
|
|
|
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
|
-
// Whether to launch Chromium without its sandbox. The sandbox requires
|
|
22
|
-
// unprivileged user-namespace cloning, which the default container seccomp
|
|
23
|
-
// policies and some hardened hosts prohibit. Setting
|
|
24
|
-
// TESTARO_CHROMIUM_NO_SANDBOX=true permits Chromium to run in such
|
|
25
|
-
// environments; the alternative is to run the container with a seccomp
|
|
26
|
-
// profile that permits user-namespace cloning. Applies only to Chromium;
|
|
27
|
-
// WebKit and Firefox have no equivalent option.
|
|
28
|
-
const chromiumNoSandbox = process.env.TESTARO_CHROMIUM_NO_SANDBOX === 'true';
|
|
29
22
|
// Two flavors of Playwright:
|
|
30
23
|
// - `playwrightCore`: the upstream Playwright SDK with no plugins attached.
|
|
31
24
|
// - `playwrightExtra`: the playwright-extra wrapper. `run.js` registers
|
|
@@ -66,6 +59,14 @@ const errorWords = [
|
|
|
66
59
|
// Seconds to wait between actions.
|
|
67
60
|
const waits = Number(process.env.WAITS) ?? 0;
|
|
68
61
|
const abortAssertively = process.env.ABORT_ASSERTIVELY === 'true';
|
|
62
|
+
// Whether to launch Chromium without its sandbox. The sandbox requires
|
|
63
|
+
// unprivileged user-namespace cloning, which the default container seccomp
|
|
64
|
+
// policies and some hardened hosts prohibit. Setting
|
|
65
|
+
// TESTARO_CHROMIUM_NO_SANDBOX=true permits Chromium to run in such
|
|
66
|
+
// environments; the alternative is to run the container with a seccomp
|
|
67
|
+
// profile that permits user-namespace cloning. Applies only to Chromium;
|
|
68
|
+
// WebKit and Firefox have no equivalent option.
|
|
69
|
+
const chromiumNoSandbox = process.env.TESTARO_CHROMIUM_NO_SANDBOX === 'true';
|
|
69
70
|
|
|
70
71
|
// FUNCTIONS
|
|
71
72
|
|
|
@@ -77,6 +78,8 @@ const wait = exports.wait = ms => {
|
|
|
77
78
|
}, ms);
|
|
78
79
|
});
|
|
79
80
|
};
|
|
81
|
+
// Removes any trailing slashes from a URL, for redirection comparison.
|
|
82
|
+
const deSlash = url => (url || '').replace(/\/+$/, '');
|
|
80
83
|
// Close a browser context and/or its browser, if they exist.
|
|
81
84
|
const browserClose = exports.browserClose = async page => {
|
|
82
85
|
if (page) {
|
|
@@ -104,8 +107,12 @@ const normalizeURL = url => {
|
|
|
104
107
|
if (url.toLowerCase().startsWith('file:')) {
|
|
105
108
|
let path = url.replace(/^file:\/+/i, '');
|
|
106
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(/^\//, '');
|
|
107
114
|
// Return the URL normalized.
|
|
108
|
-
return 'file:///' + path
|
|
115
|
+
return 'file:///' + path;
|
|
109
116
|
}
|
|
110
117
|
// Otherwise, i.e. if it is not that of a local file:
|
|
111
118
|
else {
|