pagean 4.4.2 → 6.0.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.
Files changed (96) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +9 -9
  3. package/docs/upgrade-guide.md +16 -0
  4. package/index.js +7 -4
  5. package/lib/config.js +2 -2
  6. package/lib/default-config.json +41 -39
  7. package/lib/externalFileUtils.js +1 -1
  8. package/lib/linkUtils.js +162 -25
  9. package/lib/logger.js +1 -1
  10. package/lib/report-template.handlebars +224 -209
  11. package/lib/schemaErrors.js +5 -4
  12. package/lib/testUtils.js +1 -1
  13. package/lib/tests.js +14 -14
  14. package/package.json +28 -30
  15. package/schemas/pageanrc.schema.json +199 -191
  16. package/.codeclimate.json +0 -8
  17. package/.depcheckrc.json +0 -3
  18. package/.dockerignore +0 -12
  19. package/.eslintrc.json +0 -19
  20. package/.gitattributes +0 -4
  21. package/.gitlab/gitlab-releaser.json +0 -16
  22. package/.htmlhintrc +0 -25
  23. package/.markdownlint.json +0 -13
  24. package/.pa11yci.json +0 -5
  25. package/.pageanrc.json +0 -55
  26. package/.stylelintrc.json +0 -7
  27. package/CHANGELOG.md +0 -204
  28. package/gitlab.pageanrc.json +0 -16
  29. package/jest.config.json +0 -22
  30. package/static-server.pageanrc.json +0 -50
  31. package/tests/__snapshots__/config.test.js.snap +0 -591
  32. package/tests/__snapshots__/externalFileUtils.test.js.snap +0 -7
  33. package/tests/__snapshots__/index.test.js.snap +0 -30
  34. package/tests/__snapshots__/pagean.test.js.snap +0 -82
  35. package/tests/__snapshots__/pageanrc.test.js.snap +0 -759
  36. package/tests/__snapshots__/reporter.test.js.snap +0 -509
  37. package/tests/config.test.js +0 -264
  38. package/tests/externalFileUtils.test.js +0 -184
  39. package/tests/index.test.js +0 -181
  40. package/tests/linkUtils.test.js +0 -290
  41. package/tests/logger.test.js +0 -324
  42. package/tests/pagean.test.js +0 -85
  43. package/tests/pageanrc.test.js +0 -96
  44. package/tests/reporter.test.js +0 -82
  45. package/tests/schemaErrors.test.js +0 -88
  46. package/tests/test-cases/.htmlhintrc +0 -25
  47. package/tests/test-cases/brokenLinks.html +0 -22
  48. package/tests/test-cases/consoleLog.html +0 -11
  49. package/tests/test-cases/duplicateLinks.html +0 -22
  50. package/tests/test-cases/dynamicContent.html +0 -13
  51. package/tests/test-cases/externalScripts.html +0 -21
  52. package/tests/test-cases/horizontalScrollbar.html +0 -13
  53. package/tests/test-cases/htmlError.html +0 -11
  54. package/tests/test-cases/noExternalScripts.html +0 -12
  55. package/tests/test-cases/notDocumentLinks.html +0 -18
  56. package/tests/test-cases/pagean-results.json +0 -1
  57. package/tests/test-cases/scriptError404.html +0 -9
  58. package/tests/test-cases/slowLoad.html +0 -9
  59. package/tests/test-configs/cli-tests/.pageanrc.json +0 -28
  60. package/tests/test-configs/cli-tests/all-empty.pageanrc.json +0 -10
  61. package/tests/test-configs/cli-tests/all-errors.pageanrc.json +0 -69
  62. package/tests/test-configs/cli-tests/all-fail-cli.pageanrc.json +0 -9
  63. package/tests/test-configs/cli-tests/no-urls.pageanrc.json +0 -7
  64. package/tests/test-configs/cli-tests/pass-fail-cli.pageanrc.json +0 -14
  65. package/tests/test-configs/integration-tests/all-passing-tests.pageanrc.json +0 -63
  66. package/tests/test-configs/integration-tests/broken-links-error.pageanrc.json +0 -22
  67. package/tests/test-configs/integration-tests/console-error-reporter-cli-json.pageanrc.json +0 -20
  68. package/tests/test-configs/integration-tests/console-error-reporter-html.pageanrc.json +0 -19
  69. package/tests/test-configs/integration-tests/console-error.pageanrc.json +0 -16
  70. package/tests/test-configs/integration-tests/console-output.pageanrc.json +0 -16
  71. package/tests/test-configs/integration-tests/external-scripts-error.pageanrc.json +0 -19
  72. package/tests/test-configs/integration-tests/horizontal-scrollbar.pageanrc.json +0 -16
  73. package/tests/test-configs/integration-tests/html-error.pageanrc.json +0 -16
  74. package/tests/test-configs/integration-tests/page-load-time.pageanrc.json +0 -16
  75. package/tests/test-configs/unit-tests/empty-url-values.pageanrc.json +0 -9
  76. package/tests/test-configs/unit-tests/empty-urls.pageanrc.json +0 -3
  77. package/tests/test-configs/unit-tests/empty.pageanrc.json +0 -2
  78. package/tests/test-configs/unit-tests/global-and-test-specific-settings-shorthand.pageanrc.json +0 -30
  79. package/tests/test-configs/unit-tests/global-and-test-specific-settings-test-props.pageanrc.json +0 -42
  80. package/tests/test-configs/unit-tests/global-and-test-specific-settings.pageanrc.json +0 -34
  81. package/tests/test-configs/unit-tests/global-test-settings.pageanrc.json +0 -15
  82. package/tests/test-configs/unit-tests/htmlhintrc-invalid.pageanrc.json +0 -7
  83. package/tests/test-configs/unit-tests/htmlhintrc-valid.pageanrc.json +0 -7
  84. package/tests/test-configs/unit-tests/ignored-links-denormalized.pageanrc.json +0 -18
  85. package/tests/test-configs/unit-tests/invalid.pageanrc.json +0 -0
  86. package/tests/test-configs/unit-tests/no-test-settings.pageanrc.json +0 -6
  87. package/tests/test-configs/unit-tests/project-no-test-settings.pageanrc.json +0 -7
  88. package/tests/test-configs/unit-tests/puppeteer-no-test-settings.pageanrc.json +0 -9
  89. package/tests/test-configs/unit-tests/reporters-empty.pageanrc.json +0 -7
  90. package/tests/test-configs/unit-tests/reporters-invalid-type.pageanrc.json +0 -9
  91. package/tests/test-configs/unit-tests/reporters-not-array.pageanrc.json +0 -6
  92. package/tests/test-configs/unit-tests/reporters-valid.pageanrc.json +0 -9
  93. package/tests/test-configs/unit-tests/test-specific-settings.pageanrc.json +0 -26
  94. package/tests/test-configs/unit-tests/url-types.pageanrc.json +0 -10
  95. package/tests/testUtils.test.js +0 -244
  96. package/tests/tests.test.js +0 -533
