Skip to content

Conversation

@jessicaschelly
Copy link
Member

@jessicaschelly jessicaschelly commented Nov 7, 2025

Proposed changes (including videos or screenshots)

1. Page Object Pattern Implementation

  • Replaced direct Playwright selectors with reusable page object methods
  • Created new page object fragments:
    • PinnedMessagesTab - for pinned messages interactions
    • StarredMessagesTab - for starred messages interactions
    • RoomToolbar - for room toolbar actions
  • Enhanced existing fragments:
    • E2EEMessageActions - for E2EE-specific message actions
    • CreateE2EEChannel - for encrypted channel creation with cleanup tracking
    • Message - added encryptedIcon getter

Issue(s)

https://rocketchat.atlassian.net/browse/ESH-34

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Tests
    • Improved E2EE end-to-end tests to use modal and component helpers for enabling/disabling encryption.
    • Added abstractions for pinned/starred message views and E2EE message actions to improve test stability.
    • Standardized mention, thread, toolbar, and message interactions, replacing fragile locator-based checks.
    • Removed unnecessary pre-test cleanup and consolidated shared test setup for consistency.

✏️ Tip: You can customize this high-level summary in your review settings.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 7, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is targeting the wrong base branch. It should target 7.14.0, but it targets 7.13.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2025

⚠️ No Changeset found

Latest commit: 5525008

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

Refactors E2EE end-to-end tests to replace direct DOM interactions with new page-object fragments and modal helpers (EncryptedRoomPage, Enable/DisableRoomEncryptionModal, PinnedMessagesTab, StarredMessagesTab, E2EEMessageActions), and updates tests to initialize and use these abstractions consistently.

Changes

