Skip to content

text: migrated room test from detox to maestro#6598

Merged
diegolmello merged 39 commits intodevelopfrom
maestro-more-room-test
Sep 16, 2025
Merged

text: migrated room test from detox to maestro#6598
diegolmello merged 39 commits intodevelopfrom
maestro-more-room-test

Conversation

@Rohit3523
Copy link
Contributor

@Rohit3523 Rohit3523 commented Aug 26, 2025

Proposed changes

  1. Migrate Room Test
  2. Move Create-Room test to tests folder

Working action link: https://github.com/RocketChat/Rocket.Chat.ReactNative/actions/runs/17764602508/job/50486819800

Android:
Screenshot 2025-09-16 at 9 54 40 PM

iOS:
Screenshot 2025-09-16 at 9 55 13 PM

Note: it is failing on iOS

Issue(s)

https://rocketchat.atlassian.net/browse/NATIVE-967

How to test or reproduce

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

@Rohit3523 Rohit3523 temporarily deployed to approve_e2e_testing August 26, 2025 19:24 — with GitHub Actions Inactive
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build August 26, 2025 19:27 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build August 26, 2025 19:27 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to official_android_build August 26, 2025 19:27 — with GitHub Actions Error
@Rohit3523 Rohit3523 temporarily deployed to approve_e2e_testing August 26, 2025 20:45 — with GitHub Actions Inactive
@Rohit3523 Rohit3523 had a problem deploying to official_android_build August 26, 2025 20:48 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build August 26, 2025 20:48 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build August 26, 2025 20:48 — with GitHub Actions Error
@Rohit3523 Rohit3523 temporarily deployed to approve_e2e_testing August 27, 2025 06:43 — with GitHub Actions Inactive
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build August 27, 2025 06:47 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to official_android_build August 27, 2025 06:47 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build August 27, 2025 06:47 — with GitHub Actions Error
@Rohit3523 Rohit3523 temporarily deployed to approve_e2e_testing August 27, 2025 15:02 — with GitHub Actions Inactive
@Rohit3523 Rohit3523 temporarily deployed to approve_e2e_testing August 27, 2025 15:04 — with GitHub Actions Inactive
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (6)
.maestro/tests/room/room.yaml (6)

80-99: Avoid hardcoding #general; use the created room to reduce env coupling.

Some workspaces don’t have General or it’s restricted.

-- inputText: '#general'
+- inputText: '#${output.room.name}'
 ...
-- extendedWaitUntil:
-    visible:
-      id: 'autocomplete-item-general'
+- extendedWaitUntil:
+    visible:
+      id: 'autocomplete-item-${output.room.name}'
 ...
-- tapOn:
-    id: 'autocomplete-item-general'
+- tapOn:
+    id: 'autocomplete-item-${output.room.name}'
 ...
-- extendedWaitUntil:
-    visible:
-      text: '#general '
+- extendedWaitUntil:
+    visible:
+      text: '#${output.room.name} '
 ...
-- extendedWaitUntil:
-    notVisible:
-      id: 'autocomplete-item-general'
+- extendedWaitUntil:
+    notVisible:
+      id: 'autocomplete-item-${output.room.name}'

211-220: Prefer a wait over an immediate assert to reduce flakes.

Switch to an explicit wait before tapping the add‑reaction button.

-# should show reaction picker on add reaction button pressed and have frequently used emoji
-- assertVisible:
-    id: message-add-reaction
+# should show reaction picker on add reaction button pressed and have frequently used emoji
+- extendedWaitUntil:
+    visible:
+      id: message-add-reaction
+    timeout: 60000

12-15: Resource cleanup: consider deleting created rooms too.

You delete users on teardown; rooms created by those users may persist depending on server policies.

Option: track created room IDs in utils and delete them in onFlowEnd.


104-138: Quote regex strings for YAML safety.

Unquoted patterns like .${…}. can be misparsed by some YAML parsers; quoting improves robustness.

Example:

