Fix de playwright
This commit is contained in:
@@ -76,24 +76,28 @@ const MAX_REDIRECTS = Math.max(
|
||||
);
|
||||
const DEFAULT_USER_AGENT = buildUserAgent(settings.userAgent);
|
||||
const IGNORE_HOSTS = parseIgnoreHosts(settings.ignoreHosts);
|
||||
const PLAYWRIGHT_RESOLUTION =
|
||||
settings.usePlaywright === true
|
||||
? resolvePlaywrightExecutable(settings.playwrightExecutablePath)
|
||||
: { path: null, missing: null };
|
||||
const PLAYWRIGHT_EXECUTABLE = PLAYWRIGHT_RESOLUTION.path;
|
||||
const PLAYWRIGHT_ENABLED = settings.usePlaywright === true && !PLAYWRIGHT_RESOLUTION.missing;
|
||||
if (settings.usePlaywright === true && PLAYWRIGHT_RESOLUTION.missing) {
|
||||
console.warn(
|
||||
[
|
||||
"Playwright désactivé : impossible de trouver l'exécutable demandé",
|
||||
`"${PLAYWRIGHT_RESOLUTION.missing}".`,
|
||||
`Corrigez externalLinks.playwrightExecutablePath dans ${path.relative(
|
||||
SITE_ROOT,
|
||||
CONFIG_PATH
|
||||
)} pour rétablir la vérification enrichie.`,
|
||||
].join(" ")
|
||||
);
|
||||
let PLAYWRIGHT_EXECUTABLE = null;
|
||||
if (settings.usePlaywright === true && typeof settings.playwrightExecutablePath === "string") {
|
||||
const trimmedExecutable = settings.playwrightExecutablePath.trim();
|
||||
if (trimmedExecutable) {
|
||||
const resolution = resolvePlaywrightExecutable(trimmedExecutable);
|
||||
if (resolution.missing) {
|
||||
console.error(
|
||||
[
|
||||
"Playwright activé mais impossible de trouver l'exécutable demandé",
|
||||
`"${resolution.missing}".`,
|
||||
`Corrigez externalLinks.playwrightExecutablePath dans ${path.relative(
|
||||
SITE_ROOT,
|
||||
CONFIG_PATH
|
||||
)} ou laissez ce champ vide pour utiliser la configuration Playwright par défaut.`,
|
||||
].join(" ")
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
PLAYWRIGHT_EXECUTABLE = resolution.path;
|
||||
}
|
||||
}
|
||||
const PLAYWRIGHT_ENABLED = settings.usePlaywright === true;
|
||||
const PLAYWRIGHT_TIMEOUT_MS = Math.max(
|
||||
1000,
|
||||
(Number.isFinite(Number(settings.playwrightTimeoutSeconds))
|
||||
|
||||
Reference in New Issue
Block a user