Cohort / File(s) Summary
E2EE test specs
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-key-reset.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
Replace direct DOM locators and manual modal handling with page-object APIs; initialize EncryptedRoomPage and modal/page-object helpers in beforeEach; use modal methods for enable/disable flows; switch encrypted-icon checks to encryptedRoomPage.lastMessage.encryptedIcon; refactor message/thread/pinned/starred flows to use fragments.
Page-object fragments — pinned / starred
apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts, apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
Add PinnedMessagesTab and StarredMessagesTab classes with constructor, openTab(), openLastMessageMenu() and lastMessage getter to interact with respective dialogs.
E2EE message actions fragment
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
Add E2EEMessageActions class exposing locators for forward, reply-in-DM and copy-link options and encapsulating E2EE message action interactions.
Home & Message helpers
apps/meteor/tests/e2e/page-objects/fragments/home-content.ts, apps/meteor/tests/e2e/page-objects/fragments/message.ts
Add getUserMention(username) and getChannelMention(channelName) to HomeContent; add moreButton getter and openMenu() method to Message.
Fragments index & toolbar changes
apps/meteor/tests/e2e/page-objects/fragments/index.ts, apps/meteor/tests/e2e/page-objects/fragments/toolbar.ts
Re-export pinned/starred fragments in fragments index; change RoomToolbar constructor to retain page and resolve some menu item locators via page scope instead of root.
Tests wiring & imports
apps/meteor/tests/e2e/e2e-encryption/* (multiple specs)
Add imports and top-level declarations for new page-object classes (e.g., EncryptedRoomPage, EnableRoomEncryptionModal, DisableRoomEncryptionModal, PinnedMessagesTab, StarredMessagesTab) and wire them into test lifecycles.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Files/areas to pay extra attention to:
    • e2ee-passphrase-management.spec.ts (many shared page-object initializations and navigation/state flows)
    • pinned-messages-tab.ts and starred-messages-tab.ts (dialog selectors and scoping of last message)
    • toolbar.ts (changing locator resolution from root → page may affect selectors)
    • e2ee.ts (new E2EE message actions selectors and waits)

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • dougfabris
  • tassoevan

Poem

🐰
I hopped through tests with whiskers bright,
I nudged the modals into gentle light,
Page-objects tidy every thread and stream,
I chew loose bugs and tidy up the team,
A tiny rabbit guards the E2EE dream. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly summarizes the main change: refactoring E2EE encryption tests to adopt page object patterns.
Linked Issues check ✅ Passed The PR implements all core requirements: refactors E2EE tests using page objects, maintains test coverage, and improves code reusability and maintainability as specified in ESH-34.
Out of Scope Changes check ✅ Passed All changes directly support the page object refactoring objective. No unrelated modifications or scope drift detected beyond test framework improvements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/e2ee-page-imp

📜 Recent 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 2c5711f and 5525008.

📒 Files selected for processing (1)
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
⏰ 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: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.86%. Comparing base (44ca3b1) to head (5525008).
⚠️ Report is 51 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37444      +/-   ##
===========================================
- Coverage    68.98%   68.86%   -0.12%     
===========================================
  Files         3359     3361       +2     
  Lines       114213   114390     +177     
  Branches     20535    20668     +133     
===========================================
- Hits         78788    78773      -15     
- Misses       33334    33523     +189     
- Partials      2091     2094       +3     
Flag Coverage Δ
e2e 57.27% <ø> (-0.18%) ⬇️
e2e-api 42.22% <ø> (-0.67%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jessicaschelly jessicaschelly marked this pull request as ready for review November 7, 2025 19:29
@jessicaschelly jessicaschelly requested a review from a team as a code owner November 7, 2025 19:29
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: 0

🧹 Nitpick comments (1)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1)

175-185: Inconsistent disabled state assertions.

The assertions use toBeDisabled() for the button (line 176) but toHaveClass(/disabled/) for menuitems (lines 180, 184). This inconsistency may indicate that menuitems use CSS-based disabled styling rather than ARIA attributes.

If this is intentional due to different DOM implementations, consider adding a brief inline comment explaining why different approaches are needed. Otherwise, prefer consistent use of semantic assertions like toBeDisabled() where possible.

📜 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 fddc37a and 427ba03.

📒 Files selected for processing (14)
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (17 hunks)
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts (9 hunks)
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-key-reset.spec.ts (0 hunks)
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts (4 hunks)
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts (4 hunks)
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts (9 hunks)
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts (6 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/message.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-key-reset.spec.ts
🧰 Additional context used
📓 Path-based instructions (4)
apps/meteor/tests/e2e/page-objects/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

Utilize and place Page Object implementations under apps/meteor/tests/e2e/page-objects/

Files:

  • apps/meteor/tests/e2e/page-objects/fragments/message.ts
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}: Write concise, technical TypeScript/JavaScript with accurate typing
Follow DRY by extracting reusable logic into helper functions or page objects
Avoid code comments in the implementation

Files:

  • apps/meteor/tests/e2e/page-objects/fragments/message.ts
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
apps/meteor/tests/e2e/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.{ts,tsx}: Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle
Store commonly used locators in variables/constants for reuse
Use page.waitFor() with specific conditions and avoid hardcoded timeouts
Implement proper wait strategies for dynamic content
Follow the Page Object Model pattern consistently

Files:

  • apps/meteor/tests/e2e/page-objects/fragments/message.ts
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
apps/meteor/tests/e2e/**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.spec.ts: All Playwright test files must be located under apps/meteor/tests/e2e/ and use the .spec.ts extension (e.g., login.spec.ts)
Use descriptive test names that clearly communicate expected behavior
Use test.beforeAll() and test.afterAll() for setup and teardown
Use test.step() to organize complex test scenarios
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) consistently
Prefer web-first assertions (e.g., toBeVisible, toHaveText)
Use expect matchers (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements
Maintain test isolation between test cases
Ensure a clean state for each test execution
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
🧠 Learnings (23)
📓 Common learnings
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize and place Page Object implementations under apps/meteor/tests/e2e/page-objects/
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (test, page, expect) consistently
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Follow the Page Object Model pattern consistently
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx} : Follow DRY by extracting reusable logic into helper functions or page objects
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize and place Page Object implementations under apps/meteor/tests/e2e/page-objects/

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/message.ts
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Follow the Page Object Model pattern consistently

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/message.ts
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use descriptive test names that clearly communicate expected behavior

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/message.ts
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Prefer web-first assertions (e.g., toBeVisible, toHaveText)

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/message.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/message.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx} : Follow DRY by extracting reusable logic into helper functions or page objects

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/message.ts
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (test, page, expect) consistently

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Store commonly used locators in variables/constants for reuse

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx} : Write concise, technical TypeScript/JavaScript with accurate typing

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure a clean state for each test execution

Applied to files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T13:33:49.237Z
Learnt from: cardoso
Repo: RocketChat/Rocket.Chat PR: 36890
File: apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts:21-26
Timestamp: 2025-09-16T13:33:49.237Z
Learning: In Rocket.Chat test files, the im.delete API endpoint accepts either a `roomId` parameter (requiring the actual DM room _id) or a `username` parameter (for the DM partner's username). It does not accept slug-like constructions such as concatenating usernames together.

Applied to files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
📚 Learning: 2025-09-16T13:33:49.237Z
Learnt from: cardoso
Repo: RocketChat/Rocket.Chat PR: 36890
File: apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts:21-26
Timestamp: 2025-09-16T13:33:49.237Z
Learning: The im.delete API endpoint accepts either a `roomId` parameter (requiring the actual DM room _id) or a `username` parameter (for the DM partner's username). Constructing slug-like identifiers like `user2${Users.userE2EE.data.username}` doesn't work for this endpoint.

Applied to files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Use page.waitFor() with specific conditions and avoid hardcoded timeouts

Applied to files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use expect matchers (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements

Applied to files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use test.beforeAll() and test.afterAll() for setup and teardown

Applied to files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All Playwright test files must be located under apps/meteor/tests/e2e/ and use the .spec.ts extension (e.g., login.spec.ts)

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Implement proper wait strategies for dynamic content

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use test.step() to organize complex test scenarios

Applied to files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: When generating tests, provide complete runnable TypeScript test files with proper imports, clear describe/test blocks, and adherence to these guidelines

Applied to files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
🧬 Code graph analysis (8)
apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts (1)
apps/meteor/tests/e2e/page-objects/home-channel.ts (1)
  • HomeChannel (6-127)
apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts (1)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (2)
  • EnableRoomEncryptionModal (118-135)
  • DisableRoomEncryptionModal (137-154)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (3)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (3)
  • E2EEMessageActions (156-186)
  • EnableRoomEncryptionModal (118-135)
  • DisableRoomEncryptionModal (137-154)
apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts (1)
  • PinnedMessagesTab (7-33)
apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts (1)
  • StarredMessagesTab (7-33)
apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts (2)
apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts (1)
  • RoomToolbar (3-39)
apps/meteor/tests/e2e/page-objects/fragments/message.ts (1)
  • Message (3-27)
apps/meteor/tests/e2e/page-objects/fragments/home-content.ts (1)
apps/meteor/tests/e2e/page-objects/auth.ts (1)
  • username (68-70)
apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts (2)
apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts (1)
  • RoomToolbar (3-39)
apps/meteor/tests/e2e/page-objects/fragments/message.ts (1)
  • Message (3-27)
apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts (1)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts (1)
  • encryptedRoomPage (77-149)
apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts (7)
apps/meteor/tests/e2e/page-objects/login.ts (1)
  • LoginPage (9-55)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (4)
  • EnterE2EEPasswordBanner (26-31)
  • EnterE2EEPasswordModal (70-97)
  • E2EEKeyDecodeFailureBanner (33-41)
  • ResetE2EEPasswordModal (99-116)
apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts (1)
  • HomeSidenav (7-254)
apps/meteor/tests/e2e/page-objects/account-security.ts (1)
  • AccountSecurityPage (5-59)
apps/meteor/tests/e2e/page-objects/account-profile.ts (1)
  • AccountProfile (5-179)
apps/meteor/tests/e2e/page-objects/home-channel.ts (1)
  • HomeChannel (6-127)
apps/meteor/tests/e2e/fixtures/userStates.ts (1)
  • restoreState (142-155)
🔇 Additional comments (13)
apps/meteor/tests/e2e/page-objects/fragments/home-content.ts (1)

69-75: Let me search for the actual test context to see how these methods are being used:

No issues found — code follows Playwright best practices.

The methods correctly use semantic locators, which Playwright recommends to make tests resilient. Parameter format is clear from the test usage (plain strings: 'user1', 'general'). It is recommended for users to prefer getByRole, and if it doesn't work for an element, developers should fix the HTML to have proper ARIA attributes. The methods are actively used in e2ee-encrypted-channels.spec.ts (lines 178, 192, 194, 210, 211, 345, 346) and working correctly. No changes needed.

apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1)

156-186: Well-structured page object for E2EE message actions.

The class properly encapsulates E2EE-specific message action assertions with semantic locators and clear method names.

apps/meteor/tests/e2e/page-objects/fragments/message.ts (1)

18-26: Good use of semantic locators and wait strategies.

The new moreButton getter and openMenu() method properly use semantic locators and implement appropriate wait strategies before interaction.

apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts (1)

8-8: Proper integration of EncryptedRoomPage.

The test correctly adopts the new page object pattern by importing, initializing, and using EncryptedRoomPage for encrypted icon assertions, improving test maintainability.

Also applies to: 39-39, 52-52, 92-92

apps/meteor/tests/e2e/page-objects/fragments/index.ts (1)

16-18: Clean barrel exports for new fragments.

The exports follow the existing pattern and properly expose the new page objects for consumption by tests.

apps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.ts (1)

3-3: Effective modal abstraction for encryption toggle.

The refactoring successfully replaces direct dialog interactions with modal page objects, encapsulating dialog handling and toast dismissal for cleaner, more maintainable test code.

Also applies to: 18-19, 33-34, 51-51, 56-56

apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts (1)

5-5: Consistent adoption of EncryptedRoomPage.

The test systematically replaces direct encryption icon locators with page object methods across multiple test steps, improving consistency and maintainability.

Also applies to: 21-21, 39-39, 60-60, 95-95, 110-110, 125-125, 157-157, 166-166

apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts (1)

1-33: Well-structured page object for starred messages.

The class properly encapsulates starred messages dialog interactions with clear composition of RoomToolbar and Message objects. The use of semantic locators for the dialog root and appropriate wait strategies align with best practices.

apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts (1)

1-39: Exemplary use of semantic locators.

This page object demonstrates excellent adherence to coding guidelines with consistent use of getByRole() selectors throughout, clear method names, and proper locator composition. Well done!

apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts (1)

52-57: Encrypted icon assertion stays readable

Swapping in EncryptedRoomPage.lastMessage.encryptedIcon keeps the assertion expressive and aligned with the new shared page objects. Nice reuse.

apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (1)

285-296: Great reuse of the new message tabs

Leveraging PinnedMessagesTab and StarredMessagesTab here removes a pile of bespoke locators while keeping the encrypted-message checks intact. This should pay off in future maintenance.

apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts (1)

1-32: Solid page-object abstraction

The new tab fragment cleanly wraps dialog access and reuses Message plus RoomToolbar, staying DRY with the rest of the suite.

apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts (1)

247-292: Consistent encrypted-message verification

Hooking the passphrase flows into EncryptedRoomPage keeps the encryption icon checks consistent with the other specs. The serial suite remains clear.

@jessicaschelly jessicaschelly added this to the 7.13.0 milestone Nov 14, 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: 0

🧹 Nitpick comments (3)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (3)

63-64: Encryption icon + modal helpers improve readability; consider removing explicit sleeps later

Using encryptedRoomPage.lastMessage.encryptedIcon for assertions and the Enable/DisableRoomEncryptionModal helpers to toggle encryption is a clear improvement over raw locators. Since the modal helpers already wait for dismissal and success toasts, the extra waitForTimeout(1000) calls may now be redundant and could be dropped in a follow-up to reduce flakiness and runtime.

Also applies to: 69-70, 75-76, 80-81, 86-87


155-157: Encryption enablement now uses the modal helper; consider a small helper for this pattern

Switching to enableEncryptionModal.enable() here keeps the flow consistent with other tests and ensures we always wait for the modal + toast. You repeat this pattern in a few tests; if it spreads further, consider a small helper (e.g., on HomeChannel.tabs or a dedicated encryption utility) to encapsulate “open kebab → enable E2E via modal”.

Also applies to: 163-164


266-270: Pinned/starred flows nicely encapsulated via tab fragments and E2EE actions

The pinned/starred test now:

  • Sends and verifies the encrypted message using EncryptedRoomPage (icon check).
  • Pins/stars via poHomeChannel.content menu options.
  • Uses PinnedMessagesTab / StarredMessagesTab for opening the contextual lists and asserting message text.
  • Reuses E2EEMessageActions.expectCopyLinkToBeDisabled() to confirm E2EE restrictions in both tabs.

This is a strong application of the new fragments and keeps the spec free of dialog-specific selectors. One optional enhancement would be to add PO‑level helpers to wait for the contextual bar to close after btnContextualbarClose if you ever see flakiness when switching from pinned to starred.

Also applies to: 272-280, 284-287, 291-295

📜 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 427ba03 and 75ef9de.

📒 Files selected for processing (2)
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (17 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (3)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (3)
  • E2EEMessageActions (156-186)
  • EnableRoomEncryptionModal (118-135)
  • DisableRoomEncryptionModal (137-154)
apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts (1)
  • PinnedMessagesTab (7-33)
apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts (1)
  • StarredMessagesTab (7-33)
⏰ 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: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (10)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (10)

5-8: New page-object imports are cohesive and well-scoped

Using dedicated fragments (EncryptedRoomPage, E2EEMessageActions, PinnedMessagesTab, StarredMessagesTab, and the encryption modals) keeps this spec lean and matches the intended Page Object pattern. The imports are cohesive and only bring in what the tests actually use.


23-28: beforeEach wiring of new page objects looks correct

All new helpers are instantiated from the shared page in beforeEach, matching how HomeChannel is used and avoiding per-test duplication. This should keep the tests consistent and makes it easy to extend flows later.

Also applies to: 42-47


101-103: Thread flow now consistently uses content helpers

openReplyInThread and sendMessageInThread keep this test aligned with the rest of the content API and make the thread flow much clearer. Assertions still cover both thread and channel copies, preserving the original scenario.

Also applies to: 111-112


131-135: Centralizing E2EE action assertions in E2EEMessageActions is a solid refactor

Hovering the last message via poHomeChannel.content.lastUserMessage and then delegating all disabled-state checks to E2EEMessageActions removes a lot of selector noise from the spec while still validating the same behavior (forward, reply-in-DM, copy-link all disabled). The abstraction should also make it easy to reuse in other specs.

Also applies to: 138-139


177-178: User mention verification via page object is cleaner

Using poHomeChannel.content.getUserMention('user1') centralizes how a mention is located and keeps this spec from depending on DOM details. This is exactly the kind of selector hiding the Page Object pattern is meant to achieve.


191-195: Channel mention navigation flow reads well with the new helper

getChannelMention('general') makes the test intent very clear: “find the mention and click it”. The URL assertion still verifies navigation to /channel/general, so coverage of the original behavior is preserved.


209-211: Combined user + channel mentions remain fully covered

The use of getUserMention('user1') and getChannelMention('general') here mirrors the earlier tests and keeps both mention types exercised in a single message, without leaking selector details.


237-238: Encryption toggle and delete-last-message helper keep sidebar scenario intact

Replacing the ad‑hoc encryption toggle with enableEncryptionModal.enable() and using poHomeChannel.content.deleteLastMessage() keeps this test focused on its core assertion: the sidebar shows the previous encrypted message. Behavior-wise this still matches the original scenario while being easier to maintain.

Also applies to: 249-250


309-310: Edit-encrypted flow remains covered with icon checks after edit

The edit test now explicitly checks encryptedRoomPage.lastMessage.encryptedIcon both before and after editing, which confirms that the message stays encrypted across edits, not just that the text changes. Good coverage of an important E2EE invariant.

Also applies to: 318-319


333-346: Edit-with-mentions keeps both encryption and mention behavior validated

This test now verifies:

  • Encryption via encryptedRoomPage.lastMessage.encryptedIcon after the edit.
  • Correct rendering of both user and channel mentions via getUserMention / getChannelMention.

That preserves and clarifies the original behavior while leveraging the new page objects. Looks solid.

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: 0

🧹 Nitpick comments (1)
apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts (1)

1-34: LGTM! Well-structured page object implementation.

The StarredMessagesTab class follows the page object pattern correctly and maintains consistency with the existing PinnedMessagesTab implementation. Key strengths:

  • Uses accessible role selectors (getByRole('dialog')) for robustness.
  • Good encapsulation with private members.
  • Clear delegation to composed page objects (Message, RoomToolbar).
  • Proper waiting strategy in openTab() ensures visibility before proceeding.

Optional: Consider adding JSDoc comments for better maintainability.

Adding brief JSDoc comments to the class and public methods would improve discoverability and maintainability, especially for new contributors.

Example:

+/**
+ * Page object for interacting with the Starred Messages tab dialog.
+ */
 export class StarredMessagesTab {
   // ...

+  /**
+   * Opens the Starred Messages tab from the room toolbar.
+   */
   async openTab(): Promise<void> {
     // ...
   }

+  /**
+   * Asserts that the last starred message contains the specified text.
+   * @param text - The text to search for in the last message.
+   */
   async expectLastMessageToContainText(text: string): Promise<void> {
     // ...
   }

+  /**
+   * Opens the context menu for the last starred message.
+   */
   async openLastMessageMenu(): Promise<void> {
     // ...
   }
 }
