testdriverai 4.2.0-test.3 → 4.2.1
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/.github/workflows/trigger_testdriver_dev.yml +4 -4
- package/agent.js +0 -3
- package/package.json +1 -1
- package/.github/workflows/test_interp.yml +0 -28
- package/chrome.ps1 +0 -33
- package/lib/cli.js +0 -22
- package/shot.png +0 -0
- package/test.js +0 -31
- package/test.yml +0 -18
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,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}
|