Skip to content

Conversation

@dougfabris
Copy link
Member

@dougfabris dougfabris commented Oct 17, 2025

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Bug Fixes

    • Improved modal accessibility by linking each modal to its title for better screen-reader support.
  • Tests

    • Upgraded end-to-end modal test helpers and flows for more reliable interaction, clearer assertions, and better wait handling.

@dougfabris dougfabris requested a review from a team as a code owner October 17, 2025 13:36
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Oct 17, 2025

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

  • This PR is targeting the wrong base branch. It should target 7.12.0, but it targets 7.11.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Oct 17, 2025

⚠️ No Changeset found

Latest commit: b6bee7f

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

@dougfabris dougfabris added this to the 7.12.0 milestone Oct 17, 2025
@dougfabris dougfabris added the stat: QA assured Means it has been tested and approved by a company insider label Oct 17, 2025
@dionisio-bot dionisio-bot bot removed the stat: QA assured Means it has been tested and approved by a company insider label Oct 17, 2025
@dougfabris dougfabris added the stat: QA assured Means it has been tested and approved by a company insider label Oct 17, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Oct 17, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 17, 2025

Walkthrough

Refactors e2e modal handling: removes the old Modal page-object, adds a base fragment with helpers, and introduces AppsModal and EditStatusModal subclasses. Tests updated to use the new fragments. Also adds aria-labelledby/id pairing to the ModalBlock component for accessibility.

Changes

Cohort / File(s) Summary
Modal Accessibility Enhancement
apps/meteor/client/views/modal/uikit/ModalBlock.tsx
Adds aria-labelledby={${id}-title} on the Modal and sets id={${id}-title} on ModalTitle.
Base Modal Fragment
apps/meteor/tests/e2e/page-objects/fragments/modal.ts
Adds waitForDisplay() (visibility assertion), a private btnSave locator, and save() which clicks Save and waits for dismissal.
AppsModal page-object
apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts
New AppsModal class (extends Modal); provides locators for text input, its error message, Submit button, and a submit(inputText: string) helper that fills, submits, and waits for dismissal.
EditStatusModal page-object
apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.ts
New EditStatusModal class (extends Modal); targets dialog "Edit Status", exposes input locator and changeStatusMessage(statusMessage: string) to fill and save.
Removed old Modal page-object
apps/meteor/tests/e2e/page-objects/modal.ts
Deleted exported Modal class and its helpers (getModalByName, textInput, textInputErrorMessage, btnModalSubmit) and removed Playwright type imports.
Tests updated to use new fragments
apps/meteor/tests/e2e/apps/apps-modal.spec.ts, apps/meteor/tests/e2e/presence.spec.ts
Replaced imports/usages of old Modal with AppsModal / EditStatusModal; tests now call waitForDisplay(), submit() or changeStatusMessage() and use fragment locators instead of direct element manipulation.
Index export update
apps/meteor/tests/e2e/page-objects/index.ts
Removed export * from './modal'.

Sequence Diagram(s)

sequenceDiagram
  participant Test as E2E Test
  participant AppsModal as AppsModal (page-object)
  participant ModalBase as Modal (fragment)
  participant UI as Browser Modal UI

  Test->>AppsModal: instantiate(page)
  Test->>AppsModal: waitForDisplay()
  AppsModal->>ModalBase: delegate waitForDisplay()
  ModalBase->>UI: assert dialog visible

  Test->>AppsModal: submit("text")
  AppsModal->>AppsModal: fill text input
  AppsModal->>ModalBase: click submit/save
  ModalBase->>UI: click button -> UI dismisses
  ModalBase->>AppsModal: wait for dismissal
  AppsModal->>Test: resolved
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • tassoevan
  • aleksandernsilva

Poem

