testaro 74.1.3 → 74.2.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/env.example +2 -0
- package/package.json +1 -1
- package/run.js +7 -8
- package/tests/nuVal.js +7 -1
package/env.example
CHANGED
|
@@ -28,6 +28,8 @@ REPORTDIR=__placeholder__
|
|
|
28
28
|
TIMEOUT_MULTIPLIER=1
|
|
29
29
|
# Whether to abort the job when any test act fork crashes (default false).
|
|
30
30
|
ABORT_ASSERTIVELY=false
|
|
31
|
+
# URL of any non-default (e.g., self-hosted) Nu Html Checker API (see ghcr.io/validator/validator).
|
|
32
|
+
TESTARO_NU_URL=__placeholder__
|
|
31
33
|
|
|
32
34
|
## License
|
|
33
35
|
|
package/package.json
CHANGED
package/run.js
CHANGED
|
@@ -21,16 +21,15 @@ require('dotenv').config({quiet: true});
|
|
|
21
21
|
const {isValidJob} = require('./procs/job');
|
|
22
22
|
const {getCatalog} = require('./procs/catalog');
|
|
23
23
|
const {nowString} = require('./procs/dateTime');
|
|
24
|
-
|
|
25
|
-
const {chromium} = require('playwright-extra');
|
|
24
|
+
const {chromium, webkit, firefox} = require('playwright-extra');
|
|
26
25
|
const fs = require('fs').promises;
|
|
27
26
|
const os = require('os');
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
/*
|
|
28
|
+
Module to evade detection of Chromium automation. Injects launch flags
|
|
29
|
+
(e.g., `--disable-blink-features=AutomationControlled`) and patches
|
|
30
|
+
Blink-only DOM globals. Job-level opt-out for Chromium happens in
|
|
31
|
+
procs/launch.js via the `stealth` field.
|
|
32
|
+
*/
|
|
34
33
|
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
|
|
35
34
|
chromium.use(StealthPlugin());
|
|
36
35
|
|
package/tests/nuVal.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
© 2022–2024 CVS Health and/or one of its affiliates. All rights reserved.
|
|
3
|
+
© 2026 Jeff Witt.
|
|
3
4
|
© 2026 Jonathan Robert Pool.
|
|
4
5
|
|
|
5
6
|
Licensed under the MIT License. See LICENSE file at the project root or
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
nuVal
|
|
13
14
|
This tool subjects a page and its source to the Nu Html Checker, thereby testing scripted content found only in the loaded page and erroneous content before the browser corrects it. The API erratically replaces left and right double quotation marks with invalid UTF-8, which appears as 2 or 3 successive instances of the replacement character (U+fffd). Therefore, this test removes all such quotation marks and the replacement character. That causes 'Bad value “” for' to become 'Bad value for'. Since the corruption of quotation marks is erratic, no better solution is known.
|
|
14
15
|
This tool is the API version of the Nu Html Checker. It is an alternative to the nuVnu tool, which uses the same validator as an installed dependency. Each tool has advantages and disadvantages. The main advantage of nuVal is that it does not require the Testaro host to provide a Java virtual machine. The main advantage of the nuVnu tool is that it can evaluate pages reachable from the host that Testaro runs on even if not reachable from the public Internet.
|
|
16
|
+
This tool calls the W3C validation service unless a TESTARO_NU_URL environment variable is defined with the URL of another instance of the API.
|
|
15
17
|
*/
|
|
16
18
|
|
|
17
19
|
// IMPORTS
|
|
@@ -55,7 +57,11 @@ exports.reporter = async (page, report, actIndex) => {
|
|
|
55
57
|
},
|
|
56
58
|
body: testTarget
|
|
57
59
|
};
|
|
58
|
-
|
|
60
|
+
// Override target for self-hosted Nu Html Checker instances (Docker
|
|
61
|
+
// image ghcr.io/validator/validator or equivalent). Defaults to the
|
|
62
|
+
// public W3C service, which 502s on bodies >~80 kB.
|
|
63
|
+
const nuURL = process.env.TESTARO_NU_URL
|
|
64
|
+
|| 'https://validator.w3.org/nu/?parser=html&out=json';
|
|
59
65
|
let nuData = {};
|
|
60
66
|
let nuResponse = new Response();
|
|
61
67
|
try {
|