-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: iOS Maestro test fix #6700
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
7f57e40
3511beb
2ec688c
ab6298a
070672d
d3decea
1c60a8f
447347e
00ead1c
b932ef4
894a8d6
3fa8084
72aac26
b11b611
1e8b205
d5e78df
769ad49
a687d6a
1a88a2a
46dc6f4
2a61582
9252979
3f9ebb3
9f01847
fa21bb7
abc3d74
3d8f7e4
8872b9c
d6e318a
47ebea3
e4029ee
c22d2d3
7ca6def
d6b6fc4
479e7ac
cac7b5b
a627d2b
1d8dfcf
ecb5ce7
b8e8b45
012bb80
f9a6a3d
1f43efb
376de2c
2d2c70f
c38ee70
765b1ae
5a4800b
965dc06
59243c3
f37790f
eb8f4a6
74c6e42
cfa3bd1
30df2de
e22ee41
b2ad53f
24869f6
a43fcfd
42ddb23
d86e8e3
296d94d
554db10
aa241c6
a2a48dc
a4844e9
49136c1
758ae87
9d9015d
dda2355
686ccf4
a40c135
ebdc51e
1d809ee
4b44522
8345a7f
c6765f9
caa033f
a3b3aa6
83c51bb
916dcfe
55a7f40
5e03656
8879b8c
1522475
5b7bc84
3e537cf
4857c93
2360d61
1db9493
11427f5
d2428d5
1416a4c
efaeb36
36bd063
1e63589
4893416
17f3a86
c0dece6
892a5a3
b73383a
5b92a84
5ef3dbf
d59ac72
a91bfd4
c25a85b
f2f5624
1e71e7b
2ba9216
9184a4c
c4aa879
499f9f8
90cb5c3
5e65da3
87e5109
90ffb51
7207f01
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 |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| appId: chat.rocket.reactnative | ||
| name: Hide Keyboard | ||
| tags: | ||
| - 'util' | ||
|
|
||
| --- | ||
| - runFlow: | ||
| when: | ||
| platform: android | ||
| commands: | ||
| - hideKeyboard | ||
| - runFlow: | ||
| when: | ||
| platform: iOS | ||
| commands: | ||
| - tapOn: | ||
| point: 1%,20% | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,8 @@ tags: | |
| - 'util' | ||
|
|
||
| --- | ||
| - runFlow: | ||
| when: | ||
| true: CLEAR_STATE | ||
| platform: android | ||
| commands: | ||
| - clearState | ||
| - stopApp: chat.rocket.reactnative | ||
| - clearState | ||
| - stopApp: chat.rocket.reactnative | ||
| - evalScript: ${output.login = output.utils.login(USERNAME, PASSWORD)} | ||
| - runFlow: | ||
| file: 'open-deeplink.yaml' | ||
|
|
@@ -36,6 +31,13 @@ tags: | |
| - assertNotVisible: | ||
| text: '.*Allow.*' | ||
| optional: true | ||
| - runFlow: | ||
| when: | ||
| visible: '.*Would like to send you notifications.*' | ||
| platform: iOS | ||
| commands: | ||
| - tapOn: | ||
| point: 65%,60% | ||
|
Comment on lines
+34
to
+40
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. Hardcoded iOS coordinate for notification permission is fragile. Similar to the keyboard helper, this iOS notification flow uses a hardcoded coordinate
Android uses text matching ( 🤖 Prompt for AI Agents |
||
| - extendedWaitUntil: | ||
| visible: | ||
| id: 'rooms-list-view' | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,15 @@ tags: | |
| - tapOn: | ||
| id: 'settings-logout' | ||
|
|
||
| - extendedWaitUntil: | ||
| visible: | ||
| text: '.*You will be logged out of this application.*' | ||
| timeout: 60000 | ||
|
|
||
| - assertVisible: | ||
| text: Logout | ||
| index: 0 | ||
|
|
||
| - runFlow: | ||
| when: | ||
| platform: Android | ||
|
|
@@ -60,10 +69,9 @@ tags: | |
| platform: iOS | ||
| commands: | ||
| - tapOn: | ||
| text: Logout | ||
| index: 1 | ||
| point: '65%,56%' | ||
|
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. Replace coordinate-based tap with id-based selector. The coordinate-based tap ( Consider exposing a testID for the iOS logout button in the confirmation dialog and using it here, similar to how Android targets the button by text. This would make the test more maintainable and aligned across platforms. 🤖 Prompt for AI Agents |
||
|
|
||
| - extendedWaitUntil: | ||
| visible: | ||
| id: 'new-server-view' | ||
| timeout: 60000 | ||
| timeout: 5000 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,4 +11,11 @@ tags: | |
| visible: '.*Open in.*' | ||
| platform: iOS | ||
| commands: | ||
| - tapOn: Open | ||
| - tapOn: | ||
| text: Open | ||
| index: 0 | ||
| optional: true | ||
| - tapOn: | ||
| text: Open | ||
| index: 1 | ||
| optional: true | ||
|
Comment on lines
+14
to
+21
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. Index-based multi-tap sequencing is fragile; clarify the intent and add documentation. Lines 14–21 replace a single tap with two sequential taps at different indices. This suggests handling multiple "Open" buttons in a share sheet, but the intent is unclear:
Recommendation: Add an inline comment explaining the scenario (e.g., "iOS 15+ share sheet can show multiple 'Open' buttons; we tap both as fallback") and consider whether a text pattern or visibility condition would be more resilient. 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,7 +43,8 @@ tags: | |
| visible: | ||
| id: 'create-discussion-view' | ||
| timeout: 60000 | ||
| - tapOn: 'Select a channel' | ||
| - tapOn: | ||
| id: 'create-discussion-select-channel' | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: 'action-sheet' | ||
|
|
@@ -141,7 +142,7 @@ tags: | |
| timeout: 60000 | ||
| - extendedWaitUntil: | ||
| visible: | ||
| text: ${output.room.name} | ||
| text: .*${output.room.name}.* | ||
| timeout: 60000 | ||
|
Comment on lines
143
to
146
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 chainInconsistent selector strategy: line 145 retains text-based regex while rest of file uses id-based selectors. Line 145 uses Is there a reason this element cannot be targeted by a stable testID, or is this an oversight during refactoring? 🏁 Script executed: #!/bin/bash
# View the discussion.yaml file with line numbers to verify selector patterns
cat -n .maestro/tests/room/discussion.yaml | sed -n '40,55p; 125,150p; 310,325p'Length of output: 1748 🏁 Script executed: #!/bin/bash
# Get overall statistics on selector usage in the file
echo "=== Text-based selectors (text:) ==="
rg -n "^\s+text:" .maestro/tests/room/discussion.yaml | head -20
echo ""
echo "=== ID-based selectors (id:) ==="
rg -n "^\s+id:" .maestro/tests/room/discussion.yaml | head -20
echo ""
echo "=== Total line count ==="
wc -l .maestro/tests/room/discussion.yamlLength of output: 1154 Fix two selector inconsistencies to complete migration to id-based selectors:
🤖 Prompt for AI Agents |
||
| - tapOn: | ||
| id: multi-select-discussion-name | ||
|
|
@@ -313,10 +314,10 @@ tags: | |
| # should navigate to discussion | ||
| - extendedWaitUntil: | ||
| visible: | ||
| text: .*${output.discussionFromNewMessage}.* | ||
| id: 'discussions-view-${output.discussionFromNewMessage}' | ||
| timeout: 60000 | ||
| - tapOn: | ||
| text: .*${output.discussionFromNewMessage}.* | ||
| id: 'discussions-view-${output.discussionFromNewMessage}' | ||
| - extendedWaitUntil: | ||
| visible: | ||
| id: 'room-view-title-${output.discussionFromNewMessage}' | ||
|
|
||
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.
Hardcoded iOS coordinate is fragile and may not work across device sizes or orientations.
The iOS keyboard dismissal uses a hardcoded coordinate
point: 1%,20%instead of an element selector. This approach is brittle because:Consider using an id-based selector or a visibility condition if an appropriate element is available, or document why the coordinate is stable (e.g., "taps outside all interactive elements").