Add responsive parity smoke matrix

This commit is contained in:
Meta Vens 2026-06-05 19:18:17 +01:00
commit e61c2a58a7
14 changed files with 191 additions and 67 deletions

View file

@ -3,7 +3,10 @@ param(
[string] $ApkPath = "artifacts\android\eve-debug.apk",
[string] $PackageName = "org.gamecult.eve",
[string] $ActivityName = ".MainActivity",
[int] $LaunchDelaySeconds = 3
[int] $LaunchDelaySeconds = 3,
[int] $Width = 0,
[int] $Height = 0,
[switch] $ForceInstall
)
$ErrorActionPreference = "Stop"
@ -22,22 +25,39 @@ if (-not (Test-Path $absoluteApk)) {
throw "Android APK not found: $absoluteApk"
}
adb install -r $absoluteApk | Out-Host
if ($LASTEXITCODE -ne 0) {
throw "adb install failed with exit code $LASTEXITCODE"
}
$overrideSize = $Width -gt 0 -and $Height -gt 0
try {
if ($overrideSize) {
adb shell am force-stop $PackageName | Out-Host
adb shell wm size "${Width}x${Height}" | Out-Host
if ($LASTEXITCODE -ne 0) {
throw "adb wm size failed with exit code $LASTEXITCODE"
}
}
adb shell am start -n "$PackageName/$ActivityName" | Out-Host
if ($LASTEXITCODE -ne 0) {
throw "adb launch failed with exit code $LASTEXITCODE"
}
$installed = adb shell pm path $PackageName
if ($ForceInstall -or -not $installed) {
adb install -r $absoluteApk | Out-Host
if ($LASTEXITCODE -ne 0) {
throw "adb install failed with exit code $LASTEXITCODE"
}
}
Start-Sleep -Seconds $LaunchDelaySeconds
adb shell am start -n "$PackageName/$ActivityName" | Out-Host
if ($LASTEXITCODE -ne 0) {
throw "adb launch failed with exit code $LASTEXITCODE"
}
$cmdOutput = $absoluteOutput.Replace('\', '\\')
cmd /c "adb exec-out screencap -p > `"$absoluteOutput`""
if ($LASTEXITCODE -ne 0) {
throw "adb screencap failed with exit code $LASTEXITCODE"
Start-Sleep -Seconds $LaunchDelaySeconds
cmd /c "adb exec-out screencap -p > `"$absoluteOutput`""
if ($LASTEXITCODE -ne 0) {
throw "adb screencap failed with exit code $LASTEXITCODE"
}
} finally {
if ($overrideSize) {
adb shell wm size reset | Out-Host
}
}
if (-not (Test-Path $absoluteOutput) -or (Get-Item $absoluteOutput).Length -le 0) {

View file

@ -1,6 +1,8 @@
param(
[ValidateSet("windows", "linux")]
[string] $Target = "windows",
[ValidateSet("phone", "tablet", "desktop")]
[string] $ViewportId = "desktop",
[string] $OutputPath = "artifacts\parity\flutter-windows-cultui-inspector.png"
)
@ -30,7 +32,7 @@ try {
Pop-Location
}
$golden = Join-Path $flutterRoot "test\goldens\cultui-inspector.png"
$golden = Join-Path $flutterRoot "test\goldens\cultui-inspector-$ViewportId.png"
if (-not (Test-Path $golden) -or (Get-Item $golden).Length -le 0) {
throw "Flutter golden did not produce a PNG: $golden"
}

View file

@ -10,6 +10,8 @@ $projectRoot = Split-Path -Parent $PSScriptRoot
$stamp = Get-Date -Format "yyyyMMdd-HHmmss"
$runRoot = Join-Path $projectRoot (Join-Path $OutputDirectory $stamp)
New-Item -ItemType Directory -Force $runRoot | Out-Null
$manifest = Get-Content (Join-Path $projectRoot "tools\parity\parity-manifest.json") | ConvertFrom-Json
$responsiveCases = @($manifest.responsiveCases)
$results = [ordered]@{
schema = "gamecult.eve.parity_smoke.v1"
@ -59,10 +61,14 @@ try {
throw "Semantic parity harness failed with exit code $LASTEXITCODE"
}
Invoke-Capture "web" {
powershell -ExecutionPolicy Bypass -File .\scripts\capture-web-reference.ps1 `
-ProviderId $ProviderId `
-OutputPath (Join-Path $runRoot "web-$ProviderId.png")
foreach ($case in $responsiveCases) {
Invoke-Capture "web-$($case.id)" {
powershell -ExecutionPolicy Bypass -File .\scripts\capture-web-reference.ps1 `
-ProviderId $ProviderId `
-OutputPath (Join-Path $runRoot "web-$ProviderId-$($case.id).png") `
-Width $case.width `
-Height $case.height
}
}
Invoke-Capture "ios" {
@ -71,21 +77,31 @@ try {
-OutputDirectory $runRoot
}
Invoke-Capture "android" {
powershell -ExecutionPolicy Bypass -File .\scripts\capture-android-screenshot.ps1 `
-OutputPath (Join-Path $runRoot "android-periwinkle.png")
foreach ($case in $responsiveCases) {
Invoke-Capture "android-$($case.id)" {
powershell -ExecutionPolicy Bypass -File .\scripts\capture-android-screenshot.ps1 `
-OutputPath (Join-Path $runRoot "android-periwinkle-$($case.id).png") `
-Width $case.width `
-Height $case.height
}
}
Invoke-Capture "windows" {
powershell -ExecutionPolicy Bypass -File .\scripts\capture-flutter-parity.ps1 `
-Target windows `
-OutputPath (Join-Path $runRoot "windows-flutter-cultui-inspector.png")
foreach ($case in $responsiveCases) {
Invoke-Capture "windows-$($case.id)" {
powershell -ExecutionPolicy Bypass -File .\scripts\capture-flutter-parity.ps1 `
-Target windows `
-ViewportId $case.id `
-OutputPath (Join-Path $runRoot "windows-flutter-cultui-inspector-$($case.id).png")
}
}
Invoke-Capture "linux" {
powershell -ExecutionPolicy Bypass -File .\scripts\capture-flutter-parity.ps1 `
-Target linux `
-OutputPath (Join-Path $runRoot "linux-flutter-cultui-inspector.png")
foreach ($case in $responsiveCases) {
Invoke-Capture "linux-$($case.id)" {
powershell -ExecutionPolicy Bypass -File .\scripts\capture-flutter-parity.ps1 `
-Target linux `
-ViewportId $case.id `
-OutputPath (Join-Path $runRoot "linux-flutter-cultui-inspector-$($case.id).png")
}
}
$jsonPath = Join-Path $runRoot "parity-smoke.json"