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 +2 -1
- package/package.json +1 -1
- package/run.js +3 -5
- package/watch.js +2 -2
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
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 =
|
|
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
|
|
141
|
-
await fs.writeFile(`${doneDir}/${script.timeStamp}-${script.id}.json`,
|
|
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.
|