fix syntax #67
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: TestDriver.ai | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
name: "TestDriver" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: testdriverai/action@main | |
with: | |
key: ${{secrets.TESTDRIVER_API_KEY}} | |
prompt: | | |
1. /run testdriver/test.yml | |
prerun: | | |
npm install | |
npm install dashcam-chrome | |
Start-Job -ScriptBlock { | |
echo "starting npm server" | |
npm start | |
} | |
echo "waiting for port to be live" | |
$portLive = $false | |
$targetUrl = "${{ env.LOCALHOST }}" | |
Write-Output "Beginning port checks for $targetUrl" | |
while (-not $portLive) { | |
try { | |
$response = Invoke-WebRequest -Uri $targetUrl -Method Head -UseBasicParsing -TimeoutSec 2 -ErrorAction Stop | |
if ($response.StatusCode -eq 200 -or $response.StatusCode -eq 404) { | |
$portLive = $true | |
Write-Output "Port is live (HTTP 200)" | |
} | |
} catch { | |
Start-Sleep -Seconds 1 | |
} | |
} | |
Write-Output "Starting Chrome" | |
Start-Process "C:/Program Files/Google/Chrome/Application/chrome.exe" -ArgumentList "--start-maximized", "--load-extension=$(pwd)/node_modules/dashcam-chrome/build", "${{ env.LOCALHOST }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
FORCE_COLOR: "3" | |
LOCALHOST: "http://localhost:8744" |