pagean 8.0.0 → 8.0.2
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/LICENSE +1 -1
- package/README.md +6 -0
- package/bin/pageanrc-lint.js +1 -1
- package/index.js +1 -1
- package/lib/link-utils.js +5 -1
- package/lib/reporter.js +1 -1
- package/package.json +13 -13
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -142,6 +142,8 @@ For any failing test, the `data` array in the test report includes the original
|
|
|
142
142
|
]
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
+
Note: This test will check all links on the page, and does not respect mechanisms inteded to limit web crawlers such as `robots.txt` or `noindex` tags.
|
|
146
|
+
|
|
145
147
|
## Reports
|
|
146
148
|
|
|
147
149
|
Based on the `reporters` configuration, Pagean results may be displayed in the console and saved in two reports in the project root directory (any or all of the three):
|
|
@@ -254,6 +256,10 @@ Provided with the Pagean project are Docker images configured to run the tests.
|
|
|
254
256
|
|
|
255
257
|
**Note:** Any images in the `gitlab-ci-utils/pagean/tmp` repository are temporary images used during the build process and may be deleted at any point.
|
|
256
258
|
|
|
259
|
+
### Puppeteer Cache Location
|
|
260
|
+
|
|
261
|
+
In [Puppeteer v19](https://github.com/puppeteer/puppeteer/releases/tag/v19.0.0) the default cache location for installing the Chrome binary was changed from within the project's `node_modules` folder to `~/.cache/puppeteer`. To simplify execution in a container, the `PUPPETEER_CACHE_DIR` environment variable is set to install the Chrome binaries in `/home/pptruser/.cache/puppeteer` during container build, so setting to another value before execution can cause errors where Puppeteer cannot find the Chrome binary.
|
|
262
|
+
|
|
257
263
|
## GitLab CI Configuration
|
|
258
264
|
|
|
259
265
|
The following is an example job from a .gitlab-ci.yml file to use this image to run Pagean against another project in GitLab CI:
|
package/bin/pageanrc-lint.js
CHANGED
|
@@ -25,7 +25,7 @@ const logError = (message, exitOnError = true) => {
|
|
|
25
25
|
const outputJsonResults = (configFileName, lintResults) => {
|
|
26
26
|
// Log JSON to stdout for consistency, and eliminates extraneous stderr
|
|
27
27
|
// output in PowerShell which produces invalid JSON if piped to file.
|
|
28
|
-
// eslint-disable-next-line no-magic-numbers
|
|
28
|
+
// eslint-disable-next-line no-magic-numbers -- index
|
|
29
29
|
log({ message: JSON.stringify(lintResults.errors, undefined, 2) });
|
|
30
30
|
if (!lintResults.isValid) {
|
|
31
31
|
logError(`Errors found in file ${configFileName}`);
|
package/index.js
CHANGED
|
@@ -60,7 +60,7 @@ const executeAllTests = async (config) => {
|
|
|
60
60
|
|
|
61
61
|
if (testResults.summary.failed > 0) {
|
|
62
62
|
// For test harness want process to exit with error code
|
|
63
|
-
// eslint-disable-next-line unicorn/no-process-exit, no-
|
|
63
|
+
// eslint-disable-next-line unicorn/no-process-exit, no-magic-numbers -- exit code
|
|
64
64
|
process.exit(2);
|
|
65
65
|
}
|
|
66
66
|
};
|
package/lib/link-utils.js
CHANGED
|
@@ -141,7 +141,11 @@ const checkExternalPageLink = async (page, link, useGet = false) => {
|
|
|
141
141
|
try {
|
|
142
142
|
const options = {
|
|
143
143
|
headers: { 'User-Agent': userAgent },
|
|
144
|
-
timeout: timeoutSeconds * msPerSec
|
|
144
|
+
timeout: timeoutSeconds * msPerSec,
|
|
145
|
+
// Axios can generate an error trying to decompress an empty compressed
|
|
146
|
+
// HEAD response, see https://github.com/axios/axios/issues/5102.
|
|
147
|
+
// The response body is also not used, so more efficient to skip.
|
|
148
|
+
decompress: false
|
|
145
149
|
};
|
|
146
150
|
// Using internal browser property since not exposed
|
|
147
151
|
// eslint-disable-next-line no-underscore-dangle
|
package/lib/reporter.js
CHANGED
|
@@ -14,7 +14,7 @@ const htmlReportFileName = './pagean-results.html';
|
|
|
14
14
|
const jsonReportFileName = './pagean-results.json';
|
|
15
15
|
|
|
16
16
|
handlebars.registerHelper('json', (context) => {
|
|
17
|
-
// eslint-disable-next-line no-magic-numbers
|
|
17
|
+
// eslint-disable-next-line no-magic-numbers -- count
|
|
18
18
|
return JSON.stringify(context, undefined, 2);
|
|
19
19
|
});
|
|
20
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pagean",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"description": "Pagean is a web page analysis tool designed to automate tests requiring web pages to be loaded in a browser window (e.g. horizontal scrollbar, console errors)",
|
|
5
5
|
"bin": {
|
|
6
6
|
"pagean": "./bin/pagean.js",
|
|
@@ -51,28 +51,28 @@
|
|
|
51
51
|
},
|
|
52
52
|
"homepage": "https://gitlab.com/gitlab-ci-utils/pagean",
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@aarongoldenthal/eslint-config-standard": "^
|
|
55
|
-
"@aarongoldenthal/stylelint-config-standard": "^
|
|
54
|
+
"@aarongoldenthal/eslint-config-standard": "^19.0.2",
|
|
55
|
+
"@aarongoldenthal/stylelint-config-standard": "^12.0.1",
|
|
56
56
|
"bin-tester": "^3.0.0",
|
|
57
|
-
"eslint": "^8.
|
|
58
|
-
"jest": "^29.
|
|
59
|
-
"jest-junit": "^
|
|
60
|
-
"markdownlint-cli": "^0.
|
|
61
|
-
"prettier": "^2.
|
|
57
|
+
"eslint": "^8.32.0",
|
|
58
|
+
"jest": "^29.3.1",
|
|
59
|
+
"jest-junit": "^15.0.0",
|
|
60
|
+
"markdownlint-cli": "^0.33.0",
|
|
61
|
+
"prettier": "^2.8.3",
|
|
62
62
|
"strip-ansi": "^6.0.1",
|
|
63
|
-
"stylelint": "^14.
|
|
63
|
+
"stylelint": "^14.16.1"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"ajv": "^8.
|
|
66
|
+
"ajv": "^8.12.0",
|
|
67
67
|
"ajv-errors": "^3.0.0",
|
|
68
|
-
"axios": "^1.
|
|
68
|
+
"axios": "^1.2.2",
|
|
69
69
|
"ci-logger": "^5.1.0",
|
|
70
|
-
"commander": "^
|
|
70
|
+
"commander": "^10.0.0",
|
|
71
71
|
"handlebars": "^4.7.7",
|
|
72
72
|
"htmlhint": "^1.1.4",
|
|
73
73
|
"kleur": "^4.1.5",
|
|
74
74
|
"normalize-url": "^6.1.0",
|
|
75
75
|
"protocolify": "^3.0.0",
|
|
76
|
-
"puppeteer": "^19.2
|
|
76
|
+
"puppeteer": "^19.5.2"
|
|
77
77
|
}
|
|
78
78
|
}
|