testdriverai 5.7.0 → 5.7.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/agent.js CHANGED
@@ -849,7 +849,6 @@ const firstPrompt = async () => {
849
849
  const flags = commands.slice(2);
850
850
  let shouldSave = flags.includes("--save") ? true : false;
851
851
  let shouldExit = flags.includes("--exit") ? true : false;
852
-
853
852
  await run(file, shouldSave, shouldExit);
854
853
  } else if (input.indexOf("/generate") == 0) {
855
854
  const skipYaml = commands[4] === "--skip-yaml";
@@ -1092,12 +1091,10 @@ let run = async (file = thisFile, shouldSave = false, shouldExit = true) => {
1092
1091
  logger.info(``, null);
1093
1092
  logger.info(chalk.yellow(`> ${step.prompt || "no prompt"}`), null);
1094
1093
 
1095
- if (shouldSave) {
1096
- executionHistory.push({
1097
- prompt: step.prompt,
1098
- commands: [], // run will overwrite the commands
1099
- });
1100
- }
1094
+ executionHistory.push({
1095
+ prompt: step.prompt,
1096
+ commands: [], // run will overwrite the commands
1097
+ });
1101
1098
 
1102
1099
  if (!step.commands && !step.prompt) {
1103
1100
  logger.info(chalk.red("No commands or prompt found"));
@@ -38,7 +38,12 @@ end tell`;
38
38
  // set value of attribute "AXMinimized" of every window of application process "${windowName}" to true
39
39
  // end tell`;
40
40
 
41
- const appleScriptActivate = (windowName) => `tell application "${windowName}" to activate`;
41
+ const appleScriptActivate = (windowName) => `
42
+ tell application "${windowName}"
43
+ reopen
44
+ activate
45
+ end tell
46
+ `;
42
47
 
43
48
  const runPwsh = (appName, method) => {
44
49
  let script = `powershell -ExecutionPolicy Bypass -Command "& { ${scriptPath} '${appName}' '${method}' }"`;
@@ -88,9 +93,9 @@ async function showTerminal(appName) {
88
93
  if (!config.TD_VM) {
89
94
  try {
90
95
  if (platform() == "mac") {
91
- await execSync(`osascript -e '${appleScriptActivate(appName)}'`);
92
- await execSync(`osascript -e '${appleScriptSetFrontmost(appName)}'`);
93
-
96
+ await execSync(`osascript -e '${appleScriptActivate(appName)}'`, { stdio: [] });
97
+ await execSync(`osascript -e '${appleScriptSetFrontmost(appName)}'`, { stdio: [] });
98
+
94
99
  } else if (platform() == "windows") {
95
100
  return runPwsh(appName, "Restore");
96
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "5.7.0",
3
+ "version": "5.7.2",
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,15 @@
1
+ version: 5.6.5
2
+ session: 682a09d01e7bdbd8dadde346
3
+ steps:
4
+ - prompt: focus chrome
5
+ commands:
6
+ - command: focus-application
7
+ name: Google Chrome
8
+ - prompt: focus chrome
9
+ commands:
10
+ - command: focus-application
11
+ name: Google Chrome
12
+ - prompt: focus chrome
13
+ commands:
14
+ - command: focus-application
15
+ name: Google Chrome
@@ -0,0 +1,25 @@
1
+ version: 5.7.0
2
+ session: 682a077a1e7bdbd8dadde32f
3
+ steps:
4
+ - prompt: open chrome
5
+ commands:
6
+ - command: press-keys
7
+ keys:
8
+ - command
9
+ - space
10
+ - command: type
11
+ text: Google Chrome
12
+ - command: press-keys
13
+ keys:
14
+ - enter
15
+ - prompt: search for youtube
16
+ commands:
17
+ - command: press-keys
18
+ keys:
19
+ - command
20
+ - space
21
+ - command: type
22
+ text: Google Chrome
23
+ - command: press-keys
24
+ keys:
25
+ - enter