Problem Statement
Authentication is the #1 friction point in E2E testing. Every team that evaluates Specter will hit "but my app requires login" within the first 5 minutes. Currently, if the target app requires authentication, the user must manually log in before running tests, and the session may expire mid-suite.
Proposed Solution
Specter should automatically:
- Detect login pages (URL contains
/login, /signin, presence of <input type="password">)
- Execute a configurable login scenario before the test suite
- Persist the auth state using Playwright's
context.storageState()
- Reuse the saved state for all subsequent test contexts via
browser.newContext({ storageState })
Implementation Notes
- Playwright's
context.storageState({ path: 'auth.json' }) and browser.newContext({ storageState: 'auth.json' }) are first-class APIs β no hacking needed.
- Login detection heuristic in
browserExecutor.js: check the current URL for /login, /signin, /auth, or scan the DOM for <input type="password">.
- Store auth state in the
.ai-agent-cache/ directory (already gitignored).
- Auth credentials come from the
environments config (see Multi-Environment issue) or a dedicated auth section in settings.json.
- The
coordinator.js pipeline should insert a "login check" step before the main test suite β between routeNavigator and scenarioWriter.
Auth Flow
coordinator starts β routeNavigator β navigates to target β loginDetector β checks if page is a login screen ββ NO β continue to scenarioWriter ββ YES β run login scenario β save storageState β continue
Which Agent / Component Does This Affect?
Problem Statement
Authentication is the #1 friction point in E2E testing. Every team that evaluates Specter will hit "but my app requires login" within the first 5 minutes. Currently, if the target app requires authentication, the user must manually log in before running tests, and the session may expire mid-suite.
Proposed Solution
Specter should automatically:
/login,/signin, presence of<input type="password">)context.storageState()browser.newContext({ storageState })Implementation Notes
context.storageState({ path: 'auth.json' })andbrowser.newContext({ storageState: 'auth.json' })are first-class APIs β no hacking needed.browserExecutor.js: check the current URL for/login,/signin,/auth, or scan the DOM for<input type="password">..ai-agent-cache/directory (already gitignored).environmentsconfig (see Multi-Environment issue) or a dedicatedauthsection insettings.json.coordinator.jspipeline should insert a "login check" step before the main test suite β betweenrouteNavigatorandscenarioWriter.Auth Flow
coordinator starts β routeNavigator β navigates to target β loginDetector β checks if page is a login screen ββ NO β continue to scenarioWriter ββ YES β run login scenario β save storageState β continue
Which Agent / Component Does This Affect?
loginDetectorutility or agent