Skip to content

Conversation

@Dnouv
Copy link
Member

@Dnouv Dnouv commented Sep 19, 2025

Proposed changes (including videos or screenshots)

This pull request makes a minor improvement to the iframe-authentication end-to-end test by ensuring that the main content is fully visible before performing assertions. This change helps prevent flaky tests due to timing issues.

  • Added an explicit wait for poUtils.mainContent to be visible before asserting its visibility in the test iframe-authentication.spec.ts.

Issue(s)

Steps to test or reproduce

Further comments

CORE-1388

Summary by CodeRabbit

  • Tests
    • Enhanced end-to-end stability by adding explicit visibility checks in token-based login flows and deterministic focus handling for the video conferencing microphone control.
    • Improves CI reliability by asserting UI readiness before validations, reducing intermittent failures in authentication and video conferencing scenarios.
    • No changes to user-facing behavior or settings; build and deployment unaffected.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 19, 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 Sep 19, 2025

⚠️ No Changeset found

Latest commit: 676d4e4

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 Sep 19, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds explicit waits and focus actions to stabilize two end-to-end tests: one waits for main content visibility after navigating home in iframe authentication; the other explicitly focuses the video conference mic button before asserting focus. No API or export signatures changed.

Changes

Cohort / File(s) Summary
Iframe auth e2e wait for visibility
apps/meteor/tests/e2e/iframe-authentication.spec.ts
After navigating to /home in the token-login test, adds an explicit wait for main content visibility before the existing visibility assertion.
Video conference e2e focus adjustment
apps/meteor/tests/e2e/video-conference.spec.ts
After showing the popup, explicitly calls focus() on the mic button before asserting it is focused; no other steps changed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • MartinSchoeler
  • tassoevan

Poem

A bunny taps the keys—click, click!
Waits for pages, quick but slick.
Mic gets focus, ears perk high,
Tests now pass and hop on by.
Carrots cached, green lights glow—
Ship it fast, then off we go! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title "test: failing test on iframe-authentication" clearly references the affected iframe-authentication test and is related to the changes which add explicit waits to reduce flakiness, but it frames the PR as a symptom (a failing test) rather than the corrective action. It is concise and specific enough for a reviewer to know which area is impacted, though it does not explicitly state that the PR fixes or stabilizes the test.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

@codecov
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.23%. Comparing base (050f1dc) to head (676d4e4).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #36996      +/-   ##
===========================================
- Coverage    66.23%   66.23%   -0.01%     
===========================================
  Files         3384     3384              
  Lines       115027   115044      +17     
  Branches     21064    20929     -135     
===========================================
+ Hits         76185    76195      +10     
- Misses       36247    36250       +3     
- Partials      2595     2599       +4     
Flag Coverage Δ
e2e 57.05% <ø> (+<0.01%) ⬆️
unit 71.19% <ø> (-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.

@Dnouv Dnouv marked this pull request as ready for review September 19, 2025 11:12
@Dnouv Dnouv requested a review from a team as a code owner September 19, 2025 11:12
@Dnouv Dnouv marked this pull request as draft September 19, 2025 11:14
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 (1)
apps/meteor/tests/e2e/iframe-authentication.spec.ts (1)

80-82: LGTM: explicit visibility wait reduces flakiness after token login.

This aligns with our guidance to use specific waits over timeouts and should stabilize the post-login render. Optionally, you could rely solely on the web-first assertion (keep only toBeVisible) to avoid redundancy, or complement with await expect(page).toHaveURL(/\/home/) for navigation completion.

📜 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 050f1dc and 9020327.

📒 Files selected for processing (2)
  • apps/meteor/tests/e2e/iframe-authentication.spec.ts (1 hunks)
  • apps/meteor/tests/e2e/video-conference.spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
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/iframe-authentication.spec.ts
  • apps/meteor/tests/e2e/video-conference.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/iframe-authentication.spec.ts
  • apps/meteor/tests/e2e/video-conference.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/iframe-authentication.spec.ts
  • apps/meteor/tests/e2e/video-conference.spec.ts
🧠 Learnings (11)
📓 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} : Implement proper wait strategies for dynamic content
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} : Use page.waitFor() with specific conditions and avoid hardcoded timeouts
📚 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} : Implement proper wait strategies for dynamic content

Applied to files:

  • apps/meteor/tests/e2e/iframe-authentication.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/iframe-authentication.spec.ts
  • apps/meteor/tests/e2e/video-conference.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 descriptive test names that clearly communicate expected behavior

Applied to files:

  • apps/meteor/tests/e2e/iframe-authentication.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/iframe-authentication.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} : Use page.waitFor() with specific conditions and avoid hardcoded timeouts

Applied to files:

  • apps/meteor/tests/e2e/iframe-authentication.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 : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/tests/e2e/iframe-authentication.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/iframe-authentication.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 : Maintain test isolation between test cases

Applied to files:

  • apps/meteor/tests/e2e/iframe-authentication.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/iframe-authentication.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 : Ensure a clean state for each test execution

Applied to files:

  • apps/meteor/tests/e2e/iframe-authentication.spec.ts
🔇 Additional comments (1)
apps/meteor/tests/e2e/video-conference.spec.ts (1)

39-41: Don't programmatically force focus; assert product-driven focus instead.

Remove the explicit focus() call — wait for the popup and assert the mic button becomes focused on its own.

File: apps/meteor/tests/e2e/video-conference.spec.ts (lines 39–41)

 			await expect(poHomeChannel.content.getVideoConfPopup(`Start a call in ${targetChannel}`)).toBeVisible();
-			await poHomeChannel.content.btnVideoConfMic.focus();
+			await expect(poHomeChannel.content.btnVideoConfMic).toBeVisible();
 			await expect(poHomeChannel.content.btnVideoConfMic).toBeFocused();

Previous grep run returned no matches; rerun this to verify other occurrences or allow an expanded search:

rg -nP --type=ts -U '(?s)focus\(\);\s*await\s+expect\([^)]*\)\.toBeFocused\(' apps/meteor/tests/e2e

@Dnouv Dnouv changed the title chore: failing test on iframe-authentication test: failing test on iframe-authentication Sep 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.

2 participants