Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .maestro/tests/room/mark-as-unread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tags:
timeout: 60000
- extendedWaitUntil:
visible:
text: '.*1.*'
id: 'unread-badge-1'
childOf:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000
110 changes: 110 additions & 0 deletions .maestro/tests/room/unread-badge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
appId: chat.rocket.reactnative
name: Unread badge
onFlowStart:
- runFlow: '../../helpers/setup.yaml'
tags:
- test-13

---
- evalScript: ${output.user = output.utils.createUser()}
- evalScript: ${output.otherUser = output.utils.createUser()}

- runFlow:
file: '../../helpers/login-with-deeplink.yaml'
env:
USERNAME: ${output.user.username}
PASSWORD: ${output.user.password}
Comment on lines +1 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add cleanup step for created users.

The test creates users but doesn't clean them up. The mark-as-unread.yaml test includes an onFlowComplete hook to delete created users, which should be added here as well.

Add this after line 4:

 onFlowStart:
   - runFlow: '../../helpers/setup.yaml'
+onFlowComplete:
+  - evalScript: ${output.utils.deleteCreatedUsers()}
 tags:
   - test-13
🤖 Prompt for AI Agents
In .maestro/tests/room/unread-badge.yaml around lines 1 to 16, add an
onFlowComplete hook immediately after line 4 that runs the same cleanup flow
used in mark-as-unread.yaml to delete the created users; specifically invoke the
helper cleanup flow and pass the created users (output.user and
output.otherUser) via env (usernames/passwords or identifiers) so both users are
removed when the test finishes.


# Should have normal unread indicator on normal message
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, 'message-mark-as-unread')}
- extendedWaitUntil:
visible:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000
- extendedWaitUntil:
visible:
id: 'unread-badge-1'
childOf:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000
- tapOn:
id: 'rooms-list-view-item-${output.otherUser.username}'
- tapOn:
id: header-back
- extendedWaitUntil:
notVisible:
id: 'unread-badge-1'
childOf:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000

# Should have mention unread indicator on mentioned message
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, '@' + output.user.username)}
- extendedWaitUntil:
visible:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000
- extendedWaitUntil:
visible:
id: 'mention-badge-1'
childOf:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000
- tapOn:
id: 'rooms-list-view-item-${output.otherUser.username}'
- tapOn:
id: header-back
- extendedWaitUntil:
notVisible:
id: 'mention-badge-1'
childOf:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000

# send normal message first and mention in next message and it should show mentioned unread indicator
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, 'message-mark-as-unread')}
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, '@' + output.user.username)}
- extendedWaitUntil:
visible:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000
- extendedWaitUntil:
visible:
id: 'mention-badge-2'
childOf:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000
- tapOn:
id: 'rooms-list-view-item-${output.otherUser.username}'
- tapOn:
id: header-back
- extendedWaitUntil:
notVisible:
id: 'mention-badge-2'
childOf:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000

# send mention message first and normal message in next message and it should show mentioned unread indicator
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, '@' + output.user.username)}
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, 'message-mark-as-unread')}
- extendedWaitUntil:
visible:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000
- extendedWaitUntil:
visible:
id: 'mention-badge-2'
childOf:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000
- tapOn:
id: 'rooms-list-view-item-${output.otherUser.username}'
- tapOn:
id: header-back
- extendedWaitUntil:
notVisible:
id: 'mention-badge-2'
childOf:
id: 'rooms-list-view-item-${output.otherUser.username}'
timeout: 60000
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ exports[`Story Snapshots: Badge should match snapshot 1`] = `
},
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -319,6 +320,7 @@ exports[`Story Snapshots: Badge should match snapshot 1`] = `
},
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -434,6 +436,7 @@ exports[`Story Snapshots: Badge should match snapshot 1`] = `
},
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -3703,6 +3706,7 @@ exports[`Story Snapshots: Themes should match snapshot 1`] = `
},
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -4258,6 +4262,7 @@ exports[`Story Snapshots: Themes should match snapshot 1`] = `
},
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -4813,6 +4818,7 @@ exports[`Story Snapshots: Themes should match snapshot 1`] = `
},
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down
18 changes: 18 additions & 0 deletions app/containers/RoomItem/__snapshots__/RoomItem.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
undefined,
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -1966,6 +1967,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
undefined,
]
}
testID="unread-badge-+999"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -2644,6 +2646,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
undefined,
]
}
testID="mention-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -3322,6 +3325,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
undefined,
]
}
testID="group-mention-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -4000,6 +4004,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
undefined,
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -4678,6 +4683,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
undefined,
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -5356,6 +5362,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
undefined,
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -6034,6 +6041,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
undefined,
]
}
testID="mention-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -6712,6 +6720,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
undefined,
]
}
testID="group-mention-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -7390,6 +7399,7 @@ exports[`Story Snapshots: Alerts should match snapshot 1`] = `
undefined,
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -8699,6 +8709,7 @@ exports[`Story Snapshots: CondensedRoomItem should match snapshot 1`] = `
undefined,
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -9377,6 +9388,7 @@ exports[`Story Snapshots: CondensedRoomItem should match snapshot 1`] = `
undefined,
]
}
testID="unread-badge-+999"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -10663,6 +10675,7 @@ exports[`Story Snapshots: CondensedRoomItemWithoutAvatar should match snapshot 1
undefined,
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -12507,6 +12520,7 @@ exports[`Story Snapshots: ExpandedRoomItemWithoutAvatar should match snapshot 1`
undefined,
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -13175,6 +13189,7 @@ exports[`Story Snapshots: ExpandedRoomItemWithoutAvatar should match snapshot 1`
undefined,
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -17133,6 +17148,7 @@ exports[`Story Snapshots: LastMessage should match snapshot 1`] = `
undefined,
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -17842,6 +17858,7 @@ exports[`Story Snapshots: LastMessage should match snapshot 1`] = `
undefined,
]
}
testID="unread-badge-+999"
>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -18551,6 +18568,7 @@ exports[`Story Snapshots: LastMessage should match snapshot 1`] = `
undefined,
]
}
testID="unread-badge-1"
>
<Text
numberOfLines={1}
Expand Down
Loading
Loading