Skip to content

Commit d0b8be5

Browse files
authored
test: improve some scenario for test devices (#6590)
1 parent 26937b4 commit d0b8be5

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

.github/workflows/maestro-ios.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,33 @@ jobs:
3838
defaults write com.apple.iphonesimulator DisableShadows -bool true
3939
4040
- name: Boot Simulator
41+
timeout-minutes: 30
4142
run: |
42-
xcrun simctl boot "iPhone 16 Pro Max"
43-
xcrun simctl bootstatus "iPhone 16 Pro Max" -b
43+
SIM_NAME="iPhone 16 Pro Max"
44+
TIMEOUT=300 # 5 minutes in seconds
45+
INTERVAL=5 # Check every 5 seconds
46+
47+
xcrun simctl boot "$SIM_NAME" || true
48+
49+
ELAPSED=0
50+
while true; do
51+
BOOTED=$(xcrun simctl list devices | grep "$SIM_NAME (" | grep "(Booted)")
52+
if [ -n "$BOOTED" ]; then
53+
echo "$SIM_NAME is booted"
54+
break
55+
fi
56+
57+
if [ $ELAPSED -ge $TIMEOUT ]; then
58+
echo "Simulator did not boot within 5 minutes. Retrying..."
59+
xcrun simctl shutdown "$SIM_NAME"
60+
xcrun simctl boot "$SIM_NAME"
61+
ELAPSED=0
62+
fi
63+
64+
sleep $INTERVAL
65+
ELAPSED=$((ELAPSED + INTERVAL))
66+
done
67+
4468
xcrun simctl list devices | grep Booted
4569

4670
- name: Get Simulator UDID

.maestro/helpers/launch-app.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@ tags:
1212
all: allow
1313
- waitForAnimationToEnd:
1414
timeout: 60000
15+
- runFlow:
16+
when:
17+
visible: '.*Pixel Launcher.*'
18+
commands:
19+
- tapOn: 'Close App'
1520
- assertVisible: 'Add workspace'

0 commit comments

Comments
 (0)