Files
bee/audit/internal/webui/page_scenario_test.go
Mikhail ChusavitinandClaude Sonnet 5 bcf02e0515 webui: add "6. Scenario" page — run scriptable test scenarios from removable media through the normal task queue
Exposes the scenario engine (platform.System.RunScenario, added earlier)
in the web UI instead of only the `bee run` CLI: a new nav item lists every
scenarios/*.json found on mounted removable media (GET /api/scenario/list)
and runs one with a click (POST /api/scenario/run), enqueued as a normal
Task with target "scenario" — progress/logs live in Tasks like any other
SAT pack, no separate live-output UI needed.

- app.go: satRunner gains RunScenario, exportManager gains
  ListScenarioFilesOnRemovableMedia/ReadScenarioFromRemovableMedia — both
  already implemented on platform.System, just newly exposed through App.
- webui/tasks.go: taskParams.ScenarioName; runTask's "scenario" case reads
  the file from removable media, parses it, and runs it.
- webui/page_scenario.go: the page itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-28 18:58:11 +03:00

21 lines
511 B
Go

package webui
import (
"strings"
"testing"
)
func TestRenderPageScenarioRoutes(t *testing.T) {
body := renderPage("scenario", HandlerOptions{})
if !strings.Contains(body, "scenario-list") {
t.Fatalf("scenario page body missing scenario-list container:\n%s", body)
}
}
func TestLayoutNavIncludesScenario(t *testing.T) {
nav := layoutNav("scenario", "dev")
if !strings.Contains(nav, `href="/scenario"`) || !strings.Contains(nav, "6. Scenario") {
t.Fatalf("nav missing Scenario item:\n%s", nav)
}
}