TestRunBrowserBootstrap_OpenMode covers PAD_BYPASS_SETUP_TOKEN=true: no token file required, helper should still print a /setup URL and poll to completion.
(t *testing.T)
| 114 | // no token file required, helper should still print a /setup URL and |
| 115 | // poll to completion. |
| 116 | func TestRunBrowserBootstrap_OpenMode(t *testing.T) { |
| 117 | withFastPolling(t, 10*time.Millisecond, 5*time.Second) |
| 118 | |
| 119 | var calls atomic.Int32 |
| 120 | srv := fakeSessionServer(t, func() SessionResponse { |
| 121 | n := calls.Add(1) |
| 122 | if n <= 2 { |
| 123 | return SessionResponse{SetupRequired: true, SetupMethod: "open"} |
| 124 | } |
| 125 | return SessionResponse{SetupRequired: false} |
| 126 | }) |
| 127 | cfg := newTestConfig(t, srv.URL) |
| 128 | // Deliberately no token file — open mode shouldn't need one. |
| 129 | |
| 130 | client := NewClientFromURL(srv.URL) |
| 131 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| 132 | defer cancel() |
| 133 | |
| 134 | if err := RunBrowserBootstrap(ctx, client, cfg, ""); err != nil { |
| 135 | t.Fatalf("RunBrowserBootstrap (open mode): %v", err) |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | // TestRunBrowserBootstrap_TokenMissing — server says setup_method=logs_token |
| 140 | // but the file isn't on disk. Helper should fail loudly with a path-aware |
nothing calls this directly
no test coverage detected