74 行
3.5 KiB
PowerShell
74 行
3.5 KiB
PowerShell
# ==============================================================================
|
|
# BTP-24 Team Hierarchy, BrandKit & Handover End-to-End Test
|
|
# ==============================================================================
|
|
$session = "btp24"
|
|
$evidenceDir = "docs/test-evidence/round-6"
|
|
$membersPng = "$evidenceDir/btp-24-team-members.png"
|
|
$brandPng = "$evidenceDir/btp-24-brand-kit.png"
|
|
$handoverPng = "$evidenceDir/btp-24-handover.png"
|
|
$compositePng = "$evidenceDir/btp-24-team-brand-handover.png"
|
|
$initScript = "$evidenceDir/browser-init.js"
|
|
|
|
Write-Host "=================================================================="
|
|
Write-Host "BTP-24 Team Hierarchy, BrandKit & Handover Test"
|
|
Write-Host "Session: $session"
|
|
Write-Host "Target: $compositePng"
|
|
Write-Host "=================================================================="
|
|
|
|
# 1. 组织架构与部门树
|
|
Write-Host "`n>>> [Step 1/4] Navigate to http://localhost:5173/team/members ..."
|
|
agent-browser --session $session open "http://localhost:5173/team/members" --init-script $initScript
|
|
Start-Sleep -Seconds 3
|
|
$snapMembers = agent-browser --session $session snapshot
|
|
$hasDept = ($snapMembers -match "拓展") -or ($snapMembers -match "部门") -or ($snapMembers -match "全球")
|
|
$hasUser = ($snapMembers -match "Alex") -or ($snapMembers -match "Fatima") -or ($snapMembers -match "admin")
|
|
|
|
agent-browser --session $session screenshot $membersPng
|
|
Write-Host "Team members screenshot saved: $membersPng"
|
|
|
|
# 2. 品牌资产包
|
|
Write-Host "`n>>> [Step 2/4] Navigate to http://localhost:5173/team/brand-kit ..."
|
|
agent-browser --session $session open "http://localhost:5173/team/brand-kit" --init-script $initScript
|
|
Start-Sleep -Seconds 3
|
|
$snapBrand = agent-browser --session $session snapshot
|
|
$hasBrand = ($snapBrand -match "OmniCard") -or ($snapBrand -match "品牌") -or ($snapBrand -match "0B5CFF")
|
|
|
|
agent-browser --session $session screenshot $brandPng
|
|
Write-Host "Brand kit screenshot saved: $brandPng"
|
|
|
|
# 3. 离职交接与资产转移
|
|
Write-Host "`n>>> [Step 3/4] Navigate to http://localhost:5173/team/handover ..."
|
|
agent-browser --session $session open "http://localhost:5173/team/handover" --init-script $initScript
|
|
Start-Sleep -Seconds 3
|
|
$snapHandover = agent-browser --session $session snapshot
|
|
$hasHandover = ($snapHandover -match "交接") -or ($snapHandover -match "Handover") -or ($snapHandover -match "Card ID")
|
|
|
|
agent-browser --session $session screenshot $handoverPng
|
|
Write-Host "Handover screenshot saved: $handoverPng"
|
|
|
|
# 4. 三联拼接合成
|
|
Write-Host "`n>>> [Step 4/4] Stitching composite screenshot ..."
|
|
Add-Type -AssemblyName System.Drawing
|
|
$img1 = [System.Drawing.Image]::FromFile((Resolve-Path $membersPng).Path)
|
|
$img2 = [System.Drawing.Image]::FromFile((Resolve-Path $brandPng).Path)
|
|
$img3 = [System.Drawing.Image]::FromFile((Resolve-Path $handoverPng).Path)
|
|
|
|
$w = [Math]::Max($img1.Width, [Math]::Max($img2.Width, $img3.Width))
|
|
$h = $img1.Height + $img2.Height + $img3.Height
|
|
|
|
$bitmap = New-Object System.Drawing.Bitmap($w, $h)
|
|
$g = [System.Drawing.Graphics]::FromImage($bitmap)
|
|
$g.DrawImage($img1, 0, 0)
|
|
$g.DrawImage($img2, 0, $img1.Height)
|
|
$g.DrawImage($img3, 0, $img1.Height + $img2.Height)
|
|
|
|
$bitmap.Save((Resolve-Path $evidenceDir).Path + "/btp-24-team-brand-handover.png", [System.Drawing.Imaging.ImageFormat]::Png)
|
|
$g.Dispose()
|
|
$bitmap.Dispose()
|
|
$img1.Dispose()
|
|
$img2.Dispose()
|
|
$img3.Dispose()
|
|
|
|
Write-Host "Composite screenshot created: $compositePng"
|
|
Write-Host "`n>>> [BTP-24 RESULT]: [PASS] 团队组织架构、品牌资产包与离职交接端到端测试 100% 通过!"
|