testilo 40.2.0 → 41.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.
- package/README.md +6 -10
- package/batch.js +1 -5
- package/merge.js +2 -15
- package/package.json +1 -1
- package/procs/util.js +13 -3
- package/script.js +7 -11
package/README.md
CHANGED
|
@@ -99,12 +99,7 @@ Targets can be specified in a more complex way, too. That allows you to create j
|
|
|
99
99
|
what: 'Acme Clothes',
|
|
100
100
|
url: 'https://acmeclothes.com/',
|
|
101
101
|
actGroups: {
|
|
102
|
-
public: [
|
|
103
|
-
{
|
|
104
|
-
type: 'launch',
|
|
105
|
-
what: 'Acme Clothes home page',
|
|
106
|
-
}
|
|
107
|
-
],
|
|
102
|
+
public: [],
|
|
108
103
|
private: [
|
|
109
104
|
{
|
|
110
105
|
type: 'launch',
|
|
@@ -141,13 +136,13 @@ Targets can be specified in a more complex way, too. That allows you to create j
|
|
|
141
136
|
|
|
142
137
|
As shown, a batch, unlike a target list, defines named groups of acts. They can be substituted for script placeholders, so various complex operations can be performed on each target.
|
|
143
138
|
|
|
144
|
-
In this example, the `public` act group contains
|
|
139
|
+
In this example, the `public` act group contains no acts. The `private` act group contains 5 acts. A `launch` act in an act group is permitted to have only two properties, `what` and `url`. If either of these is omitted, its value is inherited from the corresponding property of the target.
|
|
145
140
|
|
|
146
141
|
A batch is a JavaScript object. It can be converted to JSON and stored in a file.
|
|
147
142
|
|
|
148
143
|
### Target list to batch
|
|
149
144
|
|
|
150
|
-
If you have a target list, the `batch` module of Testilo can convert it to a simple batch. The batch will contain, for each target, only one act group, named `main`, containing
|
|
145
|
+
If you have a target list, the `batch` module of Testilo can convert it to a simple batch. The batch will contain, for each target, only one act group, named `main`, containing no acts.
|
|
151
146
|
|
|
152
147
|
#### Invocation
|
|
153
148
|
|
|
@@ -170,7 +165,7 @@ const batchObj = batch(id, what, targets);
|
|
|
170
165
|
|
|
171
166
|
The `id` argument to `batch()` is an identifier for the target list. The `what` variable describes the target list. The `targets` variable is an array of arrays, with each array containing the 2 items (description and URL) defining one target.
|
|
172
167
|
|
|
173
|
-
The `batch()` function of the `batch` module generates a batch and returns it as an object. Within the batch, each target is given a sequential (base-
|
|
168
|
+
The `batch()` function of the `batch` module generates a batch and returns it as an object. Within the batch, each target is given a sequential (base-36 alphanumeric) string as an ID.
|
|
174
169
|
|
|
175
170
|
The invoking module can further dispose of the batch as needed.
|
|
176
171
|
|
|
@@ -288,7 +283,7 @@ In its simplest form, `script()` requires 3 string arguments:
|
|
|
288
283
|
1. A description of the script
|
|
289
284
|
1. A device ID
|
|
290
285
|
|
|
291
|
-
Called in this way, `script()` produces a script that tells Testaro to perform the tests for all of the evaluation rules defined by all of the tools integrated by Testaro.
|
|
286
|
+
Called in this way, `script()` produces a script that tells Testaro to perform the tests for all of the evaluation rules defined by all of the tools integrated by Testaro. In this case, the script launches a new Webkit browser before performing the tests of each tool.
|
|
292
287
|
|
|
293
288
|
#### With options
|
|
294
289
|
|
|
@@ -384,6 +379,7 @@ When the `script` module creates a script for you, it does not ask you for all o
|
|
|
384
379
|
- `sendReportTo`: `process.env.SEND_REPORT_TO`, or `''` if none
|
|
385
380
|
- `sources.id`: script ID
|
|
386
381
|
- `sources.requester`: `process.env.REQUESTER`, or `''` if none
|
|
382
|
+
- test acts: `launch` = {}
|
|
387
383
|
- `axe` test act: `detailLevel` = 2
|
|
388
384
|
- `ibm` test act: `withItems` = `true`, `withNewContent` = `true`
|
|
389
385
|
- `qualWeb` test act: `withNewContent` = `false`
|
package/batch.js
CHANGED
package/merge.js
CHANGED
|
@@ -34,15 +34,6 @@ const {alphaNumOf, dateOf, getRandomString, getNowStamp} = require('./procs/util
|
|
|
34
34
|
|
|
35
35
|
// ########## CONSTANTS
|
|
36
36
|
|
|
37
|
-
// Tools that alter the page.
|
|
38
|
-
const contaminantNames = new Set([
|
|
39
|
-
'alfa',
|
|
40
|
-
'aslint',
|
|
41
|
-
'axe',
|
|
42
|
-
'ed11y',
|
|
43
|
-
'htmlcs',
|
|
44
|
-
'testaro'
|
|
45
|
-
]);
|
|
46
37
|
// Length of the random merger ID.
|
|
47
38
|
const mergeIDLength = 3;
|
|
48
39
|
|
|
@@ -85,12 +76,8 @@ exports.merge = (script, batch, executionTimeStamp) => {
|
|
|
85
76
|
// Identify it as the current one.
|
|
86
77
|
lastPlaceholder = act;
|
|
87
78
|
}
|
|
88
|
-
// Otherwise, if it is a
|
|
89
|
-
else if (
|
|
90
|
-
act.type === 'test'
|
|
91
|
-
&& contaminantNames.has(act.which)
|
|
92
|
-
&& actIndex < acts.length - 1
|
|
93
|
-
) {
|
|
79
|
+
// Otherwise, if it is a test act:
|
|
80
|
+
else if (act.type === 'test') {
|
|
94
81
|
// Change it to an array of itself and the current placeholder.
|
|
95
82
|
acts[actIndex] = JSON.parse(JSON.stringify([act, lastPlaceholder]));
|
|
96
83
|
}
|
package/package.json
CHANGED
package/procs/util.js
CHANGED
|
@@ -34,9 +34,19 @@ const alphaNumChars = (() => {
|
|
|
34
34
|
return digits.concat(lowers);
|
|
35
35
|
})();
|
|
36
36
|
// Tools.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
exports.tools = {
|
|
38
|
+
alfa: 'Alfa',
|
|
39
|
+
aslint: 'ASLint',
|
|
40
|
+
axe: 'Axe',
|
|
41
|
+
ed11y: 'Editoria11y',
|
|
42
|
+
htmlcs: 'HTML CodeSniffer',
|
|
43
|
+
ibm: 'Accessibility Checker',
|
|
44
|
+
nuVal: 'Nu Html Checker',
|
|
45
|
+
qualWeb: 'QualWeb',
|
|
46
|
+
testaro: 'Testaro',
|
|
47
|
+
wave: 'WAVE',
|
|
48
|
+
wax: 'WallyAX'
|
|
49
|
+
};
|
|
40
50
|
|
|
41
51
|
// FUNCTIONS
|
|
42
52
|
|
package/script.js
CHANGED
|
@@ -32,7 +32,7 @@ require('dotenv').config();
|
|
|
32
32
|
// Devices recognized by Playwright.
|
|
33
33
|
const {devices} = require('playwright');
|
|
34
34
|
// Utility module.
|
|
35
|
-
const {isToolID,
|
|
35
|
+
const {isToolID, tools} = require('./procs/util');
|
|
36
36
|
|
|
37
37
|
// ########## FUNCTIONS
|
|
38
38
|
|
|
@@ -142,7 +142,7 @@ exports.script = (id, what, deviceID, options = {}) => {
|
|
|
142
142
|
// Otherwise, i.e. if options are not specified:
|
|
143
143
|
else {
|
|
144
144
|
// Populate the data on tools and rules.
|
|
145
|
-
|
|
145
|
+
Object.keys(tools).forEach(toolID => {
|
|
146
146
|
toolsRulesData[toolID] = [];
|
|
147
147
|
});
|
|
148
148
|
}
|
|
@@ -151,7 +151,6 @@ exports.script = (id, what, deviceID, options = {}) => {
|
|
|
151
151
|
id,
|
|
152
152
|
what,
|
|
153
153
|
strict: false,
|
|
154
|
-
isolate: true,
|
|
155
154
|
standard: 'only',
|
|
156
155
|
observe: false,
|
|
157
156
|
device: {
|
|
@@ -171,14 +170,9 @@ exports.script = (id, what, deviceID, options = {}) => {
|
|
|
171
170
|
script: id,
|
|
172
171
|
batch: '',
|
|
173
172
|
mergeID: '',
|
|
174
|
-
requester:
|
|
173
|
+
requester: ''
|
|
175
174
|
},
|
|
176
|
-
acts: [
|
|
177
|
-
{
|
|
178
|
-
type: 'placeholder',
|
|
179
|
-
which: 'main'
|
|
180
|
-
}
|
|
181
|
-
]
|
|
175
|
+
acts: []
|
|
182
176
|
};
|
|
183
177
|
// Add the window options to the script.
|
|
184
178
|
scriptObj.device.windowOptions = getWindowOptions(deviceID);
|
|
@@ -187,7 +181,9 @@ exports.script = (id, what, deviceID, options = {}) => {
|
|
|
187
181
|
// Initialize a test act for it.
|
|
188
182
|
const toolAct = {
|
|
189
183
|
type: 'test',
|
|
190
|
-
|
|
184
|
+
launch: {},
|
|
185
|
+
which: toolID,
|
|
186
|
+
what: tools[toolID]
|
|
191
187
|
};
|
|
192
188
|
// If rules were specified:
|
|
193
189
|
const ruleIDs = toolsRulesData[toolID];
|