📜 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 75ef9de and cb99624.

📒 Files selected for processing (3)
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/meteor/tests/e2e/page-objects/fragments/index.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts (2)
apps/meteor/tests/e2e/page-objects/fragments/toolbar.ts (1)
  • RoomToolbar (14-106)
apps/meteor/tests/e2e/page-objects/fragments/message.ts (1)
  • Message (3-27)
⏰ 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: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

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

📜 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 cb99624 and ad2fc7a.

📒 Files selected for processing (1)
  • apps/meteor/tests/e2e/page-objects/fragments/toolbar.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/tests/e2e/page-objects/fragments/toolbar.ts (1)
apps/meteor/client/router/page.ts (1)
  • Page (92-241)
⏰ 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: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (1)
apps/meteor/tests/e2e/page-objects/fragments/toolbar.ts (1)

15-17: LGTM: Constructor properly stores page reference.

The updated constructor correctly stores the Page instance as a private member while maintaining the proper toolbar locator initialization.

@scuciatto scuciatto modified the milestones: 7.13.0, 7.14.0 Nov 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

📜 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 ad2fc7a and 2c5711f.

📒 Files selected for processing (5)
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (17 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/home-content.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
  • apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
🧰 Additional context used
🧬 Code graph analysis (2)
apps/meteor/tests/e2e/page-objects/fragments/home-content.ts (1)
apps/meteor/tests/e2e/page-objects/auth.ts (1)
  • username (68-70)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (3)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (3)
  • E2EEMessageActions (156-174)
  • EnableRoomEncryptionModal (118-135)
  • DisableRoomEncryptionModal (137-154)
apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts (1)
  • PinnedMessagesTab (7-30)
apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts (1)
  • StarredMessagesTab (7-30)
⏰ 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). (2)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
🔇 Additional comments (5)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (5)

