Skip to content

test: 2nd set of room test in maestro#6606

Merged
diegolmello merged 14 commits intodevelopfrom
chore-maestro-room-test
Sep 24, 2025
Merged

test: 2nd set of room test in maestro#6606
diegolmello merged 14 commits intodevelopfrom
chore-maestro-room-test

Conversation

@Rohit3523
Copy link
Contributor

@Rohit3523 Rohit3523 commented Aug 27, 2025

Proposed changes

This PR migrates the following room test to Maestro

  1. Share Message
  2. Ignore User

Working action link: https://github.com/RocketChat/Rocket.Chat.ReactNative/actions/runs/17772522243

Android:
Screenshot 2025-09-17 at 6 36 00 PM

iOS:
Screenshot 2025-09-17 at 6 36 48 PM

Note: Both tests are failing on iOS and i will fix it in future PR

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

Further comments

Summary by CodeRabbit

  • New Features

    • None
  • Tests

    • Added end-to-end coverage for ignoring/unignoring users, blocking/unblocking, message visibility toggling, and reporting from DMs and channels.
    • Added end-to-end flow for forwarding a room message to another user, including multi-select and verification steps.
    • Introduced a reusable navigation flow to reach the room info view.
  • Style

    • Standardized string quoting in test definitions with no behavioral impact.

@Rohit3523 Rohit3523 temporarily deployed to approve_e2e_testing August 28, 2025 15:30 — with GitHub Actions Inactive
@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build August 28, 2025 21:48 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build August 28, 2025 21:48 — with GitHub Actions Error
@Rohit3523 Rohit3523 had a problem deploying to official_android_build August 28, 2025 21:48 — with GitHub Actions Error
@Rohit3523 Rohit3523 changed the title chore: more room test chore: migrate 2 tests from detox to maestro Aug 29, 2025
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build September 17, 2025 12:29 — with GitHub Actions Error
@Rohit3523 Rohit3523 marked this pull request as ready for review September 17, 2025 13:08
@Rohit3523 Rohit3523 changed the title chore: migrate 2 tests from detox to maestro test: 2nd set of room test in maestro Sep 17, 2025
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: 1

🧹 Nitpick comments (8)
.maestro/tests/room/share-message.yaml (4)

91-93: Use expression interpolation for dynamic id to avoid literal '${...}' rendering.

Safer to build the id via eval-style interpolation (consistent with create-room.yaml).

-      id: 'room-view-title-${output.room.name}'
+      id: ${'room-view-title-' + output.room.name}

72-77: Quote/interpolate complex id for reliability.

Parentheses and braces in unquoted YAML scalars can be finicky across formatters. Build the id explicitly.

-      id: multi-select-item-${output.otherUser.username.toLowerCase()}
+      id: ${'multi-select-item-' + output.otherUser.username.toLowerCase()}

41-47: Stabilize long-press on iOS.

iOS can require a longer press. Specify duration to reduce flakes.

-- longPressOn: 'Hello room'
+- longPressOn:
+    text: 'Hello room'
+    durationMs: 800

1-18: Add teardown to avoid user/room leakage across runs.

Mirror create-room.yaml’s cleanup so tests don’t accumulate users/rooms.

 appId: chat.rocket.reactnative
 name: Share Message
 onFlowStart:
   - runFlow: '../../helpers/setup.yaml'
+onFlowComplete:
+  - evalScript: ${output.utils.deleteCreatedUsers()}
 
 ---
.maestro/tests/room/ignoreuser.yaml (4)

114-121: Quote regex and tap targets to avoid YAML/anchor parsing issues.

Unquoted patterns with * can be parsed as YAML aliases. Quote them.

-      text: .*Message ignored. Tap to display it.*
+      text: '.*Message ignored. Tap to display it.*'
...
-- tapOn: .*Message ignored. Tap to display it.*
+- tapOn: '.*Message ignored. Tap to display it.*'

Also applies to: 118-119


1-18: Add teardown for created users/room.

Ensure artifacts are cleaned to keep CI stable.

 appId: chat.rocket.reactnative
 name: Ignore User
 onFlowStart:
   - runFlow: '../../helpers/setup.yaml'
+onFlowComplete:
+  - evalScript: ${output.utils.deleteCreatedUsers()}
 
 ---

27-37: iOS flake guard: allow alternative labels or add small waits if needed.