package/CHANGELOG.md DELETED
@@ -1,204 +0,0 @@
1
- # Changelog
2
-
3
- ## v4.4.2 (2021-03-21)
4
-
5
- ### Fixed
6
-
7
- - Updated to latest dependencies, including resolving vulnerabilities and puppeteer v8 (#98)
8
-
9
- ### Miscellaneous
10
-
11
- - Updated CI pipeline with multiple optimizations:
12
- - Changed `merge_request` pipelines to run instead of `push` pipelines when in a merge request
13
- - Moved all jobs from `only`/`except` to `rules` (#92)
14
- - Optimized pipeline for schedules (#93) and to use standard NPM package collection (#95)
15
- - Updated Pagean jobs to be included in release evidence collection (#96)
16
- - Updated Pagean jobs for release evidence collection (#96)
17
- - Updated Docker build to ensure latest published version is installed in tag pipelines (#89)
18
- - Refactor Docker build using rules to reduce to a single job, closes #94
19
- - Update Docker build rules for local vs npm installation (#34)
20
- - Update to @aarongoldenthal/stylelint-config-standard (#91)
21
-
22
- ## v4.4.1 (2021-01-30)
23
-
24
- ### Fixed
25
-
26
- - Fixed failure of global pagean install in container (#87)
27
-
28
- ## v4.4.0 (2021-01-30)
29
-
30
- ### Added
31
-
32
- - Added test to check for broken links on the page (`http`/`file` only). For links within the page, checks for existence of the element on the page. For links to other pages, makes a request and checks response (fails if >= 400 or other error). Includes config update with array of links to ignore. Fails with warning by default so it is not a breaking change. (#77)
33
- - Added [`http-server`](https://www.npmjs.com/package/http-server) and [`wait-on`](https://www.npmjs.com/package/wait-on) to Docker images and documented example showing how to test static files with a local server. (#59)
34
-
35
- ### Fixed
36
-
37
- - Fixed error in console log reporting location information and updated tests (#85, #86)
38
- - Fixed local installation on non-master branch Docker images to accept CLI arguments (#81)
39
- - Updated to latest dependencies
40
-
41
- ### Miscellaneous
42
-
43
- - Update CI pipeline to check for secure JSON schemas (#78) and lint `.pageanrc` files (#79)
44
- - Fix test remnant left from adding `htmlhintrc` (#80)
45
-
46
- ## v4.3.0 (2020-12-28)
47
-
48
- ### Added
49
-
50
- - Added CLI command to lint pageanrc configuration files (#74)
51
- - Added configuration file property to specify project name for reports (#73)
52
- - Added configuration file property to specify htmlhintrc file (#35)
53
-
54
- ### Changed
55
-
56
- - Improved configuration file validation leveraging JSON schema (#75)
57
-
58
- ### Fixed
59
-
60
- - Updated to latest dependencies, including resolving vulnerabilities
61
-
62
- ### Miscellaneous
63
-
64
- - Refactored code to leverage array.map for optimization in several places (#70)
65
-
66
- ## v4.2.0 (2020-12-13)
67
-
68
- ### Added
69
-
70
- - Added CLI option to specify configuration file location (#14)
71
- - Added configuration file section to specify the reporters used to capture the test results (any or all of `cli`, `html`, or `json`) (#25)
72
-
73
- ### Fixed
74
-
75
- - Updated to latest dependencies, including resolving vulnerabilities
76
-
77
- ### Miscellaneous
78
-
79
- - Update test suite to include CLI integration tests (#63)
80
- - Update pipeline for Node LTS change from v12 to v14 (#65)
81
- - Updated CI pipeline to leverage simplified include syntax in GitLab 13.6 (#67) and GitLab Releaser (#68)
82
-
83
- ## v4.1.3 (2020-10-23)
84
-
85
- ### Fixed
86
-
87
- - Updated to latest dependencies, including resolving vulnerabilities
88
-
89
- ### Miscellaneous
90
-
91
- - Added tests with Node 15 (#64)
92
-
93
- ## v4.1.2 (2020-09-13)
94
-
95
- ### Fixed
96
-
97
- - Updated to latest dependencies, including resolving vulnerabilities
98
-
99
- ## v4.1.1 (2020-08-16)
100
-
101
- ### Fixed
102
-
103
- - Updated to latest dependencies, including resolving vulnerabilities
104
-
105
- ## v4.1.0 (2020-07-05)
106
-
107
- ### Changed
108
-
109
- - Updated console output to improve visualization of test results (#61)
110
-
111
- ### Fixed
112
-
113
- - Updated to latest dependencies, including Puppeteer 5
114
-
115
- ## v4.0.0 (2020-06-13)
116
-
117
- **Note: As of v4.0.0, this module is being being released as [`pagean`](https://www.npmjs.com/package/pagean) and [`page-load-tests`](https://www.npmjs.com/package/page-load-tests) has been deprecated. See details and impacts below. This drove breaking configuration changes that will require updating your project's configuration file. See the [version upgrade guide](https://gitlab.com/gitlab-ci-utils/pagean/-/blob/master/docs/upgrade-guide.md) for complete details.**
118
-
119
- ### Added
120
-
121
- - Added external script test to identify any externally loaded javascript files (e.g. loaded from a CDN) and aggregate those files so they can undergo further analysis (e.g. dependency vulnerability scanning). (#42)
122
- - Added the ability to set a failed test to result in a warning instead of a failure, which will not cause failure of the test suite. (#44)
123
-
124
- ### Changed
125
-
126
- - BREAKING: Updated test configuration to allow test-specific settings. With this change, `pageLoadTimeThreshold` must now appears as a setting of the `pageLoadTimeTest` test. (#54)
127
- - BREAKING: Removed support for Node v13 since now end-of-life. (#56)
128
- - BREAKING: Updated module name to `pagean`, including the following configuration and report name changes (#57):
129
- - Changed configurations file name from `.pltconfig.json` to `.pageanrc.json`
130
- - Changed report names from `page-load-test-results.*` to `pagean-results.*`.
131
-
132
- ### Fixed
133
-
134
- - Updated to latest dependencies
135
-
136
- ## v3.0.0 (2020-04-20)
137
-
138
- ### Changed
139
-
140
- - BREAKING: Removed [Jest](https://jestjs.io/) as the test runner and replaced with new a dedicated test runner optimized for these types of tests. This includes simplified HTML and JSON reports, removing code stack traces on error and replacing with more meaningful data, etc (#43, #48, #33, #49). This also enables future enhancements that a typical test framework could not support (e.g. #47, #44, #42).
141
-
142
- ### Fixed
143
-
144
- - Updated to Puppeteer 3.0.0 with Chrome 81 (#41, #50)
145
- - Updated to latest dependencies to resolve vulnerabilities
146
-
147
- ## v2.0.0 (2020-01-26)
148
-
149
- ### Changed
150
-
151
- - BREAKING: Removed Node v8 compatibility since end-of-life. Compatible with all current and LTS releases (`^10.13.0 || ^12.13.0 || >=13.0.0`) (#39)
152
- - Updated documentation with link to [example report](https://gitlab-ci-utils.gitlab.io/pagean/pagean-results.html) (#28)
153
-
154
- ### Fixed
155
-
156
- - Updated to latest dependencies
157
-
158
- ### Miscellaneous
159
-
160
- - Added testing for all supported Node.js versions (#36)
161
- - Added accessibility analysis for report via [pa11y-ci](https://www.npmjs.com/package/pa11y-ci) (#38)
162
- - Updated project to use [eslint-plugin-sonarjs](https://www.npmjs.com/package/eslint-plugin-sonarjs) (#37)
163
-
164
- ## v1.2.1 (2019-11-24)
165
-
166
- ### Fixed
167
-
168
- - Updated to latest dependencies to resolve vulnerabilities
169
-
170
- ## v1.2.0 (2019-11-16)
171
-
172
- ### Changed
173
-
174
- - Updated rendered HTML test to use local `.htmlhintrc` file if available (#17)
175
-
176
- ## v1.1.1 (2019-11-10)
177
-
178
- ### Fixed
179
-
180
- - Updated tests to exit with error (i.e. non-zero) for test failure (#32, #31)
181
- - Updated to latest dependencies (Puppeteer, eslint/jest/plugins) (#30)
182
-
183
- ### Miscellaneous
184
-
185
- - Updated project to use custom eslint configuration module (#29)
186
- - Updated CI pipeline to lint HTML and CSS
187
-
188
- ## v1.1.0 (2019-10-19)
189
-
190
- ### Changed
191
-
192
- - Updated tests to show original URLs (without full file path) (#18)
193
- - Added custom HTML report template with error formatting (#10)
194
- - Updated Dockerfile to run via standard CLI command (#21)
195
-
196
- ## v1.0.1 (2019-10-17)
197
-
198
- ### Fixed
199
-
200
- - Fixed error when running in a path with spaces (#26)
201
-
202
- ## v1.0.0 (2019-10-16)
203
-
204
- Initial release
@@ -1,16 +0,0 @@
1
- {
2
- "project": "Pagean",
3
- "urls": [
4
- {
5
- "url": "https://about.gitlab.com/",
6
- "settings": {
7
- "consoleOutputTest": false,
8
- "externalScriptTest": false,
9
- "renderedHtmlTest": false,
10
- "brokenLinkTest": {
11
- "failWarn": false
12
- }
13
- }
14
- }
15
- ]
16
- }
package/jest.config.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "collectCoverage": true,
3
- "collectCoverageFrom": [
4
- "./*.js",
5
- "**/lib/*.js",
6
- "!**/tests/**"
7
- ],
8
- "reporters": [
9
- "default",
10
- [
11
- "jest-junit",
12
- {
13
- "suiteNameTemplate": "{filename}",
14
- "classNameTemplate": "{classname}",
15
- "titleTemplate": "{title}"
16
- }
17
- ]
18
- ],
19
- "verbose": true,
20
- "testEnvironment": "node",
21
- "testTimeout": 60000
22
- }
@@ -1,50 +0,0 @@
1
- {
2
- "project": "Pagean",
3
- "settings": {
4
- "pageLoadTimeTest": {
5
- "pageLoadTimeThreshold": 3
6
- },
7
- "brokenLinkTest": {
8
- "failWarn": false
9
- }
10
- },
11
- "urls": [
12
- "http://localhost:8080/consoleLog.html",
13
- "http://localhost:8080/dynamicContent.html",
14
- "http://localhost:8080/horizontalScrollbar.html",
15
- "http://localhost:8080/htmlError.html",
16
- {
17
- "url": "http://localhost:8080/scriptError404.html",
18
- "settings": {
19
- "consoleOutputTest": false,
20
- "externalScriptTest": false
21
- }
22
- },
23
- {
24
- "url": "http://localhost:8080/slowLoad.html",
25
- "settings": {
26
- "pageLoadTimeTest": {
27
- "pageLoadTimeThreshold": 2
28
- },
29
- "externalScriptTest": false
30
- }
31
- },
32
- {
33
- "url": "http://localhost:8080/externalScripts.html",
34
- "settings": {
35
- "consoleOutputTest": false,
36
- "consoleErrorTest": false
37
- }
38
- },
39
- {
40
- "url": "http://localhost:8080/brokenLinks.html",
41
- "settings": {
42
- "brokenLinkTest": {
43
- "ignoredLinks": [
44
- "https://this.url.is.ignored/"
45
- ]
46
- }
47
- }
48
- }
49
- ]
50
- }