5-8: LGTM! Clean page object setup.

The new page object imports and initialization follow best practices. All declared page objects are properly instantiated in beforeEach and used throughout the tests.

Also applies to: 23-28, 42-47


63-63: LGTM! Consistent use of encrypted icon page object.

The refactoring consistently replaces direct DOM selectors with encryptedRoomPage.lastMessage.encryptedIcon across all test cases, improving maintainability and reusability.

Also applies to: 75-75, 86-86, 101-101, 131-131, 163-163, 269-269, 309-309, 318-318, 333-333, 342-342


177-177: LGTM! Mention helper methods improve readability.

The use of getUserMention() and getChannelMention() helper methods makes the test assertions more expressive and maintainable compared to direct DOM queries.

Also applies to: 191-191, 193-193, 209-210, 344-345


103-103: LGTM! Effective use of specialized page objects and helpers.

The refactoring successfully introduces:

  • PinnedMessagesTab and StarredMessagesTab for tab-based interactions (replacing dialog locators)
  • E2EEMessageActions for verifying disabled message actions on encrypted content
  • Content helper methods (openReplyInThread, sendMessageInThread, deleteLastMessage) for common operations

This significantly improves test readability and reduces duplication.

Also applies to: 111-111, 133-134, 138-139, 249-249, 272-272, 278-279, 284-287, 291-294