If iOS failures are due to timing or label differences, consider a brief wait before tapping and/or matching by id when available.

- - tapOn: 'Block'
+ - extendedWaitUntil:
+     visible:
+       text: 'Block'
+     timeout: 60000
+ - tapOn: 'Block'

Apply similarly for 'Unblock'.

Also applies to: 55-64


165-175: Prefer id-based selectors for “Report” in warning area.

Using childOf is good; if there are multiple “Report” strings on screen, consider tapping by id to reduce ambiguity.

If available, replace:

  • text: 'Report' + childOf: id: room-info-view-warning
    with:
  • id: 'room-info-view-warning-report'

Also applies to: 214-221

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2dc07bd and 59254f0.

📒 Files selected for processing (4)
  • .maestro/tests/room/create-room.yaml (1 hunks)
  • .maestro/tests/room/ignoreuser.yaml (1 hunks)
  • .maestro/tests/room/share-message.yaml (1 hunks)
  • .maestro/tests/room/utils/navigate-to-info-view.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.maestro/tests/room/create-room.yaml

[error] 8-8: syntax error: expected , but found '-'

(syntax)

🪛 GitHub Actions: Format Code with Prettier
.maestro/tests/room/create-room.yaml

[error] 1-1: YAML syntax error: A collection cannot be both a mapping and a sequence (1:1) in .maestro/tests/room/create-room.yaml while running yarn prettier --write .

🔇 Additional comments (2)
.maestro/tests/room/utils/navigate-to-info-view.yaml (1)

1-25: Nice reusable util flow.

Looks correct and platform-agnostic.

Please confirm IDs are stable on both platforms: room-header, room-actions-view, room-actions-info, room-info-view.

.maestro/tests/room/ignoreuser.yaml (1)

80-107: Good coverage of ignore/unignore UX.

Flow reads well and asserts both masked and revealed states.

If iOS is still flaky here, try adding index qualifiers to “Ignore/Unignore” taps or short pause: 300 before opening the info view.

Also applies to: 108-158

Comment on lines +8 to +9
- runFlow: '../../helpers/launch-app.yaml'
- runFlow: '../../helpers/login.yaml'
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

🧩 Analysis chain

Fix YAML doc start to resolve parse errors.

Root mixes a mapping (metadata) and a sequence (steps). Insert the YAML document separator before the first step. This will also fix the Prettier/YAMLlint failures.

Apply:

- - runFlow: '../../helpers/launch-app.yaml'
- - runFlow: '../../helpers/login.yaml'
+---
+- runFlow: '../../helpers/launch-app.yaml'
+- runFlow: '../../helpers/login.yaml'

Run to confirm no syntax errors remain:


🏁 Script executed:

#!/bin/bash
rg -n '^---$' .maestro/tests/room/create-room.yaml
node -e "require('yaml').parse(require('fs').readFileSync('.maestro/tests/room/create-room.yaml','utf8')); console.log('YAML OK')"

Length of output: 830


🏁 Script executed:

#!/bin/bash
set -euo pipefail
file=".maestro/tests/room/create-room.yaml"
if [ ! -f "$file" ]; then
  echo "MISSING:$file"
  exit 0
fi

echo "=== FILE PREVIEW ($file) ==="
nl -ba "$file" | sed -n '1,200p'

echo
echo "=== YAML DOCUMENT SEPARATORS ('---') ==="
rg -n '^---\s*$' "$file" || true

echo
echo "=== FIRST NON-EMPTY LINE ==="
awk 'NF{print NR \":\" $0; exit}' "$file"

echo
echo "=== LINES STARTING WITH DASH AT COLUMN 1 (top-level sequence items) ==="
rg -n '^\-' "$file" || true

echo
first_nonblank=$(awk 'NF{print $0; exit}' "$file")
if [[ "${first_nonblank:0:1}" == "-" ]]; then
  echo "INFERENCE: file begins with a sequence (first non-empty line starts with '-')"
else
  echo "INFERENCE: file begins with a mapping (first non-empty line does NOT start with '-')"
fi

# If file begins with mapping and top-level dashes exist and there is no doc separator, flag mixed root.
has_docsep=$(rg -n '^---\s*$' "$file" || true)
has_toplevel_dashes=$(rg -n '^\-' "$file" || true)

