testdriverai 4.2.0-test.3 → 4.2.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.
@@ -1,8 +1,8 @@
1
1
  name: Trigger Testdriver Dev Workflow
2
- #
3
- # on:
4
- # pull_request:
5
- # types: [opened, synchronize, reopened]
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, reopened]
6
6
 
7
7
  env:
8
8
  API_REF: main
package/agent.js CHANGED
@@ -898,14 +898,11 @@ let run = async (file, shouldSave = false, shouldExit = true) => {
898
898
  await exit(true);
899
899
  }
900
900
 
901
- console.log(process.env["TD_INTERPOLATION_VARS"])
902
901
  let interpolationVars = JSON.parse(process.env["TD_INTERPOLATION_VARS"] || '{}');
903
- console.log(interpolationVars);
904
902
 
905
903
  // Inject environment variables into any ${VAR} strings
906
904
  yml = parser.interpolate(yml, interpolationVars);
907
905
 
908
- console.log(yml)
909
906
  let ymlObj = null;
910
907
  try {
911
908
  ymlObj = await yaml.load(yml);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "4.2.0-test.3",
3
+ "version": "4.2.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": {
@@ -11,7 +11,8 @@
11
11
  "dev": "DEV=true node index.js",
12
12
  "debug": "DEV=true VERBOSE=true node index.js",
13
13
  "bundle": "node build.mjs",
14
- "test": "mocha test/*"
14
+ "test": "mocha test/*",
15
+ "preinstall": "node -e \"process.platform === 'win32' || process.exit(1)\" && npm install node-screenshots-win32-x64-msvc"
15
16
  },
16
17
  "author": "",
17
18
  "license": "ISC",
@@ -35,6 +36,7 @@
35
36
  "node-ipc": "^12.0.0",
36
37
  "node-notifier": "^10.0.1",
37
38
  "node-screenshots": "0.2.1",
39
+ "node-screenshots-win32-x64-msvc": "^0.2.1",
38
40
  "odiff-bin": "^3.1.2",
39
41
  "prompts": "^2.4.2",
40
42
  "remark-parse": "^11.0.0",
@@ -1,28 +0,0 @@
1
-
2
- name: Example Todo App
3
-
4
- on:
5
- push:
6
- branches: ["main"]
7
- pull_request:
8
- workflow_dispatch:
9
-
10
- jobs:
11
- run:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: testdriverai/action@alexrowe/yml-interpolation-test
15
- with:
16
- os: windows
17
- branch: alexrowe/yml-interpolation
18
- key: ${{secrets.TESTDRIVER_API_KEY}}
19
- prompt: |
20
- 1. /run test.yml
21
- prerun: |
22
- Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized", "${{ env.WEBSITE_URL }}"
23
- version: test
24
-
25
- env:
26
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27
- WEBSITE_URL: "https://kzmgtp9k2gtuuw2iquk2.lite.vusercontent.net/"
28
- TD_PASSWORD: "passW0rd!"
package/chrome.ps1 DELETED
@@ -1,33 +0,0 @@
1
- <#
2
- .SYNOPSIS
3
- Launches Google Chrome and navigates to a specified URL.
4
-
5
- .DESCRIPTION
6
- This PowerShell script will check for the existence of the Google Chrome
7
- browser at a predefined location, and if found, will open it and navigate to
8
- the URL provided as an argument to the script.
9
-
10
- .PARAMETER url
11
- The URL that Google Chrome will navigate to upon launch.
12
-
13
- .EXAMPLE
14
- .\chrome.ps1 -url "http://www.example.com"
15
- This example will open Google Chrome and navigate to http://www.example.com.
16
-
17
- .NOTES
18
- Google Chrome must be installed in the default location for this script
19
- to function correctly.
20
-
21
- #>
22
-
23
- param(
24
- [string]$url
25
- )
26
-
27
- $chromePath = "C:\Program Files\Google\Chrome\Application\chrome.exe"
28
-
29
- if (Test-Path $chromePath) {
30
- Start-Process $chromePath $url
31
- } else {
32
- Write-Error "Chrome is not installed at the expected location: $chromePath"
33
- }
package/lib/cli.js DELETED
@@ -1,22 +0,0 @@
1
- const { program } = require("commander");
2
-
3
- program.description("");
4
- program
5
- .argument("[command]", "Command to run")
6
- .option(
7
- "-c, --cwd <string>",
8
- "working directory to run in"
9
- )
10
- .option(
11
- "-i, --id <string>",
12
- "ID of server to connect to"
13
- )
14
- .option(
15
- "-o, --output-file <string>",
16
- "Output file to write the output of the command"
17
- )
18
- .option(
19
- "-e, --env <string>",
20
- "Extra environment variables"
21
- )
22
- .parse();
package/shot.png DELETED
Binary file
package/test.js DELETED
@@ -1,31 +0,0 @@
1
- const screenshot = require("screenshot-desktop");
2
- const robot = require("robotjs");
3
- const Jimp = require('jimp');
4
- const fs = require("fs");
5
-
6
- async function go () {
7
- await screenshot({ filename: "shot.png", format: "png" });
8
- let pos = robot.getMousePos()
9
- console.log(pos);
10
- let im = await Jimp.read("shot.png");
11
-
12
- // write im as a base64 string js file that can be imported in js
13
- const base64 = await im.getBase64Async(Jimp.MIME_PNG);
14
- fs.writeFileSync("pointer_image.js", `module.exports = \n"${base64}";\n`);
15
-
16
- let pointer = await Jimp.read("./cursor.png");
17
- console.log(im.getWidth(), im.getHeight());
18
- im.composite(pointer, pos.x * 2 , pos.y * 2);
19
-
20
- im.write("shot.png");
21
- };
22
-
23
- go();
24
-
25
- const screenshot = require("screenshot-desktop");
26
-
27
- async function go () {
28
- await screenshot({ filename: "shot.png", format: "png" });
29
- };
30
-
31
- go();
package/test.yml DELETED
@@ -1,18 +0,0 @@
1
- version: 4.1.40
2
- steps:
3
- - prompt: Enter Password n stuff
4
- commands:
5
- - command: focus-application
6
- name: Google Chrome
7
- - command: hover-text
8
- text: Username
9
- description: username field
10
- action: click
11
- - command: type
12
- text: ${TD_PASSWORD}
13
- - command: hover-text
14
- text: Password
15
- description: Password field
16
- action: click
17
- - command: type
18
- text: ${TD_PASSWORD}