testilo 3.4.1 → 3.5.0
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/package.json +1 -1
- package/procs/digest/dp11a/index.html +76 -0
- package/procs/digest/dp11a/index.js +127 -0
- package/procs/score/sp11a.js +1968 -0
- package/scoring/procs/tempgroup.js +96 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
tempgroup
|
|
3
|
+
Converts groups.json for inclusion in score procs.
|
|
4
|
+
*/
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
// Initialize the data.
|
|
7
|
+
const groupWeights = {
|
|
8
|
+
accessKeyDuplicate: 3,
|
|
9
|
+
activeEmbedding: 2,
|
|
10
|
+
allCaps: 1,
|
|
11
|
+
ariaReferenceBad: 4,
|
|
12
|
+
autocompleteBad: 2,
|
|
13
|
+
buttonNoText: 4,
|
|
14
|
+
childMissing: 3,
|
|
15
|
+
contrastAA: 3,
|
|
16
|
+
contrastAAA: 1,
|
|
17
|
+
duplicateID: 2,
|
|
18
|
+
eventKeyboard: 3,
|
|
19
|
+
fieldSetMissing: 2,
|
|
20
|
+
focusableOperable: 3,
|
|
21
|
+
focusIndication: 3,
|
|
22
|
+
h1Missing: 1,
|
|
23
|
+
headingEmpty: 2,
|
|
24
|
+
headingStructure: 2,
|
|
25
|
+
hoverSurprise: 1,
|
|
26
|
+
iframeNoText: 3,
|
|
27
|
+
imageInputNoText: 4,
|
|
28
|
+
imageMapAreaNoText: 3,
|
|
29
|
+
imageNoText: 4,
|
|
30
|
+
imageTextRedundant: 1,
|
|
31
|
+
inconsistentStyles: 1,
|
|
32
|
+
contrastRisk: 1,
|
|
33
|
+
labelClash: 2,
|
|
34
|
+
labelForBadID: 4,
|
|
35
|
+
languageChange: 2,
|
|
36
|
+
leadingClipsText: 3,
|
|
37
|
+
leadingFrozen: 3,
|
|
38
|
+
linkForcesNewWindow: 2,
|
|
39
|
+
linkNoText: 4,
|
|
40
|
+
linkPair: 1,
|
|
41
|
+
linkTextsSame: 2,
|
|
42
|
+
linkTitleRedundant: 1,
|
|
43
|
+
linkUnderlines: 2,
|
|
44
|
+
menuNavigation: 2,
|
|
45
|
+
metaBansZoom: 3,
|
|
46
|
+
nameValue: 3,
|
|
47
|
+
noLeading: 2,
|
|
48
|
+
objectNoText: 2,
|
|
49
|
+
pageLanguage: 3,
|
|
50
|
+
pageLanguageBad: 3,
|
|
51
|
+
pageTitle: 3,
|
|
52
|
+
parentMissing: 3,
|
|
53
|
+
pseudoHeadingRisk: 1,
|
|
54
|
+
pseudoLinkRisk: 2,
|
|
55
|
+
pseudoListRisk: 1,
|
|
56
|
+
roleBad: 3,
|
|
57
|
+
roleBadAttribute: 3,
|
|
58
|
+
roleMissingAttribute: 3,
|
|
59
|
+
selectFlatRisk: 1,
|
|
60
|
+
selectNoText: 3,
|
|
61
|
+
spontaneousMotion: 2,
|
|
62
|
+
svgImageNoText: 4,
|
|
63
|
+
tabFocusability: 3,
|
|
64
|
+
tabNavigation: 2,
|
|
65
|
+
targetSize: 2,
|
|
66
|
+
textBeyondLandmarks: 1,
|
|
67
|
+
visibleBulk: 1,
|
|
68
|
+
zIndexNotZero: 1
|
|
69
|
+
};
|
|
70
|
+
const groups = {};
|
|
71
|
+
const compile = () => {
|
|
72
|
+
const oldGroupsJSON = fs.readFileSync(`${__dirname}/../data/groups.json`, 'utf8');
|
|
73
|
+
const oldGroups = JSON.parse(oldGroupsJSON);
|
|
74
|
+
const groupIDs = Object.keys(oldGroups);
|
|
75
|
+
groupIDs.forEach(groupID => {
|
|
76
|
+
groups[groupID] = {
|
|
77
|
+
weight: groupWeights[groupID] || 0,
|
|
78
|
+
packages: {}
|
|
79
|
+
};
|
|
80
|
+
const packageIDs = Object.keys(oldGroups[groupID]);
|
|
81
|
+
packageIDs.forEach(packageID => {
|
|
82
|
+
groups[groupID].packages[packageID] = {};
|
|
83
|
+
const testStrings = oldGroups[groupID][packageID];
|
|
84
|
+
testStrings.forEach(testString => {
|
|
85
|
+
const testID = testString.replace(/ .+/, '');
|
|
86
|
+
const testWhat = testString.replace(/^[^ ]+ /, '');
|
|
87
|
+
groups[groupID].packages[packageID][testID] = {
|
|
88
|
+
weight: 0,
|
|
89
|
+
what: testWhat
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
console.log(JSON.stringify(groups, null, 2));
|
|
95
|
+
};
|
|
96
|
+
compile();
|