if [[ "${first_nonblank:0:1}" != "-" ]] && [[ -n "$has_toplevel_dashes" ]] && [[ -z "$has_docsep" ]]; then
  echo
  echo "RESULT: Detected mapping at top followed by a top-level sequence and NO document separator — root is mixed. Inserting '---' before the first top-level '-' will fix parsing."
else
  echo
  echo "RESULT: No mixed root detected, or document separator already present."
fi

Length of output: 101


🏁 Script executed:

#!/bin/bash
set -euo pipefail
file=".maestro/tests/room/create-room.yaml"
if [ ! -f "$file" ]; then
  echo "MISSING:$file"
  exit 0
fi

echo "=== FILE PREVIEW ($file) ==="
awk '{printf "%5d: %s\n", NR, $0}' "$file" | head -n 200

echo
echo "=== YAML DOCUMENT SEPARATORS ('---') ==="
rg -n '^---\s*$' "$file" || true

echo
echo "=== FIRST NON-EMPTY LINE ==="
awk 'NF{print NR \":\" $0; exit}' "$file"

echo
echo "=== LINES STARTING WITH DASH AT COLUMN 1 (top-level sequence items) ==="
rg -n '^\-' "$file" || true

echo
first_nonblank=$(awk 'NF{print $0; exit}' "$file")
if [[ "${first_nonblank:0:1}" == "-" ]]; then
  echo "INFERENCE: file begins with a sequence (first non-empty line starts with '-')"
else
  echo "INFERENCE: file begins with a mapping (first non-empty line does NOT start with '-')"
fi

has_docsep=$(rg -n '^---\s*$' "$file" || true)
has_toplevel_dashes=$(rg -n '^\-' "$file" || true)

if [[ "${first_nonblank:0:1}" != "-" ]] && [[ -n "$has_toplevel_dashes" ]] && [[ -z "$has_docsep" ]]; then
  echo
  echo "RESULT: Detected mapping at top followed by a top-level sequence and NO document separator — root is mixed. Inserting '---' before the first top-level '-' will fix parsing."
else
  echo
  echo "RESULT: No mixed root detected, or document separator already present."
fi

Length of output: 6049


Insert YAML document separator ('---') before the top-level steps

Root mixes a mapping (metadata: appId, name, onFlowStart/onFlowComplete) and a top-level sequence (steps). Insert '---' before line 8 (before "- runFlow: '../../helpers/launch-app.yaml'") to separate documents and fix YAML/Prettier/YAMLLint parse errors.

Apply:

- - runFlow: '../../helpers/launch-app.yaml'
- - runFlow: '../../helpers/login.yaml'
+---
+- runFlow: '../../helpers/launch-app.yaml'
+- runFlow: '../../helpers/login.yaml'
📝 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
- runFlow: '../../helpers/launch-app.yaml'
- runFlow: '../../helpers/login.yaml'
---
- runFlow: '../../helpers/launch-app.yaml'
- runFlow: '../../helpers/login.yaml'
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 8-8: syntax error: expected , but found '-'

(syntax)

🤖 Prompt for AI Agents
.maestro/tests/room/create-room.yaml around lines 8 to 9: the file mixes a
mapping and a top-level sequence which causes YAML parse/lint errors; insert a
YAML document separator line '---' immediately before line 8 (i.e., before the
first "- runFlow: '../../helpers/launch-app.yaml'") so the metadata mapping and
the steps sequence are split into two documents, then ensure
indentation/formatting of the steps remains unchanged.

@Rohit3523 Rohit3523 had a problem deploying to experimental_ios_build September 24, 2025 13:03 — with GitHub Actions Failure
@Rohit3523 Rohit3523 had a problem deploying to official_android_build September 24, 2025 13:03 — with GitHub Actions Failure
@Rohit3523 Rohit3523 had a problem deploying to experimental_android_build September 24, 2025 13:03 — with GitHub Actions Failure
@diegolmello diegolmello merged commit b1c22c7 into develop Sep 24, 2025
6 of 16 checks passed
@diegolmello diegolmello deleted the chore-maestro-room-test branch September 24, 2025 13:06
@coderabbitai coderabbitai bot mentioned this pull request Sep 25, 2025
10 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 23, 2025
10 tasks
@coderabbitai coderabbitai bot mentioned this pull request Dec 12, 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