testilo 36.0.0 → 36.0.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/README.md +10 -7
- package/merge.js +0 -3
- package/package.json +1 -1
- package/script.js +2 -2
package/README.md
CHANGED
|
@@ -214,8 +214,8 @@ Here is a script:
|
|
|
214
214
|
},
|
|
215
215
|
lastTarget: false,
|
|
216
216
|
mergeID: '',
|
|
217
|
-
sendReportTo: '',
|
|
218
|
-
requester: ''
|
|
217
|
+
sendReportTo: 'https://abccorp.com/api/report',
|
|
218
|
+
requester: 'anama@abccorp.com'
|
|
219
219
|
},
|
|
220
220
|
acts: [
|
|
221
221
|
{
|
|
@@ -253,7 +253,10 @@ A script has several properties that specify facts about the jobs to be created.
|
|
|
253
253
|
- `deviceID`: This specifies the default device type of the job.
|
|
254
254
|
- `browserID`: This specifies the default browser type (`'chromium'`, `'firefox'`, or `'webkit'`) of the job.
|
|
255
255
|
- `lowMotion`: This is true if the browser is to create tabs with the `reduce-motion` option set to `reduce` instead of `no-preference`. This makes the browser act as if the user has chosen a [motion-reduction option in the settings of the operating system or browser](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion#user_preferences). Motions on pages are, however, often immune to this setting.
|
|
256
|
-
- `creationTimeStamp
|
|
256
|
+
- `creationTimeStamp` and `executionTimeStamp`: These properties will have values assigned to them when jobs are created from the script.
|
|
257
|
+
- `sources.script`: This preserves the ID of the script after the `id` property is replaced with a job ID.
|
|
258
|
+
- `sources.sendReportTo`: This (if not `''`) is the URL to which a Testaro agent is to send its report after it performs a job derived from the script.
|
|
259
|
+
- `sources.requester`: This is the email address to which a message announcing the completion of the job is to be sent, if any.
|
|
257
260
|
- `acts`: an array of acts.
|
|
258
261
|
|
|
259
262
|
In this example, the script contains 3 acts, of which the first is a placeholder. If the above batch were merged with this script, in each job the placeholder would be replaced with the acts in the `private` act group of a target. For example, the first act of the first job would launch a Chromium browser on a default device, navigate to the Acme login page, complete and submit the login form, wait for the account page to load, run the Axe tests, and then run the QualWeb tests. If the batch contained additional targets, additional jobs would be created, with the acts for each target specified by the `private` property of the `actGroups` object of that target.
|
|
@@ -307,6 +310,8 @@ If you specify issue options, the script will prescribe the tests for all evalua
|
|
|
307
310
|
|
|
308
311
|
For example, one issue in the `tic43.js` file is `mainNot1`. Four rules are classified as belonging to that issue: rule `main_element_only_one` of the `aslint` tool and 3 more rules defined by 3 other tools. You can also create custom classifications and save them in a `score` subdirectory of the `FUNCTIONDIR` directory.
|
|
309
312
|
|
|
313
|
+
The `script()` function will populate the `sources.sendReportTo` property with the value, if any, of the environment variable `SEND_REPORT_TO`, and populate the `sources.requester` property with the value, if any, of the environment variable `REQUESTER`.
|
|
314
|
+
|
|
310
315
|
#### Invocation
|
|
311
316
|
|
|
312
317
|
There are two ways to use the `script` module.
|
|
@@ -389,8 +394,8 @@ A module can invoke `merge()` in this way:
|
|
|
389
394
|
const {merge} = require('testilo/merge');
|
|
390
395
|
const script = …;
|
|
391
396
|
const batch = …;
|
|
392
|
-
const
|
|
393
|
-
const jobs = merge(script, batch,
|
|
397
|
+
const executionTimeStamp = '241215T1200';
|
|
398
|
+
const jobs = merge(script, batch, executionTimeStamp);
|
|
394
399
|
```
|
|
395
400
|
|
|
396
401
|
The first two arguments are a script and a batch obtained from files or from prior calls to `script()` and `batch()`.
|
|
@@ -444,8 +449,6 @@ A Testaro job produced by `merge` will be identical to the script from which it
|
|
|
444
449
|
…
|
|
445
450
|
```
|
|
446
451
|
|
|
447
|
-
The `merge()` function will populate the `sources.sendReportTo` property with the value, if any, of the environment variable `SEND_REPORT_TO`, and populate the `sources.requester` property with the value, if any, of the environment variable `REQUESTER`.
|
|
448
|
-
|
|
449
452
|
#### Validation
|
|
450
453
|
|
|
451
454
|
To test the `merge` module, in the project directory you can execute the statement `node validation/merge/validate`. If `merge` is valid, all logging statements will begin with “Success” and none will begin with “ERROR”.
|
package/merge.js
CHANGED
|
@@ -70,11 +70,8 @@ exports.merge = (script, batch, executionTimeStamp) => {
|
|
|
70
70
|
protoJob.creationTimeStamp = getNowStamp();
|
|
71
71
|
protoJob.executionTimeStamp = executionTimeStamp;
|
|
72
72
|
const {sources} = protoJob;
|
|
73
|
-
sources.script = script.id;
|
|
74
73
|
sources.batch = batch.id;
|
|
75
74
|
sources.mergeID = getRandomString(mergeIDLength);
|
|
76
|
-
sources.sendReportTo = process.env.SEND_REPORT_TO || '';
|
|
77
|
-
sources.requester = process.env.REQUESTER || '';
|
|
78
75
|
// If isolation was requested:
|
|
79
76
|
if (protoJob.isolate) {
|
|
80
77
|
// For each act:
|
package/package.json
CHANGED
package/script.js
CHANGED
|
@@ -133,8 +133,8 @@ exports.script = (id, what, options = {}) => {
|
|
|
133
133
|
},
|
|
134
134
|
lastTarget: false,
|
|
135
135
|
mergeID: '',
|
|
136
|
-
sendReportTo: '',
|
|
137
|
-
requester: ''
|
|
136
|
+
sendReportTo: process.env.SEND_REPORT_TO || '',
|
|
137
|
+
requester: process.env.REQUESTER || ''
|
|
138
138
|
},
|
|
139
139
|
acts: [
|
|
140
140
|
{
|