-      text: .*${output.randomMessage}.*
+      text: '.*${output.randomMessage}.*'

Apply similarly to other regex-like text matchers.


499-531: Draft verification: assert composer is cleared after send.

Current check could pass on message bubble; add a negative check on the composer to ensure no residual draft.

 - tapOn:
     id: 'message-composer-send'
 - extendedWaitUntil:
     visible:
       text: '.*draft.*'
     timeout: 60000
+- extendedWaitUntil:
+    notVisible:
+      id: message-composer-input
+      # composer should not contain the draft anymore
+    timeout: 60000

139-175: Emoji IDs can diverge across platforms/skins.

If iOS failures persist here, consider falling back to searching by shortcode text first, then tapping the first result, instead of hardcoding emoji-* IDs.

I can extract a helper flow (select-emoji.yaml) that searches and taps by shortcode for cross‑platform stability.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c544a32 and e4a19a7.

📒 Files selected for processing (1)
  • .maestro/tests/room/room.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: E2E Build iOS / ios-build
  • GitHub Check: E2E Build Android / android-build
  • GitHub Check: ESLint and Test / run-eslint-and-test
🔇 Additional comments (1)
.maestro/tests/room/room.yaml (1)

265-285: iOS a11y: confirm header testID maps to accessibilityIdentifier.

If failing on iOS, ensure the header component sets testID on the native touchable and doesn’t get shadowed by nested views.

If needed, I can draft a small patch in the header component to set accessibilityIdentifier/testID explicitly.

Comment on lines +416 to +419
from:
id: action-sheet-handle
direction: UP
- scrollUntilVisible:
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 16, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix swipe direction casing.

Maestro expects lowercase directions; this will no-op and stall the test.

-    direction: UP
+    direction: up
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
from:
id: action-sheet-handle
direction: UP
- scrollUntilVisible:
from:
id: action-sheet-handle
direction: up
- scrollUntilVisible:
🤖 Prompt for AI Agents
In .maestro/tests/room/room.yaml around lines 416 to 419 the swipe direction is
uppercased ("UP") which Maestro ignores; change the direction value to lowercase
("up") and scan nearby steps to ensure any other direction values use lowercase
as well so the gesture executes correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://docs.maestro.dev/api-reference/commands/swipe

It accepts uppercase not lowercase

Copy link
Contributor

Choose a reason for hiding this comment

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

. The code as written with direction: UP is correct and will work properly.

Thank you for the correction and providing the documentation link. Your implementation is fine as-is.

🐰💡


✏️ Learnings added
Learnt from: Rohit3523
PR: RocketChat/Rocket.Chat.ReactNative#6598
File: .maestro/tests/room/room.yaml:416-419
Timestamp: 2025-09-16T12:13:16.902Z
Learning: Maestro swipe command accepts uppercase direction values: UP, DOWN, LEFT, RIGHT (not lowercase as incorrectly suggested). The official documentation shows examples using uppercase direction values.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@Rohit3523 Rohit3523 changed the title chore: migrated room test from detox to maestro text: migrated room test from detox to maestro Sep 16, 2025
@Rohit3523 Rohit3523 marked this pull request as ready for review September 16, 2025 16:26
@diegolmello diegolmello merged commit 2dc07bd into develop Sep 16, 2025
5 of 8 checks passed
@diegolmello diegolmello deleted the maestro-more-room-test branch September 16, 2025 17:01
@diegolmello diegolmello had a problem deploying to experimental_ios_build September 16, 2025 17:03 — with GitHub Actions Failure
@diegolmello diegolmello had a problem deploying to experimental_android_build September 16, 2025 17:03 — with GitHub Actions Failure
@diegolmello diegolmello had a problem deploying to official_android_build September 16, 2025 17:03 — with GitHub Actions Failure
@coderabbitai coderabbitai bot mentioned this pull request Sep 17, 2025
10 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 6, 2025
10 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 15, 2025
10 tasks
@coderabbitai coderabbitai bot mentioned this pull request Dec 18, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants