From f2b32204a213915ab457da94849d557d3d172fb4 Mon Sep 17 00:00:00 2001 From: Greg Pstrucha <875316+Gricha@users.noreply.github.com> Date: Tue, 6 Jan 2026 19:52:43 -0800 Subject: [PATCH 1/2] Add Maestro chat tests for Claude Code and OpenCode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add testIDs to SessionChatScreen (chat-input, send-button, stop-button, user-message, assistant-message, thinking-dots) - Add testIDs to WorkspaceDetailScreen chat picker (new-chat-claude-code, new-chat-opencode, new-chat-codex) - Add Maestro test flows for Claude Code and OpenCode chat - Update workflow to: - Install Docker via Colima on macOS - Build workspace Docker image - Start Perry agent with test workspace - Increase timeout to 60 minutes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/mobile-e2e.yml | 34 ++++++++-- .../.maestro/flows/03-chat-claude-code.yaml | 66 +++++++++++++++++++ mobile/.maestro/flows/04-chat-opencode.yaml | 66 +++++++++++++++++++ mobile/src/screens/SessionChatScreen.tsx | 10 +-- mobile/src/screens/WorkspaceDetailScreen.tsx | 1 + 5 files changed, 168 insertions(+), 9 deletions(-) create mode 100644 mobile/.maestro/flows/03-chat-claude-code.yaml create mode 100644 mobile/.maestro/flows/04-chat-opencode.yaml diff --git a/.github/workflows/mobile-e2e.yml b/.github/workflows/mobile-e2e.yml index 0813deef..bd9824c6 100644 --- a/.github/workflows/mobile-e2e.yml +++ b/.github/workflows/mobile-e2e.yml @@ -17,7 +17,7 @@ on: jobs: maestro-ios: runs-on: macos-14 - timeout-minutes: 45 + timeout-minutes: 60 steps: - uses: actions/checkout@v4 @@ -32,14 +32,38 @@ jobs: with: path: | ~/.bun/install/cache + node_modules mobile/node_modules - key: ${{ runner.os }}-bun-mobile-${{ hashFiles('mobile/bun.lock') }} + web/node_modules + key: ${{ runner.os }}-bun-all-${{ hashFiles('bun.lock', 'mobile/bun.lock') }} restore-keys: | - ${{ runner.os }}-bun-mobile- + ${{ runner.os }}-bun-all- - name: Install dependencies - working-directory: mobile - run: bun install + run: | + bun install + cd mobile && bun install + cd ../web && bun install + + - name: Install Docker via Colima + run: | + brew install colima docker + colima start --cpu 4 --memory 8 --disk 20 + docker info + + - name: Build workspace image + run: docker build -t perry:latest ./perry + + - name: Start Perry agent + run: | + bun run src/index.ts agent run --port 7391 & + sleep 5 + curl -s http://localhost:7391/health || (echo "Agent failed to start" && exit 1) + + - name: Create test workspace + run: | + bun run src/index.ts start test + bun run src/index.ts list - name: Select Xcode version run: | diff --git a/mobile/.maestro/flows/03-chat-claude-code.yaml b/mobile/.maestro/flows/03-chat-claude-code.yaml new file mode 100644 index 00000000..b5f246f8 --- /dev/null +++ b/mobile/.maestro/flows/03-chat-claude-code.yaml @@ -0,0 +1,66 @@ +appId: com.gricha.perry +name: Chat - Claude Code +tags: + - chat + - claude-code +--- +- launchApp: + clearState: true + +# Configure server connection +- tapOn: + id: "hostname-input" +- inputText: "localhost" +- tapOn: + id: "port-input" +- eraseText +- inputText: "7391" +- tapOn: + id: "connect-button" + +# Wait for workspace list to load +- extendedWaitUntil: + visible: "test" + timeout: 30000 + +# Tap on test workspace +- tapOn: "test" + +# Wait for workspace detail screen +- extendedWaitUntil: + visible: + id: "new-chat-button" + timeout: 10000 + +# Start new Claude Code chat +- tapOn: + id: "new-chat-button" + +# Select Claude Code from picker +- tapOn: + id: "new-chat-claude-code" + +# Wait for chat screen to load and connect +- extendedWaitUntil: + visible: + id: "chat-input" + timeout: 15000 + +# Type and send a simple message +- tapOn: + id: "chat-input" +- inputText: "Say hello" +- tapOn: + id: "send-button" + +# Verify thinking dots appear (streaming started) +- extendedWaitUntil: + visible: + id: "thinking-dots" + timeout: 10000 + +# Wait for response to complete (thinking dots disappear, assistant message appears) +- extendedWaitUntil: + visible: + id: "assistant-message" + timeout: 120000 diff --git a/mobile/.maestro/flows/04-chat-opencode.yaml b/mobile/.maestro/flows/04-chat-opencode.yaml new file mode 100644 index 00000000..8911dab2 --- /dev/null +++ b/mobile/.maestro/flows/04-chat-opencode.yaml @@ -0,0 +1,66 @@ +appId: com.gricha.perry +name: Chat - OpenCode +tags: + - chat + - opencode +--- +- launchApp: + clearState: true + +# Configure server connection +- tapOn: + id: "hostname-input" +- inputText: "localhost" +- tapOn: + id: "port-input" +- eraseText +- inputText: "7391" +- tapOn: + id: "connect-button" + +# Wait for workspace list to load +- extendedWaitUntil: + visible: "test" + timeout: 30000 + +# Tap on test workspace +- tapOn: "test" + +# Wait for workspace detail screen +- extendedWaitUntil: + visible: + id: "new-chat-button" + timeout: 10000 + +# Start new OpenCode chat +- tapOn: + id: "new-chat-button" + +# Select OpenCode from picker +- tapOn: + id: "new-chat-opencode" + +# Wait for chat screen to load and connect +- extendedWaitUntil: + visible: + id: "chat-input" + timeout: 15000 + +# Type and send a simple message +- tapOn: + id: "chat-input" +- inputText: "Say hello" +- tapOn: + id: "send-button" + +# Verify thinking dots appear (streaming started) +- extendedWaitUntil: + visible: + id: "thinking-dots" + timeout: 10000 + +# Wait for response to complete (thinking dots disappear, assistant message appears) +- extendedWaitUntil: + visible: + id: "assistant-message" + timeout: 120000 diff --git a/mobile/src/screens/SessionChatScreen.tsx b/mobile/src/screens/SessionChatScreen.tsx index 5a7e384c..43fbab16 100644 --- a/mobile/src/screens/SessionChatScreen.tsx +++ b/mobile/src/screens/SessionChatScreen.tsx @@ -177,7 +177,7 @@ function MessageBubble({ message }: { message: ChatMessage }) { if (message.role === 'user') { return ( - + {trimmedContent} ) @@ -192,7 +192,7 @@ function MessageBubble({ message }: { message: ChatMessage }) { } return ( - + {trimmedContent} ) @@ -230,7 +230,7 @@ function ThinkingDots() { }, [dot1, dot2, dot3]) return ( - + @@ -684,9 +684,10 @@ export function SessionChatScreen({ route, navigation }: any) { multiline maxLength={4000} editable={connected && !isStreaming} + testID="chat-input" /> {isStreaming ? ( - + Stop ) : ( @@ -694,6 +695,7 @@ export function SessionChatScreen({ route, navigation }: any) { style={[styles.sendBtn, (!connected || !input.trim()) && styles.sendBtnDisabled]} onPress={sendMessage} disabled={!connected || !input.trim()} + testID="send-button" > Send diff --git a/mobile/src/screens/WorkspaceDetailScreen.tsx b/mobile/src/screens/WorkspaceDetailScreen.tsx index e0accdb9..b68ca44b 100644 --- a/mobile/src/screens/WorkspaceDetailScreen.tsx +++ b/mobile/src/screens/WorkspaceDetailScreen.tsx @@ -260,6 +260,7 @@ export function WorkspaceDetailScreen({ route, navigation }: any) { setShowNewChatPicker(false) navigation.navigate('SessionChat', { workspaceName: name, isNew: true, agentType: type }) }} + testID={`new-chat-${type}`} > {type === 'claude-code' ? 'CC' : type === 'opencode' ? 'OC' : 'CX'} From 62c3fba453856a0307e5a923edb9b713410283aa Mon Sep 17 00:00:00 2001 From: Greg Pstrucha <875316+Gricha@users.noreply.github.com> Date: Tue, 6 Jan 2026 20:09:28 -0800 Subject: [PATCH 2/2] Make chat tests local-only, remove Docker from CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove Docker/Colima setup from CI (not supported on GitHub macOS runners) - Use --exclude-tags=chat to skip chat tests in CI - Chat tests (CC + OpenCode) remain for local testing - Reduce timeout back to 45 minutes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/mobile-e2e.yml | 37 ++++++-------------------------- 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/.github/workflows/mobile-e2e.yml b/.github/workflows/mobile-e2e.yml index bd9824c6..219a3590 100644 --- a/.github/workflows/mobile-e2e.yml +++ b/.github/workflows/mobile-e2e.yml @@ -17,7 +17,7 @@ on: jobs: maestro-ios: runs-on: macos-14 - timeout-minutes: 60 + timeout-minutes: 45 steps: - uses: actions/checkout@v4 @@ -32,38 +32,14 @@ jobs: with: path: | ~/.bun/install/cache - node_modules mobile/node_modules - web/node_modules - key: ${{ runner.os }}-bun-all-${{ hashFiles('bun.lock', 'mobile/bun.lock') }} + key: ${{ runner.os }}-bun-mobile-${{ hashFiles('mobile/bun.lock') }} restore-keys: | - ${{ runner.os }}-bun-all- + ${{ runner.os }}-bun-mobile- - name: Install dependencies - run: | - bun install - cd mobile && bun install - cd ../web && bun install - - - name: Install Docker via Colima - run: | - brew install colima docker - colima start --cpu 4 --memory 8 --disk 20 - docker info - - - name: Build workspace image - run: docker build -t perry:latest ./perry - - - name: Start Perry agent - run: | - bun run src/index.ts agent run --port 7391 & - sleep 5 - curl -s http://localhost:7391/health || (echo "Agent failed to start" && exit 1) - - - name: Create test workspace - run: | - bun run src/index.ts start test - bun run src/index.ts list + working-directory: mobile + run: bun install - name: Select Xcode version run: | @@ -153,7 +129,8 @@ jobs: working-directory: mobile run: | export PATH="$HOME/.maestro/bin:$PATH" - maestro test .maestro/flows/ --format junit --output maestro-report.xml + # Exclude chat tests (require backend) - run those locally + maestro test .maestro/flows/ --exclude-tags=chat --format junit --output maestro-report.xml env: MAESTRO_DRIVER_STARTUP_TIMEOUT: 120000