From d8898e321d9c1f82351fd1e0619229be6cdd6ed2 Mon Sep 17 00:00:00 2001 From: Jessica Schelly Souza Date: Mon, 13 Jul 2026 18:24:50 -0300 Subject: [PATCH 1/2] test: add Maestro coverage for reporting messages --- .maestro/scripts/data-setup.js | 23 +++++++- .maestro/tests/room/report-message.yaml | 72 +++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 .maestro/tests/room/report-message.yaml diff --git a/.maestro/scripts/data-setup.js b/.maestro/scripts/data-setup.js index 59d044b4326..2c34403251b 100644 --- a/.maestro/scripts/data-setup.js +++ b/.maestro/scripts/data-setup.js @@ -81,7 +81,7 @@ const deleteCreatedUser = async ({ username: usernameToDelete }) => { } }); - const userId = json(result.body)?.data?.user?._id; + const userId = json(result.body)?.user?._id; postWithRetry(`${data.server}/api/v1/users.delete`, { headers: { 'Content-Type': 'application/json', @@ -205,6 +205,24 @@ const deleteCreatedUsers = () => { } }; +const deleteReportedMessages = (username, password) => { + try { + const { userId } = login(username, password); + + login(output.account.adminUser, output.account.adminPassword); + + postWithRetry(`${data.server}/api/v1/moderation.user.deleteReportedMessages`, { + headers: { + 'Content-Type': 'application/json', + ...headers + }, + body: JSON.stringify({ userId }) + }); + } catch (error) { + console.log(JSON.stringify(error)); + } +}; + function logAccounts() { console.log(JSON.stringify(data.accounts)); } @@ -260,8 +278,9 @@ output.utils = { createRandomRoom, sendMessage, getProfileInfo, + deleteReportedMessages, post, login, getDeepLink, createDM -}; \ No newline at end of file +}; diff --git a/.maestro/tests/room/report-message.yaml b/.maestro/tests/room/report-message.yaml new file mode 100644 index 00000000000..e296b2858e4 --- /dev/null +++ b/.maestro/tests/room/report-message.yaml @@ -0,0 +1,72 @@ +appId: ${APP_ID} +name: Report Message +onFlowStart: + - runFlow: '../../helpers/setup.yaml' +onFlowComplete: + - evalScript: ${output.otherUser && output.utils.deleteReportedMessages(output.otherUser.username, output.otherUser.password)} + - evalScript: ${output.utils.deleteCreatedUsers()} +tags: + - test-10 + +--- +- evalScript: ${output.user = output.utils.createUser()} +- evalScript: ${output.otherUser = output.utils.createUser()} +- evalScript: ${output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, 'message-to-report')} + +- runFlow: + file: '../../helpers/login-with-deeplink.yaml' + env: + USERNAME: ${output.user.username} + PASSWORD: ${output.user.password} +- runFlow: + file: '../../helpers/navigate-to-room.yaml' + env: + ROOM: ${output.otherUser.username} + +# should report another user's message +- extendedWaitUntil: + visible: + id: 'message-content-message-to-report' + timeout: 60000 +- longPressOn: + id: 'message-content-message-to-report' +- extendedWaitUntil: + visible: + id: action-sheet + timeout: 60000 +- swipe: + from: + id: action-sheet-handle + direction: UP +- scrollUntilVisible: + element: + id: message-actions-report +- tapOn: + id: message-actions-report +- extendedWaitUntil: + visible: + text: 'Message reported' + timeout: 60000 +- tapOn: 'OK' + +# should not report own message +- runFlow: + file: '../../helpers/send-message.yaml' + env: + message: 'own-message-to-report' +- runFlow: '../../helpers/hide-keyboard.yaml' +- longPressOn: + id: 'message-content-own-message-to-report' +- extendedWaitUntil: + visible: + id: action-sheet + timeout: 60000 +- swipe: + from: + id: action-sheet-handle + direction: UP +- scrollUntilVisible: + element: + id: message-actions-delete +- assertNotVisible: + id: message-actions-report From 4dc210be44057578c4069f0cd6cf9ef7239c17e9 Mon Sep 17 00:00:00 2001 From: Jessica Schelly Souza Date: Mon, 13 Jul 2026 18:29:25 -0300 Subject: [PATCH 2/2] test: separate Maestro user cleanup fix --- .maestro/scripts/data-setup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.maestro/scripts/data-setup.js b/.maestro/scripts/data-setup.js index 2c34403251b..2e5382afb61 100644 --- a/.maestro/scripts/data-setup.js +++ b/.maestro/scripts/data-setup.js @@ -81,7 +81,7 @@ const deleteCreatedUser = async ({ username: usernameToDelete }) => { } }); - const userId = json(result.body)?.user?._id; + const userId = json(result.body)?.data?.user?._id; postWithRetry(`${data.server}/api/v1/users.delete`, { headers: { 'Content-Type': 'application/json',