diff --git a/.maestro/tests/room/mark-as-unread.yaml b/.maestro/tests/room/mark-as-unread.yaml index 7507549c2fc..dbceb3d4c66 100644 --- a/.maestro/tests/room/mark-as-unread.yaml +++ b/.maestro/tests/room/mark-as-unread.yaml @@ -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 diff --git a/.maestro/tests/room/unread-badge.yaml b/.maestro/tests/room/unread-badge.yaml new file mode 100644 index 00000000000..b095ade4440 --- /dev/null +++ b/.maestro/tests/room/unread-badge.yaml @@ -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} + +# 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 diff --git a/app/containers/Header/components/HeaderButton/__snapshots__/HeaderButtons.test.tsx.snap b/app/containers/Header/components/HeaderButton/__snapshots__/HeaderButtons.test.tsx.snap index ec296cc2f6e..938b20fc972 100644 --- a/app/containers/Header/components/HeaderButton/__snapshots__/HeaderButtons.test.tsx.snap +++ b/app/containers/Header/components/HeaderButton/__snapshots__/HeaderButtons.test.tsx.snap @@ -204,6 +204,7 @@ exports[`Story Snapshots: Badge should match snapshot 1`] = ` }, ] } + testID="unread-badge-1" > + ]} + testID={testId}> {text}