69-70: The waitForTimeout calls appear intentional for backend state propagation, not redundant UI waits.

While EnableRoomEncryptionModal.enable() and DisableRoomEncryptionModal.disable() do call waitForDismissal() and dismissToast() internally, these only handle the modal UI dismissal. The subsequent page.waitForTimeout(1000) calls appear designed to allow backend encryption state propagation on the server.

However, line 157 demonstrates inconsistency—it enables encryption without an explicit waitForTimeout, relying instead on the subsequent expect(poHomeChannel.content.encryptedRoomHeaderIcon).toBeVisible() check (which retries with Playwright's default timeout). This suggests these waits may not always be strictly required, or they may be overly conservative.

Recommendation: Verify whether the 1000ms delays are empirically necessary for test stability. If encryption state updates complete faster than 1 second in most scenarios, consider:

  • Replacing fixed waits with more targeted waits for specific UI elements (e.g., encrypted icon visibility)
  • Adding comments explaining the backend timing requirements if these delays must remain

Also applies to: 80-81, 237-238

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 359MiB 347MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB -137B
queue-worker-service 132MiB 132MiB -186B
ddp-streamer-service 126MiB 126MiB -1000B
account-service 113MiB 113MiB -609B
stream-hub-service 111MiB 111MiB -227B
authorization-service 111MiB 111MiB +111B
presence-service 111MiB 111MiB +805B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/15 22:28", "11/16 01:28", "11/17 23:50", "11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 16:24 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 11 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.2GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 1.2GiB
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-37444
  • Baseline: develop
  • Timestamp: 2025-12-03 16:24:39 UTC
  • Historical data points: 11

Updated: Wed, 03 Dec 2025 16:24:40 GMT

Copy link
Member

Choose a reason for hiding this comment

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

why changing the locators to access page instead of root?

Copy link
Member

Choose a reason for hiding this comment

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

basically all the locators here should be part of the room message instead of the StarredMessagesTab

Copy link
Member

Choose a reason for hiding this comment

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

same here

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.

5 participants