testdriverai 6.0.16-canary.a5849eb.0 → 6.0.16-canary.e337e67.0

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/index.js CHANGED
@@ -447,13 +447,14 @@ class TestDriverAgent extends EventEmitter2 {
447
447
  sourcePosition: sourcePosition,
448
448
  });
449
449
 
450
- return await this.haveAIResolveError(
450
+ await this.haveAIResolveError(
451
451
  error,
452
452
  yaml.dump({ commands: [yml] }),
453
453
  depth,
454
454
  true,
455
455
  shouldSave,
456
456
  );
457
+ throw error;
457
458
  }
458
459
  }
459
460
 
@@ -23,9 +23,9 @@ Parallel testing allows you to split your test actions into multiple files and r
23
23
  - Use a test matrix strategy to execute these files in parallel.
24
24
 
25
25
  <Warning>
26
- The `run` command is used in your test files to run other test files. This is
27
- useful for breaking down large tests into smaller, more manageable pieces. To
28
- run multiple separate tests, use a test matrix strategy.
26
+ The [`run`](/commands/run) command is used in your test files to run other
27
+ test files. This is useful for breaking down large tests into smaller, more
28
+ manageable pieces. To run multiple separate tests, use a test matrix strategy.
29
29
  </Warning>
30
30
 
31
31
  Example:
@@ -43,12 +43,12 @@ strategy:
43
43
 
44
44
  ### 2. Use optimized matching methods
45
45
 
46
- For actions like `hover-text`, `wait-for-text`, and `scroll-until-text`, use the `turbo` matching method instead of `ai`. The `turbo` method uses text similarity to quickly compute the most relevant match, making it about 40% faster than the `ai` method.
46
+ For actions like [`hover-text`](/commands/hover-text), [`wait-for-text`](/commands/wait-for-text), and [`scroll-until-text`](/commands/scroll-until-text), use the `turbo` matching method instead of `ai`. The `turbo` method uses text similarity to quickly compute the most relevant match, making it about 40% faster than the `ai` method.
47
47
 
48
48
  #### Example
49
49
 
50
50
  ```yaml
51
- command: hover-text
51
+ command: [`hover-text`](/commands/hover-text)
52
52
  text: Sign In
53
53
  description: login button
54
54
  action: click
@@ -59,12 +59,12 @@ method: turbo
59
59
 
60
60
  ### 3. Use `async` asserts
61
61
 
62
- The `assert` command supports the `async: true` property, allowing you to create non-blocking assertions. This means your tests can continue running while the assertion is being validated, saving valuable time.
62
+ The [`assert`](/commands/assert) command supports the `async: true` property, allowing you to create non-blocking assertions. This means your tests can continue running while the assertion is being validated, saving valuable time.
63
63
 
64
64
  #### Example
65
65
 
66
66
  ```yaml
67
- command: assert
67
+ command: [`assert`](/commands/assert)
68
68
  expect: The user is logged in
69
69
  async: true
70
70
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testdriverai",
3
- "version": "6.0.16-canary.a5849eb.0",
3
+ "version": "6.0.16-canary.e337e67.0",
4
4
  "description": "Next generation autonomous AI agent for end-to-end testing of web & desktop",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -22,16 +22,33 @@ steps:
22
22
 
23
23
  # Define paths
24
24
  $extensionPath = Join-Path (Get-Location) "node_modules/dashcam-chrome/build"
25
- $profilePath = Join-Path $env:TEMP "chrome-profile-$(Get-Random)"
25
+ $profilePath = Join-Path $env:TEMP "chrome-profile-$(Get-Random)"
26
+ $defaultDir = Join-Path $profilePath "Default"
27
+ $prefsPath = Join-Path $defaultDir "Preferences"
26
28
 
27
29
  Write-Host "Extension path: $extensionPath"
28
30
  Write-Host "Chrome user data dir: $profilePath"
29
31
 
30
- # Validate extension path
31
- if (-not (Test-Path $extensionPath)) {
32
- Write-Host "Extension not found at $extensionPath"
33
- }
32
+ # Create a clean profile + Preferences to disable password manager & autofill
33
+ Remove-Item $profilePath -Recurse -Force -ErrorAction SilentlyContinue
34
+ New-Item $defaultDir -ItemType Directory -Force | Out-Null
34
35
 
36
+ $prefs = @{
37
+ "credentials_enable_service" = $false
38
+ "profile" = @{
39
+ "password_manager_enabled" = $false
40
+ }
41
+ "autofill" = @{
42
+ "profile_enabled" = $false
43
+ "address_enabled" = $false
44
+ "credit_card_enabled" = $false
45
+ }
46
+ } | ConvertTo-Json -Depth 6
47
+
48
+ # Write Preferences before Chrome starts (ASCII/UTF8 is fine)
49
+ $prefs | Set-Content -Path $prefsPath -Encoding ASCII
50
+
51
+ # Build args
35
52
  $chromeArgs = @(
36
53
  "--start-maximized",
37
54
  "--load-extension=$extensionPath",
@@ -43,9 +60,6 @@ steps:
43
60
  ) -join ' '
44
61
 
45
62
  Start-Process "cmd.exe" -ArgumentList "/c", "npx @puppeteer/browsers launch chrome -- $chromeArgs"
46
-
47
- Write-Host "Script complete."
48
- exit
49
63
  - command: wait-for-text
50
64
  text: ${TD_WEBSITE}
51
65
  timeout: 60000
@@ -1 +0,0 @@
1
- TD_API_KEY=
File without changes
@@ -1,46 +0,0 @@
1
- version: 6.0.0
2
- session: 67f00511acbd9ccac373edf7
3
- steps:
4
- - prompt: download arc browser
5
- commands:
6
- - command: exec
7
- lang: pwsh
8
- code: |
9
- # === Setup ===
10
- $chocoUrl = "https://www.chocolate-doom.org/downloads/3.0.1/chocolate-doom-3.0.1-win32.zip"
11
- $wadUrl = "https://archive.org/download/DOOMIWADFILE/DOOM.WAD"
12
- $basePath = "$env:USERPROFILE\choco-doom"
13
- $extractDir = "$basePath\choco-extracted"
14
- $wadFile = "$basePath\DOOM.WAD"
15
- $chocoExe = "$extractDir\chocolate-doom.exe"
16
- $zipPath = "$basePath\choco.zip"
17
-
18
- # === Ensure clean folders ===
19
- New-Item -ItemType Directory -Force -Path $basePath | Out-Null
20
- New-Item -ItemType Directory -Force -Path $extractDir | Out-Null
21
-
22
- # === Download Chocolate DOOM if missing ===
23
- if (-not (Test-Path $zipPath)) {
24
- Write-Host "Downloading Chocolate DOOM..."
25
- Invoke-WebRequest -Uri $chocoUrl -OutFile $zipPath
26
- }
27
-
28
- # === Extract if not already extracted ===
29
- if (-not (Test-Path $chocoExe)) {
30
- Write-Host "Extracting Chocolate DOOM..."
31
- Expand-Archive -LiteralPath $zipPath -DestinationPath $extractDir -Force
32
- }
33
-
34
- # === Download DOOM.WAD if missing ===
35
- if (-not (Test-Path $wadFile)) {
36
- Write-Host "Downloading DOOM.WAD..."
37
- Invoke-WebRequest -Uri $wadUrl -OutFile $wadFile
38
- }
39
-
40
- # === Set SDL variables for software rendering ===
41
- $env:SDL_VIDEODRIVER = "windows"
42
- $env:SDL_RENDER_DRIVER = "software"
43
-
44
- # === Launch DOOM ===
45
- Write-Host "Launching Chocolate DOOM with software rendering..."
46
- Start-Process -FilePath $chocoExe -ArgumentList "-iwad `"$wadFile`""
@@ -1 +0,0 @@
1
- Can launch doom, but can not interact with it (probably due to emulation).
@@ -1,3 +0,0 @@
1
- # TBD
2
-
3
- - Alex is working on this
File without changes
@@ -1,19 +0,0 @@
1
- version: 6.0.0
2
- session: 67f00511acbd9ccac373edf7
3
- steps:
4
- - prompt: download and run npm
5
- commands:
6
- - command: exec
7
- lang: pwsh
8
- code: |
9
- # Download and install Chocolatey:
10
- powershell -c "irm https://community.chocolatey.org/install.ps1|iex"
11
-
12
- # Download and install Node.js:
13
- choco install nodejs --version="22.17.1"
14
-
15
- # Verify the Node.js version:
16
- node -v # Should print "v22.17.1".
17
-
18
- # Verify npm version:
19
- npm -v # Should print "10.9.2".
@@ -1,40 +0,0 @@
1
- version: 6.0.0
2
- session: 67f00511acbd9ccac373edf7
3
- steps:
4
- - prompt: download and run npm
5
- commands:
6
- - command: exec
7
- lang: pwsh
8
- code: |
9
- # Set the output log file path
10
- $logFile = "$PSScriptRoot\SystemUsageLog.csv"
11
-
12
- # Write header if the log file does not exist
13
- if (!(Test-Path $logFile)) {
14
- "Timestamp,CPU_Usage_Percent,Memory_Used_MB,Memory_Total_MB,Memory_Usage_Percent" | Out-File $logFile
15
- }
16
-
17
- # Monitor loop
18
- while ($true) {
19
- $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
20
-
21
- # Get CPU usage
22
- $cpuUsage = Get-Counter '\Processor(_Total)\% Processor Time'
23
- $cpuValue = [math]::Round($cpuUsage.CounterSamples.CookedValue, 2)
24
-
25
- # Get memory usage
26
- $comp = Get-CimInstance Win32_OperatingSystem
27
- $totalMemory = [math]::Round($comp.TotalVisibleMemorySize / 1024, 2)
28
- $freeMemory = [math]::Round($comp.FreePhysicalMemory / 1024, 2)
29
- $usedMemory = [math]::Round($totalMemory - $freeMemory, 2)
30
- $memPercent = [math]::Round(($usedMemory / $totalMemory) * 100, 2)
31
-
32
- # Append log entry
33
- "$timestamp,$cpuValue,$usedMemory,$totalMemory,$memPercent" | Out-File -Append -Encoding utf8 $logFile
34
-
35
- # Output to screen (optional)
36
- Write-Host "$timestamp | CPU: $cpuValue% | RAM: $usedMemory / $totalMemory MB ($memPercent%)"
37
-
38
- # Wait before next poll
39
- Start-Sleep -Seconds 5
40
- }
@@ -1,40 +0,0 @@
1
- version: 6.0.0
2
- session: 67f00511acbd9ccac373edf7
3
- steps:
4
- - prompt: download and run npm
5
- commands:
6
- - command: exec
7
- lang: pwsh
8
- code: |
9
- # Set the output log file path
10
- $logFile = "$PSScriptRoot\SystemUsageLog.csv"
11
-
12
- # Write header if the log file does not exist
13
- if (!(Test-Path $logFile)) {
14
- "Timestamp,CPU_Usage_Percent,Memory_Used_MB,Memory_Total_MB,Memory_Usage_Percent" | Out-File $logFile
15
- }
16
-
17
- # Monitor loop
18
- while ($true) {
19
- $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
20
-
21
- # Get CPU usage
22
- $cpuUsage = Get-Counter '\Processor(_Total)\% Processor Time'
23
- $cpuValue = [math]::Round($cpuUsage.CounterSamples.CookedValue, 2)
24
-
25
- # Get memory usage
26
- $comp = Get-CimInstance Win32_OperatingSystem
27
- $totalMemory = [math]::Round($comp.TotalVisibleMemorySize / 1024, 2)
28
- $freeMemory = [math]::Round($comp.FreePhysicalMemory / 1024, 2)
29
- $usedMemory = [math]::Round($totalMemory - $freeMemory, 2)
30
- $memPercent = [math]::Round(($usedMemory / $totalMemory) * 100, 2)
31
-
32
- # Append log entry
33
- "$timestamp,$cpuValue,$usedMemory,$totalMemory,$memPercent" | Out-File -Append -Encoding utf8 $logFile
34
-
35
- # Output to screen (optional)
36
- Write-Host "$timestamp | CPU: $cpuValue% | RAM: $usedMemory / $totalMemory MB ($memPercent%)"
37
-
38
- # Wait before next poll
39
- Start-Sleep -Seconds 5
40
- }
@@ -1 +0,0 @@
1
- Needs `dashcam track` call
@@ -1,2 +0,0 @@
1
- steps:
2
- - prompt: interact with the webpage
@@ -1,28 +0,0 @@
1
- version: 6.0.0
2
- session: 67f00511acbd9ccac373edf7
3
- steps:
4
- - prompt: launch playwright test recorder
5
- commands:
6
- - command: exec
7
- lang: pwsh
8
- code: |
9
- powershell -c "irm https://community.chocolatey.org/install.ps1|iex"
10
-
11
- # Download and install Node.js:
12
- choco install nodejs --version="22.17.1"
13
-
14
- # Verify the Node.js version:
15
- node -v # Should print "v22.17.1".
16
-
17
- # Verify npm version:
18
- npm -v # Should print "10.9.2".
19
-
20
- echo "Step 3: Installing Playwright dependencies"
21
- npx playwright install --with-deps chromium
22
-
23
- echo "Step 4: Generating Playwright script"
24
- $process = Start-Process -FilePath "npx" -ArgumentList "playwright codegen --target playwright-test https://airbnb.com" -PassThru
25
- Write-Output "Started Playwright with PID: $($process.Id)"
26
-
27
- echo "Step 5: Completed"
28
- exit
@@ -1 +0,0 @@
1
- Worked in v5, `npx` may be failing