testdriverai 5.3.2 → 5.3.3

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/agent.js CHANGED
@@ -1018,10 +1018,25 @@ let runRawYML = async (yml) => {
1018
1018
 
1019
1019
  let decoded = decodeURIComponent(yml);
1020
1020
 
1021
- // saved the yml to a temp file using tmp
1022
- // and run it with run()
1023
- fs.writeFileSync(tmpobj.name, await generator.rawToFormatted(decoded));
1021
+ // parse the yaml
1022
+ let ymlObj = null;
1023
+ try {
1024
+ ymlObj = await yaml.load(decoded);
1025
+ } catch (e) {
1026
+ logger.error("%s", e);
1027
+ }
1028
+
1029
+ // add the root key steps: with array of commands:
1030
+ if (ymlObj && !ymlObj.steps) {
1031
+ ymlObj = {
1032
+ steps: [ymlObj],
1033
+ };
1034
+ }
1035
+
1036
+ // write the yaml to a file
1037
+ fs.writeFileSync(tmpobj.name, yaml.dump(ymlObj));
1024
1038
 
1039
+ // and run it with run()
1025
1040
  await run(tmpobj.name, false, true);
1026
1041
 
1027
1042
  }
@@ -5,8 +5,7 @@ description: "Comprehensive guide to installing and setting up TestDriver.ai for
5
5
  icon: "file-code"
6
6
  ---
7
7
 
8
-
9
- [Download VSCode Extension](https://github.com/testdriverai/vscode/actions/runs/14451916515#artifacts)
8
+ [Download VSCode Extension](https://github.com/testdriverai/vscode/actions/runs/14458583961)
10
9
 
11
10
  # Install the extension
12
11
 
package/lib/generator.js CHANGED
@@ -64,64 +64,6 @@ const dumpToYML = async function (inputArray) {
64
64
 
65
65
  return yml;
66
66
  };
67
- const rawToFormatted = async function (inputCommands) {
68
- // inputCommands is raw yml
69
-
70
- console.log("rawToFormatted", inputCommands);
71
-
72
- let json = await yaml.load(inputCommands);
73
-
74
- const { getType } = require("./validation.js");
75
- const type = await getType(json);
76
- console.log("Detected type", type);
77
-
78
- let yml = inputCommands;
79
- // use yml dump to convert json to yml
80
- switch (type) {
81
- case "File":
82
- yml = await yaml.dump(json);
83
- break;
84
- case "Step":
85
- yml = await yaml.dump({
86
- version: package.version,
87
- session: session.get(),
88
- steps: [json],
89
- });
90
- break;
91
- case "StepList":
92
- yml = await yaml.dump({
93
- version: package.version,
94
- session: session.get(),
95
- steps: json,
96
- });
97
- break;
98
- case "Command":
99
- yml = await yaml.dump({
100
- version: package.version,
101
- session: session.get(),
102
- steps: [
103
- {
104
- prompt: "Run the following commands",
105
- commands: [json],
106
- },
107
- ],
108
- });
109
- break;
110
- case "CommandList":
111
- yml = await yaml.dump({
112
- version: package.version,
113
- session: session.get(),
114
- steps: [
115
- {
116
- prompt: "Run the following commands",
117
- commands: json,
118
- },
119
- ],
120
- });
121
- }
122
-
123
- return yml;
124
- };
125
67
 
126
68
  const hydrateFromYML = async function (yml) {
127
69
  // use yml load to convert yml to json
@@ -144,6 +86,5 @@ module.exports = {
144
86
  manualToYml,
145
87
  dumpToYML,
146
88
  hydrateFromYML,
147
- jsonToManual,
148
- rawToFormatted
89
+ jsonToManual
149
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "5.3.2",
3
+ "version": "5.3.3",
4
4
  "description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -0,0 +1,4 @@
1
+ steps:
2
+ - commands:
3
+ - command: focus-application
4
+ name: Google Chrome