test: verify trajectory planning flow demo
This commit is contained in:
@@ -0,0 +1,50 @@
|
|||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
|
$page = Join-Path $PSScriptRoot '..\ParkrobTrajplanner\Trajplanner_output\trajectory-planning-flow-demo.html'
|
||||||
|
if (-not (Test-Path -LiteralPath $page))
|
||||||
|
{
|
||||||
|
throw "Missing demo page: $page"
|
||||||
|
}
|
||||||
|
|
||||||
|
$html = Get-Content -LiteralPath $page -Raw -Encoding UTF8
|
||||||
|
$required = @(
|
||||||
|
'<meta charset="utf-8">',
|
||||||
|
'data-stage="map"',
|
||||||
|
'data-stage="coarse"',
|
||||||
|
'data-stage="smooth"',
|
||||||
|
'data-stage="em"',
|
||||||
|
'data-stage="control"',
|
||||||
|
'id="planning-map"',
|
||||||
|
'id="timeline"',
|
||||||
|
'coarse-path',
|
||||||
|
'smooth-path',
|
||||||
|
'EmTrajectory',
|
||||||
|
'TrajectoryControlCommand',
|
||||||
|
'mapSnapshotId',
|
||||||
|
'referencePathId',
|
||||||
|
'SignedLongitudinalVelocity',
|
||||||
|
'RequestDirectionChange',
|
||||||
|
'HoldBrake',
|
||||||
|
'IsTrajectoryComplete',
|
||||||
|
'function render()',
|
||||||
|
'function controlCommandForPoint(',
|
||||||
|
'addEventListener'
|
||||||
|
)
|
||||||
|
|
||||||
|
foreach ($token in $required)
|
||||||
|
{
|
||||||
|
if (-not $html.Contains($token))
|
||||||
|
{
|
||||||
|
throw "Missing required demo contract: $token"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($forbidden in @('http://', 'https://', 'fetch(', 'XMLHttpRequest', 'WebSocket'))
|
||||||
|
{
|
||||||
|
if ($html.Contains($forbidden))
|
||||||
|
{
|
||||||
|
throw "Demo must remain offline: $forbidden"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Output 'Trajectory planning flow demo checks passed.'
|
||||||
Reference in New Issue
Block a user