Skip to content

Conversation

@jessicaschelly
Copy link
Member

@jessicaschelly jessicaschelly commented Nov 7, 2025

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

  • Tests
    • Enhanced E2EE end-to-end suites with a reusable encrypted-channel creation helper and channel tracking to simplify flows.
    • Added utilities to resolve room identifiers and waits to ensure channels are ready before assertions.
    • Improved cleanup to reliably remove created channels after tests, reducing test flakiness and leftover artifacts.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 7, 2025

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

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Nov 7, 2025

⚠️ No Changeset found

Latest commit: 8ad7653

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

This PR includes no changesets

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

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

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 7, 2025

Walkthrough

Centralizes E2EE channel creation into a new CreateE2EEChannel page-object and adds a resolve-room-id utility. Seven E2EE test suites now create channels via createAndStore(...), track created channels in createdChannels, and perform afterAll cleanup using deleteRoom to remove created rooms by resolved IDs.

Changes

Cohort / File(s) Summary
New room-resolution utility
apps/meteor/tests/e2e/utils/resolve-room-id.ts
Added resolveRoomId(page, type, name), resolvePrivateRoomId(page, name), and resolveChannelRoomId(page, name) to resolve Meteor room IDs from browser context; exports RoomType.
New page-object: E2EE channel creator
apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
Added exported CreateE2EEChannel class with methods create(name), storeChannel(name,id,createdChannels), createAndStore(name,createdChannels), and resolveAndStore(name,createdChannels) using HomeSidenav and resolvePrivateRoomId.
E2EE tests: centralized creation & cleanup
apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-pdf-export.spec.ts, apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
Replaced inline sidenav channel creation with CreateE2EEChannel.createAndStore(channelName, createdChannels), added test-scoped `createdChannels: { name: string; id?: string

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Attention areas:
    • resolve-room-id.ts — verify correct, safe usage of page.evaluate and Meteor call callback handling.
    • CreateE2EEChannel methods — confirm async sequencing (create -> resolve -> store) and error/assert paths.
    • A sample of updated spec files — ensure createdChannels is populated reliably and afterAll deletes by resolved IDs.

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • cardoso
  • dougfabris
  • sampaiodiego

Poem

🐰 A clever rabbit hopped through the suite,
Making rooms tidy, neat, and complete,
With createAndStore and IDs in a row,
It cleans every channel before it can grow—
Hopping off happy, leaving tests sweet.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'test: add cleanup to e2ee encryption tests' accurately and concisely describes the main change—adding cleanup functionality to E2EE encryption tests.
Linked Issues check ✅ Passed The PR implements cleanup logic for E2EE tests by introducing a CreateE2EEChannel helper, tracking created channels, and deleting them in afterAll hooks, addressing QA-107's requirements for test isolation and cleanup of created channels.
Out of Scope Changes check ✅ Passed All changes are scoped to E2EE encryption tests and directly support the cleanup objectives; new utility functions (resolvePrivateRoomId, CreateE2EEChannel helper) are appropriately introduced to enable the cleanup functionality.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/add-deletion-channels-e2ee

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

❤️ Share

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

@jessicaschelly jessicaschelly changed the title chore: add cleanup to e2ee encryption tests test: add cleanup to e2ee encryption tests Nov 7, 2025
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.77%. Comparing base (56f1239) to head (8ad7653).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
e2e 57.15% <ø> (-0.02%) ⬇️
e2e-api 44.99% <ø> (+0.98%) ⬆️

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

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

@jessicaschelly jessicaschelly marked this pull request as ready for review November 7, 2025 19:16
@jessicaschelly jessicaschelly requested a review from a team as a code owner November 7, 2025 19:17
@jessicaschelly jessicaschelly added this to the 7.13.0 milestone Nov 7, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (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 deleteRoom call fails, Promise.all will reject and potentially leave subsequent channels undeleted. For more robust cleanup, consider using Promise.allSettled to 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 95eefa8 and db0e122.

📒 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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,tsx} : Follow the Page Object Model pattern consistently

Applied to files:

  • apps/meteor/tests/e2e/utils/resolve-room-id.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-09-16T22:08:51.490Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases

Applied to files:

  • apps/meteor/tests/e2e/utils/resolve-room-id.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-server-settings.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-passphrase-management.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-file-encryption.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encrypted-channels.spec.ts
  • apps/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.ts
  • apps/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.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-encryption-decryption.spec.ts
  • apps/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 CreateE2EEChannel in beforeEach ensures each test gets a fresh instance.


59-61: LGTM: Robust cleanup implementation.

The afterAll hook properly deletes created channels with defensive null-checking. The conditional id ? 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 createAndStore ensures 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.serial block, ensuring all channels created across the three tests are cleaned up together in afterAll.

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.describe correctly reuses the parent's createdChannels array while declaring its own createE2EEChannel instance. All channels are properly tracked and cleaned up in the outer afterAll hook.

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 createdChannels cleanup and a separate cleanup for targetRoomId in 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 null rather 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 afterAll hook 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 createAndStore method 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 CreateE2EEChannel page object and the deleteRoom utility, 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 createdChannels array accumulates test artifacts for bulk cleanup in afterAll.


44-45: LGTM - Ensures test isolation.

Initializing a fresh CreateE2EEChannel instance in beforeEach correctly ensures test isolation, preventing shared state between test cases.


57-57: LGTM - Centralized channel creation with automatic cleanup tracking.

The createAndStore calls 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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

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

167-172: Consider using non-null assertion for clarity.

The || '' fallback after the expect assertion is technically unreachable—if the assertion fails, the test fails before the return. Using return id!; with a non-null assertion would more clearly express that we expect id to 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. Using return 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 using Promise.allSettled for more resilient cleanup.

The current Promise.all will fail-fast if any single deleteRoom call throws, potentially leaving other channels un-deleted. Using Promise.allSettled ensures 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.

📥 Commits

Reviewing files that changed from the base of the PR and between db0e122 and 7afc1b3.

📒 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.ts
  • apps/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.ts
  • apps/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.ts
  • 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 descriptive test names that clearly communicate expected behavior

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • 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/**/*.{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.ts
  • 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/**/*.{ts,tsx} : Follow the Page Object Model pattern consistently

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • 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 : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • 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 : Utilize Playwright fixtures (test, page, expect) consistently

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • 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 : Maintain test isolation between test cases

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • 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 : Group related tests in the same file

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/e2ee.ts
  • 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/**/*.{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.ts
  • 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/**/*.{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 CreateE2EEChannel helper, createdChannels tracking, and afterAll cleanup 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

@scuciatto scuciatto modified the milestones: 7.13.0, 7.14.0 Nov 19, 2025
@tassoevan tassoevan force-pushed the test/add-deletion-channels-e2ee branch from 7afc1b3 to 8ad7653 Compare December 19, 2025 13:39
@github-actions
Copy link
Contributor

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 358MiB 347MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB -1.1KiB
queue-worker-service 132MiB 132MiB +298B
ddp-streamer-service 126MiB 126MiB +206B
account-service 113MiB 113MiB +693B
authorization-service 111MiB 111MiB +382B
stream-hub-service 110MiB 110MiB -1.2KiB
presence-service 110MiB 110MiB +1.4KiB

📊 Historical Trend

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

Statistics (last 25 days):

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

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

  • Tag: pr-37445
  • Baseline: develop
  • Timestamp: 2025-12-19 14:21:27 UTC
  • Historical data points: 25

Updated: Fri, 19 Dec 2025 14:21:28 GMT

@scuciatto scuciatto removed this from the 7.14.0 milestone Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants