-
Notifications
You must be signed in to change notification settings - Fork 12.6k
test: improve e2ee encryption tests to use page objects #37444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
WalkthroughRefactors 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
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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) buttoHaveClass(/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.
📒 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.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/home-content.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/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.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/home-content.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/home-content.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/home-content.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/home-content.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/home-content.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/home-content.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/home-content.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/home-content.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/home-content.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/home-content.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-otr.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/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.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/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.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/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.tsapps/meteor/tests/e2e/page-objects/fragments/room-toolbar.tsapps/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.tsapps/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 ine2ee-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
moreButtongetter andopenMenu()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
EncryptedRoomPagefor 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 readableSwapping in
EncryptedRoomPage.lastMessage.encryptedIconkeeps 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 tabsLeveraging
PinnedMessagesTabandStarredMessagesTabhere 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 abstractionThe new tab fragment cleanly wraps dialog access and reuses
MessageplusRoomToolbar, 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 verificationHooking the passphrase flows into
EncryptedRoomPagekeeps the encryption icon checks consistent with the other specs. The serial suite remains clear.
There was a problem hiding this 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 laterUsing
encryptedRoomPage.lastMessage.encryptedIconfor assertions and theEnable/DisableRoomEncryptionModalhelpers to toggle encryption is a clear improvement over raw locators. Since the modal helpers already wait for dismissal and success toasts, the extrawaitForTimeout(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 patternSwitching 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., onHomeChannel.tabsor 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 actionsThe pinned/starred test now:
- Sends and verifies the encrypted message using
EncryptedRoomPage(icon check).- Pins/stars via
poHomeChannel.contentmenu options.- Uses
PinnedMessagesTab/StarredMessagesTabfor 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
btnContextualbarCloseif 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.
📒 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-scopedUsing 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 correctAll new helpers are instantiated from the shared
pageinbeforeEach, matching howHomeChannelis 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
openReplyInThreadandsendMessageInThreadkeep 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 inE2EEMessageActionsis a solid refactorHovering the last message via
poHomeChannel.content.lastUserMessageand then delegating all disabled-state checks toE2EEMessageActionsremoves 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 cleanerUsing
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 coveredThe use of
getUserMention('user1')andgetChannelMention('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 intactReplacing the ad‑hoc encryption toggle with
enableEncryptionModal.enable()and usingpoHomeChannel.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 editThe edit test now explicitly checks
encryptedRoomPage.lastMessage.encryptedIconboth 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 validatedThis test now verifies:
- Encryption via
encryptedRoomPage.lastMessage.encryptedIconafter 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.
There was a problem hiding this 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
StarredMessagesTabclass follows the page object pattern correctly and maintains consistency with the existingPinnedMessagesTabimplementation. 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.
📒 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
There was a problem hiding this 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.
📒 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
Pageinstance as a private member while maintaining the proper toolbar locator initialization.
apps/meteor/tests/e2e/page-objects/fragments/pinned-messages-tab.ts
Outdated
Show resolved
Hide resolved
apps/meteor/tests/e2e/page-objects/fragments/starred-messages-tab.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
📒 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
beforeEachand 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.encryptedIconacross 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()andgetChannelMention()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:
PinnedMessagesTabandStarredMessagesTabfor tab-based interactions (replacing dialog locators)E2EEMessageActionsfor verifying disabled message actions on encrypted content- Content helper methods (
openReplyInThread,sendMessageInThread,deleteLastMessage) for common operationsThis 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: ThewaitForTimeoutcalls appear intentional for backend state propagation, not redundant UI waits.While
EnableRoomEncryptionModal.enable()andDisableRoomEncryptionModal.disable()do callwaitForDismissal()anddismissToast()internally, these only handle the modal UI dismissal. The subsequentpage.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 subsequentexpect(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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Proposed changes (including videos or screenshots)
1. Page Object Pattern Implementation
PinnedMessagesTab- for pinned messages interactionsStarredMessagesTab- for starred messages interactionsRoomToolbar- for room toolbar actionsE2EEMessageActions- for E2EE-specific message actionsCreateE2EEChannel- for encrypted channel creation with cleanup trackingMessage- addedencryptedIcongetterIssue(s)
https://rocketchat.atlassian.net/browse/ESH-34
Steps to test or reproduce
Further comments
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.