testaro 6.0.2 → 6.0.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/commands.js CHANGED
@@ -139,7 +139,8 @@ exports.commands = {
139
139
  'Navigate to a new URL',
140
140
  {
141
141
  which: [true, 'string', 'isURL', 'URL'],
142
- what: [false, 'string', 'hasLength', 'comment']
142
+ what: [false, 'string', 'hasLength', 'comment'],
143
+ id: [false, 'string', 'hasLength', 'ID of the host']
143
144
  }
144
145
  ],
145
146
  wait: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testaro",
3
- "version": "6.0.2",
3
+ "version": "6.0.4",
4
4
  "description": "Automation of accessibility testing",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/run.js CHANGED
@@ -1559,12 +1559,10 @@ exports.doJob = async report => {
1559
1559
  value: ((new Date()).toISOString().slice(0, 19))
1560
1560
  }
1561
1561
  );
1562
- // Add an ID to the report if none exists yet.
1563
- if (! report.id) {
1564
- report.id = Math.floor((Date.now() - Date.UTC(2022, 1)) / 2000).toString(36);
1565
- }
1566
1562
  // Add a time stamp to the report.
1567
- report.timeStamp = report.id.replace(/-.+/, '');
1563
+ report.timeStamp = Math.floor((Date.now() - Date.UTC(2022, 1)) / 2000).toString(36);
1564
+ // Add an ID to the report.
1565
+ report.id = `${report.timeStamp}-${report.script.id}`;
1568
1566
  // Add the script commands to the report as its initial acts.
1569
1567
  report.acts = JSON.parse(JSON.stringify(report.script.commands));
1570
1568
  /*
package/watch.js CHANGED
@@ -137,8 +137,8 @@ const writeNetReport = async report => {
137
137
  };
138
138
  // Archives a job.
139
139
  const archiveJob = async script => {
140
- const jobJSON = JSON.stringify(script, null, 2);
141
- await fs.writeFile(`${doneDir}/${script.timeStamp}-${script.id}.json`, jobJSON);
140
+ const scriptJSON = JSON.stringify(script, null, 2);
141
+ await fs.writeFile(`${doneDir}/${script.timeStamp}-${script.id}.json`, scriptJSON);
142
142
  await fs.rm(`${watchDir}/${script.id}.json`);
143
143
  };
144
144
  // Waits.