-
Notifications
You must be signed in to change notification settings - Fork 13k
test: Remove Utils page object
#37371
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
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
WalkthroughReplace the generic Changes
Sequence Diagram(s)sequenceDiagram
participant Test as E2E Test
participant AdminPO as AdminUsers (page-object)
participant Menu as MenuMoreActions
participant UI as Browser/UI
participant Toast as ToastMessages
Note over AdminPO: New API: dispatchUserAction({ username, action })
Test->>AdminPO: dispatchUserAction({ username:"alice", action:"Make Admin" })
AdminPO->>Menu: open row menu for username
Menu->>UI: click "Make Admin"
UI-->>Menu: action completed (toast triggered)
Menu-->>AdminPO: resolved
AdminPO-->>Test: resolved
Test->>Toast: waitForDisplay({ message: "made admin" })
Toast->>UI: query toast locator
UI-->>Toast: toast visible
Toast-->>Test: resolved
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (2 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 (3)
🧰 Additional context used📓 Path-based instructions (4)apps/meteor/tests/e2e/**/*.spec.ts📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
apps/meteor/tests/e2e/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
apps/meteor/tests/e2e/page-objects/**/*.ts📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (16)📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
📚 Learning: 2025-09-16T22:08:51.490ZApplied to files:
🧬 Code graph analysis (1)apps/meteor/tests/e2e/page-objects/admin-users.ts (2)
🔇 Additional comments (5)
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 #37371 +/- ##
===========================================
- Coverage 67.08% 67.07% -0.01%
===========================================
Files 3419 3419
Lines 117938 117938
Branches 21578 21531 -47
===========================================
- Hits 79114 79106 -8
- Misses 36132 36143 +11
+ Partials 2692 2689 -3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
021c726 to
f7d035d
Compare
f7d035d to
8337cbd
Compare
88c37c8 to
4dd24d9
Compare
4dd24d9 to
4c43eb9
Compare
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: 4
🧹 Nitpick comments (1)
apps/meteor/tests/e2e/export-messages.spec.ts (1)
91-94: Consider extracting repeated alert locator pattern.The alert locator pattern
page.locator('[role="alert"]', { hasText: ... })is repeated. While functional, consider extracting to a helper method in the test file or a page object for improved maintainability.Example:
const getAlertByText = (text: string) => page.locator('[role="alert"]', { hasText: text });Based on learnings
Also applies to: 107-111
📜 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 (17)
apps/meteor/tests/e2e/admin-users-role-management.spec.ts(2 hunks)apps/meteor/tests/e2e/admin-users-status-management.spec.ts(3 hunks)apps/meteor/tests/e2e/administration.spec.ts(4 hunks)apps/meteor/tests/e2e/delete-account.spec.ts(7 hunks)apps/meteor/tests/e2e/export-messages.spec.ts(5 hunks)apps/meteor/tests/e2e/iframe-authentication.spec.ts(4 hunks)apps/meteor/tests/e2e/login.spec.ts(3 hunks)apps/meteor/tests/e2e/page-objects/admin-users.ts(3 hunks)apps/meteor/tests/e2e/page-objects/auth.ts(1 hunks)apps/meteor/tests/e2e/page-objects/fragments/export-messages-tab.ts(1 hunks)apps/meteor/tests/e2e/page-objects/fragments/index.ts(1 hunks)apps/meteor/tests/e2e/page-objects/fragments/menu.ts(1 hunks)apps/meteor/tests/e2e/page-objects/fragments/toast-messages.ts(1 hunks)apps/meteor/tests/e2e/page-objects/index.ts(0 hunks)apps/meteor/tests/e2e/page-objects/utils.ts(0 hunks)apps/meteor/tests/e2e/preview-public-channel.spec.ts(4 hunks)apps/meteor/tests/e2e/register.spec.ts(5 hunks)
💤 Files with no reviewable changes (2)
- apps/meteor/tests/e2e/page-objects/index.ts
- apps/meteor/tests/e2e/page-objects/utils.ts
🧰 Additional context used
📓 Path-based instructions (4)
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/preview-public-channel.spec.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/register.spec.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/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/page-objects/fragments/menu.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/register.spec.tsapps/meteor/tests/e2e/page-objects/fragments/export-messages-tab.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/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/page-objects/fragments/menu.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/register.spec.tsapps/meteor/tests/e2e/page-objects/fragments/export-messages-tab.ts
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/index.tsapps/meteor/tests/e2e/page-objects/fragments/menu.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/page-objects/fragments/export-messages-tab.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/**/*.{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/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/**/*.{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/**/*.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} : Store commonly used locators in variables/constants for reuse
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
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
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
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
📚 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/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/page-objects/fragments/menu.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/register.spec.tsapps/meteor/tests/e2e/page-objects/fragments/export-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} : Avoid using page.locator(); prefer semantic locators like page.getByRole, page.getByLabel, page.getByText, and page.getByTitle
Applied to files:
apps/meteor/tests/e2e/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/page-objects/fragments/menu.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/page-objects/fragments/export-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/**/*.spec.ts : Prefer web-first assertions (e.g., toBeVisible, toHaveText)
Applied to files:
apps/meteor/tests/e2e/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/register.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/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/register.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/page-objects/**/*.ts : Utilize and place Page Object implementations under apps/meteor/tests/e2e/page-objects/
Applied to files:
apps/meteor/tests/e2e/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/page-objects/fragments/menu.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/register.spec.tsapps/meteor/tests/e2e/page-objects/fragments/export-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/**/*.spec.ts : Use expect matchers (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements
Applied to files:
apps/meteor/tests/e2e/preview-public-channel.spec.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/register.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/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/page-objects/fragments/menu.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/register.spec.tsapps/meteor/tests/e2e/page-objects/fragments/export-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,js,jsx} : Follow DRY by extracting reusable logic into helper functions or page objects
Applied to files:
apps/meteor/tests/e2e/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/page-objects/fragments/menu.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/register.spec.tsapps/meteor/tests/e2e/page-objects/fragments/export-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} : Store commonly used locators in variables/constants for reuse
Applied to files:
apps/meteor/tests/e2e/preview-public-channel.spec.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/page-objects/fragments/export-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,js,jsx} : Avoid code comments in the implementation
Applied to files:
apps/meteor/tests/e2e/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/index.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/preview-public-channel.spec.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/register.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/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/register.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 : Maintain test isolation between test cases
Applied to files:
apps/meteor/tests/e2e/preview-public-channel.spec.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/register.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/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/index.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/page-objects/admin-users.ts
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
Applied to files:
apps/meteor/tests/e2e/preview-public-channel.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/preview-public-channel.spec.tsapps/meteor/tests/e2e/delete-account.spec.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/register.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} : Implement proper wait strategies for dynamic content
Applied to files:
apps/meteor/tests/e2e/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/auth.tsapps/meteor/tests/e2e/export-messages.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/register.spec.ts
📚 Learning: 2025-09-23T19:22:59.217Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 36987
File: apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts:10-20
Timestamp: 2025-09-23T19:22:59.217Z
Learning: In Playwright e2e tests, prefer stable selectors like data-qa-id attributes over localized text in getByRole() or getByText() calls to prevent test failures when UI language changes. Test translations separately by validating actual text content after ensuring UI interactions work with stable selectors.
Applied to files:
apps/meteor/tests/e2e/preview-public-channel.spec.tsapps/meteor/tests/e2e/page-objects/fragments/toast-messages.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/delete-account.spec.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/administration.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/delete-account.spec.tsapps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/administration.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.tsapps/meteor/tests/e2e/register.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/auth.tsapps/meteor/tests/e2e/iframe-authentication.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/login.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.step() to organize complex test scenarios
Applied to files:
apps/meteor/tests/e2e/admin-users-role-management.spec.tsapps/meteor/tests/e2e/admin-users-status-management.spec.tsapps/meteor/tests/e2e/register.spec.ts
🧬 Code graph analysis (7)
apps/meteor/tests/e2e/delete-account.spec.ts (1)
apps/meteor/tests/e2e/page-objects/auth.ts (1)
Authenticated(17-21)
apps/meteor/tests/e2e/iframe-authentication.spec.ts (1)
apps/meteor/tests/e2e/page-objects/auth.ts (2)
Registration(23-115)Authenticated(17-21)
apps/meteor/tests/e2e/administration.spec.ts (1)
apps/meteor/tests/e2e/page-objects/fragments/toast-messages.ts (1)
ToastMessages(5-31)
apps/meteor/tests/e2e/admin-users-status-management.spec.ts (1)
apps/meteor/tests/e2e/page-objects/auth.ts (2)
Authenticated(17-21)Registration(23-115)
apps/meteor/tests/e2e/login.spec.ts (1)
apps/meteor/tests/e2e/page-objects/auth.ts (2)
Registration(23-115)Authenticated(17-21)
apps/meteor/tests/e2e/page-objects/admin-users.ts (2)
apps/meteor/tests/e2e/page-objects/fragments/user-info-flextab.ts (1)
UserInfoFlexTab(6-25)apps/meteor/tests/e2e/page-objects/fragments/menu.ts (1)
MenuMoreActions(23-27)
apps/meteor/tests/e2e/register.spec.ts (1)
apps/meteor/tests/e2e/page-objects/auth.ts (2)
Registration(23-115)Authenticated(17-21)
🔇 Additional comments (20)
apps/meteor/tests/e2e/page-objects/fragments/menu.ts (1)
23-27: LGTM!The
MenuMoreActionsclass follows the established pattern of the existingMenuMoreclass and correctly uses semantic locators.apps/meteor/tests/e2e/login.spec.ts (1)
4-4: LGTM!The migration from
UtilstoAuthenticatedis correctly implemented. The use ofwaitForDisplay()provides a cleaner assertion pattern and aligns with the new Page Object Model structure.Also applies to: 10-10, 14-14, 45-45, 55-55
apps/meteor/tests/e2e/page-objects/fragments/index.ts (1)
13-15: LGTM!The new fragment exports follow the established barrel export pattern and correctly expose the new page object fragments.
apps/meteor/tests/e2e/page-objects/auth.ts (3)
5-15: LGTM!The
Mainbase class provides a clean abstraction for display/dismissal wait patterns, reducing code duplication across page objects. The implementation follows best practices with proper typing and web-first assertions.Based on learnings.
17-21: LGTM!The
Authenticatedclass correctly extendsMainand provides a focused page object for authenticated state verification using the#main-contentselector.
23-26: LGTM!Refactoring
Registrationto extendMaineliminates code duplication while maintaining backward compatibility with existing locators.apps/meteor/tests/e2e/iframe-authentication.spec.ts (1)
5-5: LGTM!The migration from
UtilstoAuthenticatedis correctly implemented and consistent with the broader refactor across the test suite.Also applies to: 13-13, 31-31, 80-80, 103-103
apps/meteor/tests/e2e/page-objects/fragments/toast-messages.ts (1)
24-30: LGTM!The
waitForDisplaymethod provides a flexible API for toast verification with proper web-first assertions and support for optional message matching.apps/meteor/tests/e2e/admin-users-role-management.spec.ts (2)
42-42: LGTM!The higher-level
makeUserAdminmethod improves test readability and maintainability by encapsulating the action menu interaction logic.Based on learnings.
62-62: LGTM!The higher-level
removeUserAdminmethod improves test readability and maintainability by encapsulating the action menu interaction logic.Based on learnings.
apps/meteor/tests/e2e/page-objects/fragments/export-messages-tab.ts (1)
3-8: LGTM! Clean base class refactor.The refactor to extend
FlexTabis well-executed. The dialog locator with accessible name provides semantic identification, and all existing methods correctly leveragethis.rootfrom the base class.apps/meteor/tests/e2e/delete-account.spec.ts (2)
2-2: LGTM! Consistent page object refactor.The migration from
UtilstoAuthenticatedis clean and consistent throughout the test suite.Also applies to: 11-11, 28-28
46-46: LGTM! Proper wait strategy.Using
waitForDisplay()provides a proper wait strategy for authentication state verification.Also applies to: 84-84, 125-125
apps/meteor/tests/e2e/administration.spec.ts (2)
7-7: LGTM! Proper fragment extraction.Extracting toast message handling into a dedicated
ToastMessagesfragment follows the Page Object Model pattern and improves reusability.Based on learnings
Also applies to: 118-122
172-172: LGTM! Improved assertion pattern.Using
waitForDisplay()provides better synchronization than direct element checks.Also applies to: 182-182
apps/meteor/tests/e2e/page-objects/admin-users.ts (1)
64-72: LGTM! Excellent encapsulation.The new high-level methods
makeUserAdminandremoveUserAdminproperly encapsulate menu interactions, improving test readability and maintainability.Based on learnings
apps/meteor/tests/e2e/admin-users-status-management.spec.ts (1)
5-5: LGTM! Consistent refactoring pattern.The migration from
UtilstoAuthenticatedis consistent with the broader PR changes and improves semantic clarity.Also applies to: 25-25, 31-31, 47-47
apps/meteor/tests/e2e/export-messages.spec.ts (1)
141-141: LGTM! Proper wait strategy.Using
waitForDisplay()ensures the export dialog is visible before interaction, following Playwright best practices for dynamic content.As per coding guidelines
Also applies to: 169-169
apps/meteor/tests/e2e/register.spec.ts (2)
3-3: LGTM! Clean test setup refactor.The migration to
Authenticatedpage object simplifies the beforeEach setup and aligns with the new architecture.Also applies to: 9-14
44-44: LGTM! Consistent authentication verification.Using
waitForDisplay()provides reliable post-registration authentication state checks.Also applies to: 80-80, 209-209
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: 2
🧹 Nitpick comments (1)
apps/meteor/tests/e2e/page-objects/admin-users.ts (1)
48-48: Consider extracting the action type for reusability.The inline union type
'Remove Admin' | 'Make Admin' | 'Activate' | 'Deactivate'could be extracted to a type alias for better maintainability and reusability across tests.+export type UserAction = 'Remove Admin' | 'Make Admin' | 'Activate' | 'Deactivate'; + - async dispatchUserAction({ username, action }: { username: string; action: 'Remove Admin' | 'Make Admin' | 'Activate' | 'Deactivate' }) { + async dispatchUserAction({ username, action }: { username: string; action: UserAction }): Promise<Locator> {
📜 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/admin-users-role-management.spec.ts(2 hunks)apps/meteor/tests/e2e/admin-users.spec.ts(2 hunks)apps/meteor/tests/e2e/page-objects/admin-users.ts(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/meteor/tests/e2e/admin-users-role-management.spec.ts
🧰 Additional context used
📓 Path-based instructions (4)
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/admin-users.spec.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.ts
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/admin-users.ts
🧠 Learnings (15)
📓 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/**/*.{ts,tsx,js,jsx} : Follow DRY by extracting reusable logic into helper functions or page objects
📚 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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.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/admin-users.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/page-objects/**/*.ts : Utilize and place Page Object implementations under apps/meteor/tests/e2e/page-objects/
Applied to files:
apps/meteor/tests/e2e/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.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/admin-users.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/admin-users.ts
📚 Learning: 2025-09-23T19:22:59.217Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 36987
File: apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts:10-20
Timestamp: 2025-09-23T19:22:59.217Z
Learning: In Playwright e2e tests, prefer stable selectors like data-qa-id attributes over localized text in getByRole() or getByText() calls to prevent test failures when UI language changes. Test translations separately by validating actual text content after ensuring UI interactions work with stable selectors.
Applied to files:
apps/meteor/tests/e2e/page-objects/admin-users.ts
🧬 Code graph analysis (1)
apps/meteor/tests/e2e/page-objects/admin-users.ts (3)
apps/meteor/tests/e2e/page-objects/fragments/edit-user-flextab.ts (1)
EditUserFlexTab(5-57)apps/meteor/tests/e2e/page-objects/fragments/user-info-flextab.ts (1)
UserInfoFlexTab(6-25)apps/meteor/tests/e2e/page-objects/fragments/menu.ts (1)
MenuMoreActions(23-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
🔇 Additional comments (2)
apps/meteor/tests/e2e/page-objects/admin-users.ts (2)
4-4: LGTM: MenuMoreActions integration follows Page Object Model.The
MenuMoreActionsfragment is properly imported, declared as a readonly property, and initialized in the constructor, consistent with other fragments in this class.Also applies to: 11-12, 17-17
20-26: LGTM: Added exact matching for button locators.Using
exact: trueimproves selector precision and prevents partial text matches, following Playwright best practices.
251b974 to
ca0d906
Compare
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
🧹 Nitpick comments (2)
apps/meteor/tests/e2e/admin-users.spec.ts (1)
25-25: Optional: Extra blank line.The added blank line after
beforeEachis not necessary but doesn't affect functionality.apps/meteor/tests/e2e/page-objects/admin-users.ts (1)
37-38: Prefer semantic locators over page.locator().The coding guidelines recommend avoiding
page.locator()in favor of semantic locators. Consider usinggetByRole('row')with a filter.Apply this diff:
getUserRowByUsername(username: string): Locator { - return this.page.locator('tr', { hasText: username }); + return this.page.getByRole('row').filter({ hasText: username }); }As per coding guidelines
📜 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/admin-users-role-management.spec.ts(2 hunks)apps/meteor/tests/e2e/admin-users.spec.ts(2 hunks)apps/meteor/tests/e2e/page-objects/admin-users.ts(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/meteor/tests/e2e/admin-users-role-management.spec.ts
🧰 Additional context used
📓 Path-based instructions (4)
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/admin-users.spec.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.ts
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/admin-users.ts
🧠 Learnings (16)
📓 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/
📚 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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.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/admin-users.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.step() to organize complex test scenarios
Applied to files:
apps/meteor/tests/e2e/admin-users.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/admin-users.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/admin-users.spec.tsapps/meteor/tests/e2e/page-objects/admin-users.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/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/admin-users.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/admin-users.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/admin-users.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/admin-users.ts
🧬 Code graph analysis (1)
apps/meteor/tests/e2e/page-objects/admin-users.ts (2)
apps/meteor/tests/e2e/page-objects/fragments/user-info-flextab.ts (1)
UserInfoFlexTab(6-25)apps/meteor/tests/e2e/page-objects/fragments/menu.ts (1)
MenuMoreActions(23-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). (2)
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🔇 Additional comments (3)
apps/meteor/tests/e2e/admin-users.spec.ts (1)
51-51: Critical issue from previous review is now resolved.The previous review flagged that the returned locator was not clicked. The current implementation of
dispatchUserActioninadmin-users.ts(line 50) now performs the click internally, so this call correctly executes the 'Deactivate' action.Also applies to: 59-59
apps/meteor/tests/e2e/page-objects/admin-users.ts (2)
21-21: Good use of exact matching.Adding
exact: trueto button locators improves specificity and reduces the risk of matching unintended elements.Also applies to: 25-25
Also applies to: 25-25
44-46: Good encapsulation.Making
openUserActionMenuprivate properly encapsulates the implementation detail, withdispatchUserActionproviding the public API.
ca0d906 to
c4e529e
Compare
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit