From ed73bd3f58c8a44d81bec3046c1f604a0c35da18 Mon Sep 17 00:00:00 2001 From: Ian Jennings Date: Wed, 22 Jan 2025 22:44:40 -0600 Subject: [PATCH 01/66] first try --- .github/workflows/test-build-windows.yml | 51 ++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/test-build-windows.yml diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml new file mode 100644 index 000000000000..c4022829b7e2 --- /dev/null +++ b/.github/workflows/test-build-windows.yml @@ -0,0 +1,51 @@ +# Copyright 2019-2024 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT + +name: Build EXE for TestDriver +env: + DEBUG: napi:* + +on: + pull_request: + +defaults: + run: + working-directory: packages/cli/ + +jobs: + build: + name: build windows + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - run: corepack enable + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + architecture: x64 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-pc-windows-msvc + - name: Install dependencies + run: pnpm i --frozen-lockfile --ignore-scripts + - name: Build + run: pnpm build:cli + shell: bash + - name: Build + run: pnpm build:api + shell: bash + - name: Build API EXE + run: | + cd examples/api + pnpm tauri build + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: bindings-x86_64-pc-windows-msvc + path: packages/cli/${{ env.APP_NAME }}.*.node + if-no-files-found: error + \ No newline at end of file From 61131b5d72842c6a494c3edef865b7a8146156ca Mon Sep 17 00:00:00 2001 From: Ian Jennings Date: Wed, 22 Jan 2025 22:49:58 -0600 Subject: [PATCH 02/66] build --- .github/workflows/test-build-windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index c4022829b7e2..127fd8d98c1e 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -33,10 +33,10 @@ jobs: - name: Install dependencies run: pnpm i --frozen-lockfile --ignore-scripts - name: Build - run: pnpm build:cli + run: pnpm run build:cli shell: bash - name: Build - run: pnpm build:api + run: pnpm run build:api shell: bash - name: Build API EXE run: | From 019fb7310d17af07ea24cbb064d4c884ae63d912 Mon Sep 17 00:00:00 2001 From: Ian Jennings Date: Wed, 22 Jan 2025 22:55:28 -0600 Subject: [PATCH 03/66] i take suggestions --- .github/workflows/test-build-windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 127fd8d98c1e..00de28941ddc 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -33,10 +33,10 @@ jobs: - name: Install dependencies run: pnpm i --frozen-lockfile --ignore-scripts - name: Build - run: pnpm run build:cli + run: pnpm run -w build:cli shell: bash - name: Build - run: pnpm run build:api + run: pnpm run -w build:api shell: bash - name: Build API EXE run: | From fd5ae41bf2d9f2d27b0b7e8920c88f02aea4afc9 Mon Sep 17 00:00:00 2001 From: Ian Jennings Date: Wed, 22 Jan 2025 23:07:40 -0600 Subject: [PATCH 04/66] remove working dir setting --- .github/workflows/test-build-windows.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 00de28941ddc..0102aec4e78a 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -9,10 +9,6 @@ env: on: pull_request: -defaults: - run: - working-directory: packages/cli/ - jobs: build: name: build windows @@ -32,13 +28,13 @@ jobs: targets: x86_64-pc-windows-msvc - name: Install dependencies run: pnpm i --frozen-lockfile --ignore-scripts - - name: Build + - name: Build CLI run: pnpm run -w build:cli shell: bash - - name: Build + - name: Build AIP run: pnpm run -w build:api shell: bash - - name: Build API EXE + - name: Build API Example App run: | cd examples/api pnpm tauri build From b045639da0a60cdeaaf91f9f56ae8cc20d3524bf Mon Sep 17 00:00:00 2001 From: Ian Jennings Date: Wed, 22 Jan 2025 23:08:19 -0600 Subject: [PATCH 05/66] I think we don't need these anymore either --- .github/workflows/test-build-windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 0102aec4e78a..3ba8c47ffc67 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -29,10 +29,10 @@ jobs: - name: Install dependencies run: pnpm i --frozen-lockfile --ignore-scripts - name: Build CLI - run: pnpm run -w build:cli + run: pnpm run build:cli shell: bash - name: Build AIP - run: pnpm run -w build:api + run: pnpm run build:api shell: bash - name: Build API Example App run: | From 1385a8e193ac24a019b2b45b7defc5d7ed3325ad Mon Sep 17 00:00:00 2001 From: Ian Jennings Date: Wed, 22 Jan 2025 23:09:39 -0600 Subject: [PATCH 06/66] upload right artifact and debug --- .github/workflows/test-build-windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 3ba8c47ffc67..f0599d7a5ab7 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -38,10 +38,12 @@ jobs: run: | cd examples/api pnpm tauri build + - name: Output files in target/release + run: ls -la target/release - name: Upload artifact uses: actions/upload-artifact@v4 with: name: bindings-x86_64-pc-windows-msvc - path: packages/cli/${{ env.APP_NAME }}.*.node + path: target/release if-no-files-found: error \ No newline at end of file From 7137fde7d1d742e81118848531a781b750ec6fd1 Mon Sep 17 00:00:00 2001 From: Ian Jennings Date: Wed, 22 Jan 2025 23:31:00 -0600 Subject: [PATCH 07/66] update release target, remove ls command --- .github/workflows/test-build-windows.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index f0599d7a5ab7..a15243ec07dd 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -38,12 +38,10 @@ jobs: run: | cd examples/api pnpm tauri build - - name: Output files in target/release - run: ls -la target/release - name: Upload artifact uses: actions/upload-artifact@v4 with: name: bindings-x86_64-pc-windows-msvc - path: target/release + path: target\release\bundle\nsis\* if-no-files-found: error \ No newline at end of file From 97828e20466d5abf891ee7ddb548b7f95a0c1a53 Mon Sep 17 00:00:00 2001 From: Ian Jennings Date: Fri, 31 Jan 2025 17:15:38 -0600 Subject: [PATCH 08/66] add build commnad --- .github/workflows/test-build-windows.yml | 75 +++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index a15243ec07dd..f8022baf2ef3 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -44,4 +44,77 @@ jobs: name: bindings-x86_64-pc-windows-msvc path: target\release\bundle\nsis\* if-no-files-found: error - \ No newline at end of file + - uses: testdriverai/action@main + with: + key: ${{ secrets.TESTDRIVER_API_KEY }} + prompt: | + 1. click around the desktop app + prerun: | + $headers = @{ + Authorization = "token ${{ secrets.GITHUB_TOKEN }}" + } + $downloadFolder = "./download" + $artifactFileName = "waveterm.exe" + $artifactFilePath = "$downloadFolder/$artifactFileName" + Write-Host "Starting the artifact download process..." + # Create the download directory if it doesn't exist + if (-not (Test-Path -Path $downloadFolder)) { + Write-Host "Creating download folder..." + mkdir $downloadFolder + } else { + Write-Host "Download folder already exists." + } + # Fetch the artifact upload URL + Write-Host "Fetching the artifact upload URL..." + $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url + if ($artifactUrl) { + Write-Host "Artifact URL successfully fetched: $artifactUrl" + } else { + Write-Error "Failed to fetch the artifact URL." + exit 1 + } + # Download the artifact (zipped file) + Write-Host "Starting artifact download..." + $artifactZipPath = "$env:TEMP\artifact.zip" + try { + Invoke-WebRequest -Uri $artifactUrl ` + -Headers $headers ` + -OutFile $artifactZipPath ` + -MaximumRedirection 5 + Write-Host "Artifact downloaded successfully to $artifactZipPath" + } catch { + Write-Error "Error downloading artifact: $_" + exit 1 + } + # Unzip the artifact + $artifactUnzipPath = "$env:TEMP\artifact" + Write-Host "Unzipping the artifact to $artifactUnzipPath..." + try { + Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force + Write-Host "Artifact unzipped successfully to $artifactUnzipPath" + } catch { + Write-Error "Failed to unzip the artifact: $_" + exit 1 + } + # Find the installer or app executable + $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 + if ($artifactInstallerPath) { + Write-Host "Executable file found: $($artifactInstallerPath.FullName)" + } else { + Write-Error "Executable file not found. Exiting." + exit 1 + } + # Run the installer and log the result + Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." + try { + Start-Process -FilePath $artifactInstallerPath.FullName -Wait + Write-Host "Installer ran successfully." + } catch { + Write-Error "Failed to run the installer: $_" + exit 1 + } + # Optional: If the app executable is different from the installer, find and launch it + $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" + Write-Host "Launching the application: $($wavePath)" + Start-Process -FilePath $wavePath + Write-Host "Application launched." \ No newline at end of file From 107b34b9e773b7cf8ea4389db9db7e6b57deb0e9 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sat, 1 Feb 2025 21:40:36 -0500 Subject: [PATCH 09/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 67 ++++++++---------------- 1 file changed, 21 insertions(+), 46 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index f8022baf2ef3..b3cf9896869b 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -1,7 +1,3 @@ -# Copyright 2019-2024 Tauri Programme within The Commons Conservancy -# SPDX-License-Identifier: Apache-2.0 -# SPDX-License-Identifier: MIT - name: Build EXE for TestDriver env: DEBUG: napi:* @@ -31,7 +27,7 @@ jobs: - name: Build CLI run: pnpm run build:cli shell: bash - - name: Build AIP + - name: Build API run: pnpm run build:api shell: bash - name: Build API Example App @@ -44,11 +40,18 @@ jobs: name: bindings-x86_64-pc-windows-msvc path: target\release\bundle\nsis\* if-no-files-found: error + - name: Fetch artifact URL + run: | + echo "Fetching artifact URL..." + curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/actions/artifacts" \ + | jq '.artifacts[0].archive_download_url' - uses: testdriverai/action@main with: key: ${{ secrets.TESTDRIVER_API_KEY }} + github-token: ${{ secrets.GITHUB_TOKEN }} prompt: | - 1. click around the desktop app + 1. Click around the desktop app prerun: | $headers = @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" @@ -57,64 +60,36 @@ jobs: $artifactFileName = "waveterm.exe" $artifactFilePath = "$downloadFolder/$artifactFileName" Write-Host "Starting the artifact download process..." - # Create the download directory if it doesn't exist if (-not (Test-Path -Path $downloadFolder)) { - Write-Host "Creating download folder..." mkdir $downloadFolder - } else { - Write-Host "Download folder already exists." } - # Fetch the artifact upload URL Write-Host "Fetching the artifact upload URL..." - $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url - if ($artifactUrl) { - Write-Host "Artifact URL successfully fetched: $artifactUrl" + $artifactResponse = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/artifacts" -Headers $headers + if ($artifactResponse.artifacts.Count -gt 0) { + $artifactUrl = $artifactResponse.artifacts[0].archive_download_url + Write-Host "Artifact URL: $artifactUrl" } else { - Write-Error "Failed to fetch the artifact URL." + Write-Error "No artifacts found." exit 1 } - # Download the artifact (zipped file) - Write-Host "Starting artifact download..." $artifactZipPath = "$env:TEMP\artifact.zip" try { - Invoke-WebRequest -Uri $artifactUrl ` - -Headers $headers ` - -OutFile $artifactZipPath ` - -MaximumRedirection 5 - Write-Host "Artifact downloaded successfully to $artifactZipPath" + Invoke-WebRequest -Uri $artifactUrl -Headers $headers -OutFile $artifactZipPath -MaximumRedirection 5 + Write-Host "Artifact downloaded successfully." } catch { Write-Error "Error downloading artifact: $_" exit 1 } - # Unzip the artifact $artifactUnzipPath = "$env:TEMP\artifact" - Write-Host "Unzipping the artifact to $artifactUnzipPath..." - try { - Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force - Write-Host "Artifact unzipped successfully to $artifactUnzipPath" - } catch { - Write-Error "Failed to unzip the artifact: $_" - exit 1 - } - # Find the installer or app executable + Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 if ($artifactInstallerPath) { - Write-Host "Executable file found: $($artifactInstallerPath.FullName)" - } else { - Write-Error "Executable file not found. Exiting." - exit 1 - } - # Run the installer and log the result - Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." - try { + Write-Host "Executable found: $($artifactInstallerPath.FullName)" Start-Process -FilePath $artifactInstallerPath.FullName -Wait - Write-Host "Installer ran successfully." - } catch { - Write-Error "Failed to run the installer: $_" + } else { + Write-Error "Executable not found." exit 1 } - # Optional: If the app executable is different from the installer, find and launch it $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" - Write-Host "Launching the application: $($wavePath)" Start-Process -FilePath $wavePath - Write-Host "Application launched." \ No newline at end of file + Write-Host "Application launched." From 6551356089b68ab9717f086034f12024f337053b Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sat, 1 Feb 2025 22:02:24 -0500 Subject: [PATCH 10/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 27 +++++++----------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index b3cf9896869b..5d91c533e7c8 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -23,13 +23,9 @@ jobs: with: targets: x86_64-pc-windows-msvc - name: Install dependencies - run: pnpm i --frozen-lockfile --ignore-scripts - - name: Build CLI - run: pnpm run build:cli - shell: bash - - name: Build API - run: pnpm run build:api - shell: bash + run: | + cd examples/api + pnpm i --frozen-lockfile --ignore-scripts - name: Build API Example App run: | cd examples/api @@ -37,15 +33,9 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: bindings-x86_64-pc-windows-msvc - path: target\release\bundle\nsis\* + name: tauri-app + path: examples/api/src-tauri/target/release/app.exe if-no-files-found: error - - name: Fetch artifact URL - run: | - echo "Fetching artifact URL..." - curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/actions/artifacts" \ - | jq '.artifacts[0].archive_download_url' - uses: testdriverai/action@main with: key: ${{ secrets.TESTDRIVER_API_KEY }} @@ -57,7 +47,7 @@ jobs: Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } $downloadFolder = "./download" - $artifactFileName = "waveterm.exe" + $artifactFileName = "app.exe" $artifactFilePath = "$downloadFolder/$artifactFileName" Write-Host "Starting the artifact download process..." if (-not (Test-Path -Path $downloadFolder)) { @@ -82,7 +72,7 @@ jobs: } $artifactUnzipPath = "$env:TEMP\artifact" Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force - $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 + $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter app.exe -Recurse | Select-Object -First 1 if ($artifactInstallerPath) { Write-Host "Executable found: $($artifactInstallerPath.FullName)" Start-Process -FilePath $artifactInstallerPath.FullName -Wait @@ -90,6 +80,5 @@ jobs: Write-Error "Executable not found." exit 1 } - $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" - Start-Process -FilePath $wavePath Write-Host "Application launched." + From c6dd4bd1d76df7f5b71ce0fdd44dd341a467200c Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sat, 1 Feb 2025 22:13:01 -0500 Subject: [PATCH 11/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 118 ++++++++++++++--------- 1 file changed, 72 insertions(+), 46 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 5d91c533e7c8..07dded84d091 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -1,18 +1,24 @@ -name: Build EXE for TestDriver +name: Build and Test EXE for TestDriver + env: DEBUG: napi:* on: + push: + branches: ["main"] pull_request: + workflow_dispatch: + schedule: + - cron: '0 */6 * * *' jobs: build: - name: build windows + name: Build Windows EXE runs-on: windows-latest steps: - uses: actions/checkout@v4 - run: corepack enable - - name: Setup node + - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 20 @@ -36,49 +42,69 @@ jobs: name: tauri-app path: examples/api/src-tauri/target/release/app.exe if-no-files-found: error - - uses: testdriverai/action@main + + testdriver_matrix: + name: "TestDriver Matrix" + needs: build + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + test: + - name: "Functions testdriver" + file: "testdriver/functions.yml" + - name: "Chat testdriver" + file: "testdriver/chat_test.yml" + - name: "P2P dynamic payment testdriver" + file: "testdriver/p2p_dynamic_payment.yml" + - name: "Dynamic matchmaking testdriver" + file: "testdriver/skill_based_matchmaking.yml" + - name: "Support search testdriver" + file: "testdriver/support_search.yml" + - name: "Ask AI testdriver" + file: "testdriver/ask_ai.yml" + - name: "Edit settings testdriver" + file: "testdriver/edit_account_settings.yml" + - name: "Debug console testdriver" + file: "testdriver/debug_console.yml" + steps: + - name: Download Built App + uses: actions/download-artifact@v4 + with: + name: tauri-app + path: ${{ runner.temp }}/tauri-app + + - name: Verify and Launch Application + shell: pwsh + run: | + $exePath = "${{ runner.temp }}\tauri-app\app.exe" + if (Test-Path $exePath) { + Write-Host "✅ Executable found at: $exePath" + Unblock-File -Path $exePath + Write-Host "🚀 Launching application..." + + # Run process and keep it open for testing + $process = Start-Process -FilePath $exePath -NoNewWindow -PassThru + + Start-Sleep -Seconds 5 # Give time for startup + if ($process.HasExited) { + Write-Error "❌ The application exited unexpectedly." + exit 1 + } else { + Write-Host "✅ Application is running successfully." + } + } else { + Write-Error "❌ Executable not found." + exit 1 + } + + - name: Run TestDriver Tests + uses: testdriverai/action@main with: key: ${{ secrets.TESTDRIVER_API_KEY }} - github-token: ${{ secrets.GITHUB_TOKEN }} - prompt: | - 1. Click around the desktop app - prerun: | - $headers = @{ - Authorization = "token ${{ secrets.GITHUB_TOKEN }}" - } - $downloadFolder = "./download" - $artifactFileName = "app.exe" - $artifactFilePath = "$downloadFolder/$artifactFileName" - Write-Host "Starting the artifact download process..." - if (-not (Test-Path -Path $downloadFolder)) { - mkdir $downloadFolder - } - Write-Host "Fetching the artifact upload URL..." - $artifactResponse = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/artifacts" -Headers $headers - if ($artifactResponse.artifacts.Count -gt 0) { - $artifactUrl = $artifactResponse.artifacts[0].archive_download_url - Write-Host "Artifact URL: $artifactUrl" - } else { - Write-Error "No artifacts found." - exit 1 - } - $artifactZipPath = "$env:TEMP\artifact.zip" - try { - Invoke-WebRequest -Uri $artifactUrl -Headers $headers -OutFile $artifactZipPath -MaximumRedirection 5 - Write-Host "Artifact downloaded successfully." - } catch { - Write-Error "Error downloading artifact: $_" - exit 1 - } - $artifactUnzipPath = "$env:TEMP\artifact" - Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force - $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter app.exe -Recurse | Select-Object -First 1 - if ($artifactInstallerPath) { - Write-Host "Executable found: $($artifactInstallerPath.FullName)" - Start-Process -FilePath $artifactInstallerPath.FullName -Wait - } else { - Write-Error "Executable not found." - exit 1 - } - Write-Host "Application launched." + prompt: | + 1. /run ${{ matrix.test.file }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FORCE_COLOR: "3" From 2f0f7851b6e65b1539cdd44f92b00fac91a79222 Mon Sep 17 00:00:00 2001 From: Spencer Poisseroux Date: Sat, 1 Feb 2025 22:14:32 -0500 Subject: [PATCH 12/66] communication tests --- testdriver/comm_call_log_api.yml | 33 ++++++++++++++++++++++++++++ testdriver/comm_call_request_api.yml | 33 ++++++++++++++++++++++++++++ testdriver/comm_echo.yml | 33 ++++++++++++++++++++++++++++ testdriver/comm_send_event_rust.yml | 33 ++++++++++++++++++++++++++++ testdriver/comm_spam.yml | 33 ++++++++++++++++++++++++++++ 5 files changed, 165 insertions(+) create mode 100644 testdriver/comm_call_log_api.yml create mode 100644 testdriver/comm_call_request_api.yml create mode 100644 testdriver/comm_echo.yml create mode 100644 testdriver/comm_send_event_rust.yml create mode 100644 testdriver/comm_spam.yml diff --git a/testdriver/comm_call_log_api.yml b/testdriver/comm_call_log_api.yml new file mode 100644 index 000000000000..18ce3018e687 --- /dev/null +++ b/testdriver/comm_call_log_api.yml @@ -0,0 +1,33 @@ +version: 4.1.58 +session: 679ed1b8a1ad2d40a789e790 +steps: + - prompt: focus tauri API Validation + commands: + - command: hover-text + text: Tauri API Validation + description: window title of the Tauri API Validation application + action: click + - prompt: click the Communication tab in the sidebar + commands: + - command: hover-text + text: Communication + description: >- + Communication tab in the sidebar of the Tauri API Validation + application + action: click + - prompt: Click the Call Log API button + commands: + - command: hover-text + text: Call Log API + description: >- + Call Log API button in the Communication section of the + Tauri API Validation application + action: click + - prompt: Wait 5 seconds + commands: + - command: wait + timeout: 5000 + - prompt: Assert that the console shows a successful response + commands: + - command: assert + expect: the console shows a response diff --git a/testdriver/comm_call_request_api.yml b/testdriver/comm_call_request_api.yml new file mode 100644 index 000000000000..42c5a0000e7e --- /dev/null +++ b/testdriver/comm_call_request_api.yml @@ -0,0 +1,33 @@ +version: 4.1.58 +session: 679ed1b8a1ad2d40a789e790 +steps: + - prompt: focus tauri API Validation + commands: + - command: hover-text + text: Tauri API Validation + description: window title of the Tauri API Validation application + action: click + - prompt: click the Communication tab in the sidebar + commands: + - command: hover-text + text: Communication + description: >- + Communication tab in the sidebar of the Tauri API Validation + application + action: click + - prompt: Click the Call Request (async) API button + commands: + - command: hover-text + text: Call Request (async) API + description: >- + Call Request (async) API button in the Communication section of the + Tauri API Validation application + action: click + - prompt: Wait 5 seconds + commands: + - command: wait + timeout: 5000 + - prompt: Assert that the console shows a successful response + commands: + - command: assert + expect: the console shows "message response" diff --git a/testdriver/comm_echo.yml b/testdriver/comm_echo.yml new file mode 100644 index 000000000000..1e879a070c47 --- /dev/null +++ b/testdriver/comm_echo.yml @@ -0,0 +1,33 @@ +version: 4.1.58 +session: 679ed1b8a1ad2d40a789e790 +steps: + - prompt: focus tauri API Validation + commands: + - command: hover-text + text: Tauri API Validation + description: window title of the Tauri API Validation application + action: click + - prompt: click the Communication tab in the sidebar + commands: + - command: hover-text + text: Communication + description: >- + Communication tab in the sidebar of the Tauri API Validation + application + action: click + - prompt: Click the Echo button + commands: + - command: hover-text + text: Echo + description: >- + Echo button in the Communication section of the + Tauri API Validation application + action: click + - prompt: Wait 5 seconds + commands: + - command: wait + timeout: 5000 + - prompt: Assert that the console shows a successful response + commands: + - command: assert + expect: the console shows a response with "Tauri JSON request!" and "1, 2, 3" diff --git a/testdriver/comm_send_event_rust.yml b/testdriver/comm_send_event_rust.yml new file mode 100644 index 000000000000..f506ed8cd14d --- /dev/null +++ b/testdriver/comm_send_event_rust.yml @@ -0,0 +1,33 @@ +version: 4.1.58 +session: 679ed1b8a1ad2d40a789e790 +steps: + - prompt: focus tauri API Validation + commands: + - command: hover-text + text: Tauri API Validation + description: window title of the Tauri API Validation application + action: click + - prompt: click the Communication tab in the sidebar + commands: + - command: hover-text + text: Communication + description: >- + Communication tab in the sidebar of the Tauri API Validation + application + action: click + - prompt: Click the Send event to Rust button + commands: + - command: hover-text + text: Send event to Rust + description: >- + Send Event to Rust button in the Communication section of the + Tauri API Validation application + action: click + - prompt: Wait 5 seconds + commands: + - command: wait + timeout: 5000 + - prompt: Assert that the console shows a successful response + commands: + - command: assert + expect: the console shows a response with an "event", "payload", and "id" diff --git a/testdriver/comm_spam.yml b/testdriver/comm_spam.yml new file mode 100644 index 000000000000..d55072689872 --- /dev/null +++ b/testdriver/comm_spam.yml @@ -0,0 +1,33 @@ +version: 4.1.58 +session: 679ed1b8a1ad2d40a789e790 +steps: + - prompt: focus tauri API Validation + commands: + - command: hover-text + text: Tauri API Validation + description: window title of the Tauri API Validation application + action: click + - prompt: click the Communication tab in the sidebar + commands: + - command: hover-text + text: Communication + description: >- + Communication tab in the sidebar of the Tauri API Validation + application + action: click + - prompt: Click the Spam button + commands: + - command: hover-text + text: Spam + description: >- + Spam button in the Communication section of the + Tauri API Validation application + action: click + - prompt: Wait 5 seconds + commands: + - command: wait + timeout: 5000 + - prompt: Assert that the console shows a successful response + commands: + - command: assert + expect: the console shows a response with value 1000 From 4f49a88f5a73ac8be1da271c2c8237c39b949c65 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sat, 1 Feb 2025 22:17:21 -0500 Subject: [PATCH 13/66] add communication tests --- .github/workflows/test-build-windows.yml | 26 +++++++++--------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 07dded84d091..ab1490dd0ba7 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -51,22 +51,16 @@ jobs: fail-fast: false matrix: test: - - name: "Functions testdriver" - file: "testdriver/functions.yml" - - name: "Chat testdriver" - file: "testdriver/chat_test.yml" - - name: "P2P dynamic payment testdriver" - file: "testdriver/p2p_dynamic_payment.yml" - - name: "Dynamic matchmaking testdriver" - file: "testdriver/skill_based_matchmaking.yml" - - name: "Support search testdriver" - file: "testdriver/support_search.yml" - - name: "Ask AI testdriver" - file: "testdriver/ask_ai.yml" - - name: "Edit settings testdriver" - file: "testdriver/edit_account_settings.yml" - - name: "Debug console testdriver" - file: "testdriver/debug_console.yml" + - name: "Call Log API testdriver" + file: "testdriver/comm_call_log_api.yml" + - name: "Call Request API testdriver" + file: "testdriver/comm_call_request_api.yml" + - name: "Echo testdriver" + file: "testdriver/comm_echo.yml" + - name: "Send Event to Rust testdriver" + file: "testdriver/comm_send_event_rust.yml" + - name: "Spam testdriver" + file: "testdriver/comm_spam.yml" steps: - name: Download Built App uses: actions/download-artifact@v4 From 540832ab027ab4261d59cd19d6414d8785751a60 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sat, 1 Feb 2025 22:24:20 -0500 Subject: [PATCH 14/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index ab1490dd0ba7..150d7be47e7a 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -31,7 +31,10 @@ jobs: - name: Install dependencies run: | cd examples/api - pnpm i --frozen-lockfile --ignore-scripts + pnpm install --prod --frozen-lockfile --ignore-scripts + - name: Install Tauri CLI + run: | + pnpm add @tauri-apps/cli --dev - name: Build API Example App run: | cd examples/api @@ -91,7 +94,6 @@ jobs: Write-Error "❌ Executable not found." exit 1 } - - name: Run TestDriver Tests uses: testdriverai/action@main with: @@ -101,4 +103,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" - From d0a8a8aa5601383ef35d90412279017a0833d042 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sat, 1 Feb 2025 22:26:36 -0500 Subject: [PATCH 15/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 150d7be47e7a..b19d97560cae 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -34,7 +34,7 @@ jobs: pnpm install --prod --frozen-lockfile --ignore-scripts - name: Install Tauri CLI run: | - pnpm add @tauri-apps/cli --dev + pnpm add @tauri-apps/cli -D - name: Build API Example App run: | cd examples/api From 6b5c2a54b52a5b9743d30992711f3cc506c60c6c Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sat, 1 Feb 2025 22:29:03 -0500 Subject: [PATCH 16/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index b19d97560cae..a81886b99699 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -34,6 +34,7 @@ jobs: pnpm install --prod --frozen-lockfile --ignore-scripts - name: Install Tauri CLI run: | + cd examples/api pnpm add @tauri-apps/cli -D - name: Build API Example App run: | From 7e8866529389f0fb1a620cc16c3260bd7915ff7b Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sat, 1 Feb 2025 22:32:40 -0500 Subject: [PATCH 17/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index a81886b99699..b9c0b28df569 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -28,9 +28,10 @@ jobs: uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc - - name: Install dependencies + - name: Install dependencies (clean) run: | cd examples/api + rm -rf node_modules pnpm-lock.yaml # Clean old dependencies pnpm install --prod --frozen-lockfile --ignore-scripts - name: Install Tauri CLI run: | @@ -104,3 +105,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" + From c891e316ebc329cc4ec7d80d125ca99aa776c1de Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sat, 1 Feb 2025 22:36:46 -0500 Subject: [PATCH 18/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 69 ++++++++++++++---------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index b9c0b28df569..7806157c2e72 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -28,15 +28,10 @@ jobs: uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc - - name: Install dependencies (clean) + - name: Install dependencies run: | cd examples/api - rm -rf node_modules pnpm-lock.yaml # Clean old dependencies - pnpm install --prod --frozen-lockfile --ignore-scripts - - name: Install Tauri CLI - run: | - cd examples/api - pnpm add @tauri-apps/cli -D + pnpm i --frozen-lockfile --ignore-scripts - name: Build API Example App run: | cd examples/api @@ -67,35 +62,52 @@ jobs: - name: "Spam testdriver" file: "testdriver/comm_spam.yml" steps: - - name: Download Built App - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: name: tauri-app path: ${{ runner.temp }}/tauri-app - - - name: Verify and Launch Application + - name: Launch Application shell: pwsh run: | - $exePath = "${{ runner.temp }}\tauri-app\app.exe" - if (Test-Path $exePath) { - Write-Host "✅ Executable found at: $exePath" - Unblock-File -Path $exePath - Write-Host "🚀 Launching application..." - - # Run process and keep it open for testing - $process = Start-Process -FilePath $exePath -NoNewWindow -PassThru - - Start-Sleep -Seconds 5 # Give time for startup - if ($process.HasExited) { - Write-Error "❌ The application exited unexpectedly." - exit 1 - } else { - Write-Host "✅ Application is running successfully." - } + $headers = @{ + Authorization = "token ${{ secrets.GITHUB_TOKEN }}" + } + $downloadFolder = "$env:TEMP\download" + $artifactFileName = "app.exe" + $artifactFilePath = "$downloadFolder\$artifactFileName" + Write-Host "Starting the artifact download process..." + if (-not (Test-Path -Path $downloadFolder)) { + mkdir $downloadFolder + } + Write-Host "Fetching the artifact upload URL..." + $artifactResponse = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/artifacts" -Headers $headers + if ($artifactResponse.artifacts.Count -gt 0) { + $artifactUrl = $artifactResponse.artifacts[0].archive_download_url + Write-Host "Artifact URL: $artifactUrl" + } else { + Write-Error "No artifacts found." + exit 1 + } + $artifactZipPath = "$env:TEMP\artifact.zip" + try { + Invoke-WebRequest -Uri $artifactUrl -Headers $headers -OutFile $artifactZipPath -MaximumRedirection 5 + Write-Host "Artifact downloaded successfully." + } catch { + Write-Error "Error downloading artifact: $_" + exit 1 + } + $artifactUnzipPath = "$env:TEMP\artifact" + Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force + $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter app.exe -Recurse | Select-Object -First 1 + if ($artifactInstallerPath) { + Write-Host "Executable found: $($artifactInstallerPath.FullName)" + Start-Process -FilePath $artifactInstallerPath.FullName } else { - Write-Error "❌ Executable not found." + Write-Error "Executable not found." exit 1 } + Write-Host "Application launched." + - name: Run TestDriver Tests uses: testdriverai/action@main with: @@ -105,4 +117,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" - From 565e764dd5e59bb49ea9f902f27240d49bc559d7 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sat, 1 Feb 2025 22:44:02 -0500 Subject: [PATCH 19/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 7806157c2e72..433804eb2b0f 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -17,25 +17,45 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 + - run: corepack enable + - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' architecture: x64 + - name: Install Rust uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc + + - name: Install Visual Studio Build Tools + run: | + choco install visualstudio2019buildtools + - name: Install dependencies run: | cd examples/api - pnpm i --frozen-lockfile --ignore-scripts + pnpm i --frozen-lockfile + + - name: Install Tauri CLI + run: | + cd examples/api + pnpm add @tauri-apps/cli + + - name: Verify Tauri CLI installation + run: | + cd examples/api + pnpm tauri --version + - name: Build API Example App run: | cd examples/api pnpm tauri build + - name: Upload artifact uses: actions/upload-artifact@v4 with: @@ -66,6 +86,7 @@ jobs: with: name: tauri-app path: ${{ runner.temp }}/tauri-app + - name: Launch Application shell: pwsh run: | @@ -117,3 +138,4 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" + From 1d47085af9406aab1d33810bfb28bd3aea507971 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 12:29:37 -0500 Subject: [PATCH 20/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 191 +++++++++++------------ 1 file changed, 87 insertions(+), 104 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 433804eb2b0f..19bc23f24305 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -1,140 +1,123 @@ -name: Build and Test EXE for TestDriver +# Copyright 2019-2024 Tauri Programme within The Commons Conservancy +# SPDX-License-Identifier: Apache-2.0 +# SPDX-License-Identifier: MIT +name: Build EXE for TestDriver env: DEBUG: napi:* on: - push: - branches: ["main"] pull_request: - workflow_dispatch: - schedule: - - cron: '0 */6 * * *' jobs: build: - name: Build Windows EXE + name: build windows runs-on: windows-latest steps: - uses: actions/checkout@v4 - - run: corepack enable - - - name: Setup Node.js + - name: Setup node uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' architecture: x64 - - name: Install Rust uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc - - - name: Install Visual Studio Build Tools - run: | - choco install visualstudio2019buildtools - - name: Install dependencies - run: | - cd examples/api - pnpm i --frozen-lockfile - - - name: Install Tauri CLI - run: | - cd examples/api - pnpm add @tauri-apps/cli - - - name: Verify Tauri CLI installation - run: | - cd examples/api - pnpm tauri --version - + run: pnpm i --frozen-lockfile --ignore-scripts + - name: Build CLI + run: pnpm run build:cli + shell: bash + - name: Build AIP + run: pnpm run build:api + shell: bash - name: Build API Example App run: | cd examples/api pnpm tauri build - - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: tauri-app - path: examples/api/src-tauri/target/release/app.exe + name: bindings-x86_64-pc-windows-msvc + path: target\release\bundle\nsis\* if-no-files-found: error - - testdriver_matrix: - name: "TestDriver Matrix" - needs: build - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - test: - - name: "Call Log API testdriver" - file: "testdriver/comm_call_log_api.yml" - - name: "Call Request API testdriver" - file: "testdriver/comm_call_request_api.yml" - - name: "Echo testdriver" - file: "testdriver/comm_echo.yml" - - name: "Send Event to Rust testdriver" - file: "testdriver/comm_send_event_rust.yml" - - name: "Spam testdriver" - file: "testdriver/comm_spam.yml" - steps: - - uses: actions/download-artifact@v4 - with: - name: tauri-app - path: ${{ runner.temp }}/tauri-app - - - name: Launch Application - shell: pwsh - run: | - $headers = @{ - Authorization = "token ${{ secrets.GITHUB_TOKEN }}" - } - $downloadFolder = "$env:TEMP\download" - $artifactFileName = "app.exe" - $artifactFilePath = "$downloadFolder\$artifactFileName" - Write-Host "Starting the artifact download process..." - if (-not (Test-Path -Path $downloadFolder)) { - mkdir $downloadFolder - } - Write-Host "Fetching the artifact upload URL..." - $artifactResponse = Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/artifacts" -Headers $headers - if ($artifactResponse.artifacts.Count -gt 0) { - $artifactUrl = $artifactResponse.artifacts[0].archive_download_url - Write-Host "Artifact URL: $artifactUrl" - } else { - Write-Error "No artifacts found." - exit 1 - } - $artifactZipPath = "$env:TEMP\artifact.zip" - try { - Invoke-WebRequest -Uri $artifactUrl -Headers $headers -OutFile $artifactZipPath -MaximumRedirection 5 - Write-Host "Artifact downloaded successfully." - } catch { - Write-Error "Error downloading artifact: $_" - exit 1 - } - $artifactUnzipPath = "$env:TEMP\artifact" - Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force - $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter app.exe -Recurse | Select-Object -First 1 - if ($artifactInstallerPath) { - Write-Host "Executable found: $($artifactInstallerPath.FullName)" - Start-Process -FilePath $artifactInstallerPath.FullName - } else { - Write-Error "Executable not found." - exit 1 - } - Write-Host "Application launched." - - - name: Run TestDriver Tests - uses: testdriverai/action@main + - uses: testdriverai/action@main with: key: ${{ secrets.TESTDRIVER_API_KEY }} - prompt: | - 1. /run ${{ matrix.test.file }} + prompt: | + 1. click around the desktop app + prerun: | + $headers = @{ + Authorization = "token ${{ secrets.GITHUB_TOKEN }}" + } + $downloadFolder = "./download" + $artifactFileName = "waveterm.exe" + $artifactFilePath = "$downloadFolder/$artifactFileName" + Write-Host "Starting the artifact download process..." + # Create the download directory if it doesn't exist + if (-not (Test-Path -Path $downloadFolder)) { + Write-Host "Creating download folder..." + mkdir $downloadFolder + } else { + Write-Host "Download folder already exists." + } + # Fetch the artifact upload URL + Write-Host "Fetching the artifact upload URL..." + $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url + if ($artifactUrl) { + Write-Host "Artifact URL successfully fetched: $artifactUrl" + } else { + Write-Error "Failed to fetch the artifact URL." + exit 1 + } + # Download the artifact (zipped file) + Write-Host "Starting artifact download..." + $artifactZipPath = "$env:TEMP\artifact.zip" + try { + Invoke-WebRequest -Uri $artifactUrl ` + -Headers $headers ` + -OutFile $artifactZipPath ` + -MaximumRedirection 5 + Write-Host "Artifact downloaded successfully to $artifactZipPath" + } catch { + Write-Error "Error downloading artifact: $_" + exit 1 + } + # Unzip the artifact + $artifactUnzipPath = "$env:TEMP\artifact" + Write-Host "Unzipping the artifact to $artifactUnzipPath..." + try { + Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force + Write-Host "Artifact unzipped successfully to $artifactUnzipPath" + } catch { + Write-Error "Failed to unzip the artifact: $_" + exit 1 + } + # Find the installer or app executable + $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 + if ($artifactInstallerPath) { + Write-Host "Executable file found: $($artifactInstallerPath.FullName)" + } else { + Write-Error "Executable file not found. Exiting." + exit 1 + } + # Run the installer and log the result + Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." + try { + Start-Process -FilePath $artifactInstallerPath.FullName -Wait + Write-Host "Installer ran successfully." + } catch { + Write-Error "Failed to run the installer: $_" + exit 1 + } + # Optional: If the app executable is different from the installer, find and launch it + $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" + Write-Host "Launching the application: $($wavePath)" + Start-Process -FilePath $wavePath + Write-Host "Application launched." env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" From 25be29774459d7eca5ce0599c9e015fd29ba49e5 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 12:58:59 -0500 Subject: [PATCH 21/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 34 +++++++++++++----------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 19bc23f24305..52f14bd4e7f4 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -31,9 +31,13 @@ jobs: - name: Build CLI run: pnpm run build:cli shell: bash - - name: Build AIP + - name: Build API run: pnpm run build:api shell: bash + - name: Install dependencies for API Example App + run: | + cd examples/api + pnpm i - name: Build API Example App run: | cd examples/api @@ -42,21 +46,22 @@ jobs: uses: actions/upload-artifact@v4 with: name: bindings-x86_64-pc-windows-msvc - path: target\release\bundle\nsis\* + path: examples/api/src-tauri/target/release/app.exe if-no-files-found: error - uses: testdriverai/action@main with: key: ${{ secrets.TESTDRIVER_API_KEY }} prompt: | - 1. click around the desktop app + 1. Click around the desktop app prerun: | $headers = @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } $downloadFolder = "./download" - $artifactFileName = "waveterm.exe" + $artifactFileName = "app.exe" $artifactFilePath = "$downloadFolder/$artifactFileName" Write-Host "Starting the artifact download process..." + # Create the download directory if it doesn't exist if (-not (Test-Path -Path $downloadFolder)) { Write-Host "Creating download folder..." @@ -64,6 +69,7 @@ jobs: } else { Write-Host "Download folder already exists." } + # Fetch the artifact upload URL Write-Host "Fetching the artifact upload URL..." $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url @@ -73,6 +79,7 @@ jobs: Write-Error "Failed to fetch the artifact URL." exit 1 } + # Download the artifact (zipped file) Write-Host "Starting artifact download..." $artifactZipPath = "$env:TEMP\artifact.zip" @@ -86,6 +93,7 @@ jobs: Write-Error "Error downloading artifact: $_" exit 1 } + # Unzip the artifact $artifactUnzipPath = "$env:TEMP\artifact" Write-Host "Unzipping the artifact to $artifactUnzipPath..." @@ -96,6 +104,7 @@ jobs: Write-Error "Failed to unzip the artifact: $_" exit 1 } + # Find the installer or app executable $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 if ($artifactInstallerPath) { @@ -104,21 +113,16 @@ jobs: Write-Error "Executable file not found. Exiting." exit 1 } - # Run the installer and log the result - Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." + + # Run the app directly instead of an installer + Write-Host "Launching the Tauri API Example App: $($artifactInstallerPath.FullName)..." try { - Start-Process -FilePath $artifactInstallerPath.FullName -Wait - Write-Host "Installer ran successfully." + Start-Process -FilePath $artifactInstallerPath.FullName + Write-Host "Application launched." } catch { - Write-Error "Failed to run the installer: $_" + Write-Error "Failed to run the application: $_" exit 1 } - # Optional: If the app executable is different from the installer, find and launch it - $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" - Write-Host "Launching the application: $($wavePath)" - Start-Process -FilePath $wavePath - Write-Host "Application launched." env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" - From 1597e255510b38094cc8befcf3c1d8291d3efa61 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:07:24 -0500 Subject: [PATCH 22/66] change path, upload correct artifact --- .github/workflows/test-build-windows.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 52f14bd4e7f4..14c6ced5f779 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -31,13 +31,9 @@ jobs: - name: Build CLI run: pnpm run build:cli shell: bash - - name: Build API + - name: Build AIP run: pnpm run build:api shell: bash - - name: Install dependencies for API Example App - run: | - cd examples/api - pnpm i - name: Build API Example App run: | cd examples/api @@ -46,13 +42,13 @@ jobs: uses: actions/upload-artifact@v4 with: name: bindings-x86_64-pc-windows-msvc - path: examples/api/src-tauri/target/release/app.exe + path: examples/api/src-tauri/target/release/*.exe if-no-files-found: error - uses: testdriverai/action@main with: key: ${{ secrets.TESTDRIVER_API_KEY }} prompt: | - 1. Click around the desktop app + 1. click around the desktop app prerun: | $headers = @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" @@ -61,7 +57,6 @@ jobs: $artifactFileName = "app.exe" $artifactFilePath = "$downloadFolder/$artifactFileName" Write-Host "Starting the artifact download process..." - # Create the download directory if it doesn't exist if (-not (Test-Path -Path $downloadFolder)) { Write-Host "Creating download folder..." @@ -69,7 +64,6 @@ jobs: } else { Write-Host "Download folder already exists." } - # Fetch the artifact upload URL Write-Host "Fetching the artifact upload URL..." $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url @@ -79,7 +73,6 @@ jobs: Write-Error "Failed to fetch the artifact URL." exit 1 } - # Download the artifact (zipped file) Write-Host "Starting artifact download..." $artifactZipPath = "$env:TEMP\artifact.zip" @@ -93,7 +86,6 @@ jobs: Write-Error "Error downloading artifact: $_" exit 1 } - # Unzip the artifact $artifactUnzipPath = "$env:TEMP\artifact" Write-Host "Unzipping the artifact to $artifactUnzipPath..." @@ -104,7 +96,6 @@ jobs: Write-Error "Failed to unzip the artifact: $_" exit 1 } - # Find the installer or app executable $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 if ($artifactInstallerPath) { @@ -113,8 +104,7 @@ jobs: Write-Error "Executable file not found. Exiting." exit 1 } - - # Run the app directly instead of an installer + # Run the application directly Write-Host "Launching the Tauri API Example App: $($artifactInstallerPath.FullName)..." try { Start-Process -FilePath $artifactInstallerPath.FullName From 1eea580ac90311fac92baad6593a5cb6ea80fc36 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:12:18 -0500 Subject: [PATCH 23/66] rollback test-build-windows.yml --- .github/workflows/test-build-windows.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 14c6ced5f779..19bc23f24305 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -42,7 +42,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: bindings-x86_64-pc-windows-msvc - path: examples/api/src-tauri/target/release/*.exe + path: target\release\bundle\nsis\* if-no-files-found: error - uses: testdriverai/action@main with: @@ -54,7 +54,7 @@ jobs: Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } $downloadFolder = "./download" - $artifactFileName = "app.exe" + $artifactFileName = "waveterm.exe" $artifactFilePath = "$downloadFolder/$artifactFileName" Write-Host "Starting the artifact download process..." # Create the download directory if it doesn't exist @@ -104,15 +104,21 @@ jobs: Write-Error "Executable file not found. Exiting." exit 1 } - # Run the application directly - Write-Host "Launching the Tauri API Example App: $($artifactInstallerPath.FullName)..." + # Run the installer and log the result + Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." try { - Start-Process -FilePath $artifactInstallerPath.FullName - Write-Host "Application launched." + Start-Process -FilePath $artifactInstallerPath.FullName -Wait + Write-Host "Installer ran successfully." } catch { - Write-Error "Failed to run the application: $_" + Write-Error "Failed to run the installer: $_" exit 1 } + # Optional: If the app executable is different from the installer, find and launch it + $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" + Write-Host "Launching the application: $($wavePath)" + Start-Process -FilePath $wavePath + Write-Host "Application launched." env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" + From 3647273a9deafcd8bfe2195b7557444d95d20bd6 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:14:36 -0500 Subject: [PATCH 24/66] rollback test-build-windows.yml From 64df16c923c60d9c01dfb83360b4658ab65ba943 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:19:51 -0500 Subject: [PATCH 25/66] Update test-build-windows.yml, fix signature issue and artifact handling? --- .github/workflows/test-build-windows.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 19bc23f24305..39c2122e0c00 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -15,13 +15,16 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 - - run: corepack enable - name: Setup node uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' architecture: x64 + - name: Disable Corepack + run: corepack disable + - name: Install Specific pnpm Version + run: npm install -g pnpm@8.15.4 # Use the latest stable version or the version you need - name: Install Rust uses: dtolnay/rust-toolchain@stable with: @@ -54,7 +57,7 @@ jobs: Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } $downloadFolder = "./download" - $artifactFileName = "waveterm.exe" + $artifactFileName = "app.exe" # Change this to match the name of your app's executable $artifactFilePath = "$downloadFolder/$artifactFileName" Write-Host "Starting the artifact download process..." # Create the download directory if it doesn't exist @@ -114,11 +117,10 @@ jobs: exit 1 } # Optional: If the app executable is different from the installer, find and launch it - $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" - Write-Host "Launching the application: $($wavePath)" - Start-Process -FilePath $wavePath + $appPath = Join-Path $env:USERPROFILE "AppData\Local\Programs\yourapp\yourapp.exe" # Adjust this path to your app's executable + Write-Host "Launching the application: $($appPath)" + Start-Process -FilePath $appPath Write-Host "Application launched." env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" - From 8d608ce63d1925d277b64f77939ead97620f69c6 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:22:53 -0500 Subject: [PATCH 26/66] Update test-build-windows.yml, pnpm path --- .github/workflows/test-build-windows.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 39c2122e0c00..fae508d2ad34 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -24,7 +24,10 @@ jobs: - name: Disable Corepack run: corepack disable - name: Install Specific pnpm Version - run: npm install -g pnpm@8.15.4 # Use the latest stable version or the version you need + run: | + npm install -g pnpm@8.15.4 + echo "Adding pnpm to PATH" + echo "$(npm bin -g)" >> $GITHUB_PATH - name: Install Rust uses: dtolnay/rust-toolchain@stable with: From 3436518e646df511781d8e1ce4d541e995d15eae Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:25:58 -0500 Subject: [PATCH 27/66] Update test-build-windows.yml, pnpm confirm --- .github/workflows/test-build-windows.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index fae508d2ad34..99984cf2ef8a 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -15,23 +15,21 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 + - run: corepack enable - name: Setup node uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' architecture: x64 - - name: Disable Corepack - run: corepack disable - - name: Install Specific pnpm Version - run: | - npm install -g pnpm@8.15.4 - echo "Adding pnpm to PATH" - echo "$(npm bin -g)" >> $GITHUB_PATH - name: Install Rust uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc + - name: Install pnpm + run: | + npm install -g pnpm@8.15.4 + echo "pnpm installed successfully" - name: Install dependencies run: pnpm i --frozen-lockfile --ignore-scripts - name: Build CLI @@ -60,7 +58,7 @@ jobs: Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } $downloadFolder = "./download" - $artifactFileName = "app.exe" # Change this to match the name of your app's executable + $artifactFileName = "waveterm.exe" $artifactFilePath = "$downloadFolder/$artifactFileName" Write-Host "Starting the artifact download process..." # Create the download directory if it doesn't exist @@ -120,9 +118,9 @@ jobs: exit 1 } # Optional: If the app executable is different from the installer, find and launch it - $appPath = Join-Path $env:USERPROFILE "AppData\Local\Programs\yourapp\yourapp.exe" # Adjust this path to your app's executable - Write-Host "Launching the application: $($appPath)" - Start-Process -FilePath $appPath + $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" + Write-Host "Launching the application: $($wavePath)" + Start-Process -FilePath $wavePath Write-Host "Application launched." env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 73e5d8ea93e5a90c6213739884686e7e48fc0472 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:28:07 -0500 Subject: [PATCH 28/66] Update test-build-windows.yml, disable corepack --- .github/workflows/test-build-windows.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 99984cf2ef8a..ed11c59a7d51 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -15,7 +15,6 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 - - run: corepack enable - name: Setup node uses: actions/setup-node@v4 with: @@ -26,6 +25,11 @@ jobs: uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc + - name: Clear corepack cache + run: | + npm cache clean --force + corepack disable + echo "Corepack cache cleared." - name: Install pnpm run: | npm install -g pnpm@8.15.4 From 3f404308a15aab5c4c800292d677eda69e701342 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:32:47 -0500 Subject: [PATCH 29/66] Update test-build-windows.yml, corepack changes --- .github/workflows/test-build-windows.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index ed11c59a7d51..207078e614db 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -21,21 +21,17 @@ jobs: node-version: 20 cache: 'pnpm' architecture: x64 + - name: Enable Corepack and ensure pnpm is available + run: | + corepack enable + corepack prepare pnpm@latest --activate + pnpm --version # Ensure pnpm is available - name: Install Rust uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc - - name: Clear corepack cache - run: | - npm cache clean --force - corepack disable - echo "Corepack cache cleared." - - name: Install pnpm - run: | - npm install -g pnpm@8.15.4 - echo "pnpm installed successfully" - name: Install dependencies - run: pnpm i --frozen-lockfile --ignore-scripts + run: pnpm install --frozen-lockfile --ignore-scripts - name: Build CLI run: pnpm run build:cli shell: bash From 1eac10dc92f2ec1b75d829ed9bdb35754be0c1fa Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:34:39 -0500 Subject: [PATCH 30/66] Update test-build-windows.yml, ensure pnpm after corepack install --- .github/workflows/test-build-windows.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 207078e614db..88a305dc5693 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -21,11 +21,12 @@ jobs: node-version: 20 cache: 'pnpm' architecture: x64 - - name: Enable Corepack and ensure pnpm is available + - name: Install pnpm globally + run: npm install -g pnpm + - name: Verify pnpm installation run: | - corepack enable - corepack prepare pnpm@latest --activate - pnpm --version # Ensure pnpm is available + pnpm --version + where pnpm - name: Install Rust uses: dtolnay/rust-toolchain@stable with: From 610dfbf3d49ea8190de8c2c7eb9f6b11a8334718 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:37:11 -0500 Subject: [PATCH 31/66] Update test-build-windows.yml, install pnpm before node --- .github/workflows/test-build-windows.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 88a305dc5693..c31beca43bd0 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -15,18 +15,16 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 + - name: Install pnpm explicitly + run: | + npm install -g pnpm + pnpm --version # Verify pnpm is installed and available - name: Setup node uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' architecture: x64 - - name: Install pnpm globally - run: npm install -g pnpm - - name: Verify pnpm installation - run: | - pnpm --version - where pnpm - name: Install Rust uses: dtolnay/rust-toolchain@stable with: From 7e64d8f1ff4ee35ceca82cf455abd4fcaed792a2 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 14:15:47 -0500 Subject: [PATCH 32/66] Update test-build-windows.yml, update artifact url --- .github/workflows/test-build-windows.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index c31beca43bd0..789bae082c92 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -1,7 +1,6 @@ # Copyright 2019-2024 Tauri Programme within The Commons Conservancy # SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: MIT - name: Build EXE for TestDriver env: DEBUG: napi:* @@ -47,6 +46,10 @@ jobs: name: bindings-x86_64-pc-windows-msvc path: target\release\bundle\nsis\* if-no-files-found: error + - name: Set environment variables + run: | + echo "GITHUB_REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV + echo "GITHUB_RUN_ID=${{ github.run_id }}" >> $GITHUB_ENV - uses: testdriverai/action@main with: key: ${{ secrets.TESTDRIVER_API_KEY }} @@ -69,7 +72,7 @@ jobs: } # Fetch the artifact upload URL Write-Host "Fetching the artifact upload URL..." - $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url + $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID/artifacts" -Headers $headers).artifacts[0].archive_download_url if ($artifactUrl) { Write-Host "Artifact URL successfully fetched: $artifactUrl" } else { From 4528fe502d30f578fbdabdfb15219586b1af84b9 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 14:44:30 -0500 Subject: [PATCH 33/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 789bae082c92..571598b84464 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -70,9 +70,27 @@ jobs: } else { Write-Host "Download folder already exists." } + # Debugging: Check if environment variables are correctly set + Write-Host "Repository: $env:GITHUB_REPOSITORY" + Write-Host "Run ID: $env:GITHUB_RUN_ID" + # Fetch the artifact upload URL Write-Host "Fetching the artifact upload URL..." - $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID/artifacts" -Headers $headers).artifacts[0].archive_download_url + try { + $artifactResponse = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID/artifacts" -Headers $headers + Write-Host "Artifact API response: $($artifactResponse | ConvertTo-Json -Depth 3)" # Print the full API response for debugging + + if ($artifactResponse.artifacts.Count -gt 0) { + $artifactUrl = $artifactResponse.artifacts[0].archive_download_url + Write-Host "Artifact URL successfully fetched: $artifactUrl" + } else { + Write-Error "No artifacts found for this workflow run." + exit 1 + } + } catch { + Write-Error "Failed to fetch the artifact URL: $_" + exit 1 + }d_url if ($artifactUrl) { Write-Host "Artifact URL successfully fetched: $artifactUrl" } else { From a567ded3b7a4d37cf61d1f8bcbf769d98cbc8e81 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 15:11:20 -0500 Subject: [PATCH 34/66] Update test-build-windows.yml, set gh variable correctly --- .github/workflows/test-build-windows.yml | 26 +++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 571598b84464..1c98a41fbe43 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -14,42 +14,52 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v4 + - name: Install pnpm explicitly run: | npm install -g pnpm pnpm --version # Verify pnpm is installed and available + - name: Setup node uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' architecture: x64 + - name: Install Rust uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc + - name: Install dependencies run: pnpm install --frozen-lockfile --ignore-scripts + - name: Build CLI run: pnpm run build:cli shell: bash - - name: Build AIP + + - name: Build API run: pnpm run build:api shell: bash + - name: Build API Example App run: | cd examples/api pnpm tauri build + - name: Upload artifact uses: actions/upload-artifact@v4 with: name: bindings-x86_64-pc-windows-msvc path: target\release\bundle\nsis\* if-no-files-found: error + - name: Set environment variables run: | echo "GITHUB_REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV echo "GITHUB_RUN_ID=${{ github.run_id }}" >> $GITHUB_ENV + - uses: testdriverai/action@main with: key: ${{ secrets.TESTDRIVER_API_KEY }} @@ -63,6 +73,7 @@ jobs: $artifactFileName = "waveterm.exe" $artifactFilePath = "$downloadFolder/$artifactFileName" Write-Host "Starting the artifact download process..." + # Create the download directory if it doesn't exist if (-not (Test-Path -Path $downloadFolder)) { Write-Host "Creating download folder..." @@ -70,6 +81,7 @@ jobs: } else { Write-Host "Download folder already exists." } + # Debugging: Check if environment variables are correctly set Write-Host "Repository: $env:GITHUB_REPOSITORY" Write-Host "Run ID: $env:GITHUB_RUN_ID" @@ -90,13 +102,8 @@ jobs: } catch { Write-Error "Failed to fetch the artifact URL: $_" exit 1 - }d_url - if ($artifactUrl) { - Write-Host "Artifact URL successfully fetched: $artifactUrl" - } else { - Write-Error "Failed to fetch the artifact URL." - exit 1 } + # Download the artifact (zipped file) Write-Host "Starting artifact download..." $artifactZipPath = "$env:TEMP\artifact.zip" @@ -110,6 +117,7 @@ jobs: Write-Error "Error downloading artifact: $_" exit 1 } + # Unzip the artifact $artifactUnzipPath = "$env:TEMP\artifact" Write-Host "Unzipping the artifact to $artifactUnzipPath..." @@ -120,6 +128,7 @@ jobs: Write-Error "Failed to unzip the artifact: $_" exit 1 } + # Find the installer or app executable $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 if ($artifactInstallerPath) { @@ -128,6 +137,7 @@ jobs: Write-Error "Executable file not found. Exiting." exit 1 } + # Run the installer and log the result Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." try { @@ -137,11 +147,13 @@ jobs: Write-Error "Failed to run the installer: $_" exit 1 } + # Optional: If the app executable is different from the installer, find and launch it $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" Write-Host "Launching the application: $($wavePath)" Start-Process -FilePath $wavePath Write-Host "Application launched." + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" From f46d7b647d3593dd781077400bca9b9f6a9939a5 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 15:46:00 -0500 Subject: [PATCH 35/66] Update test-build-windows.yml, match artifact names --- .github/workflows/test-build-windows.yml | 95 +++++++++--------------- 1 file changed, 37 insertions(+), 58 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 1c98a41fbe43..6fcea02c7dc5 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -64,96 +64,75 @@ jobs: with: key: ${{ secrets.TESTDRIVER_API_KEY }} prompt: | - 1. click around the desktop app + 1. Click around the desktop app and verify functionality. prerun: | $headers = @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } - $downloadFolder = "./download" - $artifactFileName = "waveterm.exe" - $artifactFilePath = "$downloadFolder/$artifactFileName" - Write-Host "Starting the artifact download process..." - - # Create the download directory if it doesn't exist - if (-not (Test-Path -Path $downloadFolder)) { - Write-Host "Creating download folder..." - mkdir $downloadFolder - } else { - Write-Host "Download folder already exists." - } + $artifactName = "bindings-x86_64-pc-windows-msvc" + $downloadFolder = "$env:TEMP\artifact" + $artifactZipPath = "$env:TEMP\artifact.zip" - # Debugging: Check if environment variables are correctly set - Write-Host "Repository: $env:GITHUB_REPOSITORY" - Write-Host "Run ID: $env:GITHUB_RUN_ID" - - # Fetch the artifact upload URL - Write-Host "Fetching the artifact upload URL..." + Write-Host "Starting artifact download process..." + + # Fetch artifact details + Write-Host "Fetching artifact URL..." try { $artifactResponse = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID/artifacts" -Headers $headers - Write-Host "Artifact API response: $($artifactResponse | ConvertTo-Json -Depth 3)" # Print the full API response for debugging - - if ($artifactResponse.artifacts.Count -gt 0) { - $artifactUrl = $artifactResponse.artifacts[0].archive_download_url - Write-Host "Artifact URL successfully fetched: $artifactUrl" - } else { - Write-Error "No artifacts found for this workflow run." + $artifact = $artifactResponse.artifacts | Where-Object { $_.name -eq $artifactName } + + if (-not $artifact) { + Write-Error "No artifact named $artifactName found!" exit 1 } + + $artifactUrl = $artifact.archive_download_url + Write-Host "Artifact URL: $artifactUrl" } catch { - Write-Error "Failed to fetch the artifact URL: $_" + Write-Error "Failed to fetch artifact URL: $_" exit 1 } - # Download the artifact (zipped file) - Write-Host "Starting artifact download..." - $artifactZipPath = "$env:TEMP\artifact.zip" + # Download the artifact + Write-Host "Downloading artifact..." try { - Invoke-WebRequest -Uri $artifactUrl ` - -Headers $headers ` - -OutFile $artifactZipPath ` - -MaximumRedirection 5 - Write-Host "Artifact downloaded successfully to $artifactZipPath" + Invoke-WebRequest -Uri $artifactUrl -Headers $headers -OutFile $artifactZipPath + Write-Host "Artifact downloaded to $artifactZipPath" } catch { Write-Error "Error downloading artifact: $_" exit 1 } - # Unzip the artifact - $artifactUnzipPath = "$env:TEMP\artifact" - Write-Host "Unzipping the artifact to $artifactUnzipPath..." + # Extract the artifact + Write-Host "Extracting artifact..." try { - Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force - Write-Host "Artifact unzipped successfully to $artifactUnzipPath" + Expand-Archive -Path $artifactZipPath -DestinationPath $downloadFolder -Force + Write-Host "Artifact extracted to $downloadFolder" } catch { - Write-Error "Failed to unzip the artifact: $_" + Write-Error "Failed to extract artifact: $_" exit 1 } - # Find the installer or app executable - $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 - if ($artifactInstallerPath) { - Write-Host "Executable file found: $($artifactInstallerPath.FullName)" - } else { - Write-Error "Executable file not found. Exiting." + # Locate the .exe file dynamically + Write-Host "Searching for an executable file..." + $exeFile = Get-ChildItem -Path $downloadFolder -Filter *.exe -Recurse | Select-Object -First 1 + if (-not $exeFile) { + Write-Error "No .exe file found in artifact!" exit 1 } + + Write-Host "Executable found: $($exeFile.FullName)" - # Run the installer and log the result - Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." + # Run the executable + Write-Host "Launching the application..." try { - Start-Process -FilePath $artifactInstallerPath.FullName -Wait - Write-Host "Installer ran successfully." + Start-Process -FilePath $exeFile.FullName + Write-Host "Application launched successfully." } catch { - Write-Error "Failed to run the installer: $_" + Write-Error "Failed to launch application: $_" exit 1 } - # Optional: If the app executable is different from the installer, find and launch it - $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" - Write-Host "Launching the application: $($wavePath)" - Start-Process -FilePath $wavePath - Write-Host "Application launched." - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" From 769a25f6fca5ce611f2a788cf4b8d8b73d01b1a8 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:17:09 -0500 Subject: [PATCH 36/66] Update test-build-windows.yml, get most recent artifact, run id not getting? --- .github/workflows/test-build-windows.yml | 89 ++++++++++++++---------- 1 file changed, 53 insertions(+), 36 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 6fcea02c7dc5..46177d813ccd 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -64,75 +64,92 @@ jobs: with: key: ${{ secrets.TESTDRIVER_API_KEY }} prompt: | - 1. Click around the desktop app and verify functionality. + 1. click around the desktop app prerun: | $headers = @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } - $artifactName = "bindings-x86_64-pc-windows-msvc" - $downloadFolder = "$env:TEMP\artifact" - $artifactZipPath = "$env:TEMP\artifact.zip" - Write-Host "Starting artifact download process..." + $downloadFolder = "./download" + $artifactName = "bindings-x86_64-pc-windows-msvc" + Write-Host "Starting the artifact download process..." + + # Create the download directory if it doesn't exist + if (-not (Test-Path -Path $downloadFolder)) { + Write-Host "Creating download folder..." + mkdir $downloadFolder + } else { + Write-Host "Download folder already exists." + } - # Fetch artifact details - Write-Host "Fetching artifact URL..." + # Fetch the artifact upload URL (no need for GITHUB_RUN_ID) + Write-Host "Fetching the artifact upload URL..." try { - $artifactResponse = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID/artifacts" -Headers $headers - $artifact = $artifactResponse.artifacts | Where-Object { $_.name -eq $artifactName } + $artifactResponse = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:GITHUB_REPOSITORY/actions/artifacts" -Headers $headers + Write-Host "Artifact API response: $($artifactResponse | ConvertTo-Json -Depth 3)" # Print the full API response for debugging - if (-not $artifact) { - Write-Error "No artifact named $artifactName found!" + if ($artifactResponse.artifacts.Count -gt 0) { + $artifactUrl = $artifactResponse.artifacts[0].archive_download_url + Write-Host "Artifact URL successfully fetched: $artifactUrl" + } else { + Write-Error "No artifacts found for this workflow run." exit 1 } - - $artifactUrl = $artifact.archive_download_url - Write-Host "Artifact URL: $artifactUrl" } catch { - Write-Error "Failed to fetch artifact URL: $_" + Write-Error "Failed to fetch the artifact URL: $_" exit 1 } - # Download the artifact - Write-Host "Downloading artifact..." + # Download the artifact (zipped file) + Write-Host "Starting artifact download..." + $artifactZipPath = "$env:TEMP\artifact.zip" try { - Invoke-WebRequest -Uri $artifactUrl -Headers $headers -OutFile $artifactZipPath - Write-Host "Artifact downloaded to $artifactZipPath" + Invoke-WebRequest -Uri $artifactUrl ` + -Headers $headers ` + -OutFile $artifactZipPath ` + -MaximumRedirection 5 + Write-Host "Artifact downloaded successfully to $artifactZipPath" } catch { Write-Error "Error downloading artifact: $_" exit 1 } - # Extract the artifact - Write-Host "Extracting artifact..." + # Unzip the artifact + $artifactUnzipPath = "$env:TEMP\artifact" + Write-Host "Unzipping the artifact to $artifactUnzipPath..." try { - Expand-Archive -Path $artifactZipPath -DestinationPath $downloadFolder -Force - Write-Host "Artifact extracted to $downloadFolder" + Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force + Write-Host "Artifact unzipped successfully to $artifactUnzipPath" } catch { - Write-Error "Failed to extract artifact: $_" + Write-Error "Failed to unzip the artifact: $_" exit 1 } - # Locate the .exe file dynamically - Write-Host "Searching for an executable file..." - $exeFile = Get-ChildItem -Path $downloadFolder -Filter *.exe -Recurse | Select-Object -First 1 - if (-not $exeFile) { - Write-Error "No .exe file found in artifact!" + # Find the installer or app executable + $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 + if ($artifactInstallerPath) { + Write-Host "Executable file found: $($artifactInstallerPath.FullName)" + } else { + Write-Error "Executable file not found. Exiting." exit 1 } - - Write-Host "Executable found: $($exeFile.FullName)" - # Run the executable - Write-Host "Launching the application..." + # Run the installer and log the result + Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." try { - Start-Process -FilePath $exeFile.FullName - Write-Host "Application launched successfully." + Start-Process -FilePath $artifactInstallerPath.FullName -Wait + Write-Host "Installer ran successfully." } catch { - Write-Error "Failed to launch application: $_" + Write-Error "Failed to run the installer: $_" exit 1 } + # Optional: If the app executable is different from the installer, find and launch it + $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" + Write-Host "Launching the application: $($wavePath)" + Start-Process -FilePath $wavePath + Write-Host "Application launched." + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" From 16bc7c8941747a2cf9c2952a4ccf50abf2282de8 Mon Sep 17 00:00:00 2001 From: Spencer Poisseroux Date: Sun, 2 Feb 2025 16:30:54 -0500 Subject: [PATCH 37/66] minimize, dark mode tests added --- testdriver/dark_light_mode.yml | 29 +++++++++++++++++++++++++++++ testdriver/minimize_maximize.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 testdriver/dark_light_mode.yml create mode 100644 testdriver/minimize_maximize.yml diff --git a/testdriver/dark_light_mode.yml b/testdriver/dark_light_mode.yml new file mode 100644 index 000000000000..720ade1d3118 --- /dev/null +++ b/testdriver/dark_light_mode.yml @@ -0,0 +1,29 @@ +version: 4.1.58 +session: 679fdccba1ad2d40a789f609 +steps: + - prompt: focus tauri API Validation + commands: + - command: hover-text + text: Tauri API Validation + description: window title of the Tauri API Validation application + action: click + - prompt: Click the dark mode button + commands: + - command: hover-text + text: Switch to Dark mode + description: Dark mode button in the Tauri API sidebar + action: click + - prompt: Assert that the Tauri application is dark mode + commands: + - command: assert + expect: Tauri application is dark mode + - prompt: Click the light mode button + commands: + - command: hover-text + text: Switch to Light mode + description: Light mode button in the Tauri API sidebar + action: click + - prompt: Assert that the Tauri application is light mode + commands: + - command: assert + expect: Tauri application is light mode diff --git a/testdriver/minimize_maximize.yml b/testdriver/minimize_maximize.yml new file mode 100644 index 000000000000..1ad77b36d884 --- /dev/null +++ b/testdriver/minimize_maximize.yml @@ -0,0 +1,27 @@ +version: 4.1.58 +session: 679fdccba1ad2d40a789f609 +steps: + - prompt: focus tauri API Validation + commands: + - command: hover-text + text: Tauri API Validation + description: window title of the Tauri API Validation application + action: click + - prompt: maximize the tauri application + commands: + - command: hover-image + description: maximize button in the Tauri window title bar top right + action: click + - prompt: Assert that the Tauri application is maximized + commands: + - command: assert + expect: Tauri application is maximized + - prompt: restore down the tauri application + commands: + - command: hover-image + description: restore down button in the Tauri window title bar top right + action: click + - prompt: Assert that the Tauri application is restored down + commands: + - command: assert + expect: Tauri application is restored down \ No newline at end of file From f40cd625023854ca202f083163cc2278d766febe Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:41:28 -0500 Subject: [PATCH 38/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 46177d813ccd..4aea5dc49efd 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -84,19 +84,12 @@ jobs: # Fetch the artifact upload URL (no need for GITHUB_RUN_ID) Write-Host "Fetching the artifact upload URL..." - try { - $artifactResponse = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:GITHUB_REPOSITORY/actions/artifacts" -Headers $headers - Write-Host "Artifact API response: $($artifactResponse | ConvertTo-Json -Depth 3)" # Print the full API response for debugging - - if ($artifactResponse.artifacts.Count -gt 0) { - $artifactUrl = $artifactResponse.artifacts[0].archive_download_url - Write-Host "Artifact URL successfully fetched: $artifactUrl" - } else { - Write-Error "No artifacts found for this workflow run." - exit 1 - } - } catch { - Write-Error "Failed to fetch the artifact URL: $_" + $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url + + if ($artifactUrl) { + Write-Host "Artifact URL successfully fetched: $artifactUrl" + } else { + Write-Error "Failed to fetch the artifact URL." exit 1 } From 77f82d8a37eee512204e8650be570f88a6de5a52 Mon Sep 17 00:00:00 2001 From: Spencer Poisseroux Date: Sun, 2 Feb 2025 17:56:19 -0500 Subject: [PATCH 39/66] Create tauri_api_install.yml --- testdriver/tauri_api_install.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 testdriver/tauri_api_install.yml diff --git a/testdriver/tauri_api_install.yml b/testdriver/tauri_api_install.yml new file mode 100644 index 000000000000..4518f6876347 --- /dev/null +++ b/testdriver/tauri_api_install.yml @@ -0,0 +1,39 @@ +version: 4.1.58 +session: 679ff568a1ad2d40a789f778 +steps: + - prompt: Click next in the Tauri API Setup + commands: + - command: focus-application + name: Tauri API Setup + - command: hover-text + text: Next > + description: next button in the Tauri API Setup + action: click + - prompt: Click next again in the Tauri API Setup + commands: + - command: focus-application + name: Tauri API + - command: hover-text + text: Next > + description: next button in the Tauri API Setup + action: click + - prompt: Click Next again in the Tauri API Setup + commands: + - command: focus-application + name: Tauri API + - command: hover-text + text: Next > + description: next button in the Tauri API Setup + action: click + - prompt: Click Finish in Tauri API Setup + commands: + - command: focus-application + name: Tauri API + - command: hover-text + text: Finish + description: finish button in the Tauri API Setup + action: click + - prompt: assert that the Tauri API program is open + commands: + - command: assert + expect: the Tauri API program is open From 4b558482ba4d5fec56f45a2c23862ab6c83768a8 Mon Sep 17 00:00:00 2001 From: Spencer Poisseroux Date: Sun, 2 Feb 2025 18:19:50 -0500 Subject: [PATCH 40/66] add comm/ui tests to main yml --- .github/workflows/test-build-windows.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 4aea5dc49efd..9d60bad2afca 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -146,3 +146,16 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" + + - name: Run API Application Tests + uses: testdriverai/action@main + with: + prompt: | + 1. /run testdriver/tauri_api_install.yml + 2. /run testdriver/comm_call_request_api.yml + 3. /run testdriver/comm_echo.yml + 4. /run testdriver/comm_send_event_rust.yml + 5. /run testdriver/comm_spam.yml + 6. /run testdriver/dark_light_mode.yml + 7. /run testdriver/minimize_maximize.yml + 8. /run testdriver/comm_call_log_api.yml From 3e4df29dfa5f12ec9ca6091d87e8deedf467a2f5 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 19:30:38 -0500 Subject: [PATCH 41/66] Update test-build-windows.yml, remove wait from installation --- .github/workflows/test-build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 9d60bad2afca..6c87431c5466 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -130,7 +130,7 @@ jobs: # Run the installer and log the result Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." try { - Start-Process -FilePath $artifactInstallerPath.FullName -Wait + Start-Process -FilePath $artifactInstallerPath.FullName Write-Host "Installer ran successfully." } catch { Write-Error "Failed to run the installer: $_" From 4ba918e4ba93a6e7fa7fa0facb4a7e73137a5b73 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 19:59:08 -0500 Subject: [PATCH 42/66] Update test-build-windows.yml, remove wave.exe optional run --- .github/workflows/test-build-windows.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 6c87431c5466..5593dc7f999f 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -138,10 +138,10 @@ jobs: } # Optional: If the app executable is different from the installer, find and launch it - $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" - Write-Host "Launching the application: $($wavePath)" - Start-Process -FilePath $wavePath - Write-Host "Application launched." + # $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" + # Write-Host "Launching the application: $($wavePath)" + # Start-Process -FilePath $wavePath + # Write-Host "Application launched." env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From fbf2dacf9949beec424d951ca1a1322f44710e3f Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 20:38:02 -0500 Subject: [PATCH 43/66] Update test-build-windows.yml, remove dummy prompt --- .github/workflows/test-build-windows.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 5593dc7f999f..f92fa52f5689 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -64,7 +64,14 @@ jobs: with: key: ${{ secrets.TESTDRIVER_API_KEY }} prompt: | - 1. click around the desktop app + 1. /run testdriver/tauri_api_install.yml + 2. /run testdriver/comm_call_request_api.yml + 3. /run testdriver/comm_echo.yml + 4. /run testdriver/comm_send_event_rust.yml + 5. /run testdriver/comm_spam.yml + 6. /run testdriver/dark_light_mode.yml + 7. /run testdriver/minimize_maximize.yml + 8. /run testdriver/comm_call_log_api.yml prerun: | $headers = @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" @@ -146,16 +153,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" - - - name: Run API Application Tests - uses: testdriverai/action@main - with: - prompt: | - 1. /run testdriver/tauri_api_install.yml - 2. /run testdriver/comm_call_request_api.yml - 3. /run testdriver/comm_echo.yml - 4. /run testdriver/comm_send_event_rust.yml - 5. /run testdriver/comm_spam.yml - 6. /run testdriver/dark_light_mode.yml - 7. /run testdriver/minimize_maximize.yml - 8. /run testdriver/comm_call_log_api.yml From b3967c3239edb73a56e75b29c598e722b96be0b0 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 21:14:06 -0500 Subject: [PATCH 44/66] Update test-build-windows.yml, reorder prompts --- .github/workflows/test-build-windows.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index f92fa52f5689..a8ba5b179bf6 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -65,13 +65,14 @@ jobs: key: ${{ secrets.TESTDRIVER_API_KEY }} prompt: | 1. /run testdriver/tauri_api_install.yml - 2. /run testdriver/comm_call_request_api.yml - 3. /run testdriver/comm_echo.yml - 4. /run testdriver/comm_send_event_rust.yml - 5. /run testdriver/comm_spam.yml - 6. /run testdriver/dark_light_mode.yml - 7. /run testdriver/minimize_maximize.yml + 2. /run testdriver/dark_light_mode.yml + 3. /run testdriver/minimize_maximize.yml + 4. /run testdriver/comm_echo.yml + 5. /run testdriver/comm_send_event_rust.yml + 6. /run testdriver/comm_spam.yml + 7. /run testdriver/comm_call_request_api.yml 8. /run testdriver/comm_call_log_api.yml + prerun: | $headers = @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" From 5023a4ead986d3b5d0e3305dbe2474e2cce8570f Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sun, 2 Feb 2025 21:16:43 -0500 Subject: [PATCH 45/66] Update test-build-windows.yml, corepack enable --- .github/workflows/test-build-windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index a8ba5b179bf6..234b961d76f0 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -15,6 +15,8 @@ jobs: steps: - uses: actions/checkout@v4 + - run: corepack enable + - name: Install pnpm explicitly run: | npm install -g pnpm From 7de2351aea40385eba92be69f9ce59e2ed646f20 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 3 Feb 2025 09:43:28 -0500 Subject: [PATCH 46/66] Update dark_light_mode.yml --- testdriver/dark_light_mode.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testdriver/dark_light_mode.yml b/testdriver/dark_light_mode.yml index 720ade1d3118..5abd8d266b92 100644 --- a/testdriver/dark_light_mode.yml +++ b/testdriver/dark_light_mode.yml @@ -16,7 +16,7 @@ steps: - prompt: Assert that the Tauri application is dark mode commands: - command: assert - expect: Tauri application is dark mode + expect: Tauri application says Switch to Light Mode - prompt: Click the light mode button commands: - command: hover-text @@ -26,4 +26,4 @@ steps: - prompt: Assert that the Tauri application is light mode commands: - command: assert - expect: Tauri application is light mode + expect: Tauri application says Switch to Dark mode From 9201f1aa211d86e1887ac50ec1c37491cf45213c Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 3 Feb 2025 10:12:25 -0500 Subject: [PATCH 47/66] Update minimize_maximize.yml --- testdriver/minimize_maximize.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testdriver/minimize_maximize.yml b/testdriver/minimize_maximize.yml index 1ad77b36d884..4671ae1a6ec0 100644 --- a/testdriver/minimize_maximize.yml +++ b/testdriver/minimize_maximize.yml @@ -10,7 +10,7 @@ steps: - prompt: maximize the tauri application commands: - command: hover-image - description: maximize button in the Tauri window title bar top right + description: maximize window button in the Tauri API Validation application title bar action: click - prompt: Assert that the Tauri application is maximized commands: @@ -19,9 +19,9 @@ steps: - prompt: restore down the tauri application commands: - command: hover-image - description: restore down button in the Tauri window title bar top right + description: restore window down button in the Tauri API Validation application title bar action: click - prompt: Assert that the Tauri application is restored down commands: - command: assert - expect: Tauri application is restored down \ No newline at end of file + expect: Tauri application is restored down From feace59937fa8ec3c40dcb46112bc0adf793fc49 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 3 Feb 2025 10:47:07 -0500 Subject: [PATCH 48/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 234b961d76f0..df10392d838b 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -68,12 +68,12 @@ jobs: prompt: | 1. /run testdriver/tauri_api_install.yml 2. /run testdriver/dark_light_mode.yml - 3. /run testdriver/minimize_maximize.yml - 4. /run testdriver/comm_echo.yml - 5. /run testdriver/comm_send_event_rust.yml - 6. /run testdriver/comm_spam.yml - 7. /run testdriver/comm_call_request_api.yml - 8. /run testdriver/comm_call_log_api.yml + # 3. /run testdriver/minimize_maximize.yml + 3. /run testdriver/comm_echo.yml + 4. /run testdriver/comm_send_event_rust.yml + 5. /run testdriver/comm_spam.yml + 6. /run testdriver/comm_call_request_api.yml + # 7. /run testdriver/comm_call_log_api.yml prerun: | $headers = @{ From 851568f78a257b8598eda1fc13a1d586bb30ed9e Mon Sep 17 00:00:00 2001 From: Spencer Poisseroux Date: Mon, 3 Feb 2025 10:51:52 -0500 Subject: [PATCH 49/66] add testdriver readme --- testdriver/README.md | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 testdriver/README.md diff --git a/testdriver/README.md b/testdriver/README.md new file mode 100644 index 000000000000..9795762c12a9 --- /dev/null +++ b/testdriver/README.md @@ -0,0 +1,55 @@ +Hello! I'm going to show you how to create a new [TestDriver.ai](http://TestDriver.ai) regression test and implement it into the [TestDriver.ai](http://TestDriver.ai) github action, specifically for the Tauri API Validation app. + +In the Tauri repo there is a directory called '**testdriver**' which holds all of our created [TestDriver.ai](http://TestDriver.ai) regression tests. + +Right now, the file .github/workflows/test-build-windows.yml is our main [TestDriver.ai](http://TestDriver.ai) workflow for building and testing the Tauri API validation application. + +[TestDriver.ai](http://TestDriver.ai) github action uses this workflow to spin up an ephemeral VM, open the app, and test it by starting up a local [TestDriver.ai](http://TestDriver.ai) agent and using our regression tests passed into the workflow file from the '**testdriver**' directory. (Reference testdrivers workflow docs [here](https://docs.testdriver.ai/continuous-integration/github-setup)). + +Of course, before being able to test the API example app we need to build and install the app on our VM. Which already happens in our [prerun script](https://docs.testdriver.ai/continuous-integration/prerun-scripts) in the workflow. + +In the workflow, we can see `/run` commands under the `prompt:` we use these to run our tests sequentially after the app has been built and launched ([parallel testing](https://docs.testdriver.ai/continuous-integration/parallel-testing) can also be done). + +**So, how can we create more regression tests?** After [installing TestDriver.ai](https://docs.testdriver.ai/overview/installing-via-npm) on your local machine, navigate to the root of your local Tauri repo. + +Once at the root, it may be beneficial to select your desired preferences for [TestDriver.ai](http://TestDriver.ai) by using `testdriverai init` ,there you can select whether to receive desktop notifications, minimize the terminal when creating tests (this helps [TestDriver.ai](http://TestDriver.ai) resolve quicker), and more. + +Then use `testdriverai testdriver/[new test name].yml` to create a new test within the '**testdriver'** directory. + +Now, [TestDriver.ai](http://TestDriver.ai) should start and be awaiting a prompt. So, let's open the Tauri API validation app, and place it next to our terminal, and begin creating a test. + +If we give [TestDriver.ai](http://TestDriver.ai) a prompt like '**click the Communication tab in the sidebar**', [TestDriver.ai](http://TestDriver.ai) will do so, and give us something like this resulting YAML. + +``` + - prompt: click the Communication tab in the sidebar + commands: + - command: hover-text + text: Communication + description: >- + Communication tab in the sidebar of the Tauri API Validation + application + action: click + +``` + +When we give another prompt, like '**click the spam button**', [TestDriver.ai](http://TestDriver.ai) will generate something like: + +``` + - prompt: Click the Spam button + commands: + - command: hover-text + text: Spam + description: >- + Spam button in the Communication section of the + Tauri API Validation application + action: click + +``` + +And then automatically append it to our previously generated YAML! + +([CLI commands](https://docs.testdriver.ai/reference/cli-commands) like `/undo` and `assert` are also important!) + +We can do `/save` to ensure our YAML is saved. Then we can run the regression test we've just created with `/run testdriver/[new test name].yml` just like how the prompts are being run in the workflow file. + +Then, if we want to implement this test into our github action workflow, all we have to do is add the `/run testdriver/[new test name].yml` under a `prompt:` in the workflow. ([workflow doc](https://docs.testdriver.ai/continuous-integration/github-setup)) \ No newline at end of file From ac65d0f06a590280e9c416f0a9679e041f14698f Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 3 Feb 2025 11:31:16 -0500 Subject: [PATCH 50/66] Update test-build-windows.yml, backend wasnt working --- .github/workflows/test-build-windows.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index df10392d838b..a622a3c04be4 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -33,10 +33,14 @@ jobs: uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc - - - name: Install dependencies + + - name: Install dependencies (root) run: pnpm install --frozen-lockfile --ignore-scripts + - name: Install dependencies (examples/api) + working-directory: examples/api + run: pnpm i + - name: Build CLI run: pnpm run build:cli shell: bash @@ -44,11 +48,14 @@ jobs: - name: Build API run: pnpm run build:api shell: bash + + - name: Run app in dev mode + working-directory: examples/api + run: pnpm tauri dev - name: Build API Example App - run: | - cd examples/api - pnpm tauri build + working-directory: examples/api + run: pnpm tauri build - name: Upload artifact uses: actions/upload-artifact@v4 From 7809ddf01bbe09a333299658a86a42175c7d5698 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:14:55 -0500 Subject: [PATCH 51/66] Update test-build-windows.yml, remove run in dev --- .github/workflows/test-build-windows.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index a622a3c04be4..f80f6a390d6e 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -48,10 +48,6 @@ jobs: - name: Build API run: pnpm run build:api shell: bash - - - name: Run app in dev mode - working-directory: examples/api - run: pnpm tauri dev - name: Build API Example App working-directory: examples/api From eec29baf6ef1966d3051643ce527e68c1d2d7aa5 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:43:04 -0500 Subject: [PATCH 52/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index f80f6a390d6e..0878d2e18e96 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -70,12 +70,12 @@ jobs: key: ${{ secrets.TESTDRIVER_API_KEY }} prompt: | 1. /run testdriver/tauri_api_install.yml - 2. /run testdriver/dark_light_mode.yml + # 2. /run testdriver/dark_light_mode.yml # 3. /run testdriver/minimize_maximize.yml - 3. /run testdriver/comm_echo.yml - 4. /run testdriver/comm_send_event_rust.yml - 5. /run testdriver/comm_spam.yml - 6. /run testdriver/comm_call_request_api.yml + 2. /run testdriver/comm_echo.yml + 3. /run testdriver/comm_send_event_rust.yml + 4. /run testdriver/comm_spam.yml + 5. /run testdriver/comm_call_request_api.yml # 7. /run testdriver/comm_call_log_api.yml prerun: | From 45b96b6f09f77165d7b2b51f81abd90c61bff7d7 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:46:04 -0500 Subject: [PATCH 53/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 0878d2e18e96..073a4e6ac05d 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -48,6 +48,12 @@ jobs: - name: Build API run: pnpm run build:api shell: bash + + - name: Run app in dev mode (background) + working-directory: examples/api + run: | + Start-Process -NoNewWindow -FilePath "pnpm" -ArgumentList "tauri dev" -PassThru | Out-Null + shell: powershell - name: Build API Example App working-directory: examples/api From 520bab615dadf8a72ab9ee373d68aad7a05b0b4e Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:03:06 -0500 Subject: [PATCH 54/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 073a4e6ac05d..a16462fc7421 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -52,7 +52,7 @@ jobs: - name: Run app in dev mode (background) working-directory: examples/api run: | - Start-Process -NoNewWindow -FilePath "pnpm" -ArgumentList "tauri dev" -PassThru | Out-Null + Start-Process -NoNewWindow -FilePath "cmd.exe" -ArgumentList "/c pnpm tauri dev" shell: powershell - name: Build API Example App From acfcb40c5e200f98e796e950a397180cdc325b2d Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Tue, 4 Feb 2025 12:55:05 -0500 Subject: [PATCH 55/66] Update README.md in testdriver dir --- testdriver/README.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/testdriver/README.md b/testdriver/README.md index 9795762c12a9..0b9186fc03d8 100644 --- a/testdriver/README.md +++ b/testdriver/README.md @@ -1,24 +1,30 @@ -Hello! I'm going to show you how to create a new [TestDriver.ai](http://TestDriver.ai) regression test and implement it into the [TestDriver.ai](http://TestDriver.ai) github action, specifically for the Tauri API Validation app. +# Tauri API with TestDriver.ai + +Hello! I'm going to show you how to create a new [TestDriver.ai](http://TestDriver.ai) regression test and implement it into the TestDriver.ai github action, specifically for the Tauri API Validation app. + +## How it works In the Tauri repo there is a directory called '**testdriver**' which holds all of our created [TestDriver.ai](http://TestDriver.ai) regression tests. -Right now, the file .github/workflows/test-build-windows.yml is our main [TestDriver.ai](http://TestDriver.ai) workflow for building and testing the Tauri API validation application. +Right now, the file .github/workflows/test-build-windows.yml is our main TestDrivier. workflow for building and testing the Tauri API validation application. -[TestDriver.ai](http://TestDriver.ai) github action uses this workflow to spin up an ephemeral VM, open the app, and test it by starting up a local [TestDriver.ai](http://TestDriver.ai) agent and using our regression tests passed into the workflow file from the '**testdriver**' directory. (Reference testdrivers workflow docs [here](https://docs.testdriver.ai/continuous-integration/github-setup)). +TestDriver.ai github action uses this workflow to spin up an ephemeral VM, open the app, and test it by starting up a local TestDriver.ai agent and using our regression tests passed into the workflow file from the '**testdriver**' directory. (Reference testdrivers workflow docs [here](https://docs.testdriver.ai/continuous-integration/github-setup)). Of course, before being able to test the API example app we need to build and install the app on our VM. Which already happens in our [prerun script](https://docs.testdriver.ai/continuous-integration/prerun-scripts) in the workflow. In the workflow, we can see `/run` commands under the `prompt:` we use these to run our tests sequentially after the app has been built and launched ([parallel testing](https://docs.testdriver.ai/continuous-integration/parallel-testing) can also be done). -**So, how can we create more regression tests?** After [installing TestDriver.ai](https://docs.testdriver.ai/overview/installing-via-npm) on your local machine, navigate to the root of your local Tauri repo. +## Creating regression tests + +After [installing TestDriver.ai](https://docs.testdriver.ai/overview/installing-via-npm) on your local machine, navigate to the root of your local Tauri repo. -Once at the root, it may be beneficial to select your desired preferences for [TestDriver.ai](http://TestDriver.ai) by using `testdriverai init` ,there you can select whether to receive desktop notifications, minimize the terminal when creating tests (this helps [TestDriver.ai](http://TestDriver.ai) resolve quicker), and more. +Once at the root, it may be beneficial to select your desired preferences for TestDriver.ai by using `testdriverai init` ,there you can select whether to receive desktop notifications, minimize the terminal when creating tests (this helps TestDriver.ai resolve quicker), and more. Then use `testdriverai testdriver/[new test name].yml` to create a new test within the '**testdriver'** directory. -Now, [TestDriver.ai](http://TestDriver.ai) should start and be awaiting a prompt. So, let's open the Tauri API validation app, and place it next to our terminal, and begin creating a test. +Now, TestDriver.ai should start and be awaiting a prompt. So, let's open the Tauri API validation app, and place it next to our terminal, and begin creating a test. -If we give [TestDriver.ai](http://TestDriver.ai) a prompt like '**click the Communication tab in the sidebar**', [TestDriver.ai](http://TestDriver.ai) will do so, and give us something like this resulting YAML. +If we give TestDriver.ai a prompt like '**click the Communication tab in the sidebar**', TestDriver.ai will do so, and give us something like this resulting YAML. ``` - prompt: click the Communication tab in the sidebar @@ -32,7 +38,7 @@ If we give [TestDriver.ai](http://TestDriver.ai) a prompt like '**click the Comm ``` -When we give another prompt, like '**click the spam button**', [TestDriver.ai](http://TestDriver.ai) will generate something like: +When we give another prompt, like '**click the spam button**', TestDriver.ai will generate something like: ``` - prompt: Click the Spam button @@ -52,4 +58,4 @@ And then automatically append it to our previously generated YAML! We can do `/save` to ensure our YAML is saved. Then we can run the regression test we've just created with `/run testdriver/[new test name].yml` just like how the prompts are being run in the workflow file. -Then, if we want to implement this test into our github action workflow, all we have to do is add the `/run testdriver/[new test name].yml` under a `prompt:` in the workflow. ([workflow doc](https://docs.testdriver.ai/continuous-integration/github-setup)) \ No newline at end of file +If we want to implement this test into our github action workflow, all we have to do is add the `/run testdriver/[new test name].yml` under a `prompt:` in the workflow. ([workflow doc](https://docs.testdriver.ai/continuous-integration/github-setup)) From ef4cb73984693e21c4fbe80fd6831026e007afe0 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Tue, 4 Feb 2025 12:57:18 -0500 Subject: [PATCH 56/66] Update README.md --- testdriver/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testdriver/README.md b/testdriver/README.md index 0b9186fc03d8..3e977f265179 100644 --- a/testdriver/README.md +++ b/testdriver/README.md @@ -4,7 +4,7 @@ Hello! I'm going to show you how to create a new [TestDriver.ai](http://TestDriv ## How it works -In the Tauri repo there is a directory called '**testdriver**' which holds all of our created [TestDriver.ai](http://TestDriver.ai) regression tests. +In the Tauri repo there is a directory called '**testdriver**' which holds all of our created TestDriver.ai regression tests. Right now, the file .github/workflows/test-build-windows.yml is our main TestDrivier. workflow for building and testing the Tauri API validation application. From 4686cc32c4b9ab28ecdcbaf6a8121abca6659982 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Sat, 8 Feb 2025 16:48:54 -0500 Subject: [PATCH 57/66] Update test-build-windows.yml, add run api exe --- .github/workflows/test-build-windows.yml | 131 ++++++++++++----------- 1 file changed, 66 insertions(+), 65 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index a16462fc7421..ba40ae075775 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -66,6 +66,13 @@ jobs: path: target\release\bundle\nsis\* if-no-files-found: error + - name: Upload API artifact + uses: actions/upload-artifact@v4 + with: + name: api-executable + path: target\debug\api + if-no-files-found: error + - name: Set environment variables run: | echo "GITHUB_REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV @@ -88,79 +95,73 @@ jobs: $headers = @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } - + $downloadFolder = "./download" - $artifactName = "bindings-x86_64-pc-windows-msvc" - Write-Host "Starting the artifact download process..." - - # Create the download directory if it doesn't exist - if (-not (Test-Path -Path $downloadFolder)) { - Write-Host "Creating download folder..." - mkdir $downloadFolder - } else { - Write-Host "Download folder already exists." - } - - # Fetch the artifact upload URL (no need for GITHUB_RUN_ID) - Write-Host "Fetching the artifact upload URL..." - $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url - - if ($artifactUrl) { - Write-Host "Artifact URL successfully fetched: $artifactUrl" - } else { - Write-Error "Failed to fetch the artifact URL." - exit 1 - } - - # Download the artifact (zipped file) - Write-Host "Starting artifact download..." - $artifactZipPath = "$env:TEMP\artifact.zip" - try { - Invoke-WebRequest -Uri $artifactUrl ` - -Headers $headers ` - -OutFile $artifactZipPath ` - -MaximumRedirection 5 - Write-Host "Artifact downloaded successfully to $artifactZipPath" - } catch { - Write-Error "Error downloading artifact: $_" - exit 1 + + function Download-And-Extract-Artifact($artifactName) { + Write-Host "Fetching the artifact upload URL for $artifactName..." + $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" -Headers $headers).artifacts | Where-Object { $_.name -eq $artifactName } | Select-Object -ExpandProperty archive_download_url + + if ($artifactUrl) { + Write-Host "Artifact URL successfully fetched for $artifactName: $artifactUrl" + } else { + Write-Error "Failed to fetch the artifact URL for $artifactName." + exit 1 + } + + $artifactZipPath = "$env:TEMP\$artifactName.zip" + try { + Invoke-WebRequest -Uri $artifactUrl -Headers $headers -OutFile $artifactZipPath + Write-Host "Artifact $artifactName downloaded successfully." + } catch { + Write-Error "Error downloading artifact $artifactName: $_" + exit 1 + } + + $artifactUnzipPath = "$env:TEMP\$artifactName" + Write-Host "Unzipping $artifactName to $artifactUnzipPath..." + try { + Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force + Write-Host "Artifact $artifactName unzipped successfully." + } catch { + Write-Error "Failed to unzip $artifactName: $_" + exit 1 + } + + return $artifactUnzipPath } - - # Unzip the artifact - $artifactUnzipPath = "$env:TEMP\artifact" - Write-Host "Unzipping the artifact to $artifactUnzipPath..." - try { - Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force - Write-Host "Artifact unzipped successfully to $artifactUnzipPath" - } catch { - Write-Error "Failed to unzip the artifact: $_" - exit 1 - } - - # Find the installer or app executable - $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 + + # Download and extract main EXE + $exePath = Download-And-Extract-Artifact "bindings-x86_64-pc-windows-msvc" + + # Download and extract API executable + $apiPath = Download-And-Extract-Artifact "api-executable" + + # Find the main EXE + $artifactInstallerPath = Get-ChildItem -Path $exePath -Filter *.exe -Recurse | Select-Object -First 1 if ($artifactInstallerPath) { - Write-Host "Executable file found: $($artifactInstallerPath.FullName)" + Write-Host "Main executable found: $($artifactInstallerPath.FullName)" } else { - Write-Error "Executable file not found. Exiting." + Write-Error "Main executable not found. Exiting." exit 1 } - - # Run the installer and log the result - Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." - try { - Start-Process -FilePath $artifactInstallerPath.FullName - Write-Host "Installer ran successfully." - } catch { - Write-Error "Failed to run the installer: $_" + + # Find the API executable + $apiExecutablePath = Get-ChildItem -Path $apiPath -Filter "api" -Recurse | Select-Object -First 1 + if ($apiExecutablePath) { + Write-Host "API executable found: $($apiExecutablePath.FullName)" + } else { + Write-Error "API executable not found. Exiting." exit 1 } - - # Optional: If the app executable is different from the installer, find and launch it - # $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" - # Write-Host "Launching the application: $($wavePath)" - # Start-Process -FilePath $wavePath - # Write-Host "Application launched." + + # Start the API executable in the background + Write-Host "Starting API executable..." + Start-Process -NoNewWindow -FilePath $apiExecutablePath.FullName + + # Start the main executable + Write-Host "Running main installer: $($artifactInstallerPath.FullName)..." + Start-Process -FilePath $artifactInstallerPath.FullName env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1ad935774fffb5d7e77218372b0ca7e71ae73d2c Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:48:18 -0500 Subject: [PATCH 58/66] Update test-build-windows.yml, restore one artifact, remove api tests for now --- .github/workflows/test-build-windows.yml | 145 +++++++++++------------ 1 file changed, 72 insertions(+), 73 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index ba40ae075775..ed8c6f9b891d 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -66,13 +66,6 @@ jobs: path: target\release\bundle\nsis\* if-no-files-found: error - - name: Upload API artifact - uses: actions/upload-artifact@v4 - with: - name: api-executable - path: target\debug\api - if-no-files-found: error - - name: Set environment variables run: | echo "GITHUB_REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV @@ -83,85 +76,91 @@ jobs: key: ${{ secrets.TESTDRIVER_API_KEY }} prompt: | 1. /run testdriver/tauri_api_install.yml - # 2. /run testdriver/dark_light_mode.yml - # 3. /run testdriver/minimize_maximize.yml - 2. /run testdriver/comm_echo.yml - 3. /run testdriver/comm_send_event_rust.yml - 4. /run testdriver/comm_spam.yml - 5. /run testdriver/comm_call_request_api.yml - # 7. /run testdriver/comm_call_log_api.yml + #1. /run testdriver/dark_light_mode.yml + #1. /run testdriver/minimize_maximize.yml + #1. /run testdriver/comm_echo.yml + #1. /run testdriver/comm_send_event_rust.yml + #1. /run testdriver/comm_spam.yml + #1. /run testdriver/comm_call_request_api.yml + #1. /run testdriver/comm_call_log_api.yml prerun: | $headers = @{ Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } - + $downloadFolder = "./download" - - function Download-And-Extract-Artifact($artifactName) { - Write-Host "Fetching the artifact upload URL for $artifactName..." - $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" -Headers $headers).artifacts | Where-Object { $_.name -eq $artifactName } | Select-Object -ExpandProperty archive_download_url - - if ($artifactUrl) { - Write-Host "Artifact URL successfully fetched for $artifactName: $artifactUrl" - } else { - Write-Error "Failed to fetch the artifact URL for $artifactName." - exit 1 - } - - $artifactZipPath = "$env:TEMP\$artifactName.zip" - try { - Invoke-WebRequest -Uri $artifactUrl -Headers $headers -OutFile $artifactZipPath - Write-Host "Artifact $artifactName downloaded successfully." - } catch { - Write-Error "Error downloading artifact $artifactName: $_" - exit 1 - } - - $artifactUnzipPath = "$env:TEMP\$artifactName" - Write-Host "Unzipping $artifactName to $artifactUnzipPath..." - try { - Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force - Write-Host "Artifact $artifactName unzipped successfully." - } catch { - Write-Error "Failed to unzip $artifactName: $_" - exit 1 - } - - return $artifactUnzipPath + $artifactName = "bindings-x86_64-pc-windows-msvc" + Write-Host "Starting the artifact download process..." + + # Create the download directory if it doesn't exist + if (-not (Test-Path -Path $downloadFolder)) { + Write-Host "Creating download folder..." + mkdir $downloadFolder + } else { + Write-Host "Download folder already exists." } - - # Download and extract main EXE - $exePath = Download-And-Extract-Artifact "bindings-x86_64-pc-windows-msvc" - - # Download and extract API executable - $apiPath = Download-And-Extract-Artifact "api-executable" - - # Find the main EXE - $artifactInstallerPath = Get-ChildItem -Path $exePath -Filter *.exe -Recurse | Select-Object -First 1 - if ($artifactInstallerPath) { - Write-Host "Main executable found: $($artifactInstallerPath.FullName)" + + # Fetch the artifact upload URL (no need for GITHUB_RUN_ID) + Write-Host "Fetching the artifact upload URL..." + $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url + + if ($artifactUrl) { + Write-Host "Artifact URL successfully fetched: $artifactUrl" } else { - Write-Error "Main executable not found. Exiting." + Write-Error "Failed to fetch the artifact URL." + exit 1 + } + + # Download the artifact (zipped file) + Write-Host "Starting artifact download..." + $artifactZipPath = "$env:TEMP\artifact.zip" + try { + Invoke-WebRequest -Uri $artifactUrl ` + -Headers $headers ` + -OutFile $artifactZipPath ` + -MaximumRedirection 5 + Write-Host "Artifact downloaded successfully to $artifactZipPath" + } catch { + Write-Error "Error downloading artifact: $_" + exit 1 + } + + # Unzip the artifact + $artifactUnzipPath = "$env:TEMP\artifact" + Write-Host "Unzipping the artifact to $artifactUnzipPath..." + try { + Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force + Write-Host "Artifact unzipped successfully to $artifactUnzipPath" + } catch { + Write-Error "Failed to unzip the artifact: $_" exit 1 } - - # Find the API executable - $apiExecutablePath = Get-ChildItem -Path $apiPath -Filter "api" -Recurse | Select-Object -First 1 - if ($apiExecutablePath) { - Write-Host "API executable found: $($apiExecutablePath.FullName)" + + # Find the installer or app executable + $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 + if ($artifactInstallerPath) { + Write-Host "Executable file found: $($artifactInstallerPath.FullName)" } else { - Write-Error "API executable not found. Exiting." + Write-Error "Executable file not found. Exiting." exit 1 } - - # Start the API executable in the background - Write-Host "Starting API executable..." - Start-Process -NoNewWindow -FilePath $apiExecutablePath.FullName - - # Start the main executable - Write-Host "Running main installer: $($artifactInstallerPath.FullName)..." - Start-Process -FilePath $artifactInstallerPath.FullName + + # Run the installer and log the result + Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." + try { + Start-Process -FilePath $artifactInstallerPath.FullName + Write-Host "Installer ran successfully." + } catch { + Write-Error "Failed to run the installer: $_" + exit 1 + } + + # Optional: If the app executable is different from the installer, find and launch it + # $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" + # Write-Host "Launching the application: $($wavePath)" + # Start-Process -FilePath $wavePath + # Write-Host "Application launched." env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 9102a7d2478bd8325c7e67cdd5c4f58370c6cf07 Mon Sep 17 00:00:00 2001 From: Spencer Poisseroux Date: Mon, 10 Feb 2025 16:29:44 -0500 Subject: [PATCH 59/66] upload create_window.yml testdriver test --- testdriver/create_window.yml | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 testdriver/create_window.yml diff --git a/testdriver/create_window.yml b/testdriver/create_window.yml new file mode 100644 index 000000000000..ebc5f37394d5 --- /dev/null +++ b/testdriver/create_window.yml @@ -0,0 +1,48 @@ +version: 4.1.42 +steps: + - prompt: focus tauri API Validation + commands: + - command: hover-text + text: Tauri API Validation + description: window title of the Tauri API Validation application + action: click + - prompt: Click the Window button + commands: + - command: hover-text + text: Window + description: Window button in the Tauri API sidebar + action: click + - prompt: Type 'test' for New window label, then click create + commands: + - command: focus-application + name: Tauri API Validation + - command: hover-text + text: New window label + description: input field for new window label + action: click + - command: type + text: test + - command: hover-text + text: Create + description: button to create a new window + action: click + - prompt: assert that a new tauri app window has been created + commands: + - command: hover-text + text: Tauri App + description: window title of the Tauri application + action: hover + - command: assert + expect: the Tauri app window is visible + - prompt: >- + close the newly created Tauri App window, ensuring only one Tauri window + is open + commands: + - command: hover-text + text: Tauri App + description: title of the Tauri App window + action: click + - command: press-keys + keys: + - command + - w From 41323d00d787c1e3e224bee60f76aeef639639ff Mon Sep 17 00:00:00 2001 From: Spencer Poisseroux Date: Mon, 10 Feb 2025 16:36:49 -0500 Subject: [PATCH 60/66] upload set_window_title --- testdriver/set_window_title.yml | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 testdriver/set_window_title.yml diff --git a/testdriver/set_window_title.yml b/testdriver/set_window_title.yml new file mode 100644 index 000000000000..0f6b94dc89c3 --- /dev/null +++ b/testdriver/set_window_title.yml @@ -0,0 +1,47 @@ +version: 4.1.42 +steps: + - prompt: click window in the Tauri App sidebar + commands: + - command: focus-application + name: Tauri API Validation + - command: hover-text + text: Window + description: window option in the Tauri App sidebar + action: click + - prompt: Click Set under Set Window Title + commands: + - command: focus-application + name: Tauri API Validation + - command: hover-text + text: Set + description: set button under Set Window Title in the Tauri App + action: click + - prompt: assert that the Tauri App windows title says Awesome Tauri Example! + commands: + - command: focus-application + name: Tauri API Validation + - command: assert + expect: the window title is "Awesome Tauri Example!" + - prompt: >- + In the field under Set Window Title, erase the existing test and type + Tauri API Validation and then click Set + commands: + - command: focus-application + name: Tauri API Validation + - command: hover-text + text: Awesome Tauri Example! + description: input field under Set Window Title + action: click + - command: press-keys + keys: + - command + - a + - command: press-keys + keys: + - backspace + - command: type + text: Tauri API Validation + - command: hover-text + text: Set + description: set button under Set Window Title + action: click From de312cf21549c649f5f3fdf489b8230aa1eb8e3b Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:40:09 -0500 Subject: [PATCH 61/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index ed8c6f9b891d..9e738f7719fc 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -76,7 +76,9 @@ jobs: key: ${{ secrets.TESTDRIVER_API_KEY }} prompt: | 1. /run testdriver/tauri_api_install.yml - #1. /run testdriver/dark_light_mode.yml + 2. /run testdriver/create_window.yml + 3. /run testdriver/set_window_title.yml + 4. /run testdriver/dark_light_mode.yml #1. /run testdriver/minimize_maximize.yml #1. /run testdriver/comm_echo.yml #1. /run testdriver/comm_send_event_rust.yml From d28199f1688c2621d5316b3fb19ffd704929a0bf Mon Sep 17 00:00:00 2001 From: Spencer Poisseroux Date: Mon, 10 Feb 2025 16:52:05 -0500 Subject: [PATCH 62/66] minimize_window --- testdriver/minimize_maximize.yml | 27 -------------------- testdriver/minimize_window.yml | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 27 deletions(-) delete mode 100644 testdriver/minimize_maximize.yml create mode 100644 testdriver/minimize_window.yml diff --git a/testdriver/minimize_maximize.yml b/testdriver/minimize_maximize.yml deleted file mode 100644 index 4671ae1a6ec0..000000000000 --- a/testdriver/minimize_maximize.yml +++ /dev/null @@ -1,27 +0,0 @@ -version: 4.1.58 -session: 679fdccba1ad2d40a789f609 -steps: - - prompt: focus tauri API Validation - commands: - - command: hover-text - text: Tauri API Validation - description: window title of the Tauri API Validation application - action: click - - prompt: maximize the tauri application - commands: - - command: hover-image - description: maximize window button in the Tauri API Validation application title bar - action: click - - prompt: Assert that the Tauri application is maximized - commands: - - command: assert - expect: Tauri application is maximized - - prompt: restore down the tauri application - commands: - - command: hover-image - description: restore window down button in the Tauri API Validation application title bar - action: click - - prompt: Assert that the Tauri application is restored down - commands: - - command: assert - expect: Tauri application is restored down diff --git a/testdriver/minimize_window.yml b/testdriver/minimize_window.yml new file mode 100644 index 000000000000..8ef4377ea842 --- /dev/null +++ b/testdriver/minimize_window.yml @@ -0,0 +1,42 @@ +version: 4.1.42 +steps: + - prompt: minimize the Tauri API app + commands: + - command: hover-text + text: Minimize + description: minimize button in the Tauri API app window + action: click + - prompt: minimize the Tauri API app + commands: + - command: hover-text + text: Tauri API + description: Tauri API app window title bar + action: click + - command: press-keys + keys: + - command + - m + - prompt: assert the tauri app is minimized + commands: + - command: assert + expect: the Tauri app is minimized + - prompt: restore the tauri app by searching for it + commands: + - command: press-keys + keys: + - command + - space + - prompt: restore the tauri app by searching for it + commands: + - command: type + text: Tauri + - prompt: restore the tauri app by searching for it + commands: + - command: hover-text + text: Tauri API + description: Tauri app in Spotlight Search results + action: click + - prompt: assert that the tauri window is visible + commands: + - command: assert + expect: the Tauri window is visible From fe9313161c6b54ab69dbc1742cd137ffb4d19b82 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:54:57 -0500 Subject: [PATCH 63/66] Update test-build-windows.yml, add minimize_window.yml --- .github/workflows/test-build-windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 9e738f7719fc..557713a32c7a 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -77,9 +77,9 @@ jobs: prompt: | 1. /run testdriver/tauri_api_install.yml 2. /run testdriver/create_window.yml - 3. /run testdriver/set_window_title.yml - 4. /run testdriver/dark_light_mode.yml - #1. /run testdriver/minimize_maximize.yml + 3. /run testdriver/dark_light_mode.yml + 4. /run testdriver/set_window_title.yml + 5. /run testdriver/minimize_window.yml #1. /run testdriver/comm_echo.yml #1. /run testdriver/comm_send_event_rust.yml #1. /run testdriver/comm_spam.yml From 9f421f9ee86e99bcd0e82e66fdcb6ac67497769f Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:00:21 -0500 Subject: [PATCH 64/66] Update test-build-windows.yml, remove corepack for prettier --- .github/workflows/test-build-windows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 557713a32c7a..93d6716d53a1 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -15,8 +15,6 @@ jobs: steps: - uses: actions/checkout@v4 - - run: corepack enable - - name: Install pnpm explicitly run: | npm install -g pnpm From 9ff3129803867d96afd87cdf3dc74aac1ab24c23 Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:05:29 -0500 Subject: [PATCH 65/66] Update test-build-windows.yml, formatting --- .github/workflows/test-build-windows.yml | 76 +++++++++++------------- 1 file changed, 36 insertions(+), 40 deletions(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 93d6716d53a1..45b5f35356ac 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: MIT name: Build EXE for TestDriver + env: DEBUG: napi:* @@ -15,23 +16,25 @@ jobs: steps: - uses: actions/checkout@v4 + - run: corepack enable + - name: Install pnpm explicitly run: | npm install -g pnpm - pnpm --version # Verify pnpm is installed and available + pnpm --version # Verify pnpm is installed and available - name: Setup node uses: actions/setup-node@v4 with: node-version: 20 - cache: 'pnpm' + cache: pnpm architecture: x64 - name: Install Rust uses: dtolnay/rust-toolchain@stable with: targets: x86_64-pc-windows-msvc - + - name: Install dependencies (root) run: pnpm install --frozen-lockfile --ignore-scripts @@ -46,11 +49,10 @@ jobs: - name: Build API run: pnpm run build:api shell: bash - + - name: Run app in dev mode (background) working-directory: examples/api - run: | - Start-Process -NoNewWindow -FilePath "cmd.exe" -ArgumentList "/c pnpm tauri dev" + run: Start-Process -NoNewWindow -FilePath "cmd.exe" -ArgumentList "/c pnpm tauri dev" shell: powershell - name: Build API Example App @@ -72,7 +74,7 @@ jobs: - uses: testdriverai/action@main with: key: ${{ secrets.TESTDRIVER_API_KEY }} - prompt: | + prompt: | 1. /run testdriver/tauri_api_install.yml 2. /run testdriver/create_window.yml 3. /run testdriver/dark_light_mode.yml @@ -83,10 +85,10 @@ jobs: #1. /run testdriver/comm_spam.yml #1. /run testdriver/comm_call_request_api.yml #1. /run testdriver/comm_call_log_api.yml - + prerun: | $headers = @{ - Authorization = "token ${{ secrets.GITHUB_TOKEN }}" + Authorization = "token ${{ secrets.GITHUB_TOKEN }}" } $downloadFolder = "./download" @@ -95,73 +97,67 @@ jobs: # Create the download directory if it doesn't exist if (-not (Test-Path -Path $downloadFolder)) { - Write-Host "Creating download folder..." - mkdir $downloadFolder + Write-Host "Creating download folder..." + mkdir $downloadFolder } else { - Write-Host "Download folder already exists." + Write-Host "Download folder already exists." } # Fetch the artifact upload URL (no need for GITHUB_RUN_ID) Write-Host "Fetching the artifact upload URL..." $artifactUrl = (Invoke-RestMethod -Uri "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" -Headers $headers).artifacts[0].archive_download_url - + if ($artifactUrl) { - Write-Host "Artifact URL successfully fetched: $artifactUrl" + Write-Host "Artifact URL successfully fetched: $artifactUrl" } else { - Write-Error "Failed to fetch the artifact URL." - exit 1 + Write-Error "Failed to fetch the artifact URL." + exit 1 } # Download the artifact (zipped file) Write-Host "Starting artifact download..." $artifactZipPath = "$env:TEMP\artifact.zip" try { - Invoke-WebRequest -Uri $artifactUrl ` - -Headers $headers ` - -OutFile $artifactZipPath ` - -MaximumRedirection 5 - Write-Host "Artifact downloaded successfully to $artifactZipPath" + Invoke-WebRequest -Uri $artifactUrl ` + -Headers $headers ` + -OutFile $artifactZipPath ` + -MaximumRedirection 5 + Write-Host "Artifact downloaded successfully to $artifactZipPath" } catch { - Write-Error "Error downloading artifact: $_" - exit 1 + Write-Error "Error downloading artifact: $_" + exit 1 } # Unzip the artifact $artifactUnzipPath = "$env:TEMP\artifact" Write-Host "Unzipping the artifact to $artifactUnzipPath..." try { - Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force - Write-Host "Artifact unzipped successfully to $artifactUnzipPath" + Expand-Archive -Path $artifactZipPath -DestinationPath $artifactUnzipPath -Force + Write-Host "Artifact unzipped successfully to $artifactUnzipPath" } catch { - Write-Error "Failed to unzip the artifact: $_" - exit 1 + Write-Error "Failed to unzip the artifact: $_" + exit 1 } # Find the installer or app executable $artifactInstallerPath = Get-ChildItem -Path $artifactUnzipPath -Filter *.exe -Recurse | Select-Object -First 1 if ($artifactInstallerPath) { - Write-Host "Executable file found: $($artifactInstallerPath.FullName)" + Write-Host "Executable file found: $($artifactInstallerPath.FullName)" } else { - Write-Error "Executable file not found. Exiting." - exit 1 + Write-Error "Executable file not found. Exiting." + exit 1 } # Run the installer and log the result Write-Host "Running the installer: $($artifactInstallerPath.FullName)..." try { - Start-Process -FilePath $artifactInstallerPath.FullName - Write-Host "Installer ran successfully." + Start-Process -FilePath $artifactInstallerPath.FullName + Write-Host "Installer ran successfully." } catch { - Write-Error "Failed to run the installer: $_" - exit 1 + Write-Error "Failed to run the installer: $_" + exit 1 } - # Optional: If the app executable is different from the installer, find and launch it - # $wavePath = Join-Path $env:USERPROFILE "AppData\Local\Programs\waveterm\Wave.exe" - # Write-Host "Launching the application: $($wavePath)" - # Start-Process -FilePath $wavePath - # Write-Host "Application launched." - env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORCE_COLOR: "3" From ed9321d27476d23c82eea71d9003254339e6d47f Mon Sep 17 00:00:00 2001 From: keehar <54379749+spoisseroux@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:40:48 -0500 Subject: [PATCH 66/66] Update test-build-windows.yml --- .github/workflows/test-build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-windows.yml b/.github/workflows/test-build-windows.yml index 45b5f35356ac..cb263034f7c3 100644 --- a/.github/workflows/test-build-windows.yml +++ b/.github/workflows/test-build-windows.yml @@ -79,7 +79,7 @@ jobs: 2. /run testdriver/create_window.yml 3. /run testdriver/dark_light_mode.yml 4. /run testdriver/set_window_title.yml - 5. /run testdriver/minimize_window.yml + #1. /run testdriver/minimize_window.yml #1. /run testdriver/comm_echo.yml #1. /run testdriver/comm_send_event_rust.yml #1. /run testdriver/comm_spam.yml