-
Notifications
You must be signed in to change notification settings - Fork 38
fix(e2e): fix iOS login testID and Android ANR failures in Maestro #2274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6dd4a1d
8bd5be9
745e5b1
446f4ad
9c44e59
16f8504
871795e
744c99d
ff8e63f
021b855
b8ed94d
3ddb9e7
f583c58
f34b085
41e9b7e
b0624a6
92d4fa8
e994c86
e5da36f
78158c8
6dc0d32
8f01b6d
85ae538
ba7b093
83b86b2
f5ceb58
542ee40
9137181
0e850ed
5da0628
0c3261d
21a920e
31a855d
cd81893
ccc6d84
fe24725
6654580
3fca175
2ded5b6
b306189
269dfdb
0811bbe
40ed701
e4815b2
63b0311
417708b
8110caa
5ebe6c9
5006800
257613b
9e57a02
7bada72
f9242bd
6c6debe
564d20c
9d46cde
b78f056
33092e4
5851f22
1d549ac
d1fdc42
2ae9e44
1314d13
854f462
78977a5
993873f
67ecce1
d8da257
a2f523b
fe7b02d
3f72ef4
c2db008
9fb4036
f111f8b
d4a90a2
85b1b41
16e1f7f
4934a05
f3bdbc5
3b3d21b
82d62f1
be7d442
cad3d96
999830e
5795cba
571f4b8
8f5f932
5d45465
7a37309
460c5ac
d920495
13f268a
01e5eaa
53f0c11
d5f5366
917e333
bebfbcb
057a9cb
a8c23a7
ffa088e
bb17b2f
0e9f3b0
1656d18
8a4463a
cdf53e5
af7fa50
e9cf78e
1f0c2bf
e1b9acf
5873556
bb386f5
b6dac2b
f96bca9
719ae91
fba14d2
118cf60
a298c20
a5b6813
616734f
af81bbe
add0eca
1af5935
c21b377
ecd64b9
3302c16
ef6a8a1
8b6e646
55c6f11
a0857d1
e18305d
38e18f4
757c53e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -31,7 +31,7 @@ jobs: | |||||
| - name: Install dependencies | ||||||
| env: | ||||||
| PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }} | ||||||
| run: bun install --frozen-lockfile | ||||||
| run: bun install | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's check if the file exists and read it
if [ -f .github/workflows/checks.yml ]; then
echo "=== File .github/workflows/checks.yml exists ==="
echo "=== Content with line numbers ==="
cat -n .github/workflows/checks.yml | head -50
else
echo "File not found"
git ls-files | grep -E '\.github/workflows'
fiRepository: PackRat-AI/PackRat Length of output: 2085 🏁 Script executed: # Let me check if there are other bun install commands in the file
rg "bun install" .github/workflows/checks.ymlRepository: PackRat-AI/PackRat Length of output: 87 Use Line 34 uses bare Suggested fix- run: bun install
+ run: bun install --frozen-lockfile📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| - name: Run Biome (check mode) | ||||||
| if: ${{ !(github.event_name == 'workflow_dispatch' && inputs.fix == true) }} | ||||||
| run: bun biome check | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -87,7 +87,7 @@ jobs: | |||||
| - name: Install dependencies | ||||||
| env: | ||||||
| PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }} | ||||||
| run: bun install --frozen-lockfile | ||||||
| run: bun install | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Check if the file exists and examine line 90 with context
if [ -f ".github/workflows/copilot-setup-steps.yml" ]; then
echo "=== File exists ==="
wc -l ".github/workflows/copilot-setup-steps.yml"
echo ""
echo "=== Context around line 90 ==="
sed -n '85,95p' ".github/workflows/copilot-setup-steps.yml"
else
echo "File does not exist"
fiRepository: PackRat-AI/PackRat Length of output: 708 Use Line 90 uses bare Suggested fix- run: bun install
+ run: bun install --frozen-lockfile📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| # Confirm the key CLI tools installed by the workspace are usable. | ||||||
| # Scoped to cloud-agent-safe tasks (lint/typecheck/tests); no mobile simulator tooling. | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -72,7 +72,6 @@ jobs: | |||||
| uses: oven-sh/setup-bun@v2 | ||||||
| with: | ||||||
| bun-version: latest | ||||||
| cache: true | ||||||
|
|
||||||
| - name: Cache node_modules | ||||||
| uses: actions/cache@v4 | ||||||
|
|
@@ -85,7 +84,7 @@ jobs: | |||||
| - name: Install dependencies | ||||||
| env: | ||||||
| PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }} | ||||||
| run: bun install --frozen-lockfile | ||||||
| run: bun install | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restoring As per coding guidelines: "Prefer Proposed fix- run: bun install
+ run: bun install --frozen-lockfile📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| - name: Setup Expo | ||||||
| uses: expo/expo-github-action@v8 | ||||||
|
|
@@ -109,7 +108,15 @@ jobs: | |||||
| restore-keys: | | ||||||
| cocoapods-${{ runner.os }}- | ||||||
|
|
||||||
| - name: Cache iOS simulator build | ||||||
| id: ios-build-cache | ||||||
| uses: actions/cache@v4 | ||||||
| with: | ||||||
| path: apps/expo/build/PackRat-sim.tar.gz | ||||||
| key: ios-sim-${{ runner.os }}-${{ hashFiles('apps/expo/**', 'packages/**', 'bun.lock') }} | ||||||
|
|
||||||
| - name: Build iOS app for simulator | ||||||
| if: steps.ios-build-cache.outputs.cache-hit != 'true' | ||||||
| run: | | ||||||
| cd apps/expo | ||||||
| mkdir -p build | ||||||
|
|
@@ -324,7 +331,6 @@ jobs: | |||||
| uses: oven-sh/setup-bun@v2 | ||||||
| with: | ||||||
| bun-version: latest | ||||||
| cache: true | ||||||
|
|
||||||
| - name: Cache node_modules | ||||||
| uses: actions/cache@v4 | ||||||
|
|
@@ -337,7 +343,7 @@ jobs: | |||||
| - name: Install dependencies | ||||||
| env: | ||||||
| PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }} | ||||||
| run: bun install --frozen-lockfile | ||||||
| run: bun install | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issue: restore Proposed fix- run: bun install
+ run: bun install --frozen-lockfile📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| - name: Setup Expo | ||||||
| uses: expo/expo-github-action@v8 | ||||||
|
|
@@ -377,7 +383,15 @@ jobs: | |||||
| - name: Add Maestro to PATH | ||||||
| run: echo "${HOME}/.maestro/bin" >> "${GITHUB_PATH}" | ||||||
|
|
||||||
| - name: Cache Android APK build | ||||||
| id: android-build-cache | ||||||
| uses: actions/cache@v4 | ||||||
| with: | ||||||
| path: apps/expo/build/PackRat.apk | ||||||
| key: android-apk-${{ runner.os }}-${{ hashFiles('apps/expo/**', 'packages/**', 'bun.lock') }} | ||||||
|
|
||||||
| - name: Build Android APK for emulator | ||||||
| if: steps.android-build-cache.outputs.cache-hit != 'true' | ||||||
| run: | | ||||||
| cd apps/expo | ||||||
| mkdir -p build | ||||||
|
|
@@ -446,6 +460,14 @@ jobs: | |||||
| adb shell pm disable-user com.android.launcher3 || true | ||||||
| adb shell pm disable-user com.google.android.apps.nexuslauncher || true | ||||||
| adb install apps/expo/build/PackRat.apk | ||||||
| # Give System UI time to fully initialize before launching tests. | ||||||
| # The emulator's System UI can raise an ANR dialog ("System UI isn't | ||||||
| # responding") in the seconds after boot. Without this wait, Maestro | ||||||
| # starts while that dialog is still blocking the screen. | ||||||
| sleep 10 | ||||||
| # Dismiss any lingering ANR / crash dialogs left over from emulator boot | ||||||
| adb shell input keyevent KEYCODE_BACK 2>/dev/null || true | ||||||
| adb shell input keyevent KEYCODE_BACK 2>/dev/null || true | ||||||
| bash .github/scripts/e2e.sh android --format junit --output test-results/maestro-results.xml | ||||||
| env: | ||||||
| TEST_EMAIL: ${{ env.TEST_EMAIL }} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -44,7 +44,7 @@ jobs: | |||||
| - name: Install dependencies | ||||||
| env: | ||||||
| PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }} | ||||||
| run: bun install --frozen-lockfile | ||||||
| run: bun install | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n .github/workflows/migrations.yml | sed -n '40,55p'Repository: PackRat-AI/PackRat Length of output: 737 Use Line 47 should use Suggested fix- run: bun install
+ run: bun install --frozen-lockfile📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| - name: Determine target environment | ||||||
| id: env | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -39,7 +39,7 @@ jobs: | |||||
| echo "PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV | ||||||
|
|
||||||
| - name: Install dependencies | ||||||
| run: bun install --frozen-lockfile | ||||||
| run: bun install | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Check if the workflow file exists
fd -t f "sync-guides-r2.yml"Repository: PackRat-AI/PackRat Length of output: 44 🏁 Script executed: # If file exists, read the relevant section around line 42
if [ -f ".github/workflows/sync-guides-r2.yml" ]; then
echo "=== Line 42 and context (lines 35-50) ===";
sed -n '35,50p' .github/workflows/sync-guides-r2.yml | cat -n;
fiRepository: PackRat-AI/PackRat Length of output: 669 🏁 Script executed: # Also check if there are other bun install commands in the file
rg "bun install" .github/workflows/sync-guides-r2.yml -nRepository: PackRat-AI/PackRat Length of output: 90 Use frozen lockfile for immutable dependency resolution in CI. Line 42 uses bare Suggested fix- run: bun install
+ run: bun install --frozen-lockfile📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| timeout-minutes: 5 | ||||||
|
|
||||||
| - name: Sync guides to R2 bucket | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,7 @@ jobs: | |
| - name: Install dependencies | ||
| env: | ||
| PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }} | ||
| run: bun install --frozen-lockfile | ||
| run: bun install | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore lockfile immutability in CI installs. Using bare Proposed fix- run: bun install
+ run: bun install --frozen-lockfile
...
- run: bun install
+ run: bun install --frozen-lockfileAs per coding guidelines: " Also applies to: 88-88 🤖 Prompt for AI Agents |
||
|
|
||
| - name: Run API unit tests | ||
| run: bun run --cwd packages/api test:unit:coverage | ||
|
|
@@ -85,7 +85,7 @@ jobs: | |
| - name: Install dependencies | ||
| env: | ||
| PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN: ${{ secrets.PACKRAT_NATIVEWIND_UI_GITHUB_TOKEN }} | ||
| run: bun install --frozen-lockfile | ||
| run: bun install | ||
|
|
||
| - name: Run Expo unit tests | ||
| run: bun run --cwd apps/expo test:coverage | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,25 +3,81 @@ appId: ${APP_ID} | |
| # Login Flow: Navigate to auth screen and sign in with email and password | ||
| - launchApp | ||
|
|
||
| # Wait for the auth entry screen to appear | ||
| - waitForAnimationToEnd | ||
| # Dismiss Android ANR dialog that can appear during emulator boot before first interaction | ||
| - runFlow: | ||
| when: | ||
| platform: Android | ||
| commands: | ||
| - runFlow: | ||
| when: | ||
| visible: | ||
| text: "isn't responding" | ||
| commands: | ||
| - tapOn: | ||
| text: "Wait" | ||
| - waitForAnimationToEnd | ||
|
|
||
| # Wait for the auth entry screen — ensures sign-in button is rendered before tapping | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: "sign-in-email-button" | ||
| timeout: 15000 | ||
|
|
||
| # Tap the "Sign In" (email) button to navigate to the email login screen | ||
| - tapOn: | ||
| id: "sign-in-email-button" | ||
|
|
||
| # Wait for login form to appear | ||
| # Wait for login form to appear. | ||
| # auth/(login) is presented as a modal; waitForAnimationToEnd alone is not | ||
| # sufficient — the XCTest accessibility tree may not include the modal until | ||
| # the presentation animation fully settles. extendedWaitUntil polls until | ||
| # the field is accessible, giving the modal time to fully render. | ||
| # iOS 26 / slow CI: the app startup takes ~10s before sign-in-button appears; | ||
| # by the time the modal opens we may have little budget left. Use 35s here. | ||
| - runFlow: | ||
| when: | ||
| platform: iOS | ||
| commands: | ||
| - extendedWaitUntil: | ||
| visible: | ||
| text: "Email" | ||
| timeout: 35000 | ||
| - waitForAnimationToEnd | ||
|
|
||
| # Fill in the email field | ||
| - tapOn: | ||
| id: "email-input" | ||
| - inputText: "${TEST_EMAIL}" | ||
| # Fill in the email field. | ||
| # iOS: NativeWindUI's TextField inside accessible={false} FormSection doesn't expose | ||
| # testID to Maestro's XCTest snapshot, so we match the placeholder text instead. | ||
| # Android: testID maps reliably to resource-id. | ||
| - runFlow: | ||
| when: | ||
| platform: iOS | ||
| commands: | ||
| - tapOn: | ||
| text: "Email" | ||
| - inputText: "${TEST_EMAIL}" | ||
| - runFlow: | ||
| when: | ||
| platform: Android | ||
| commands: | ||
| - tapOn: | ||
| id: "email-input" | ||
| - inputText: "${TEST_EMAIL}" | ||
|
|
||
| # Fill in the password field | ||
| - tapOn: | ||
| id: "password-input" | ||
| - inputText: ${TEST_PASSWORD} | ||
| - runFlow: | ||
| when: | ||
| platform: iOS | ||
| commands: | ||
| - tapOn: | ||
| text: "Password" | ||
| - inputText: ${TEST_PASSWORD} | ||
| - runFlow: | ||
| when: | ||
| platform: Android | ||
| commands: | ||
| - tapOn: | ||
| id: "password-input" | ||
| - inputText: ${TEST_PASSWORD} | ||
|
|
||
| # Dismiss the keyboard before submitting | ||
| - hideKeyboard | ||
|
|
@@ -33,6 +89,20 @@ appId: ${APP_ID} | |
| # Wait for navigation to complete — login can take a few seconds | ||
| - waitForAnimationToEnd | ||
|
|
||
| # Handle transient network error: if the API call failed (e.g. "Network request | ||
| # failed" dialog), dismiss the alert and retry once with the same credentials. | ||
| - runFlow: | ||
| when: | ||
| visible: | ||
| text: "Network request failed" | ||
| commands: | ||
| - tapOn: | ||
| text: "OK" | ||
| - waitForAnimationToEnd | ||
| - tapOn: | ||
| id: "continue-button" | ||
| - waitForAnimationToEnd | ||
|
Comment on lines
+92
to
+104
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: In Maestro YAML, runFlow with when: visible evaluates the condition once when the command is reached in the flow execution. If false, it skips the runFlow and continues to the next command without waiting or polling. This differs from assertions like assertVisible, which poll the UI for up to 7 seconds (retrying if initially not visible). The recommended pattern for handling an alert that may appear asynchronously after a submit action is to use runFlow with when: visible on the alert element right after the submit. This checks if the alert is present at that moment (after any automatic waits from prior commands) and dismisses it if visible, skipping silently if not. Example: - tapOn: "Submit" - runFlow: when: visible: "Alert Title" # or reliable selector for alert commands: - tapOn: "Dismiss" # or handle alert For alerts taking longer, precede with assertVisible on expected post-submit content or use extendedWaitUntil first, but for optional alerts, the conditional runFlow is idiomatic and prevents flakiness. Citations:
The
🤖 Prompt for AI Agents |
||
|
|
||
| # iOS only: dismiss the system "Save Password?" Keychain prompt that appears | ||
| # after submitting any form with a password field (textContentType="password"). | ||
| # This prompt is a blocking OS-level dialog and would intercept subsequent taps | ||
|
|
@@ -46,14 +116,13 @@ appId: ${APP_ID} | |
| optional: true | ||
| label: "Dismiss iOS Save Password prompt" | ||
|
|
||
| # Wait for the main tab bar to appear — confirms we are logged in and on the main app. | ||
| # We only assert the tab bar is visible here; navigation to specific tabs is left to | ||
| # subsequent flows (dashboard-tiles-flow taps Packs, providing a stable entry point for | ||
| # create-pack-flow). Navigating to Packs directly after login is unreliable on iOS | ||
| # because Expo Router's post-login routing is still settling at this point. | ||
| - waitForAnimationToEnd | ||
| - extendedWaitUntil: | ||
| visible: | ||
| text: "Packs" | ||
| timeout: 15000 | ||
|
|
||
| # Assert we are now logged in by navigating to Packs and verifying a stable testID | ||
| - tapOn: | ||
| text: "Packs" | ||
| - waitForAnimationToEnd | ||
| - assertVisible: | ||
| id: "create-pack-button" | ||
| timeout: 35000 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cat -n .github/workflows/api-tests.yml | head -50Repository: PackRat-AI/PackRat
Length of output: 1519
Use frozen lockfile for API test workflow installs.
Line 38 uses bare
bun installwhich allows mutable dependency versions in CI. Add--frozen-lockfileto ensure reproducible builds.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents