accessibility-checker 3.1.0 → 3.1.4
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/README.md +3 -2
- package/bin/achecker.d.ts +2 -0
- package/bin/achecker.js +293 -177
- package/bin/achecker.js.map +1 -0
- package/index.d.ts +317 -0
- package/index.js +359 -13
- package/index.js.map +1 -0
- package/lib/ACBrowserManager.d.ts +22 -0
- package/lib/ACBrowserManager.js +237 -0
- package/lib/ACBrowserManager.js.map +1 -0
- package/lib/ACConfigManager.d.ts +6 -0
- package/lib/ACConfigManager.js +399 -0
- package/lib/ACConfigManager.js.map +1 -0
- package/lib/ACConstants.d.ts +17 -0
- package/lib/ACConstants.js +12 -38
- package/lib/ACConstants.js.map +1 -0
- package/lib/ACEngineManager.d.ts +21 -0
- package/lib/ACEngineManager.js +220 -0
- package/lib/ACEngineManager.js.map +1 -0
- package/lib/ACHelper.d.ts +2 -0
- package/lib/ACHelper.js +485 -2085
- package/lib/ACHelper.js.map +1 -0
- package/lib/ACReportManager.d.ts +586 -0
- package/lib/ACReportManager.js +1150 -0
- package/lib/ACReportManager.js.map +1 -0
- package/lib/api/IChecker.d.ts +131 -0
- package/lib/api/IChecker.js +11 -0
- package/lib/api/IChecker.js.map +1 -0
- package/lib/api/IEngine.d.ts +124 -0
- package/lib/api/IEngine.js +110 -0
- package/lib/api/IEngine.js.map +1 -0
- package/lib/api/IMapper.d.ts +37 -0
- package/lib/api/IMapper.js +18 -0
- package/lib/api/IMapper.js.map +1 -0
- package/lib/log/ACMetricsLogger.d.ts +67 -0
- package/lib/log/ACMetricsLogger.js +40 -66
- package/lib/log/ACMetricsLogger.js.map +1 -0
- package/lib/reporters/ACReporterCSV.d.ts +103 -0
- package/lib/reporters/ACReporterCSV.js +83 -152
- package/lib/reporters/ACReporterCSV.js.map +1 -0
- package/lib/reporters/ACReporterHTML.d.ts +114 -0
- package/lib/reporters/ACReporterHTML.js +150 -293
- package/lib/reporters/ACReporterHTML.js.map +1 -0
- package/lib/reporters/ACReporterJSON.d.ts +114 -0
- package/lib/reporters/ACReporterJSON.js +95 -249
- package/lib/reporters/ACReporterJSON.js.map +1 -0
- package/lib/reporters/ReportUtil.d.ts +33 -0
- package/lib/reporters/ReportUtil.js +65 -0
- package/lib/reporters/ReportUtil.js.map +1 -0
- package/lib/reporters/genReport.d.ts +1 -0
- package/lib/reporters/genReport.js +13 -11
- package/lib/reporters/genReport.js.map +1 -0
- package/package.json +4 -3
- package/lib/ACConfigLoader.js +0 -358
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ACReporterHTML.js","sourceRoot":"","sources":["../../../src-ts/lib/reporters/ACReporterHTML.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;gFAcgF;;;AAEhF,uCAAuC;AACvC,8BAAgC;AAChC,uBAAyB;AACzB,sDAAqD;AAGrD,yCAAwC;AAIxC;;;;;;;;;;;;;;;;GAgBG;AACH;IAII,wBAAY,MAA0B,EAAE,WAAyB;QA+FjE;;;;;;;;;;;WAWG;QACH,sBAAiB,GAAG,UAAU,SAAS;YACnC,uBAAuB;YACvB,IAAI,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,IAAI,EAAE,CAAC;YAClD,IAAI,cAAc,GAAG,KAAK,CAAC;YAE3B,+EAA+E;YAC/E,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;gBAEzC,qCAAqC;gBACrC,aAAa,GAAG,SAAS,CAAC;gBAE1B,cAAc,GAAG,IAAI,CAAC;aACzB;YAED,wEAAwE;YACxE,IAAI,CAAC,cAAc,EAAE;gBACjB,gFAAgF;gBAChF,uDAAuD;gBACvD,wFAAwF;gBACxF,mCAAmC;gBACnC,KAAK,IAAI,KAAK,IAAI,SAAS,EAAE;oBACzB,aAAa,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;iBAC5C;aACJ;YAED,6D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GAAiG;QACjG,0BAA0B;QAC1B,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,qBAAS,CAAC,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAExE,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;OAMG;IACH,oCAAW,GAAX,UAAY,OAAO;IAEnB,CAAC;IAED;;;;;;;;;OASG;IACH,oCAAW,GAAX,UAAY,MAAM;QACd,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAEjE,4FAA4F;QAC5F,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;QAE7C,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAE/D,OAAO,MAAM,CAAC;IAClB,CAAC;IACL,qBAAC;AAAD,CAAC,AAtRD,IAsRC;AAtRY,wCAAc;AAsR1B,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
Copyright:: 2020- IBM, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*****************************************************************************/
|
|
16
|
+
import { IConfigUnsupported } from "../api/IChecker";
|
|
17
|
+
import { IScanSummary } from "./ReportUtil";
|
|
18
|
+
/**
|
|
19
|
+
* This function is responsible for constructing the aChecker Reporter which will be used to, report
|
|
20
|
+
* the scan results, such as writing the page results and the summary to a JSON file. This reporter function
|
|
21
|
+
* is registered with Karma server and triggered based on events that are triggered by the karma communication.
|
|
22
|
+
*
|
|
23
|
+
* @param {Object} baseReporterDecorator - the base karma reporter, which had the base functions which we override
|
|
24
|
+
* @param {Object} config - All the Karma configuration, we will extract what we need from this over
|
|
25
|
+
* all object, we need the entire object so that we detect any changes in the object
|
|
26
|
+
* as other plugins are loaded and the object is updated dynamically.
|
|
27
|
+
* @param {Object} logger - logger object which is used to log debug/error/info messages
|
|
28
|
+
* @param {Object} emitter - emitter object which allows to listem on any event that is triggered and allow to execute
|
|
29
|
+
* custom code, to handle the event that was triggered.
|
|
30
|
+
*
|
|
31
|
+
* @return - N/A
|
|
32
|
+
*
|
|
33
|
+
* @memberOf this
|
|
34
|
+
*/
|
|
35
|
+
export declare class ACReporterJSON {
|
|
36
|
+
Config: IConfigUnsupported;
|
|
37
|
+
scanSummary: IScanSummary;
|
|
38
|
+
constructor(Config: IConfigUnsupported, scanSummary: IScanSummary);
|
|
39
|
+
report(info: any): void;
|
|
40
|
+
/**
|
|
41
|
+
* This function is responsible for performing any action when the entire karma run is done.
|
|
42
|
+
* Overrides onRunComplete function from baseReporterDecorator
|
|
43
|
+
*
|
|
44
|
+
* @override
|
|
45
|
+
*
|
|
46
|
+
* @memberOf this
|
|
47
|
+
*/
|
|
48
|
+
onRunComplete(): void;
|
|
49
|
+
/**
|
|
50
|
+
* This function is responsible for saving a single scans results to a file as JSON. On a side note
|
|
51
|
+
* this function will also extract the label which will be the file names where the results will be
|
|
52
|
+
* saved.
|
|
53
|
+
*
|
|
54
|
+
* @param {Object} config - Karma config object, used to extrat the outputFolder from the ACConfig.
|
|
55
|
+
* @param {Object} results - Provide the scan results for a single page that should be saved.
|
|
56
|
+
*
|
|
57
|
+
* @memberOf this
|
|
58
|
+
*/
|
|
59
|
+
savePageResults(results: any): void;
|
|
60
|
+
/**
|
|
61
|
+
* This function is responsible for converting a javascript object into JSON and then writing that to a
|
|
62
|
+
* json file.
|
|
63
|
+
*
|
|
64
|
+
* @param {String} fileName - Full path of file where the JSON object should be stored
|
|
65
|
+
* @param {String} content - The javascript object which should be converted and saved to file as JSON.
|
|
66
|
+
*
|
|
67
|
+
* @memberOf this
|
|
68
|
+
*/
|
|
69
|
+
writeObjectToFileAsJSON(fileName: any, content: any): void;
|
|
70
|
+
/**
|
|
71
|
+
* This function is responsible for saving the summary object of the while scan to a summary file.
|
|
72
|
+
*
|
|
73
|
+
* @param {Object} summary - The summary object that needs to be written to the summary file.
|
|
74
|
+
*
|
|
75
|
+
* @memberOf this
|
|
76
|
+
*/
|
|
77
|
+
saveSummary(summary: any): void;
|
|
78
|
+
/**
|
|
79
|
+
* This function is responsible for checking if a number needs a leading 0, and if it is needed
|
|
80
|
+
* add the leading 0 and return that as the new number.
|
|
81
|
+
*
|
|
82
|
+
* @param {int} number - Provide a number to check if a leading 0 needs to be added or not.
|
|
83
|
+
*
|
|
84
|
+
* @return {String} number - Return the number with the leading 0 added back
|
|
85
|
+
*
|
|
86
|
+
* @memberOf this
|
|
87
|
+
*/
|
|
88
|
+
datePadding(number: any): any;
|
|
89
|
+
/**
|
|
90
|
+
* This function is responsible for indexing the results into global spaces based on label.
|
|
91
|
+
*
|
|
92
|
+
* @param {Object} results - Results object which will be provided to the user/wroten to the file.
|
|
93
|
+
* Refer to aChecker.buildReport function's return to figure out what the object
|
|
94
|
+
* will look like.
|
|
95
|
+
*
|
|
96
|
+
* @return - N/A - Global object is updated with the results
|
|
97
|
+
*
|
|
98
|
+
* @memberOf this
|
|
99
|
+
*/
|
|
100
|
+
addResultsToGlobal(results: any): void;
|
|
101
|
+
/**
|
|
102
|
+
* This function is responsible for updating/creating the global violation summary for the engine karma run
|
|
103
|
+
* for browser that it is running on. Will take the pageCount object which is part of the page object and
|
|
104
|
+
* add extract the values for each of the levels and add them to the global object. This will provide an overall
|
|
105
|
+
* summary of violations for all testcases run and all scans done.
|
|
106
|
+
*
|
|
107
|
+
* @param {Object} pageCount - Provide the page count object, in the following format:
|
|
108
|
+
*
|
|
109
|
+
* @return N/A - Global summary object is updated with the counts
|
|
110
|
+
*
|
|
111
|
+
* @memberOf this
|
|
112
|
+
*/
|
|
113
|
+
addToSummaryCount(pageCount: any): void;
|
|
114
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/******************************************************************************
|
|
2
3
|
Copyright:: 2020- IBM, Inc
|
|
3
4
|
|
|
@@ -13,15 +14,11 @@
|
|
|
13
14
|
See the License for the specific language governing permissions and
|
|
14
15
|
limitations under the License.
|
|
15
16
|
*****************************************************************************/
|
|
16
|
-
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ACReporterJSON = void 0;
|
|
17
19
|
// Load all the modules that are needed
|
|
18
|
-
var pathLib = require(
|
|
19
|
-
var fs = require(
|
|
20
|
-
require("../ACConfigLoader");
|
|
21
|
-
|
|
22
|
-
// Global aChecker Summary Holder
|
|
23
|
-
var scanSummary = {};
|
|
24
|
-
|
|
20
|
+
var pathLib = require("path");
|
|
21
|
+
var fs = require("fs");
|
|
25
22
|
/**
|
|
26
23
|
* This function is responsible for constructing the aChecker Reporter which will be used to, report
|
|
27
24
|
* the scan results, such as writing the page results and the summary to a JSON file. This reporter function
|
|
@@ -39,29 +36,38 @@ var scanSummary = {};
|
|
|
39
36
|
*
|
|
40
37
|
* @memberOf this
|
|
41
38
|
*/
|
|
42
|
-
var ACReporterJSON = function (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
var ACReporterJSON = /** @class */ (function () {
|
|
40
|
+
function ACReporterJSON(Config, scanSummary) {
|
|
41
|
+
this.Config = Config;
|
|
42
|
+
this.scanSummary = scanSummary;
|
|
43
|
+
this.Config.DEBUG && console.log("START ACReporter Constructor");
|
|
44
|
+
var myThis = this;
|
|
45
|
+
if (typeof (after) !== "undefined") {
|
|
46
|
+
after(function (done) {
|
|
47
|
+
myThis.onRunComplete();
|
|
48
|
+
done && done();
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
process.on('beforeExit', function () {
|
|
53
|
+
myThis.onRunComplete();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
this.Config.DEBUG && console.log("END ACReporter Constructor");
|
|
57
|
+
}
|
|
48
58
|
// This emitter function is responsible for calling this function when the info event is detected
|
|
49
|
-
|
|
50
|
-
Config.DEBUG && console.log("START 'info' emitter function");
|
|
51
|
-
|
|
59
|
+
ACReporterJSON.prototype.report = function (info) {
|
|
60
|
+
this.Config.DEBUG && console.log("START 'info' emitter function");
|
|
52
61
|
// Save the results of a single scan to a JSON file based on the label provided
|
|
53
|
-
savePageResults(info);
|
|
54
|
-
|
|
62
|
+
this.savePageResults(info);
|
|
55
63
|
// Update the overall summary object count object to include the new scan that was performed
|
|
56
|
-
addToSummaryCount(info.summary.counts);
|
|
57
|
-
|
|
64
|
+
this.addToSummaryCount(info.summary.counts);
|
|
58
65
|
// Save the summary of this scan into global space of this reporter, to be logged
|
|
59
66
|
// once the whole scan is done.
|
|
60
|
-
addResultsToGlobal(info);
|
|
61
|
-
|
|
62
|
-
Config.DEBUG && console.log("END 'info' emitter function");
|
|
67
|
+
this.addResultsToGlobal(info);
|
|
68
|
+
this.Config.DEBUG && console.log("END 'info' emitter function");
|
|
63
69
|
};
|
|
64
|
-
|
|
70
|
+
;
|
|
65
71
|
/**
|
|
66
72
|
* This function is responsible for performing any action when the entire karma run is done.
|
|
67
73
|
* Overrides onRunComplete function from baseReporterDecorator
|
|
@@ -70,19 +76,16 @@ var ACReporterJSON = function (aChecker) {
|
|
|
70
76
|
*
|
|
71
77
|
* @memberOf this
|
|
72
78
|
*/
|
|
73
|
-
|
|
74
|
-
Config.DEBUG && console.log("START 'ACReporterJSON:onRunComplete' function");
|
|
75
|
-
|
|
79
|
+
ACReporterJSON.prototype.onRunComplete = function () {
|
|
80
|
+
this.Config.DEBUG && console.log("START 'ACReporterJSON:onRunComplete' function");
|
|
76
81
|
// Add End time when the whole karma run is done
|
|
77
82
|
// End time will be in milliseconds elapsed since 1 January 1970 00:00:00 UTC up until now.
|
|
78
|
-
scanSummary.endReport = Date.now();
|
|
79
|
-
|
|
83
|
+
this.scanSummary.endReport = Date.now();
|
|
80
84
|
// Save summary object to a JSON file.
|
|
81
|
-
saveSummary(scanSummary);
|
|
82
|
-
|
|
83
|
-
Config.DEBUG && console.log("END 'ACReporterJSON:onRunComplete' function");
|
|
85
|
+
this.saveSummary(this.scanSummary);
|
|
86
|
+
this.Config.DEBUG && console.log("END 'ACReporterJSON:onRunComplete' function");
|
|
84
87
|
};
|
|
85
|
-
|
|
88
|
+
;
|
|
86
89
|
/**
|
|
87
90
|
* This function is responsible for saving a single scans results to a file as JSON. On a side note
|
|
88
91
|
* this function will also extract the label which will be the file names where the results will be
|
|
@@ -93,32 +96,25 @@ var ACReporterJSON = function (aChecker) {
|
|
|
93
96
|
*
|
|
94
97
|
* @memberOf this
|
|
95
98
|
*/
|
|
96
|
-
|
|
97
|
-
Config.DEBUG && console.log("START 'savePageResults' function");
|
|
98
|
-
|
|
99
|
+
ACReporterJSON.prototype.savePageResults = function (results) {
|
|
100
|
+
this.Config.DEBUG && console.log("START 'savePageResults' function");
|
|
99
101
|
// Extract the outputFolder from the ACConfig (this is the user config that they provid)
|
|
100
|
-
var resultDir = Config.outputFolder;
|
|
101
|
-
|
|
102
|
-
Config.DEBUG && console.log("Results are going to be stored under results directory: \"" + resultDir + "\"");
|
|
103
|
-
|
|
102
|
+
var resultDir = this.Config.outputFolder;
|
|
103
|
+
this.Config.DEBUG && console.log("Results are going to be stored under results directory: \"" + resultDir + "\"");
|
|
104
104
|
// Build the full file name based on the label provide in the results and also the results dir specified in the
|
|
105
105
|
// configuration.
|
|
106
106
|
var resultsFileName = pathLib.join(resultDir, results.label + '.json');
|
|
107
|
-
|
|
108
107
|
/**************************************************** DEBUG INFORMATION ***************************************************************
|
|
109
108
|
// Debug example which has label which has unix "/" in them.
|
|
110
|
-
|
|
109
|
+
let resultsFileName = pathLib.join(resultDir, "dependencies/tools-rules-html/v2/a11y/test/g471/Table-layoutMultiple.html.json");
|
|
111
110
|
|
|
112
111
|
// Debug example which has a label which has Windows "\" in them.
|
|
113
|
-
|
|
112
|
+
let resultsFileName = pathLib.join(resultDir, "dependencies\\tools-rules-html\\v2\\a11y\\test\\g471\\Table-layoutMultiple.html.json");
|
|
114
113
|
***************************************************************************************************************************************/
|
|
115
|
-
|
|
116
114
|
// Write the results object as JSON to a file.
|
|
117
|
-
writeObjectToFileAsJSON(resultsFileName, results);
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
115
|
+
this.writeObjectToFileAsJSON(resultsFileName, results);
|
|
116
|
+
this.Config.DEBUG && console.log("END 'savePageResults' function");
|
|
117
|
+
};
|
|
122
118
|
/**
|
|
123
119
|
* This function is responsible for converting a javascript object into JSON and then writing that to a
|
|
124
120
|
* json file.
|
|
@@ -128,133 +124,24 @@ var ACReporterJSON = function (aChecker) {
|
|
|
128
124
|
*
|
|
129
125
|
* @memberOf this
|
|
130
126
|
*/
|
|
131
|
-
|
|
132
|
-
Config.DEBUG && console.log("START 'writeObjectToFileAsJSON' function");
|
|
133
|
-
|
|
127
|
+
ACReporterJSON.prototype.writeObjectToFileAsJSON = function (fileName, content) {
|
|
128
|
+
this.Config.DEBUG && console.log("START 'writeObjectToFileAsJSON' function");
|
|
134
129
|
// Extract the parent directory of the file name that is provided
|
|
135
130
|
var parentDir = pathLib.dirname(fileName);
|
|
136
|
-
|
|
137
|
-
Config.DEBUG && console.log("Parent Directoy: \"" + parentDir + "\"");
|
|
138
|
-
|
|
131
|
+
this.Config.DEBUG && console.log("Parent Directoy: \"" + parentDir + "\"");
|
|
139
132
|
// In the case that the parent directoy does not exist, create the directories
|
|
140
133
|
if (!fs.existsSync(parentDir)) {
|
|
141
|
-
|
|
142
134
|
// Create the parent directory recerseivly if it does not exist.
|
|
143
|
-
fs.mkdirSync(parentDir, { recursive: true});
|
|
135
|
+
fs.mkdirSync(parentDir, { recursive: true });
|
|
144
136
|
}
|
|
145
|
-
|
|
146
|
-
Config.DEBUG && console.log("Object will be written to file: \"" + fileName + "\"");
|
|
147
|
-
|
|
137
|
+
this.Config.DEBUG && console.log("Object will be written to file: \"" + fileName + "\"");
|
|
148
138
|
// Convert the Object into JSON string and write that to the file
|
|
149
139
|
// Make sure to use utf-8 encoding to avoid an issues specify to OS.
|
|
150
140
|
// In terms of the JSON string that is constructed use 4 spaces to format the JSON object, before
|
|
151
141
|
// writing it to the file.
|
|
152
142
|
fs.writeFileSync(fileName, JSON.stringify(content, null, ' '), { encoding: 'utf-8' });
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* This function is responsible for initializing the summary object which will store all informations about the
|
|
159
|
-
* scans that will occurs while karma is still running and running compliance scans.
|
|
160
|
-
*
|
|
161
|
-
* @return {Object} scanSummary - return the built scan summary object, which will follow the following format:
|
|
162
|
-
* {
|
|
163
|
-
* "scanID": "ef3aec68-f073-4f9c-b372-421ae00bd55d",
|
|
164
|
-
* "counts": {
|
|
165
|
-
* "violation": 0,
|
|
166
|
-
* "potentialviolation": 0,
|
|
167
|
-
* "recommendation": 0,
|
|
168
|
-
* "potentialrecommendation": 0,
|
|
169
|
-
* "manual": 0
|
|
170
|
-
* },
|
|
171
|
-
* "startReport": "2016-06-06T00:52:41.603Z",
|
|
172
|
-
* "endReport": "",
|
|
173
|
-
* "toolID": "karma-ibma-v1.0.0",
|
|
174
|
-
* "policies": [
|
|
175
|
-
* "CI162_5_2_DCP070116",
|
|
176
|
-
* "CI162_5_2_DCP080115"
|
|
177
|
-
* ],
|
|
178
|
-
* "reportLevels": [
|
|
179
|
-
* "violation",
|
|
180
|
-
* "potentialviolation",
|
|
181
|
-
* "recommendation",
|
|
182
|
-
* "potentialrecommendation",
|
|
183
|
-
* "manual"
|
|
184
|
-
* ],
|
|
185
|
-
* "labels": [
|
|
186
|
-
* "Firefox",
|
|
187
|
-
* "master",
|
|
188
|
-
* "V12",
|
|
189
|
-
* "Linux"
|
|
190
|
-
* ],
|
|
191
|
-
* "pageScanSummary": {}
|
|
192
|
-
* }
|
|
193
|
-
*
|
|
194
|
-
* @memberOf this
|
|
195
|
-
*/
|
|
196
|
-
var initializeSummary = function (config) {
|
|
197
|
-
// Variable Decleration
|
|
198
|
-
var scanSummary = {};
|
|
199
|
-
var reportLevels = Config.reportLevels;
|
|
200
|
-
|
|
201
|
-
// Initialize counts
|
|
202
|
-
scanSummary.counts = {}
|
|
203
|
-
|
|
204
|
-
// In the case that report levels are provided then populate the count object in
|
|
205
|
-
// scanSummary.counts object with the levels which were provided in reportLevels
|
|
206
|
-
// array.
|
|
207
|
-
if (reportLevels) {
|
|
208
|
-
|
|
209
|
-
// Iterate over the report levels and populate the pageResultsWithCount counts
|
|
210
|
-
// object
|
|
211
|
-
reportLevels.forEach(function (levels) {
|
|
212
|
-
scanSummary.counts[levels] = 0;
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
// Populate the scanSummary.counts object with all the levels
|
|
216
|
-
else {
|
|
217
|
-
scanSummary.counts = {
|
|
218
|
-
"violation": 0,
|
|
219
|
-
"potentialviolation": 0,
|
|
220
|
-
"recommendation": 0,
|
|
221
|
-
"potentialrecommendation": 0,
|
|
222
|
-
"manual": 0,
|
|
223
|
-
"pass": 0
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// Add ignored count disableIgnore field in config file is not true
|
|
228
|
-
if(Config.disableIgnore == undefined || Config.disableIgnore == false || Config.disableIgnore == null){
|
|
229
|
-
scanSummary.counts.ignored = 0;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Add Start time when this script is loaded into browser
|
|
233
|
-
// Start time will be in milliseconds elapsed since 1 January 1970 00:00:00 UTC up until now.
|
|
234
|
-
scanSummary.startReport = Date.now();
|
|
235
|
-
|
|
236
|
-
// Leave end report as empty for now
|
|
237
|
-
scanSummary.endReport = '';
|
|
238
|
-
|
|
239
|
-
// Add the toolID, ruleArchive, policies, reportLevels, failLevels and labels from the config to the summary
|
|
240
|
-
scanSummary.toolID = Config.toolID;
|
|
241
|
-
// Append the id and the name of the archive to the report.
|
|
242
|
-
scanSummary.policies = Config.policies;
|
|
243
|
-
scanSummary.ruleArchive = Config.ruleArchive;
|
|
244
|
-
scanSummary.reportLevels = Config.reportLevels;
|
|
245
|
-
scanSummary.labels = Config.label;
|
|
246
|
-
scanSummary.failLevels = Config.failLevels;
|
|
247
|
-
|
|
248
|
-
// Add scanID (UUID) to the scan summary object
|
|
249
|
-
scanSummary.scanID = Config.scanID;
|
|
250
|
-
|
|
251
|
-
// Build the paceScanSummary object which will contains all the items that were scanned and a count
|
|
252
|
-
// summary for each of the scanned items.
|
|
253
|
-
scanSummary.pageScanSummary = [];
|
|
254
|
-
|
|
255
|
-
return scanSummary;
|
|
256
|
-
}
|
|
257
|
-
|
|
143
|
+
this.Config.DEBUG && console.log("END 'writeObjectToFileAsJSON' function");
|
|
144
|
+
};
|
|
258
145
|
/**
|
|
259
146
|
* This function is responsible for saving the summary object of the while scan to a summary file.
|
|
260
147
|
*
|
|
@@ -262,54 +149,42 @@ var ACReporterJSON = function (aChecker) {
|
|
|
262
149
|
*
|
|
263
150
|
* @memberOf this
|
|
264
151
|
*/
|
|
265
|
-
|
|
266
|
-
if (Config.outputFormat.indexOf("json") === -1) {
|
|
152
|
+
ACReporterJSON.prototype.saveSummary = function (summary) {
|
|
153
|
+
if (this.Config.outputFormat.indexOf("json") === -1) {
|
|
267
154
|
return;
|
|
268
155
|
}
|
|
269
|
-
Config.DEBUG && console.log("START 'saveSummary' function");
|
|
270
|
-
|
|
156
|
+
this.Config.DEBUG && console.log("START 'saveSummary' function");
|
|
271
157
|
// Fetch the start time of the report from the summary object
|
|
272
158
|
var startReportTime = summary.startReport;
|
|
273
|
-
|
|
274
159
|
// Extract the outputFolder from the ACConfig (this is the user config that they provid)
|
|
275
|
-
var resultDir = Config.outputFolder;
|
|
276
|
-
|
|
277
|
-
Config.DEBUG && console.log("Converting: " + startReportTime);
|
|
278
|
-
|
|
160
|
+
var resultDir = this.Config.outputFolder;
|
|
161
|
+
this.Config.DEBUG && console.log("Converting: " + startReportTime);
|
|
279
162
|
// Now we need to take the from epoch format date and convert it to readable data
|
|
280
163
|
// Construct a new Data object with the start report time
|
|
281
164
|
var formattedData = new Date(startReportTime);
|
|
282
|
-
|
|
283
165
|
// Extract all the date fields which are needed to construct the filename
|
|
284
|
-
var year = datePadding(formattedData.getUTCFullYear());
|
|
285
|
-
var month = datePadding(formattedData.getUTCMonth()+1); // UTC Month is provid in a range of A Number, from 0-11, representing the month
|
|
286
|
-
var date = datePadding(formattedData.getUTCDate());
|
|
287
|
-
var hour = datePadding(formattedData.getHours());
|
|
288
|
-
var minute = datePadding(formattedData.getMinutes());
|
|
289
|
-
var seconds = datePadding(formattedData.getUTCSeconds());
|
|
290
|
-
|
|
291
|
-
Config.DEBUG && console.log("
|
|
292
|
-
Config.DEBUG && console.log("
|
|
293
|
-
Config.DEBUG && console.log("
|
|
294
|
-
Config.DEBUG && console.log("
|
|
295
|
-
Config.DEBUG && console.log("
|
|
296
|
-
Config.DEBUG && console.log("Seconds: " + seconds);
|
|
297
|
-
|
|
166
|
+
var year = this.datePadding(formattedData.getUTCFullYear());
|
|
167
|
+
var month = this.datePadding(formattedData.getUTCMonth() + 1); // UTC Month is provid in a range of A Number, from 0-11, representing the month
|
|
168
|
+
var date = this.datePadding(formattedData.getUTCDate());
|
|
169
|
+
var hour = this.datePadding(formattedData.getHours());
|
|
170
|
+
var minute = this.datePadding(formattedData.getMinutes());
|
|
171
|
+
var seconds = this.datePadding(formattedData.getUTCSeconds());
|
|
172
|
+
this.Config.DEBUG && console.log("Year: " + year);
|
|
173
|
+
this.Config.DEBUG && console.log("Month: " + month);
|
|
174
|
+
this.Config.DEBUG && console.log("Date: " + date);
|
|
175
|
+
this.Config.DEBUG && console.log("Hour: " + hour);
|
|
176
|
+
this.Config.DEBUG && console.log("Minute: " + minute);
|
|
177
|
+
this.Config.DEBUG && console.log("Seconds: " + seconds);
|
|
298
178
|
// Build the summary file name based on the following format: summary_2016-06-20-13-26-45GMT.json
|
|
299
179
|
// summary_<year>-<month>-<date>-<hour>-<minute>-<seconds>GMT.json
|
|
300
180
|
var filename = "summary_" + year + "-" + month + "-" + date + "-" + hour + "-" + minute + "-" + seconds + "GMT.json";
|
|
301
|
-
|
|
302
181
|
// Add the results dir to the filename so that all the summary files can be saved under the output folder
|
|
303
182
|
filename = pathLib.join(resultDir, filename);
|
|
304
|
-
|
|
305
|
-
Config.DEBUG && console.log("Filename Constructed: " + filename);
|
|
306
|
-
|
|
183
|
+
this.Config.DEBUG && console.log("Filename Constructed: " + filename);
|
|
307
184
|
// Write the summary object as json to the summary file.
|
|
308
|
-
writeObjectToFileAsJSON(filename, summary);
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
|
|
185
|
+
this.writeObjectToFileAsJSON(filename, summary);
|
|
186
|
+
this.Config.DEBUG && console.log("END 'saveSummary' function");
|
|
187
|
+
};
|
|
313
188
|
/**
|
|
314
189
|
* This function is responsible for checking if a number needs a leading 0, and if it is needed
|
|
315
190
|
* add the leading 0 and return that as the new number.
|
|
@@ -320,17 +195,13 @@ var ACReporterJSON = function (aChecker) {
|
|
|
320
195
|
*
|
|
321
196
|
* @memberOf this
|
|
322
197
|
*/
|
|
323
|
-
|
|
324
|
-
Config.DEBUG && console.log("START 'datePadding' function");
|
|
325
|
-
|
|
198
|
+
ACReporterJSON.prototype.datePadding = function (number) {
|
|
199
|
+
this.Config.DEBUG && console.log("START 'datePadding' function");
|
|
326
200
|
// In the case that the number is less then 10 we need to add the leading '0' to the number.
|
|
327
201
|
number = number < 10 ? '0' + number : number;
|
|
328
|
-
|
|
329
|
-
Config.DEBUG && console.log("END 'datePadding' function");
|
|
330
|
-
|
|
202
|
+
this.Config.DEBUG && console.log("END 'datePadding' function");
|
|
331
203
|
return number;
|
|
332
|
-
}
|
|
333
|
-
|
|
204
|
+
};
|
|
334
205
|
/**
|
|
335
206
|
* This function is responsible for indexing the results into global spaces based on label.
|
|
336
207
|
*
|
|
@@ -342,9 +213,8 @@ var ACReporterJSON = function (aChecker) {
|
|
|
342
213
|
*
|
|
343
214
|
* @memberOf this
|
|
344
215
|
*/
|
|
345
|
-
|
|
346
|
-
Config.DEBUG && console.log("START 'addResultsToGlobal' function");
|
|
347
|
-
|
|
216
|
+
ACReporterJSON.prototype.addResultsToGlobal = function (results) {
|
|
217
|
+
this.Config.DEBUG && console.log("START 'addResultsToGlobal' function");
|
|
348
218
|
// Build the single page summary object to follow the following format:
|
|
349
219
|
// "label": "dependencies/tools-rules-html/v2/a11y/test/g471/Table-DataNoSummaryARIA.html",
|
|
350
220
|
// "counts": {
|
|
@@ -357,18 +227,14 @@ var ACReporterJSON = function (aChecker) {
|
|
|
357
227
|
var pageSummaryObject = {
|
|
358
228
|
label: results.label,
|
|
359
229
|
counts: results.summary.counts
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
Config.DEBUG && console.log(
|
|
363
|
-
Config.DEBUG && console.log(pageSummaryObject);
|
|
364
|
-
|
|
230
|
+
};
|
|
231
|
+
this.Config.DEBUG && console.log("Adding following object to scanSummary.pageScanSummary: ");
|
|
232
|
+
this.Config.DEBUG && console.log(pageSummaryObject);
|
|
365
233
|
// Add the summary count for this scan to the pageScanSummary object which is in the global space
|
|
366
234
|
// Index this by the label.
|
|
367
|
-
scanSummary.pageScanSummary.push(pageSummaryObject);
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
371
|
-
|
|
235
|
+
this.scanSummary.pageScanSummary.push(pageSummaryObject);
|
|
236
|
+
this.Config.DEBUG && console.log("END 'addResultsToGlobal' function");
|
|
237
|
+
};
|
|
372
238
|
/**
|
|
373
239
|
* This function is responsible for updating/creating the global violation summary for the engine karma run
|
|
374
240
|
* for browser that it is running on. Will take the pageCount object which is part of the page object and
|
|
@@ -381,21 +247,16 @@ var ACReporterJSON = function (aChecker) {
|
|
|
381
247
|
*
|
|
382
248
|
* @memberOf this
|
|
383
249
|
*/
|
|
384
|
-
|
|
385
|
-
|
|
250
|
+
ACReporterJSON.prototype.addToSummaryCount = function (pageCount) {
|
|
386
251
|
// Variable Decleration
|
|
387
|
-
var ACScanSummary = scanSummary.counts || {};
|
|
252
|
+
var ACScanSummary = this.scanSummary.counts || {};
|
|
388
253
|
var addedToSummary = false;
|
|
389
|
-
|
|
390
254
|
// In the case ACScanSummary is empty, simply assign pageCount to ACScanSummary
|
|
391
255
|
if (Object.keys(ACScanSummary).length === 0) {
|
|
392
|
-
|
|
393
256
|
// Set pageCount as the summary count
|
|
394
257
|
ACScanSummary = pageCount;
|
|
395
|
-
|
|
396
258
|
addedToSummary = true;
|
|
397
259
|
}
|
|
398
|
-
|
|
399
260
|
// In the case that this is not first scan, handle adding up the summary
|
|
400
261
|
if (!addedToSummary) {
|
|
401
262
|
// Go through the pageCount object and for each of the levels, extract the value
|
|
@@ -406,26 +267,11 @@ var ACReporterJSON = function (aChecker) {
|
|
|
406
267
|
ACScanSummary[level] += pageCount[level];
|
|
407
268
|
}
|
|
408
269
|
}
|
|
409
|
-
|
|
410
270
|
// Assign the new violation summary back to the global object
|
|
411
|
-
scanSummary.counts = ACScanSummary;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
after(function(done) {
|
|
419
|
-
myThis.onRunComplete();
|
|
420
|
-
done && done();
|
|
421
|
-
});
|
|
422
|
-
} else {
|
|
423
|
-
process.on('beforeExit', function() {
|
|
424
|
-
myThis.onRunComplete();
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
Config.DEBUG && console.log("END ACReporter Constructor");
|
|
428
|
-
};
|
|
429
|
-
|
|
430
|
-
// Export this function, which will be called when accessibility-checker loads
|
|
431
|
-
module.exports = ACReporterJSON;
|
|
271
|
+
this.scanSummary.counts = ACScanSummary;
|
|
272
|
+
};
|
|
273
|
+
return ACReporterJSON;
|
|
274
|
+
}());
|
|
275
|
+
exports.ACReporterJSON = ACReporterJSON;
|
|
276
|
+
;
|
|
277
|
+
//# sourceMappingURL=ACReporterJSON.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ACReporterJSON.js","sourceRoot":"","sources":["../../../src-ts/lib/reporters/ACReporterJSON.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;gFAcgF;;;AAEhF,uCAAuC;AACvC,8BAAgC;AAChC,uBAAyB;AAMzB;;;;;;;;;;;;;;;;GAgBG;AACH;IAGI,wBAAY,MAA0B,EAAE,WAAyB;QAC7D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;QAEjE,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,IAAI,OAAM,CAAC,KAAK,CAAC,KAAK,WAAW,EAAE;YAC/B,KAAK,CAAC,UAAS,IAAI;gBACf,MAAM,CAAC,aAAa,EAAE,CAAC;gBACvB,IAAI,IAAI,IAAI,EAAE,CAAC;YACnB,CAAC,CAAC,CAAC;SACN;aAAM;YACH,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE;gBACrB,MAAM,CAAC,aAAa,EAAE,CAAC;YAC3B,CAAC,CAAC,CAAC;SACN;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG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AAC;QAE3B,+EAA+E;QAC/E,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YAEzC,qCAAqC;YACrC,aAAa,GAAG,SAAS,CAAC;YAE1B,cAAc,GAAG,IAAI,CAAC;SACzB;QAED,wEAAwE;QACxE,IAAI,CAAC,cAAc,EAAE;YACjB,gFAAgF;YAChF,uDAAuD;YACvD,wFAAwF;YACxF,mCAAmC;YACnC,KAAK,IAAI,KAAK,IAAI,SAAS,EAAE;gBACzB,aAAa,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;aAC5C;SACJ;QAED,6DAA6D;QAC7D,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,aAAa,CAAC;IAC5C,CAAC;IAEL,qBAAC;AAAD,CAAC,AA/RD,IA+RC;AA/RY,wCAAc;AA+R1B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IConfigUnsupported } from "../api/IChecker";
|
|
2
|
+
export interface IPageScanSummary {
|
|
3
|
+
label: string;
|
|
4
|
+
}
|
|
5
|
+
export interface IScanSummaryCounts {
|
|
6
|
+
ignored?: number;
|
|
7
|
+
violation?: number;
|
|
8
|
+
review?: number;
|
|
9
|
+
recommendation?: number;
|
|
10
|
+
recommendationreview?: number;
|
|
11
|
+
pass?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface IScanSummary {
|
|
14
|
+
counts: IScanSummaryCounts;
|
|
15
|
+
startReport: number;
|
|
16
|
+
endReport: number;
|
|
17
|
+
toolID: string;
|
|
18
|
+
policies: string;
|
|
19
|
+
reportLevels: string[];
|
|
20
|
+
labels: string[];
|
|
21
|
+
failLevels: string[];
|
|
22
|
+
scanID: string;
|
|
23
|
+
pageScanSummary: IPageScanSummary[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* This function is responsible for initializing the summary object which will store all informations about the
|
|
27
|
+
* scans that will occurs while karma is still running and running compliance scans.
|
|
28
|
+
*
|
|
29
|
+
* @return {Object} scanSummary - return the built scan summary object
|
|
30
|
+
*
|
|
31
|
+
* @memberOf this
|
|
32
|
+
*/
|
|
33
|
+
export declare function initializeSummary(config: IConfigUnsupported): IScanSummary;
|