🐰 I hopped through tests with a bright little jig,
Replaced the old Modal with fragments so spry,
Labeled the title so screen readers sing,
Fill, submit, dismiss — neat helpers reply,
A carrot of clarity beneath CI's sky. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The PR title "test: Merge modal page objects" references modal page objects, which is indeed relevant to the changeset. However, the term "Merge" is potentially misleading about what the PR actually accomplishes. The changeset shows a significant refactoring that creates new specialized page-object classes (AppsModal and EditStatusModal in a fragments directory), updates the base Modal class with new methods, removes the old generic Modal class, and reorganizes the structure—this is more accurately described as refactoring or reorganizing rather than merging. While the title is not entirely unrelated, it does not clearly or accurately convey the primary intent of the changes, making it ambiguous whether "merge" accurately describes the restructuring being done. Consider revising the title to more accurately reflect the main change, such as "test: Refactor modal page objects into specialized fragments" or "test: Extract specialized modal page-object classes". This would better communicate that the PR is reorganizing the modal page-object structure into multiple specialized classes rather than merging them, helping reviewers quickly understand the primary intent of the changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ 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/merge-modal-po

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.

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 (5)
apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts (3)

1-1: Use consistent import path.

Other test files import from '@playwright/test' instead of 'playwright-core'. Ensure consistency across the codebase.

Apply this diff:

-import type { Locator, Page } from 'playwright-core';
+import type { Locator, Page } from '@playwright/test';

6-6: Remove unused property.

The page property is declared but never used in this class. Consider removing it to reduce clutter.

Apply this diff:

 export class AppsModal extends Modal {
-	protected readonly page: Page;
-
 	constructor(page: Page) {

16-18: Consider using role-based locator for error message.

If the error message has a semantic role like alert or status, prefer getByRole() over getByText() for more robust and accessible selection.

apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.ts (2)

1-1: Use consistent import path.

Similar to AppsModal, this file imports from 'playwright-core' instead of '@playwright/test'. Maintain consistency with other test files.

Apply this diff:

-import type { Page } from 'playwright-core';
+import type { Page } from '@playwright/test';

6-6: Remove unused property.

The page property is declared but never referenced. Consider removing it.

Apply this diff:

 export class EditStatusModal extends Modal {
-	protected readonly page: Page;
-
 	constructor(page: Page) {
📜 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 b85e96a and f2b18c8.

📒 Files selected for processing (7)
  • apps/meteor/client/views/modal/uikit/ModalBlock.tsx (1 hunks)
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts (2 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/modal.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/modal.ts (0 hunks)
  • apps/meteor/tests/e2e/presence.spec.ts (2 hunks)
💤 Files with no reviewable changes (1)
  • apps/meteor/tests/e2e/page-objects/modal.ts
🧰 Additional context used
📓 Path-based instructions (4)
apps/meteor/tests/e2e/**/*.spec.ts

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

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

Files:

  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts
apps/meteor/tests/e2e/**/*.{ts,tsx,js,jsx}

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

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

Files:

  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modal.ts
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/apps-modal.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/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modal.ts
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/apps-modal.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/edit-status-modal.ts
  • apps/meteor/tests/e2e/page-objects/fragments/modal.ts
  • apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
PR: RocketChat/Rocket.Chat#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
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/presence.spec.ts
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/presence.spec.ts
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps/apps-modal.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps/apps-modal.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps/apps-modal.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps/apps-modal.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps/apps-modal.spec.ts
🧬 Code graph analysis (3)
apps/meteor/tests/e2e/presence.spec.ts (1)
apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.ts (1)
  • EditStatusModal (5-20)
apps/meteor/client/views/modal/uikit/ModalBlock.tsx (1)
packages/fuselage-ui-kit/src/surfaces/index.ts (1)
  • modalParser (15-15)
apps/meteor/tests/e2e/apps/apps-modal.spec.ts (2)
apps/meteor/tests/e2e/page-objects/home-channel.ts (1)
  • HomeChannel (6-127)
apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts (1)
  • AppsModal (5-29)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (12)
apps/meteor/tests/e2e/page-objects/fragments/modal.ts (3)

8-10: LGTM: Well-structured visibility assertion.

The method correctly uses web-first assertions and complements the existing waitForDismissal() method.


16-18: Consider i18n for button text.

The hard-coded 'Save' string may fail in non-English locales if the button text is localized. If the application supports multiple languages, consider whether this locator needs to be more flexible.


20-23: LGTM: Clean save flow.

The method correctly sequences the click action with dismissal verification.

apps/meteor/client/views/modal/uikit/ModalBlock.tsx (1)

178-178: LGTM: Proper ARIA labeling for accessibility.

The modal is correctly linked to its title using aria-labelledby, which improves screen reader support and follows WAI-ARIA authoring practices.

Also applies to: 181-181

apps/meteor/tests/e2e/presence.spec.ts (2)

4-4: LGTM: Clean migration to specialized modal.

The switch to EditStatusModal follows the Page Object Model pattern consistently and improves code organization. Based on learnings.

Also applies to: 51-51


55-55: LGTM: Cleaner API encapsulates modal interaction.

The changeStatusMessage() method provides a cleaner abstraction compared to the previous multi-step interaction, improving maintainability. Based on coding guidelines.

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

20-28: LGTM: Well-structured submit flow.

The btnSubmit getter correctly uses semantic locators, and the submit() method properly sequences the fill, click, and wait operations.

apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.ts (2)

12-14: LGTM: Proper semantic locator usage.

The getter correctly uses getByRole() with an accessible name, following coding guidelines and accessibility best practices. As per coding guidelines.


16-19: LGTM: Clean encapsulation of status change flow.

The method properly leverages the base Modal.save() method and provides a clear API for changing status messages.

apps/meteor/tests/e2e/apps/apps-modal.spec.ts (3)

6-6: LGTM: Clean migration to AppsModal.

The test correctly adopts the new AppsModal page object, following the Page Object Model pattern consistently. Based on learnings.

Also applies to: 14-14, 22-22


32-40: LGTM: Tests correctly use new modal APIs.

The tests properly utilize waitForDisplay() and direct access to btnSubmit, maintaining descriptive test names and web-first assertions. Based on learnings.


42-44: LGTM: Clean use of submit helper.

The test correctly uses the submit() helper method, which encapsulates the entire submission flow in a single, maintainable call.

@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.61%. Comparing base (6dd5ddd) to head (b6bee7f).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37253      +/-   ##
===========================================
- Coverage    67.61%   67.61%   -0.01%     
===========================================
  Files         3341     3341              
  Lines       114018   114018              
  Branches     20672    20669       -3     
===========================================
- Hits         77096    77094       -2     
- Misses       34246    34248       +2     
  Partials      2676     2676              
Flag Coverage Δ
e2e 57.32% <ø> (-0.03%) ⬇️
unit 71.59% <ø> (+0.01%) ⬆️

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.

MartinSchoeler
MartinSchoeler previously approved these changes Oct 17, 2025
Copy link
Member

@MartinSchoeler MartinSchoeler left a comment

Choose a reason for hiding this comment

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

Noice

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

♻️ Duplicate comments (1)
apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts (1)

12-14: Prefer semantic locators over attribute selectors.

The textInput getter uses locator('[name="modal_input"]'), which violates the guideline to avoid page.locator() and prefer semantic locators like getByRole('textbox') with an accessible name or getByLabel(). As per coding guidelines.

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

6-6: Remove unused property.

The page property is declared but never used within the class. Consider removing it to reduce clutter.

-	protected readonly page: Page;
-
 	constructor(page: Page) {
apps/meteor/tests/e2e/apps/apps-modal.spec.ts (2)

32-35: Add explicit assertion for modal visibility.

The test waits for the modal to display but doesn't assert its visibility. While waitForDisplay() may throw on timeout, an explicit assertion improves test clarity and intent.

 	test('should allow user open app modal', async () => {
 		await poHomeChannel.content.dispatchSlashCommand('/modal');
 		await poModal.waitForDisplay();
+		await expect(poModal.root).toBeVisible();
 	});

42-44: Add assertion to verify successful submission.

The test calls submit() but doesn't assert the outcome. Consider verifying that the modal dismissed successfully or that the error message is not visible.

 	test('should not display validation error message in app modal', async () => {
 		await poModal.submit('something');
+		await expect(poModal.textInputErrorMessage).not.toBeVisible();
 	});
apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.ts (1)

6-6: Remove unused page property.

The page property is declared but never referenced in this class. The base Modal handles page access through the locator passed to super().

Apply this diff to remove the unused property:

 export class EditStatusModal extends Modal {
-	protected readonly page: Page;
-
 	constructor(page: Page) {
 		super(page.getByRole('dialog', { name: 'Edit Status' }));
 	}
📜 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 f2b18c8 and 5409963.

📒 Files selected for processing (8)
  • apps/meteor/client/views/modal/uikit/ModalBlock.tsx (1 hunks)
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts (2 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/fragments/modal.ts (1 hunks)
  • apps/meteor/tests/e2e/page-objects/index.ts (0 hunks)
  • apps/meteor/tests/e2e/page-objects/modal.ts (0 hunks)
  • apps/meteor/tests/e2e/presence.spec.ts (2 hunks)
💤 Files with no reviewable changes (2)
  • apps/meteor/tests/e2e/page-objects/modal.ts
  • apps/meteor/tests/e2e/page-objects/index.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/meteor/tests/e2e/page-objects/fragments/modal.ts
  • apps/meteor/client/views/modal/uikit/ModalBlock.tsx
🧰 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/apps-modal.ts
  • apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.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/apps-modal.ts
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts
  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.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/apps-modal.ts
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts
  • apps/meteor/tests/e2e/presence.spec.ts
  • apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.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/apps/apps-modal.spec.ts
  • apps/meteor/tests/e2e/presence.spec.ts
🧠 Learnings (11)
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps-modal.ts
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps-modal.ts
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps-modal.ts
  • apps/meteor/tests/e2e/apps/apps-modal.spec.ts
📚 Learning: 2025-09-23T19:22:59.217Z
Learnt from: dougfabris
PR: RocketChat/Rocket.Chat#36987
File: apps/meteor/tests/e2e/page-objects/fragments/room-toolbar.ts:10-20
Timestamp: 2025-09-23T19:22:59.217Z
Learning: In Playwright e2e tests, prefer stable selectors like data-qa-id attributes over localized text in getByRole() or getByText() calls to prevent test failures when UI language changes. Test translations separately by validating actual text content after ensuring UI interactions work with stable selectors.

Applied to files:

  • apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps-modal.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps/apps-modal.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps/apps-modal.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps/apps-modal.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps/apps-modal.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps/apps-modal.spec.ts
📚 Learning: 2025-09-16T22:08:51.490Z
Learnt from: CR
PR: RocketChat/Rocket.Chat#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/apps/apps-modal.spec.ts
🧬 Code graph analysis (2)
apps/meteor/tests/e2e/apps/apps-modal.spec.ts (2)
apps/meteor/tests/e2e/page-objects/home-channel.ts (1)
  • HomeChannel (6-127)
apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts (1)
  • AppsModal (5-29)
apps/meteor/tests/e2e/presence.spec.ts (1)
apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.ts (1)
  • EditStatusModal (5-20)
⏰ 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). (7)
  • GitHub Check: 🔨 Test Unit / Unit Tests
  • GitHub Check: 🔨 Test Storybook / Test Storybook
  • GitHub Check: 🔎 Code Check / Code Lint
  • GitHub Check: 🔎 Code Check / TypeScript
  • GitHub Check: 📦 Meteor Build - coverage
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (7)
apps/meteor/tests/e2e/page-objects/fragments/apps-modal.ts (1)

24-28: Well-structured helper method.

The submit method effectively encapsulates the submission flow and follows the DRY principle by providing a reusable interaction pattern.

apps/meteor/tests/e2e/apps/apps-modal.spec.ts (1)

37-40: Clear validation test with proper assertion.

The test correctly verifies the error message appears when submitting without input, using web-first assertions as recommended.

apps/meteor/tests/e2e/page-objects/fragments/edit-status-modal.ts (3)

8-10: LGTM!

The constructor properly targets the "Edit Status" dialog using a semantic locator and passes it to the base Modal class.


12-14: LGTM!

The getter correctly uses a semantic locator to target the status message textbox via its accessible name.


16-19: LGTM!

The method provides a clean abstraction for changing the status message. It properly fills the input and saves the modal, encapsulating the interaction logic per the Page Object Model pattern.

apps/meteor/tests/e2e/presence.spec.ts (2)

4-4: LGTM!

The import correctly references the new EditStatusModal fragment from the appropriate location.


51-55: LGTM!

The refactor properly uses the new EditStatusModal page object, replacing the previous multi-step interaction with a single, encapsulated method call. This improves maintainability and follows the DRY principle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants