fix: integration test video source detection for Chinese names

This commit is contained in:
tian 2026-07-27 21:04:54 +08:00
parent b256ecc5d2
commit e4608f48a0

View File

@ -223,21 +223,16 @@ func TestIntegration_WizardDeployRoundtrip(t *testing.T) {
}
page := string(body)
// Find a video source
// Find a video source name from table cell
sourceName := ""
for _, line := range strings.Split(page, "\n") {
for _, prefix := range []string{">cam", ">src_", ">gate_"} {
if idx := strings.Index(line, prefix); idx >= 0 {
rest := line[idx+1:]
if end := strings.Index(rest, "<"); end > 1 {
sourceName = rest[:end]
break
}
if idx := strings.Index(line, ">车间"); idx >= 0 {
rest := line[idx+1:]
if end := strings.Index(rest, "<"); end > 1 {
sourceName = rest[:end]
break
}
}
if sourceName != "" {
break
}
}
if sourceName == "" {
t.Skip("no video source found")