Skip to content

test: stabilize flaky omnichannel and livechat specs#40775

Merged
dionisio-bot[bot] merged 4 commits into
developfrom
test/omnichannel-flaky-e2e
Jun 3, 2026
Merged

test: stabilize flaky omnichannel and livechat specs#40775
dionisio-bot[bot] merged 4 commits into
developfrom
test/omnichannel-flaky-e2e

Conversation

@jessicaschelly
Copy link
Copy Markdown
Member

@jessicaschelly jessicaschelly commented Jun 2, 2026

Proposed changes (including videos or screenshots)

This PR focus on stabilizing flaky Omnichannel/API tests by adding explicit waits for the UI/API state each assertion depends on, instead of relying on timing from previous actions.

Area Change
Omnichannel managers Wait for the manager form to be visible before interacting with it.
Livechat read receipts Wait for the viewed/read receipt state before asserting the read-by dialog content.
Omnichannel units Wait for selected monitor state and unit row removal before continuing assertions.
Livechat dashboard API Reset test agents to available before asserting agent status metrics.
Agent idle routing Ensure agent availability state is explicit for routing assertions.
Canned responses Use a more specific popup item locator for selecting canned responses.
Livechat triggers Wait for the livechat registration form input to be visible before filling it.
Chat transfers Wait for the forward modal to close before asserting sidebar ownership changes.

No screenshots or videos: test-only changes.

Issue(s)

FLAKY-1605
FLAKY-1403
FLAKY-1829
FLAKY-1866
FLAKY-1865
FLAKY-1603
FLAKY-1319

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Tests
    • Improved omnichannel E2E test reliability and coverage across chat transfers, agent idle settings, read receipts, triggers, and units modules.
    • Enhanced test assertions for modal dismissal, agent availability status, and message read receipts.
    • Refactored page object navigation and canned response selection flows for improved test maintainability.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Jun 2, 2026

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 2, 2026

⚠️ No Changeset found

Latest commit: 2772b86

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
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

Walkthrough

This PR updates eight omnichannel e2e test files and page objects to improve test stability. Changes include adding modal dismissal synchronization, UI visibility assertions, agent availability setup calls, refactoring page object navigation via a new goto() method, and updating canned response selection interaction logic using a popup-based approach.

Changes

Omnichannel E2E Test Stabilization

Layer / File(s) Summary
OmnichannelManager page object navigation
apps/meteor/tests/e2e/page-objects/omnichannel/omnichannel-manager.ts, apps/meteor/tests/e2e/omnichannel/omnichannel-manager.spec.ts
Introduce async goto() method to OmnichannelManager to navigate directly to /omnichannel/managers and wait for "Add manager" button visibility, replacing manual page navigation in test setup.
Test synchronization and assertion improvements
apps/meteor/tests/e2e/omnichannel/omnichannel-chat-transfers.spec.ts, apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-read-receipts.spec.ts, apps/meteor/tests/e2e/omnichannel/omnichannel-triggers.spec.ts, apps/meteor/tests/e2e/omnichannel/omnichannel-units.spec.ts
Add waits for modal dismissal after forward button click, visibility checks for live chat name input during guest registration, status "Message viewed" assertion for read receipts, monitor chip visibility confirmation during unit creation, and update unit deletion verification from "No units yet" message to row count assertion.
Agent availability initialization pattern
apps/meteor/tests/e2e/omnichannel/omnichannel-livechat-agent-idle-setting.spec.ts, apps/meteor/tests/end-to-end/api/livechat/04-dashboards.ts
Import and invoke makeAgentAvailable in agent idle setting test beforeEach and dashboard test setup to ensure agents are set to available status before running assertions; add online status badge visibility assertion in idle setting test.
Canned response selection popup interaction
apps/meteor/tests/e2e/page-objects/fragments/home-omnichannel-content.ts
Refactor selectCannedResponse to wait for composer boxPopup visibility, type canned response name, and click exact-match popup item instead of using page-level menu selector with Enter keypress.

Possibly related PRs

  • RocketChat/Rocket.Chat#40741: Both PRs modify omnichannel-livechat-read-receipts.spec.ts to adjust agent message read flow and align test assertions with backend timing around read-receipt/read-view state.
  • RocketChat/Rocket.Chat#40512: The PR adds "Message viewed" status assertion in read-receipts test that directly validates livechat read-receipts behavior implemented in this related PR.

Suggested labels

type: chore

Suggested reviewers

  • tassoevan

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main objective of the PR: stabilizing flaky omnichannel and livechat test specifications by adding explicit waits and state validations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (7)
  • FLAKY-1605: Request failed with status code 401
  • FLAKY-1403: Request failed with status code 401
  • FLAKY-1829: Request failed with status code 401
  • FLAKY-1866: Request failed with status code 401
  • FLAKY-1865: Request failed with status code 401
  • FLAKY-1603: Request failed with status code 401
  • FLAKY-1319: Request failed with status code 401

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.75%. Comparing base (da1de5f) to head (2772b86).
⚠️ Report is 5 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40775      +/-   ##
===========================================
- Coverage    69.80%   69.75%   -0.05%     
===========================================
  Files         3327     3330       +3     
  Lines       123135   123158      +23     
  Branches     21983    21982       -1     
===========================================
- Hits         85952    85909      -43     
- Misses       33832    33898      +66     
  Partials      3351     3351              
Flag Coverage Δ
e2e 59.35% <ø> (+0.01%) ⬆️
e2e-api 46.26% <ø> (-0.84%) ⬇️
unit 70.46% <ø> (-0.06%) ⬇️

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 June 3, 2026 12:47
@jessicaschelly jessicaschelly requested review from a team as code owners June 3, 2026 12:47
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 9 files

Re-trigger cubic

@jessicaschelly jessicaschelly changed the title test: reduce omnichannel flakiness test: stabilize flaky omnichannel and livechat specs Jun 3, 2026
@KevLehman KevLehman added this to the 8.6.0 milestone Jun 3, 2026
@gabriellsh gabriellsh added the stat: QA assured Means it has been tested and approved by a company insider label Jun 3, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 3, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue Jun 3, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 3, 2026
@jessicaschelly jessicaschelly removed the stat: QA assured Means it has been tested and approved by a company insider label Jun 3, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Jun 3, 2026
@jessicaschelly jessicaschelly added the stat: QA assured Means it has been tested and approved by a company insider label Jun 3, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 3, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue Jun 3, 2026
Merged via the queue into develop with commit 94bf85d Jun 3, 2026
48 checks passed
@dionisio-bot dionisio-bot Bot deleted the test/omnichannel-flaky-e2e branch June 3, 2026 20:08
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 type: chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants