test(activation): add Maestro E2E coverage for the activation flow
Adds deterministic end-to-end coverage for first-open -> telemetry consent -> server URL entry -> connect -> send first message -> receive reply, targeting the 0%-7-day-retention investigation (GitHub issue #76). - tests/fixtures/mock-opencode-server.ts: dependency-free HTTP+SSE stub matching the REAL client protocol (src/lib/sdk.ts) — REST + a single long-lived GET /global/event SSE stream, no WebSocket. Supports a --fail-auth mode that 401s every request to exercise the connect-time auth-failure class. - .maestro/flows/activation-positive.yaml: consent -> quick connect -> new session -> send message -> assert streamed reply renders, with a screenshot at every step (positive-S1..S8). - .maestro/flows/activation-negative-401.yaml: same setup against the --fail-auth server, asserts Quick Connect's existing "Connection Failed" alert is shown (not silently swallowed) and that the connection is not saved. Flags in comments that Advanced-mode Save (handleAdvancedSave) still has no testConnection() check and is a known, uncovered gap. - testID props added (no restructuring) to the screens/components the flows drive: TelemetryConsentModal, connection/add.tsx, tabs/index.tsx, session/[id].tsx, MessageBubble. - .github/workflows/activation-e2e.yml: new CI job — Android emulator via reactivecircus/android-emulator-runner, builds the debug-signed APK, starts both mock server instances, runs both Maestro flows, uploads screenshots via actions/upload-artifact. Kept separate from the existing vision-driven cua-smoke.yml, which needs a live server + LLM and isn't suited to tight deterministic regression assertions. - .gitignore: Maestro takeScreenshot output is never committed. Verified locally: mock server exercised standalone via curl (health, project/current, path, session create, SSE event ordering, message persistence) in both normal and --fail-auth modes; both Maestro flow files validated as well-formed YAML; tsc --noEmit clean on all changed files. No lint script exists in this repo (N/A). Full emulator execution was not run — no Android SDK/emulator available in this environment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NJKAQ6HAikWGQK7PGZ5Y4E
This commit is contained in:
@@ -177,6 +177,7 @@ export default function AddConnectionScreen() {
|
||||
autoCapitalize="none"
|
||||
autoCorrect={false}
|
||||
keyboardType="url"
|
||||
testID="connect-ip-input"
|
||||
/>
|
||||
<Text style={[styles.ipColon, isDark && styles.textDark]}>:</Text>
|
||||
<TextInput
|
||||
@@ -186,6 +187,7 @@ export default function AddConnectionScreen() {
|
||||
value={port}
|
||||
onChangeText={setPort}
|
||||
keyboardType="number-pad"
|
||||
testID="connect-port-input"
|
||||
/>
|
||||
</View>
|
||||
|
||||
@@ -208,6 +210,7 @@ export default function AddConnectionScreen() {
|
||||
value={password}
|
||||
onChangeText={setPassword}
|
||||
secureTextEntry
|
||||
testID="connect-password-input"
|
||||
/>
|
||||
<Text style={[styles.usernameHint, isDark && styles.hintDark]}>
|
||||
Username defaults to <Text style={styles.code}>opencode</Text>. Custom username? Use{" "}
|
||||
@@ -222,6 +225,7 @@ export default function AddConnectionScreen() {
|
||||
style={[styles.connectButton, isDark && styles.connectButtonDark]}
|
||||
onPress={handleQuickConnect}
|
||||
disabled={isConnecting}
|
||||
testID="connect-submit-button"
|
||||
>
|
||||
{isConnecting ? (
|
||||
<ActivityIndicator size="small" color={isDark ? "#0a0a0a" : "#ffffff"} />
|
||||
|
||||
Reference in New Issue
Block a user