@qualweb/earl-reporter 0.3.0 → 0.4.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 +14 -14
- package/README.md +68 -68
- package/dist/contants.d.ts +941 -0
- package/dist/contants.d.ts.map +1 -0
- package/dist/contants.js +945 -0
- package/dist/contants.js.map +1 -0
- package/dist/index.d.ts +6 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +155 -134
- package/dist/index.js.map +1 -1
- package/package.json +63 -51
- package/.eslintignore +0 -3
- package/.eslintrc +0 -19
- package/.prettierrc +0 -6
- package/CHANGELOG +0 -86
- package/dist/lib/act-rules.reporter.d.ts +0 -6
- package/dist/lib/act-rules.reporter.d.ts.map +0 -1
- package/dist/lib/act-rules.reporter.js +0 -59
- package/dist/lib/act-rules.reporter.js.map +0 -1
- package/dist/lib/best-practices.reporter.d.ts +0 -6
- package/dist/lib/best-practices.reporter.d.ts.map +0 -1
- package/dist/lib/best-practices.reporter.js +0 -58
- package/dist/lib/best-practices.reporter.js.map +0 -1
- package/dist/lib/wcag-techniques.reporter.d.ts +0 -6
- package/dist/lib/wcag-techniques.reporter.d.ts.map +0 -1
- package/dist/lib/wcag-techniques.reporter.js +0 -59
- package/dist/lib/wcag-techniques.reporter.js.map +0 -1
- package/src/index.ts +0 -130
- package/src/lib/act-rules.reporter.ts +0 -61
- package/src/lib/best-practices.reporter.ts +0 -58
- package/src/lib/wcag-techniques.reporter.ts +0 -58
- package/test/modules.spec.js +0 -286
- package/test/report.spec.js +0 -665
- package/tsconfig.json +0 -38
package/test/report.spec.js
DELETED
|
@@ -1,665 +0,0 @@
|
|
|
1
|
-
import { expect } from 'chai';
|
|
2
|
-
import reporter from '../dist/index';
|
|
3
|
-
// https://ciencias.ulisboa.pt - 05/08/2019 15:31
|
|
4
|
-
const evaluationReport = {
|
|
5
|
-
"type": "evaluation",
|
|
6
|
-
"system": {
|
|
7
|
-
"name": "QualWeb",
|
|
8
|
-
"description": "QualWeb is an automatic accessibility evaluator for webpages.",
|
|
9
|
-
"version": "3.0.0",
|
|
10
|
-
"homepage": "http://www.qualweb.di.fc.ul.pt/",
|
|
11
|
-
"date": "8/5/2019",
|
|
12
|
-
"hash": "491d2298c471c51df262d524741bb9aa9eb70090",
|
|
13
|
-
"url": {
|
|
14
|
-
"inputUrl": "https://ciencias.ulisboa.pt",
|
|
15
|
-
"protocol": "https",
|
|
16
|
-
"domainName": "ciencias.ulisboa.pt",
|
|
17
|
-
"domain": "pt",
|
|
18
|
-
"uri": "",
|
|
19
|
-
"completeUrl": "https://ciencias.ulisboa.pt"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"modules": {
|
|
23
|
-
"act-rules": {
|
|
24
|
-
"type": "act-rules",
|
|
25
|
-
"rules": {
|
|
26
|
-
"QW-ACT-R4": {
|
|
27
|
-
"name": "Meta-refresh no delay",
|
|
28
|
-
"code": "QW-ACT-R4",
|
|
29
|
-
"mapping": "bc659a",
|
|
30
|
-
"description": "This rule checks that the meta element is not used for delayed redirecting or refreshing.",
|
|
31
|
-
"metadata": {
|
|
32
|
-
"target": {
|
|
33
|
-
"element": "meta"
|
|
34
|
-
},
|
|
35
|
-
"success-criteria": [{
|
|
36
|
-
"name": "2.1.1",
|
|
37
|
-
"level": "A",
|
|
38
|
-
"principle": "Operable"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"name": "2.2.4",
|
|
42
|
-
"level": "AAA",
|
|
43
|
-
"principle": "Operable"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"name": "3.2.5",
|
|
47
|
-
"level": "AAA",
|
|
48
|
-
"principle": "Understandable"
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
"related": [
|
|
52
|
-
"H76",
|
|
53
|
-
"F40",
|
|
54
|
-
"F41"
|
|
55
|
-
],
|
|
56
|
-
"url": "https://act-rules.github.io/rules/bc659a",
|
|
57
|
-
"passed": 0,
|
|
58
|
-
"failed": 0,
|
|
59
|
-
"inapplicable": 6,
|
|
60
|
-
"type": [
|
|
61
|
-
"ACTRule",
|
|
62
|
-
"TestCase"
|
|
63
|
-
],
|
|
64
|
-
"outcome": "inapplicable",
|
|
65
|
-
"description": "\"Content\" attribute is invalid\""
|
|
66
|
-
},
|
|
67
|
-
"results": [{
|
|
68
|
-
"verdict": "inapplicable",
|
|
69
|
-
"description": "\"Content\" attribute is invalid\"",
|
|
70
|
-
"code": "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">",
|
|
71
|
-
"pointer": "html > head > meta:nth-of-type(1)"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"verdict": "inapplicable",
|
|
75
|
-
"description": "Inexistent attribute \"http-equiv\"",
|
|
76
|
-
"code": "<meta name=\"theme-color\" content=\"#2c3fb1\">",
|
|
77
|
-
"pointer": "html > head > meta:nth-of-type(2)"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"verdict": "inapplicable",
|
|
81
|
-
"description": "Inexistent attribute \"http-equiv\"",
|
|
82
|
-
"code": "<meta name=\"generator\" content=\"Drupal 7 (https://www.drupal.org)\">",
|
|
83
|
-
"pointer": "html > head > meta:nth-of-type(3)"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"verdict": "inapplicable",
|
|
87
|
-
"description": "Inexistent attribute \"http-equiv\"",
|
|
88
|
-
"code": "<meta name=\"MobileOptimized\" content=\"width\">",
|
|
89
|
-
"pointer": "html > head > meta:nth-of-type(4)"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"verdict": "inapplicable",
|
|
93
|
-
"description": "Inexistent attribute \"http-equiv\"",
|
|
94
|
-
"code": "<meta name=\"HandheldFriendly\" content=\"true\">",
|
|
95
|
-
"pointer": "html > head > meta:nth-of-type(5)"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"verdict": "inapplicable",
|
|
99
|
-
"description": "Inexistent attribute \"http-equiv\"",
|
|
100
|
-
"code": "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">",
|
|
101
|
-
"pointer": "html > head > meta:nth-of-type(6)"
|
|
102
|
-
}
|
|
103
|
-
]
|
|
104
|
-
},
|
|
105
|
-
"QW-ACT-R1": {
|
|
106
|
-
"name": "HTML Page has a title",
|
|
107
|
-
"code": "QW-ACT-R1",
|
|
108
|
-
"mapping": "2779a5",
|
|
109
|
-
"description": "This rule checks that the HTML page has a title.",
|
|
110
|
-
"metadata": {
|
|
111
|
-
"target": {
|
|
112
|
-
"element": "title"
|
|
113
|
-
},
|
|
114
|
-
"success-criteria": [{
|
|
115
|
-
"name": "2.4.2",
|
|
116
|
-
"level": "A",
|
|
117
|
-
"principle": "Operable"
|
|
118
|
-
}],
|
|
119
|
-
"related": [],
|
|
120
|
-
"url": "https://act-rules.github.io/rules/2779a5",
|
|
121
|
-
"passed": 1,
|
|
122
|
-
"inapplicable": 0,
|
|
123
|
-
"failed": 0,
|
|
124
|
-
"type": [
|
|
125
|
-
"ACTRule",
|
|
126
|
-
"TestCase"
|
|
127
|
-
],
|
|
128
|
-
"a11yReq": [
|
|
129
|
-
"WCAG21:title"
|
|
130
|
-
],
|
|
131
|
-
"outcome": "passed",
|
|
132
|
-
"description": "Title element exists and it's not empty"
|
|
133
|
-
},
|
|
134
|
-
"results": [{
|
|
135
|
-
"verdict": "passed",
|
|
136
|
-
"description": "Title element exists and it's not empty",
|
|
137
|
-
"code": "<title>Faculdade de Ciências da Universidade de Lisboa</title>",
|
|
138
|
-
"pointer": "html > head > title:nth-of-type(1)"
|
|
139
|
-
}]
|
|
140
|
-
},
|
|
141
|
-
"QW-ACT-R2": {
|
|
142
|
-
"name": "HTML has lang attribute",
|
|
143
|
-
"code": "QW-ACT-R2",
|
|
144
|
-
"mapping": "b5c3f8",
|
|
145
|
-
"description": "This rule checks that the html element has a non-empty lang or xml:lang attribute.",
|
|
146
|
-
"metadata": {
|
|
147
|
-
"target": {
|
|
148
|
-
"element": "html",
|
|
149
|
-
"attributes": [
|
|
150
|
-
"lang",
|
|
151
|
-
"xml:lang"
|
|
152
|
-
]
|
|
153
|
-
},
|
|
154
|
-
"success-criteria": [{
|
|
155
|
-
"name": "3.1.1",
|
|
156
|
-
"level": "A",
|
|
157
|
-
"principle": "Understandable"
|
|
158
|
-
}],
|
|
159
|
-
"related": [],
|
|
160
|
-
"url": "https://act-rules.github.io/rules/b5c3f8",
|
|
161
|
-
"passed": 1,
|
|
162
|
-
"inapplicable": 0,
|
|
163
|
-
"failed": 0,
|
|
164
|
-
"type": [
|
|
165
|
-
"ACTRule",
|
|
166
|
-
"TestCase"
|
|
167
|
-
],
|
|
168
|
-
"a11yReq": [
|
|
169
|
-
"WCAG21:language"
|
|
170
|
-
],
|
|
171
|
-
"outcome": "passed",
|
|
172
|
-
"description": "The lang attribute has a value "
|
|
173
|
-
},
|
|
174
|
-
"results": [{
|
|
175
|
-
"verdict": "passed",
|
|
176
|
-
"description": "The lang attribute has a value ",
|
|
177
|
-
"code": "<html class=\"no-js js\" lang=\"pt-pt\" dir=\"ltr\"></html>",
|
|
178
|
-
"pointer": "html"
|
|
179
|
-
}]
|
|
180
|
-
},
|
|
181
|
-
"QW-ACT-R3": {
|
|
182
|
-
"name": "HTML lang and xml:lang match",
|
|
183
|
-
"code": "QW-ACT-R3",
|
|
184
|
-
"mapping": "5b7ae0",
|
|
185
|
-
"description": "The rule checks that for the html element, there is no mismatch between the primary language in non-empty lang and xml:lang attributes, if both are used.",
|
|
186
|
-
"metadata": {
|
|
187
|
-
"target": {
|
|
188
|
-
"element": "html",
|
|
189
|
-
"attributes": [
|
|
190
|
-
"lang",
|
|
191
|
-
"xml:lang"
|
|
192
|
-
]
|
|
193
|
-
},
|
|
194
|
-
"success-criteria": [{
|
|
195
|
-
"name": "3.1.1",
|
|
196
|
-
"level": "A",
|
|
197
|
-
"principle": "Understandable"
|
|
198
|
-
}],
|
|
199
|
-
"related": [],
|
|
200
|
-
"url": "https://act-rules.github.io/rules/5b7ae0",
|
|
201
|
-
"passed": 0,
|
|
202
|
-
"inapplicable": 1,
|
|
203
|
-
"failed": 0,
|
|
204
|
-
"type": [
|
|
205
|
-
"ACTRule",
|
|
206
|
-
"TestCase"
|
|
207
|
-
],
|
|
208
|
-
"a11yReq": [
|
|
209
|
-
"WCAG21:language"
|
|
210
|
-
],
|
|
211
|
-
"outcome": "inapplicable",
|
|
212
|
-
"description": "lang or xml:lang attribute doesn't exist in html element"
|
|
213
|
-
},
|
|
214
|
-
"results": [{
|
|
215
|
-
"verdict": "inapplicable",
|
|
216
|
-
"description": "lang or xml:lang attribute doesn't exist in html element",
|
|
217
|
-
"test": "https://act-rules.github.io/rules/5b7ae0",
|
|
218
|
-
"code": "<html class=\"no-js js\" lang=\"pt-pt\" dir=\"ltr\"></html>",
|
|
219
|
-
"pointer": "html"
|
|
220
|
-
}]
|
|
221
|
-
},
|
|
222
|
-
"QW-ACT-R5": {
|
|
223
|
-
"name": "Validity of HTML Lang attribute",
|
|
224
|
-
"code": "QW-ACT-R5",
|
|
225
|
-
"mapping": "bf051a",
|
|
226
|
-
"description": "This rule checks the lang or xml:lang attribute has a valid language subtag.",
|
|
227
|
-
"metadata": {
|
|
228
|
-
"target": {
|
|
229
|
-
"element": "html",
|
|
230
|
-
"attributes": [
|
|
231
|
-
"lang",
|
|
232
|
-
"xml:lang"
|
|
233
|
-
]
|
|
234
|
-
},
|
|
235
|
-
"success-criteria": [{
|
|
236
|
-
"name": "3.1.1",
|
|
237
|
-
"level": "A",
|
|
238
|
-
"principle": "Understandable"
|
|
239
|
-
}],
|
|
240
|
-
"related": [],
|
|
241
|
-
"url": "https://act-rules.github.io/rules/bf051a",
|
|
242
|
-
"passed": 1,
|
|
243
|
-
"inapplicable": 0,
|
|
244
|
-
"failed": 0,
|
|
245
|
-
"type": [
|
|
246
|
-
"ACTRule",
|
|
247
|
-
"TestCase"
|
|
248
|
-
],
|
|
249
|
-
"a11yReq": [
|
|
250
|
-
"WCAG21:language"
|
|
251
|
-
],
|
|
252
|
-
"outcome": "passed",
|
|
253
|
-
"description": "The lang attribute has a valid value "
|
|
254
|
-
},
|
|
255
|
-
"results": [{
|
|
256
|
-
"verdict": "passed",
|
|
257
|
-
"description": "The lang attribute has a valid value ",
|
|
258
|
-
"test": "https://act-rules.github.io/rules/bf051a",
|
|
259
|
-
"code": "<html class=\"no-js js\" lang=\"pt-pt\" dir=\"ltr\"></html>",
|
|
260
|
-
"pointer": "html"
|
|
261
|
-
}]
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
describe('EARL report', function () {
|
|
269
|
-
describe('"@context" field', function () {
|
|
270
|
-
it('should exist', async function () {
|
|
271
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
272
|
-
expect(Object.keys(earl[0])).to.be.an('array').and.to.include('@context');
|
|
273
|
-
});
|
|
274
|
-
it('should not be empty', async function () {
|
|
275
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
276
|
-
expect(earl[0]['@context']).to.be.not.equal({});
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
|
|
280
|
-
describe('"@graph" field', function() {
|
|
281
|
-
it('should exists', async function () {
|
|
282
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
283
|
-
expect(Object.keys(earl[0])).to.be.an('array').and.to.include('@graph');
|
|
284
|
-
});
|
|
285
|
-
it('should be of type array', async function () {
|
|
286
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
287
|
-
expect(earl[0]['@graph']).to.be.an('array');
|
|
288
|
-
});
|
|
289
|
-
it('should not be empty', async function () {
|
|
290
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
291
|
-
expect(earl[0]['@graph'].length).to.be.not.equal(0);
|
|
292
|
-
});
|
|
293
|
-
it('should have only one test subject', async function() {
|
|
294
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
295
|
-
expect(earl[0]['@graph'].length).to.be.equal(1);
|
|
296
|
-
});
|
|
297
|
-
describe('"Test subject" field', function() {
|
|
298
|
-
describe('"@type" field', function() {
|
|
299
|
-
it('should exist', async function() {
|
|
300
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
301
|
-
expect(Object.keys(earl[0]['@graph'][0])).to.be.an('array').and.to.include('@type');
|
|
302
|
-
});
|
|
303
|
-
it('should be of type string', async function() {
|
|
304
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
305
|
-
expect(earl[0]['@graph'][0]['@type']).to.be.a('string');
|
|
306
|
-
});
|
|
307
|
-
it('should not be empty', async function() {
|
|
308
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
309
|
-
expect(earl[0]['@graph'][0]['@type'].trim()).to.not.be.equal('');
|
|
310
|
-
});
|
|
311
|
-
it('should be "TestSubject"', async function() {
|
|
312
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
313
|
-
expect(earl[0]['@graph'][0]['@type'].trim()).to.be.equal('TestSubject');
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
describe('"source" field', function() {
|
|
317
|
-
it('should exist', async function() {
|
|
318
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
319
|
-
expect(Object.keys(earl[0]['@graph'][0])).to.be.an('array').and.to.include('source');
|
|
320
|
-
});
|
|
321
|
-
it('should be of type string', async function() {
|
|
322
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
323
|
-
expect(earl[0]['@graph'][0]['source']).to.be.a('string');
|
|
324
|
-
});
|
|
325
|
-
it('should not be empty', async function() {
|
|
326
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
327
|
-
expect(earl[0]['@graph'][0]['source'].trim()).to.not.be.equal('');
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
describe('"assertor" field', function() {
|
|
331
|
-
it('should exist', async function() {
|
|
332
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
333
|
-
expect(Object.keys(earl[0]['@graph'][0])).to.be.an('array').and.to.include('assertor');
|
|
334
|
-
})
|
|
335
|
-
describe('"@id" field', function() {
|
|
336
|
-
it('should exist', async function() {
|
|
337
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
338
|
-
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('@id');
|
|
339
|
-
});
|
|
340
|
-
it('should be of type string', async function() {
|
|
341
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
342
|
-
expect(earl[0]['@graph'][0].assertor['@id']).to.be.a('string');
|
|
343
|
-
});
|
|
344
|
-
it('should not be empty', async function() {
|
|
345
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
346
|
-
expect(earl[0]['@graph'][0].assertor['@id'].trim()).to.not.be.equal('');
|
|
347
|
-
});
|
|
348
|
-
});
|
|
349
|
-
describe('"@type" field', function() {
|
|
350
|
-
it('should exist', async function() {
|
|
351
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
352
|
-
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('@type');
|
|
353
|
-
});
|
|
354
|
-
it('should be of type string', async function() {
|
|
355
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
356
|
-
expect(earl[0]['@graph'][0].assertor['@type']).to.be.a('string');
|
|
357
|
-
});
|
|
358
|
-
it('should not be empty', async function() {
|
|
359
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
360
|
-
expect(earl[0]['@graph'][0].assertor['@type'].trim()).to.not.be.equal('');
|
|
361
|
-
});
|
|
362
|
-
it('should be "Software"', async function() {
|
|
363
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
364
|
-
expect(earl[0]['@graph'][0].assertor['@type'].trim()).to.be.equal('Software');
|
|
365
|
-
});
|
|
366
|
-
});
|
|
367
|
-
describe('"title" field', function() {
|
|
368
|
-
it('should exist', async function() {
|
|
369
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
370
|
-
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('title');
|
|
371
|
-
});
|
|
372
|
-
it('should be of type string', async function() {
|
|
373
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
374
|
-
expect(earl[0]['@graph'][0].assertor['title']).to.be.a('string');
|
|
375
|
-
});
|
|
376
|
-
it('should not be empty', async function() {
|
|
377
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
378
|
-
expect(earl[0]['@graph'][0].assertor['title'].trim()).to.not.be.equal('');
|
|
379
|
-
});
|
|
380
|
-
});
|
|
381
|
-
describe('"description" field', function() {
|
|
382
|
-
it('should exist', async function() {
|
|
383
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
384
|
-
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('description');
|
|
385
|
-
});
|
|
386
|
-
it('should be of type string', async function() {
|
|
387
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
388
|
-
expect(earl[0]['@graph'][0].assertor['description']).to.be.a('string');
|
|
389
|
-
});
|
|
390
|
-
it('should not be empty', async function() {
|
|
391
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
392
|
-
expect(earl[0]['@graph'][0].assertor['description'].trim()).to.not.be.equal('');
|
|
393
|
-
});
|
|
394
|
-
});
|
|
395
|
-
describe('"hasVersion" field', function() {
|
|
396
|
-
it('should exist', async function() {
|
|
397
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
398
|
-
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('hasVersion');
|
|
399
|
-
});
|
|
400
|
-
it('should be of type string', async function() {
|
|
401
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
402
|
-
expect(earl[0]['@graph'][0].assertor['hasVersion']).to.be.a('string');
|
|
403
|
-
});
|
|
404
|
-
it('should not be empty', async function() {
|
|
405
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
406
|
-
expect(earl[0]['@graph'][0].assertor['hasVersion'].trim()).to.not.be.equal('');
|
|
407
|
-
});
|
|
408
|
-
});
|
|
409
|
-
describe('"homepage" field', function() {
|
|
410
|
-
it('should exist', async function() {
|
|
411
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
412
|
-
expect(Object.keys(earl[0]['@graph'][0].assertor)).to.be.an('array').and.to.include('homepage');
|
|
413
|
-
});
|
|
414
|
-
it('should be of type string', async function() {
|
|
415
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
416
|
-
expect(earl[0]['@graph'][0].assertor['homepage']).to.be.a('string');
|
|
417
|
-
});
|
|
418
|
-
it('should not be empty', async function() {
|
|
419
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
420
|
-
expect(earl[0]['@graph'][0].assertor['homepage'].trim()).to.not.be.equal('');
|
|
421
|
-
});
|
|
422
|
-
});
|
|
423
|
-
});
|
|
424
|
-
describe('"assertions" field', function() {
|
|
425
|
-
it('should exist', async function() {
|
|
426
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
427
|
-
expect(Object.keys(earl[0]['@graph'][0])).to.be.an('array').and.to.include('assertions');
|
|
428
|
-
});
|
|
429
|
-
it('should be of type array', async function() {
|
|
430
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
431
|
-
expect(earl[0]['@graph'][0].assertions).to.be.an('array');
|
|
432
|
-
});
|
|
433
|
-
it('should not be empty', async function() {
|
|
434
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
435
|
-
expect(earl[0]['@graph'][0].assertions.length).to.not.be.equal(0);
|
|
436
|
-
});
|
|
437
|
-
it('should have number of assertions equal to the same amount of tests done', async function() {
|
|
438
|
-
const nAssertions = Object.keys(evaluationReport.modules['act-rules'].rules).length +
|
|
439
|
-
(evaluationReport.modules['html-techniques'] ? Object.keys(evaluationReport.modules['html-techniques'].techniques).length : 0) +
|
|
440
|
-
(evaluationReport.modules['css-techniques'] ? Object.keys(evaluationReport.modules['css-techniques'].techniques).length : 0);
|
|
441
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
442
|
-
expect(earl[0]['@graph'][0].assertions.length).to.be.equal(nAssertions);
|
|
443
|
-
});
|
|
444
|
-
describe('"assertion" field', function() {
|
|
445
|
-
describe('"@type" field', function() {
|
|
446
|
-
it('should exist', async function() {
|
|
447
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
448
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0])).to.include('@type');
|
|
449
|
-
});
|
|
450
|
-
it('should be of type string', async function() {
|
|
451
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
452
|
-
expect(earl[0]['@graph'][0].assertions[0]['@type']).to.be.a('string');
|
|
453
|
-
});
|
|
454
|
-
it('should not be empty', async function() {
|
|
455
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
456
|
-
expect(earl[0]['@graph'][0].assertions[0]['@type'].trim()).to.not.be.equal('');
|
|
457
|
-
});
|
|
458
|
-
it('should be "Assertion"', async function() {
|
|
459
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
460
|
-
expect(earl[0]['@graph'][0].assertions[0]['@type'].trim()).to.be.equal('Assertion');
|
|
461
|
-
});
|
|
462
|
-
});
|
|
463
|
-
describe('"test" field', function() {
|
|
464
|
-
it('should exist', async function() {
|
|
465
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
466
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0])).to.include('test');
|
|
467
|
-
});
|
|
468
|
-
describe('"@id" field', function() {
|
|
469
|
-
it('should exist', async function() {
|
|
470
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
471
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].test)).to.include('@id');
|
|
472
|
-
});
|
|
473
|
-
it('should be of type string', async function() {
|
|
474
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
475
|
-
expect(earl[0]['@graph'][0].assertions[0].test['@id']).to.be.a('string');
|
|
476
|
-
});
|
|
477
|
-
it('should not be empty', async function() {
|
|
478
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
479
|
-
expect(earl[0]['@graph'][0].assertions[0].test['@id'].trim()).to.not.be.equal('');
|
|
480
|
-
});
|
|
481
|
-
});
|
|
482
|
-
describe('"@type" field', function() {
|
|
483
|
-
it('should exist', async function() {
|
|
484
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
485
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].test)).to.include('@type');
|
|
486
|
-
});
|
|
487
|
-
it('should be of type string', async function() {
|
|
488
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
489
|
-
expect(earl[0]['@graph'][0].assertions[0].test['@type']).to.be.a('string');
|
|
490
|
-
});
|
|
491
|
-
it('should not be empty', async function() {
|
|
492
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
493
|
-
expect(earl[0]['@graph'][0].assertions[0].test['@type'].trim()).to.not.be.equal('');
|
|
494
|
-
});
|
|
495
|
-
it('should be "TestCase"', async function() {
|
|
496
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
497
|
-
expect(earl[0]['@graph'][0].assertions[0].test['@type'].trim()).to.be.equal('TestCase');
|
|
498
|
-
});
|
|
499
|
-
});
|
|
500
|
-
describe('"title" field', function() {
|
|
501
|
-
it('should exist', async function() {
|
|
502
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
503
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].test)).to.include('title');
|
|
504
|
-
});
|
|
505
|
-
it('should be of type string', async function() {
|
|
506
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
507
|
-
expect(earl[0]['@graph'][0].assertions[0].test['title']).to.be.a('string');
|
|
508
|
-
});
|
|
509
|
-
it('should not be empty', async function() {
|
|
510
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
511
|
-
expect(earl[0]['@graph'][0].assertions[0].test['title'].trim()).to.not.be.equal('');
|
|
512
|
-
});
|
|
513
|
-
});
|
|
514
|
-
describe('"description" field', function() {
|
|
515
|
-
it('should exist', async function() {
|
|
516
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
517
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].test)).to.include('description');
|
|
518
|
-
});
|
|
519
|
-
it('should be of type string', async function() {
|
|
520
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
521
|
-
expect(earl[0]['@graph'][0].assertions[0].test['description']).to.be.a('string');
|
|
522
|
-
});
|
|
523
|
-
it('should not be empty', async function() {
|
|
524
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
525
|
-
expect(earl[0]['@graph'][0].assertions[0].test['description'].trim()).to.not.be.equal('');
|
|
526
|
-
});
|
|
527
|
-
});
|
|
528
|
-
});
|
|
529
|
-
describe('"mode" field', function() {
|
|
530
|
-
it('should exist', async function() {
|
|
531
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
532
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0])).to.include('mode');
|
|
533
|
-
});
|
|
534
|
-
it('should be of type string', async function() {
|
|
535
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
536
|
-
expect(earl[0]['@graph'][0].assertions[0]['mode']).to.be.a('string');
|
|
537
|
-
});
|
|
538
|
-
it('should not be empty', async function() {
|
|
539
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
540
|
-
expect(earl[0]['@graph'][0].assertions[0]['mode'].trim()).to.not.be.equal('');
|
|
541
|
-
});
|
|
542
|
-
it('should be "earl:automatic"', async function() {
|
|
543
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
544
|
-
expect(earl[0]['@graph'][0].assertions[0]['mode'].trim()).to.be.equal('earl:automatic');
|
|
545
|
-
});
|
|
546
|
-
});
|
|
547
|
-
describe('"result" field', function() {
|
|
548
|
-
it('should exist', async function() {
|
|
549
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
550
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0])).to.include('result');
|
|
551
|
-
});
|
|
552
|
-
describe('"@type" field', function() {
|
|
553
|
-
it('should exist', async function() {
|
|
554
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
555
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result)).to.include('@type');
|
|
556
|
-
});
|
|
557
|
-
it('should be of type string', async function() {
|
|
558
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
559
|
-
expect(earl[0]['@graph'][0].assertions[0].result['@type']).to.be.a('string');
|
|
560
|
-
});
|
|
561
|
-
it('should not be empty', async function() {
|
|
562
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
563
|
-
expect(earl[0]['@graph'][0].assertions[0].result['@type'].trim()).to.not.be.equal('');
|
|
564
|
-
});
|
|
565
|
-
it('should be "TestCase"', async function() {
|
|
566
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
567
|
-
expect(earl[0]['@graph'][0].assertions[0].result['@type'].trim()).to.be.equal('TestResult');
|
|
568
|
-
});
|
|
569
|
-
});
|
|
570
|
-
describe('"outcome" field', function() {
|
|
571
|
-
it('should exist', async function() {
|
|
572
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
573
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result)).to.include('outcome');
|
|
574
|
-
});
|
|
575
|
-
it('should be of type string', async function() {
|
|
576
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
577
|
-
expect(earl[0]['@graph'][0].assertions[0].result['outcome']).to.be.a('string');
|
|
578
|
-
});
|
|
579
|
-
it('should not be empty', async function() {
|
|
580
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
581
|
-
expect(earl[0]['@graph'][0].assertions[0].result['outcome'].trim()).to.not.be.equal('');
|
|
582
|
-
});
|
|
583
|
-
it('should be "earl:passed" or "earl:failed" or "earl:inapplicable"', async function() {
|
|
584
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
585
|
-
expect(['earl:passed', 'earl:failed', 'earl:inapplicable']).to.include(earl[0]['@graph'][0].assertions[0].result['outcome'].trim());
|
|
586
|
-
});
|
|
587
|
-
});
|
|
588
|
-
describe('"source" field', function() {
|
|
589
|
-
it('should exist', async function() {
|
|
590
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
591
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result)).to.include('source');
|
|
592
|
-
});
|
|
593
|
-
describe('"result" field', function() {
|
|
594
|
-
it('should exist', async function() {
|
|
595
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
596
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result.source[0])).to.include('result');
|
|
597
|
-
});
|
|
598
|
-
describe('"pointer" field', function() {
|
|
599
|
-
it('should exist', async function() {
|
|
600
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
601
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result.source[0].result)).to.include('pointer');
|
|
602
|
-
});
|
|
603
|
-
it('should be of type string', async function() {
|
|
604
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
605
|
-
expect(earl[0]['@graph'][0].assertions[0].result.source[0].result.pointer).to.be.a('string');
|
|
606
|
-
});
|
|
607
|
-
it('should not be empty', async function() {
|
|
608
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
609
|
-
expect(earl[0]['@graph'][0].assertions[0].result.source[0].result.pointer.trim()).to.not.be.equal('');
|
|
610
|
-
});
|
|
611
|
-
});
|
|
612
|
-
describe('"outcome" field', function() {
|
|
613
|
-
it('should exist', async function() {
|
|
614
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
615
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result.source[0].result)).to.include('outcome');
|
|
616
|
-
});
|
|
617
|
-
it('should be of type string', async function() {
|
|
618
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
619
|
-
expect(earl[0]['@graph'][0].assertions[0].result.source[0].result.outcome).to.be.a('string');
|
|
620
|
-
});
|
|
621
|
-
it('should not be empty', async function() {
|
|
622
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
623
|
-
expect(earl[0]['@graph'][0].assertions[0].result.source[0].result.outcome.trim()).to.not.be.equal('');
|
|
624
|
-
});
|
|
625
|
-
it('should be "earl:passed" or "earl:failed" or "earl:inapplicable"', async function() {
|
|
626
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
627
|
-
expect(['earl:passed', 'earl:failed', 'earl:inapplicable']).to.include(earl[0]['@graph'][0].assertions[0].result.source[0].result.outcome.trim());
|
|
628
|
-
});
|
|
629
|
-
});
|
|
630
|
-
});
|
|
631
|
-
});
|
|
632
|
-
describe('"description" field', function() {
|
|
633
|
-
it('should exist', async function() {
|
|
634
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
635
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result)).to.include('description');
|
|
636
|
-
});
|
|
637
|
-
it('should be of type string', async function() {
|
|
638
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
639
|
-
expect(earl[0]['@graph'][0].assertions[0].result['description']).to.be.a('string');
|
|
640
|
-
});
|
|
641
|
-
it('should not be empty', async function() {
|
|
642
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
643
|
-
expect(earl[0]['@graph'][0].assertions[0].result['description'].trim()).to.not.be.equal('');
|
|
644
|
-
});
|
|
645
|
-
});
|
|
646
|
-
describe('"date" field', function() {
|
|
647
|
-
it('should exist', async function() {
|
|
648
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
649
|
-
expect(Object.keys(earl[0]['@graph'][0].assertions[0].result)).to.include('date');
|
|
650
|
-
});
|
|
651
|
-
it('should be of type string', async function() {
|
|
652
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
653
|
-
expect(earl[0]['@graph'][0].assertions[0].result['date']).to.be.a('string');
|
|
654
|
-
});
|
|
655
|
-
it('should not be empty', async function() {
|
|
656
|
-
const earl = await reporter.generateEARLReport([evaluationReport]);
|
|
657
|
-
expect(earl[0]['@graph'][0].assertions[0].result['date'].trim()).to.not.be.equal('');
|
|
658
|
-
});
|
|
659
|
-
});
|
|
660
|
-
});
|
|
661
|
-
});
|
|
662
|
-
});
|
|
663
|
-
});
|
|
664
|
-
});
|
|
665
|
-
});
|