-
Notifications
You must be signed in to change notification settings - Fork 13k
test: add cleanup to e2ee encryption tests #37445
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 |
|
WalkthroughCentralizes E2EE channel creation into a new Changes
Sequence Diagram(s)sequenceDiagram
participant Test
participant CreateE2EEChannel
participant HomeSidenav
participant Browser as Meteor (in page)
participant Cleanup as afterAll
Test->>CreateE2EEChannel: beforeEach: new(page)
Note over Test,CreateE2EEChannel: Test execution creates channels
Test->>CreateE2EEChannel: createAndStore(channelName, createdChannels)
CreateE2EEChannel->>HomeSidenav: createEncryptedChannel(name)
HomeSidenav-->>CreateE2EEChannel: created (UI)
CreateE2EEChannel->>Browser: resolvePrivateRoomId(name)
Browser-->>CreateE2EEChannel: roomId
CreateE2EEChannel->>CreateE2EEChannel: storeChannel(name, roomId, createdChannels)
CreateE2EEChannel-->>Test: return roomId
Note over Test,Cleanup: After all tests
Test->>Cleanup: iterate createdChannels
loop per channel
Cleanup->>Browser: deleteRoom(api, id)
Browser-->>Cleanup: deletion result
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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)
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 #37445 +/- ##
===========================================
+ Coverage 67.69% 67.77% +0.07%
===========================================
Files 3474 3474
Lines 113852 113852
Branches 20938 20938
===========================================
+ Hits 77073 77162 +89
+ Misses 34595 34505 -90
- Partials 2184 2185 +1
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: 1
🧹 Nitpick comments (1)
apps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.spec.ts (1)
47-49: Consider error resilience in cleanup.The cleanup logic correctly deletes all tracked channels. However, if any
deleteRoomcall fails,Promise.allwill reject and potentially leave subsequent channels undeleted. For more robust cleanup, consider usingPromise.allSettledto ensure all deletion attempts complete regardless of individual failures.Example refactor:
test.afterAll(async ({ api }) => { - await Promise.all(createdChannels.map(({ id }) => (id ? deleteRoom(api, id) : Promise.resolve()))); + await Promise.allSettled(createdChannels.map(({ id }) => (id ? deleteRoom(api, id) : Promise.resolve()))); });This ensures all channels are attempted for deletion even if some fail, improving test environment cleanup reliability.
📜 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 (9)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts(13 hunks)apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts(6 hunks)apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts(5 hunks)apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts(3 hunks)apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts(6 hunks)apps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.spec.ts(4 hunks)apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts(5 hunks)apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts(2 hunks)apps/meteor/tests/e2e/utils/resolve-room-id.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
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/utils/resolve-room-id.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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/utils/resolve-room-id.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.spec.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/e2ee.ts
🧠 Learnings (20)
📚 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/utils/resolve-room-id.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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/utils/resolve-room-id.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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/utils/resolve-room-id.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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/utils/resolve-room-id.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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/utils/resolve-room-id.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.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/utils/resolve-room-id.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/**/*.{ts,tsx} : Follow the Page Object Model pattern consistently
Applied to files:
apps/meteor/tests/e2e/utils/resolve-room-id.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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/utils/resolve-room-id.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/utils/resolve-room-id.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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/utils/resolve-room-id.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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/utils/resolve-room-id.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.tsapps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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/e2e-encryption/e2ee-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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-server-settings.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.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/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.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/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/**/*.{ts,tsx} : Implement proper wait strategies for dynamic content
Applied to files:
apps/meteor/tests/e2e/page-objects/fragments/e2ee.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-encryption-decryption.spec.ts
🧬 Code graph analysis (9)
apps/meteor/tests/e2e/utils/resolve-room-id.ts (1)
apps/meteor/server/publications/room/index.ts (1)
type(53-93)
apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts (3)
apps/meteor/tests/e2e/page-objects/home-channel.ts (1)
HomeChannel(6-127)apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1)
CreateE2EEChannel(157-183)apps/meteor/tests/e2e/utils/create-target-channel.ts (1)
deleteRoom(48-50)
apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts (2)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1)
CreateE2EEChannel(157-183)apps/meteor/tests/e2e/utils/create-target-channel.ts (1)
deleteRoom(48-50)
apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts (2)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1)
CreateE2EEChannel(157-183)apps/meteor/tests/e2e/utils/create-target-channel.ts (1)
deleteRoom(48-50)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (2)
apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts (1)
HomeSidenav(7-254)apps/meteor/tests/e2e/utils/resolve-room-id.ts (1)
resolvePrivateRoomId(41-43)
apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts (3)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1)
CreateE2EEChannel(157-183)apps/meteor/tests/e2e/utils/create-target-channel.ts (1)
deleteRoom(48-50)apps/meteor/tests/e2e/fixtures/userStates.ts (2)
restoreState(142-155)Users(119-136)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts (2)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1)
CreateE2EEChannel(157-183)apps/meteor/tests/e2e/utils/create-target-channel.ts (1)
deleteRoom(48-50)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (4)
apps/meteor/tests/e2e/page-objects/home-channel.ts (1)
HomeChannel(6-127)apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1)
CreateE2EEChannel(157-183)apps/meteor/tests/e2e/utils/create-target-channel.ts (1)
deleteRoom(48-50)apps/meteor/tests/e2e/utils/resolve-room-id.ts (1)
resolvePrivateRoomId(41-43)
apps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.spec.ts (2)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1)
CreateE2EEChannel(157-183)apps/meteor/tests/e2e/utils/create-target-channel.ts (1)
deleteRoom(48-50)
🔇 Additional comments (20)
apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts (4)
8-9: LGTM: Proper setup for centralized E2EE channel management.The imports and declarations correctly set up the infrastructure for tracking and cleaning up test channels.
Also applies to: 39-39, 41-41
55-55: LGTM: Proper instantiation in beforeEach.Instantiating
CreateE2EEChannelinbeforeEachensures each test gets a fresh instance.
59-61: LGTM: Robust cleanup implementation.The
afterAllhook properly deletes created channels with defensive null-checking. The conditionalid ? deleteRoom(api, id) : Promise.resolve()safely handles any edge cases where room IDs might not be captured.
69-69: LGTM: Centralized channel creation with tracking.Using
createAndStoreensures the channel is properly tracked for cleanup.apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts (1)
188-199: LGTM: Proper cleanup for serial test suite.The cleanup is correctly scoped to the
test.describe.serialblock, ensuring all channels created across the three tests are cleaned up together inafterAll.Also applies to: 211-213, 232-232, 274-274, 316-316
apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts (1)
21-23: LGTM: Proper scope management in nested describes.The nested
test.describecorrectly reuses the parent'screatedChannelsarray while declaring its owncreateE2EEChannelinstance. All channels are properly tracked and cleaned up in the outerafterAllhook.Also applies to: 37-43, 49-49, 74-74, 78-78, 93-93
apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts (1)
21-22: LGTM: Dual cleanup approach is correct.The file correctly uses both the centralized
createdChannelscleanup and a separate cleanup fortargetRoomIdin the nested test suite. Both cleanup mechanisms are independent and properly scoped.Also applies to: 41-46, 58-58, 99-99, 176-176
apps/meteor/tests/e2e/utils/resolve-room-id.ts (4)
1-10: LGTM: Well-documented utility with clear types.The type definitions and function signature are clear. The JSDoc properly explains why this utility is needed for E2EE rooms.
14-19: LGTM: Defensive type-safe Meteor access.The type assertion and runtime checks properly handle cases where Meteor might not be available in the browser context.
24-32: LGTM: Proper error handling in promisified call.The promisification correctly handles errors and missing data by resolving to
nullrather than rejecting, which is appropriate for this use case.
38-50: LGTM: Clean convenience wrappers.The wrapper functions provide clear, type-specific interfaces for common use cases.
apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts (1)
21-21: LGTM: Consistent implementation with additional cleanup.The file follows the same pattern as other E2EE test files. The
afterAllhook correctly includes both channel cleanup and FileUpload settings restoration.Also applies to: 23-23, 35-36, 43-43, 51-51, 86-86, 150-150
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (4)
3-4: LGTM: Clean page object structure.The class follows Page Object Model best practices with proper encapsulation and dependency injection via constructor.
Also applies to: 7-7, 157-165
167-172: LGTM: Proper room ID resolution with assertion.The method correctly resolves the room ID and includes a descriptive assertion message. The empty string fallback is defensive in case the resolution fails.
174-176: LGTM: Simple channel tracking.The method correctly stores channel metadata in the provided array for later cleanup.
178-182: LGTM: Convenient combined operation.The
createAndStoremethod provides a clean interface for the common pattern of creating and tracking channels in one step.apps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.spec.ts (4)
5-5: LGTM - Imports follow Page Object Model pattern.The imports correctly reference the centralized
CreateE2EEChannelpage object and thedeleteRoomutility, aligning with the cleanup pattern established across the E2EE test suite.Also applies to: 8-8
22-23: LGTM - Proper resource tracking for cleanup.Suite-level declarations appropriately track created channels and the E2EE channel creator instance. The
createdChannelsarray accumulates test artifacts for bulk cleanup inafterAll.
44-45: LGTM - Ensures test isolation.Initializing a fresh
CreateE2EEChannelinstance inbeforeEachcorrectly ensures test isolation, preventing shared state between test cases.
57-57: LGTM - Centralized channel creation with automatic cleanup tracking.The
createAndStorecalls elegantly replace inline channel creation with a centralized approach that automatically:
- Creates the E2EE channel
- Resolves and stores the channel ID for cleanup
- Maintains test isolation
This follows the Page Object Model pattern and DRY principle outlined in the coding guidelines.
Also applies to: 72-72
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.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: 0
🧹 Nitpick comments (3)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (2)
167-172: Consider using non-null assertion for clarity.The
|| ''fallback after theexpectassertion is technically unreachable—if the assertion fails, the test fails before the return. Usingreturn id!;with a non-null assertion would more clearly express that we expectidto be truthy at this point.Apply this diff if you prefer explicit intent:
async create(name: string): Promise<string> { await this.sidenav.createEncryptedChannel(name); const id = await resolvePrivateRoomId(this.page, name); await expect(id, `Failed to resolve roomId for ${name}`).toBeTruthy(); - return id || ''; + return id!; }
184-189: Consider using non-null assertion for clarity.Same pattern as in
create: the|| ''fallback is unreachable after the assertion. Usingreturn id!;would be clearer.Apply this diff:
async resolveAndStore(name: string, createdChannels: { name: string; id?: string | null }[]): Promise<string> { const id = await resolvePrivateRoomId(this.page, name); await expect(id, `Failed to resolve roomId for ${name}`).toBeTruthy(); - await this.storeChannel(name, id || '', createdChannels); - return id || ''; + await this.storeChannel(name, id!, createdChannels); + return id!; }apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (1)
40-42: Consider usingPromise.allSettledfor more resilient cleanup.The current
Promise.allwill fail-fast if any singledeleteRoomcall throws, potentially leaving other channels un-deleted. UsingPromise.allSettledensures all deletions are attempted regardless of individual failures.Apply this diff:
test.afterAll(async ({ api }) => { - await Promise.all(createdChannels.map(({ id }) => (id ? deleteRoom(api, id) : Promise.resolve()))); + const results = await Promise.allSettled(createdChannels.map(({ id }) => (id ? deleteRoom(api, id) : Promise.resolve()))); + const failures = results.filter((r) => r.status === 'rejected'); + if (failures.length > 0) { + console.warn(`Failed to delete ${failures.length} channel(s) during cleanup`); + } });
📜 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(13 hunks)apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts(2 hunks)
🧰 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/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/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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-encrypted-channels.spec.ts
🧠 Learnings (18)
📚 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/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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/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/**/*.{ts,tsx} : Store commonly used locators in variables/constants for reuse
Applied to files:
apps/meteor/tests/e2e/page-objects/fragments/e2ee.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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/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/**/*.{ts,tsx} : Use page.waitFor() with specific conditions and avoid hardcoded timeouts
Applied to files:
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : 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/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 : Prefer web-first assertions (e.g., toBeVisible, toHaveText)
Applied to files:
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Implement proper wait strategies for dynamic content
Applied to files:
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure a clean state for each test execution
Applied to files:
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.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-encrypted-channels.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/e2e-encryption/e2ee-encrypted-channels.spec.ts
🧬 Code graph analysis (2)
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (2)
apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts (1)
HomeSidenav(7-254)apps/meteor/tests/e2e/utils/resolve-room-id.ts (1)
resolvePrivateRoomId(41-43)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (3)
apps/meteor/tests/e2e/page-objects/home-channel.ts (1)
HomeChannel(6-127)apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts (1)
CreateE2EEChannel(157-190)apps/meteor/tests/e2e/utils/create-target-channel.ts (1)
deleteRoom(48-50)
⏰ 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 Docker (amd64, authorization-service, production)
- GitHub Check: 🚢 Build Docker (arm64, rocketchat, production)
🔇 Additional comments (1)
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts (1)
5-6: Well-implemented cleanup strategy for test isolation.The addition of the
CreateE2EEChannelhelper,createdChannelstracking, andafterAllcleanup properly addresses the PR objective of ensuring test isolation and reliability. The implementation follows the Page Object Model pattern, uses proper Playwright fixtures, and maintains clean state management across tests.Also applies to: 20-20, 22-22, 36-36, 40-42, 47-47, 89-89, 121-121, 154-154, 177-177, 195-195, 217-217, 256-256, 296-296, 351-351, 376-376
7afc1b3 to
8ad7653
Compare
Proposed changes (including videos or screenshots)
Add cleanup steps to the end-to-end encryption (E2EE) automated tests to ensure test isolation and reliability.
Scope
Covers E2EE encryption test suite, focusing on proper cleanup of test data and environment after test execution.
Issue(s)
https://rocketchat.atlassian.net/browse/QA-107
Steps to test or reproduce
Further comments
Summary by CodeRabbit