testdriverai 4.0.38 → 4.0.40
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/index.js +9 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -404,7 +404,7 @@ commands:
|
|
|
404
404
|
|
|
405
405
|
await aiExecute(response)
|
|
406
406
|
|
|
407
|
-
await save(true);
|
|
407
|
+
await save({ silent: true });
|
|
408
408
|
|
|
409
409
|
}
|
|
410
410
|
|
|
@@ -437,7 +437,7 @@ const humanInput = async (currentTask, validateAndLoop = false) => {
|
|
|
437
437
|
|
|
438
438
|
log.log('debug', 'showing prompt from humanInput response check')
|
|
439
439
|
|
|
440
|
-
await save(true)
|
|
440
|
+
await save({ silent: true })
|
|
441
441
|
|
|
442
442
|
}
|
|
443
443
|
|
|
@@ -470,7 +470,7 @@ const generate = async (type) => {
|
|
|
470
470
|
fs.mkdirSync(path.join(process.cwd(), 'testdriver', 'generate'));
|
|
471
471
|
}
|
|
472
472
|
let list = testPrompt.listsOrdered[0];
|
|
473
|
-
list.append(
|
|
473
|
+
list.append(`/save testdriver/${fileName}`);
|
|
474
474
|
let contents = list.map((item, index) => `${index + 1}. /explore ${item}`).join('\n');
|
|
475
475
|
fs.writeFileSync(path1, contents);
|
|
476
476
|
}
|
|
@@ -514,7 +514,7 @@ ${yml}
|
|
|
514
514
|
|
|
515
515
|
await aiExecute(message, false);
|
|
516
516
|
|
|
517
|
-
await save(true)
|
|
517
|
+
await save({ silent: true })
|
|
518
518
|
|
|
519
519
|
}
|
|
520
520
|
|
|
@@ -588,7 +588,7 @@ const firstPrompt = async (text) => {
|
|
|
588
588
|
} else if (input.indexOf('/quit') == 0) {
|
|
589
589
|
await exit();
|
|
590
590
|
} else if (input.indexOf('/save') == 0) {
|
|
591
|
-
await save();
|
|
591
|
+
await save({ filepath: commands[1] });
|
|
592
592
|
} else if (input.indexOf('/explore') == 0) {
|
|
593
593
|
await humanInput(commands.slice(1).join(' '), true)
|
|
594
594
|
} else if (input.indexOf('/undo') == 0) {
|
|
@@ -698,7 +698,7 @@ let summarize = async (error = null) => {
|
|
|
698
698
|
}
|
|
699
699
|
|
|
700
700
|
// this function is responsible for saving the regression test script to a file
|
|
701
|
-
let save = async (silent) => {
|
|
701
|
+
let save = async ({ filepath = thisFile, silent = false } = {}) => {
|
|
702
702
|
|
|
703
703
|
analytics.track('save', {silent});
|
|
704
704
|
|
|
@@ -714,7 +714,7 @@ let save = async (silent) => {
|
|
|
714
714
|
// write reply to /tmp/oiResult.log.log
|
|
715
715
|
let regression = await generator.historyToYml(executionHistory);
|
|
716
716
|
try {
|
|
717
|
-
fs.writeFileSync(
|
|
717
|
+
fs.writeFileSync(filepath, regression);
|
|
718
718
|
} catch (e) {
|
|
719
719
|
log.log('error', e.message)
|
|
720
720
|
console.log(e)
|
|
@@ -731,7 +731,7 @@ ${regression}
|
|
|
731
731
|
|
|
732
732
|
// console.log(csv.join('\n'))
|
|
733
733
|
|
|
734
|
-
const fileName =
|
|
734
|
+
const fileName = filepath.split('/').pop();
|
|
735
735
|
if (!silent) {
|
|
736
736
|
log.log('info', chalk.dim(`saved as ${fileName}`));
|
|
737
737
|
}
|
|
@@ -808,7 +808,7 @@ ${yaml.dump(step)}
|
|
|
808
808
|
}
|
|
809
809
|
|
|
810
810
|
if (overwrite) {
|
|
811
|
-
await save();
|
|
811
|
+
await save({ filepath: file });
|
|
812
812
|
}
|
|
813
813
|
|
|
814
814
|
setTerminalWindowTransparency(false);
|