Skip to content

docs: e2e performance migration rollout plan#40257

Draft
ggazzo wants to merge 14 commits into
developfrom
docs/e2e-performance-migration-plan
Draft

docs: e2e performance migration rollout plan#40257
ggazzo wants to merge 14 commits into
developfrom
docs/e2e-performance-migration-plan

Conversation

@ggazzo
Copy link
Copy Markdown
Member

@ggazzo ggazzo commented Apr 22, 2026

Summary

  • New proposal at docs/proposals/e2e-performance-migration.md laying out how we roll out the two performance patterns landed in test: optimize quote messages suite #39691 across the remaining ~150 Playwright specs.
  • The patterns themselves (benefits, anti-patterns, template, helper catalog, per-file recipe) live in apps/meteor/tests/e2e/README.md — this doc intentionally only covers the rollout (phasing, triage, batch rules, guardrails, handoff to contributors and AI agents).

What's inside

  • Phase 0 — consolidate and split the utils/ helpers before any migration starts.
  • Phase 1 — one-shot triage that produces the prioritized worklist (includes explicit do-not-migrate list).
  • Phase 2 — migration in batches of max 5 specs per PR, with a mandatory PR body template for before/after timings.
  • Phase 3 — guardrails (review checklist, optional lint, timing watchdog) so we don't regress.
  • Pickup guide — separate instructions for human contributors and AI agents.

Test plan

  • Docs-only change — no code paths touched.
  • Internal links verified (#performance-patterns, #migrating-an-existing-suite, path to e2e README).
  • Team agreement on the do-not-migrate list and the 5-files-per-PR cap before the first Phase 2 PR lands.

Summary by CodeRabbit

  • Documentation
    • Added end-to-end testing performance migration guidelines and rollout plan to development documentation.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

⚠️ No Changeset found

Latest commit: be99397

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

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Apr 22, 2026

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 targeting the wrong base branch. It should target 8.5.0, but it targets 8.4.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

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.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bf77e382-13c9-4f8a-8870-6265458dea76

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Introduces a new documentation file defining an end-to-end rollout plan for migrating the Playwright E2E test suite to performance patterns established in PR #39691. The document specifies baseline metrics, success criteria, a phased execution approach, and contributor guidelines.

Changes

Cohort / File(s) Summary
E2E Performance Migration Documentation
docs/proposals/e2e-performance-migration.md
New proposal document outlining a phased migration plan for the Playwright E2E suite, including baseline state, success criteria (helper consolidation, lifecycle behavior, CI time improvements, coverage non-regression), phased execution details (Phases 0-3), and contributor instructions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Suggested labels

type: chore

🚥 Pre-merge checks | ✅ 5
✅ 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 'docs: e2e performance migration rollout plan' accurately and concisely describes the main change: a new documentation file introducing an end-to-end rollout plan for migrating the Playwright E2E suite to performance patterns.
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.

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


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.

Proposal for rolling out the two performance patterns landed in #39691
across the remaining E2E suite. Patterns themselves live in the e2e
README; this doc focuses only on how we migrate 150+ files in batches
without regressing coverage or review throughput.
@ggazzo ggazzo force-pushed the docs/e2e-performance-migration-plan branch from 82f5f7e to 8a05976 Compare April 22, 2026 17:09
@ggazzo ggazzo added this to the 8.5.0 milestone Apr 22, 2026
@ggazzo ggazzo marked this pull request as draft April 22, 2026 17:09
Copy link
Copy Markdown
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.

🧹 Nitpick comments (3)
docs/proposals/e2e-performance-migration.md (3)

94-94: Clarify the "Tests" column in the impact table.

The per-file impact table includes a "Tests" column, but it's unclear what this represents. Is it:

  • Total number of test cases in the file?
  • Number of tests that were modified?
  • Number of tests that were consolidated?

Adding a brief note in the template (e.g., "Tests = number of test cases") would improve clarity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/proposals/e2e-performance-migration.md` at line 94, Clarify the meaning
of the "Tests" column in the per-file impact table by updating the table header
or adding a brief note in the template: change the header to e.g. "Tests (number
of test cases)" or append a short footnote like "Tests = number of test cases in
the file" near the table in e2e-performance-migration.md so readers know it
represents the total number of test cases per file; update the table header text
or the surrounding explanatory text accordingly to reflect this definition.

61-61: Define "setup-only test.step" criteria.

The term "setup-only test.steps" is used to filter UI setup hits but isn't clearly defined. What distinguishes a setup-only step from a behavior-testing step? Consider adding explicit criteria, such as:

  • Steps that only create state without assertions
  • Steps labeled with "setup" or "arrange" in their description
  • Steps that appear before the first expect() call

This will ensure consistent triage across contributors and AI agents.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/proposals/e2e-performance-migration.md` at line 61, The term "setup-only
test.step"s used in the ui_setup_hits metric is ambiguous; update the proposal
to define deterministic criteria for identifying setup-only steps: steps inside
beforeAll/beforeEach or test.step whose body contains only state-mutating calls
(e.g. content.sendMessage, openLastMessageMenu, btnCreateDiscussionModal,
btnCreateChannel, btnCreateDirectMessage) with no assertions, or whose
description includes canonical flags like "setup" or "arrange", or that occur
entirely before the first expect() in the test; include these three rules (no
assertions, descriptive label, pre-expect position) and an explicit precedence
rule for conflicting cases so contributors and automation can consistently
classify test.step entries.

43-43: Clarify the function signature notation.

The signature sendMessage(api, roomId, msg, { threadId?, asUser? }) is ambiguous. Is the entire options object optional, or just the properties within it? Consider using TypeScript-like notation for clarity:

sendMessage(api, roomId, msg, options?: { threadId?: string, asUser?: User })

This makes it clear that the fourth parameter is optional and contains optional properties.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/proposals/e2e-performance-migration.md` at line 43, Update the
proposal's function signature to remove ambiguity by using TypeScript-style
optional notation: replace `sendMessage(api, roomId, msg, { threadId?, asUser?
})` with `sendMessage(api, roomId, msg, options?: { threadId?: string, asUser?:
User })`, and mention that this unifies `sendMessage` and `sendMessageFromUser`
into a single function where the entire options object is optional and its
properties are individually optional.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/proposals/e2e-performance-migration.md`:
- Line 94: Clarify the meaning of the "Tests" column in the per-file impact
table by updating the table header or adding a brief note in the template:
change the header to e.g. "Tests (number of test cases)" or append a short
footnote like "Tests = number of test cases in the file" near the table in
e2e-performance-migration.md so readers know it represents the total number of
test cases per file; update the table header text or the surrounding explanatory
text accordingly to reflect this definition.
- Line 61: The term "setup-only test.step"s used in the ui_setup_hits metric is
ambiguous; update the proposal to define deterministic criteria for identifying
setup-only steps: steps inside beforeAll/beforeEach or test.step whose body
contains only state-mutating calls (e.g. content.sendMessage,
openLastMessageMenu, btnCreateDiscussionModal, btnCreateChannel,
btnCreateDirectMessage) with no assertions, or whose description includes
canonical flags like "setup" or "arrange", or that occur entirely before the
first expect() in the test; include these three rules (no assertions,
descriptive label, pre-expect position) and an explicit precedence rule for
conflicting cases so contributors and automation can consistently classify
test.step entries.
- Line 43: Update the proposal's function signature to remove ambiguity by using
TypeScript-style optional notation: replace `sendMessage(api, roomId, msg, {
threadId?, asUser? })` with `sendMessage(api, roomId, msg, options?: {
threadId?: string, asUser?: User })`, and mention that this unifies
`sendMessage` and `sendMessageFromUser` into a single function where the entire
options object is optional and its properties are individually optional.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2edcc46e-f943-47c6-bce7-40d9c2ab0b91

📥 Commits

Reviewing files that changed from the base of the PR and between 5cf4c7c and 8a05976.

📒 Files selected for processing (1)
  • docs/proposals/e2e-performance-migration.md
📜 Review details
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: smirk-dev
Repo: RocketChat/Rocket.Chat PR: 39625
File: apps/meteor/app/api/server/v1/push.ts:85-97
Timestamp: 2026-03-14T14:58:58.834Z
Learning: In RocketChat/Rocket.Chat, the `push.token` POST/DELETE endpoints in `apps/meteor/app/api/server/v1/push.ts` were already migrated to the chained router API pattern on `develop` prior to PR `#39625`. `cleanTokenResult` (which strips `authToken` and returns `PushTokenResult`) and `isPushTokenPOSTProps`/`isPushTokenDELETEProps` validators already exist on `develop`. PR `#39625` only migrates `push.get` and `push.info` to the chained pattern. Do not flag `cleanTokenResult` or `PushTokenResult` as newly introduced behavior-breaking changes when reviewing this PR.
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.step()` for complex test scenarios to improve organization in Playwright tests
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Implement proper wait strategies for dynamic content in Playwright tests
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.spec.ts : Use descriptive test names that clearly communicate expected behavior in Playwright tests
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure clean state for each test execution in Playwright tests
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.beforeAll()` and `test.afterAll()` for setup/teardown in Playwright tests
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `page.waitFor()` with specific conditions instead of hardcoded timeouts in Playwright tests
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files

Applied to files:

  • docs/proposals/e2e-performance-migration.md
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests

Applied to files:

  • docs/proposals/e2e-performance-migration.md
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.step()` for complex test scenarios to improve organization in Playwright tests

Applied to files:

  • docs/proposals/e2e-performance-migration.md
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Implement proper wait strategies for dynamic content in Playwright tests

Applied to files:

  • docs/proposals/e2e-performance-migration.md
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure clean state for each test execution in Playwright tests

Applied to files:

  • docs/proposals/e2e-performance-migration.md
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests

Applied to files:

  • docs/proposals/e2e-performance-migration.md
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.beforeAll()` and `test.afterAll()` for setup/teardown in Playwright tests

Applied to files:

  • docs/proposals/e2e-performance-migration.md
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • docs/proposals/e2e-performance-migration.md
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests

Applied to files:

  • docs/proposals/e2e-performance-migration.md
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `page.waitFor()` with specific conditions instead of hardcoded timeouts in Playwright tests

Applied to files:

  • docs/proposals/e2e-performance-migration.md
📚 Learning: 2026-03-16T11:50:18.066Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 39657
File: apps/meteor/tests/end-to-end/apps/app-resolve-visitor.ts:18-21
Timestamp: 2026-03-16T11:50:18.066Z
Learning: In `apps/meteor/tests/end-to-end/apps/` (and Livechat E2E tests broadly), calling `createAgent()` and `makeAgentAvailable()` immediately after `updateSetting('Livechat_enabled', true)` — without any intermediate sleep — is an established, non-flaky pattern used across 10+ tests in the codebase. Do not flag this sequence as a potential race condition or suggest adding a delay between them.

Applied to files:

  • docs/proposals/e2e-performance-migration.md
📚 Learning: 2026-02-04T12:09:05.769Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 38374
File: apps/meteor/tests/end-to-end/apps/app-logs-nested-requests.ts:26-37
Timestamp: 2026-02-04T12:09:05.769Z
Learning: In E2E tests at apps/meteor/tests/end-to-end/apps/, prefer sleeping for a fixed duration (e.g., 1 second) over implementing polling/retry logic when waiting for asynchronous operations to complete. Tests should fail deterministically if the expected result isn't available after the sleep.

Applied to files:

  • docs/proposals/e2e-performance-migration.md
🪛 LanguageTool
docs/proposals/e2e-performance-migration.md

[uncategorized] ~57-~57: Did you mean the formatting language “Markdown” (= proper noun)?
Context: ...hase 2. Deliverable: a spreadsheet (or markdown table, committed under `docs/proposals/...

(MARKDOWN_NNP)


[uncategorized] ~115-~115: The official name of this software platform is spelled with a capital “H”.
Context: ...rns to flag in review". Link to it from .github/pull_request_template.md under the E2E...

(GITHUB)

🔇 Additional comments (1)
docs/proposals/e2e-performance-migration.md (1)

3-3: All referenced files and anchors exist and are correctly accessible:

  • apps/meteor/tests/e2e/README.md with ## Performance patterns section ✓
  • apps/meteor/tests/e2e/federation/README.md
  • .github/PULL_REQUEST_TEMPLATE.md

No issues found.

ggazzo added 4 commits April 23, 2026 11:50
Phase 0 of the rollout plan in docs/proposals/e2e-performance-migration.md.

- Split utils/create-target-channel.ts by concern into channels.ts,
  groups.ts, teams.ts, direct-messages.ts, discussions.ts, messages.ts
  and rooms.ts so specs import by topic instead of a catch-all file.
- Unify sendMessage and sendMessageFromUser into a single
  sendMessage(api, roomId, msg, { threadId?, asUser? }) using
  /chat.sendMessage uniformly.
- Add createThreadReply, inviteUsersToRoom and setRoomTopic helpers
  identified as missing for Phase 2 migrations.
- Re-export the new surface from utils/index.ts so specs stay on the
  './utils' import path.
- Update README helper table to match.
Phase 1 of the rollout plan: the generated triage table is the input
for Phase 2 batches.

- apps/meteor/tests/e2e/scripts/e2e-triage.mts walks the spec tree,
  flags serial suites, and counts UI-setup calls inside beforeAll /
  beforeEach and assertion-free test.step bodies.
- docs/proposals/e2e-migration-triage.md: generated worklist (152
  specs, 144 migration candidates, 8 opt-outs from the do-not-migrate
  list). ci_median_ms left blank for a human to fill in from the
  latest Playwright report; rows are sorted by a stand-in score until
  that number is populated.
- Plan doc now points at both the triage file and the generator.
Phase 2 batch 1. Per-file impact pending a Playwright-report rerun;
structural changes only.

Files in this batch:
- report-message.spec.ts — replace 5 "send message as user1" test.steps
  with sendMessage(api, channelId, msg, { asUser: Users.user1 }) and
  reuse the admin HomeChannel created in beforeAll. Drops the user1
  page.goto('/home') on 4 of 5 tests (only the own-message menu test
  still needs it).
- messaging.spec.ts — seed msg1 / msg2 via API (as user1, so the
  edit-by-ArrowUp assertion still passes) in the outer beforeAll
  instead of the first Navigation test.
- threads.spec.ts — parent messages for the two outer tests and the
  "thread message actions" beforeEach now come from sendMessage(api,
  ...). UI openReplyInThread / sendMessageInThread stays because the
  tests are about the reply-in-thread flow itself.
- image-gallery.spec.ts — image-link seed in the "When sending an
  image as a link" describe moved to sendMessage(api, ...,
  { asUser: Users.user1 }) so the unfurling still happens server-side
  but the client-side type-and-send step is gone.

Pattern 2 (shared browser context): not applied. None of these suites
meet every precondition: report-message uses two pages, messaging
spans multiple serial describes that don't leave the page at a
shared home position, threads and image-gallery tests end in
different URL/gallery states. Captured for follow-up PRs.

Timings: not measured — this environment cannot run Playwright. The
triage doc still has ci_median_ms blank; the PR body should be
updated with before/after numbers before merge per the Phase 2
template in docs/proposals/e2e-performance-migration.md.
Fixes surfaced while running the Phase 2 batch against a live server.

- utils/messages.ts: Playwright's APIRequestContext resolves a path with
  a leading slash against the origin, not the baseURL. Calling
  userContext.post('/chat.sendMessage') was hitting /chat.sendMessage
  (404) instead of /api/v1/chat.sendMessage. Drop the baseURL and use
  the BASE_API_URL-prefixed absolute URL, matching the old
  sendMessageFromUser call.
- utils/rooms.ts: add joinChannelAsUser(roomId, user) which performs
  /channels.join as the given user. Unlike inviteUsersToRoom (admin
  adds someone, emits "added" system message), this produces the
  single "joined" system message that UI-driven joins produce.
- messaging.spec.ts: after navbar.openChat, click the composer to move
  keyboard focus there so the Navigation/Edition keyboard shortcuts
  have the right starting point the UI sendMessage used to provide.
  Seed user1's membership via joinChannelAsUser so the Navigation
  test's "first system message" assertion still resolves to exactly
  one system message.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.39%. Comparing base (053b311) to head (be99397).
⚠️ Report is 17 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40257      +/-   ##
===========================================
- Coverage    69.84%   69.39%   -0.46%     
===========================================
  Files         3296     3274      -22     
  Lines       119173   118446     -727     
  Branches     21514    21288     -226     
===========================================
- Hits         83233    82192    -1041     
- Misses       32635    33082     +447     
+ Partials      3305     3172     -133     
Flag Coverage Δ
e2e 57.83% <ø> (-1.88%) ⬇️
e2e-api 46.20% <ø> (-0.86%) ⬇️
unit 70.57% <ø> (-0.02%) ⬇️

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.

ggazzo added 8 commits April 23, 2026 18:34
Phase 2, pattern 2. account-security is a 6-test serial suite that all
hit /account/security under the admin user — the precondition for a
shared browser context is met. Moves context/page creation to
beforeAll, keeps the per-test page.goto + the Accounts_Password_Policy
toggle, tears the page down in afterAll. Verified against a live
server: 6 passed (14.6s).

account-profile.spec.ts attempted the same migration but Personal
Access Tokens failed in a way (page.waitForResponse → "Target page
has been closed") I could not reproduce without a running server;
leaving the file at HEAD until it can be debugged live.
Finishes the non-lint guardrails from the rollout plan; the optional
ESLint rule is still open.

- .github/PULL_REQUEST_TEMPLATE.md: point E2E reviewers at the
  "Anti-patterns to flag in review" section of the e2e README and the
  performance-migration plan.
- apps/meteor/playwright.config.ts: enable Playwright's JSON reporter
  (tests/e2e/.playwright/results.json). The file rides along in the
  existing `playwright-test-trace-*` artifact uploads, so no workflow
  change is needed to expose it.
- apps/meteor/tests/e2e/scripts/e2e-timing-report.mts: turns a
  results.json into a markdown table of specs whose p50 exceeds the
  3s/test target (`ci_median_ms` baseline from the plan). Default
  threshold is configurable via CLI arg.
- .github/workflows/e2e-timing-guardrail.yml: Mondays 09:00 UTC +
  manual dispatch; downloads the latest successful ci.yml artifact
  from develop and posts the report to the run summary, so recurring
  offenders surface without digging through Playwright HTML.
- docs/proposals/e2e-performance-migration.md: Phase 3 section now
  reflects what landed and what is still open.
- docs/proposals/e2e-migration-triage.md: regenerated after the Phase
  2 batch — down from 9 to 5 files with UI setup hits.
Phase 2 batch 3 — pattern 2 on 4 serial suites that met the shared-user
precondition, validated against the live dev server.

- account-profile.spec.ts — 8 of 9 tests (1 is test.skip by a
  pre-existing FIXME). The Personal Access Tokens test needs the
  'create-personal-access-tokens' permission on the 'user' role; in CI
  this is seeded, locally it may not be.
- admin-room.spec.ts — 6 tests, admin, beforeEach goto('/admin/rooms').
- emojis.spec.ts — 4 tests, admin, beforeEach goto('/home').
- file-upload.spec.ts — 14 tests across three nested describes. The
  video-message test now grants camera/microphone on the shared
  context (not the default test fixture) so the Video message button
  actually enables.
Three more serial, single-user suites that meet the shared-context
precondition.

- jump-to-thread-message.spec.ts — 3 tests, admin, each test goto to a
  different message link.
- email-inboxes.spec.ts — 2 tests, admin, beforeEach goto
  /admin/email-inboxes. (The delete test assumes an empty inboxes
  table — leftover inboxes from older runs break it; not a migration
  regression.)
- messaging-scroll-to-bottom.spec.ts — 4 tests, admin. Moves the
  shared 1023x700 viewport into browser.newContext so each test
  doesn't have to reset it.
6 admin tests against /admin/import and /admin/rooms — each was
re-creating the AdminImports / AdminRooms page-objects per test.
Move context, page and page-objects into beforeAll so the suite pays
the hydration cost once.
Three more serial admin suites share a browser context.

- system-messages.spec.ts — 4 tests, page-object + page moved to
  beforeAll. Each test still does its own /home goto + openChat in
  beforeEach.
- settings-assets.spec.ts — 4 tests, same shape.
- sidebar.spec.ts — 14 tests, the trickier one. Tests shrink the
  viewport to 1023x767 / 767x510 for mobile/tablet checks; beforeEach
  now resets to 1280x720 so a previous test's mobile size doesn't
  leak in.
12-test serial suite under user1. One test shrinks to 768x600 for the
compact toolbar check — beforeEach resets to 1280x720 so the next
test starts at the expected viewport.

Also add user1 to targetChannel members (the channel is now shared
across tests and user1 needs to post without the UI join step).
Shard 1/4 of the UI CI job hit a flaky "Target page has been closed"
on the Avatar > "should show inline error if url does not point to
an image" test after 60s timeout. Reproduces locally when the dev
meteor server has any hiccup. The account-profile form state does
not fully reset across the shared page the way page.goto('/account/
profile') suggests — leaving the shared-context migration for a
follow-up that understands the interaction with the avatar save
pipeline.

The rest of the Phase 2 shared-context batches (report-message,
messaging, threads, image-gallery, account-security, admin-room,
emojis, file-upload, jump-to-thread-message, email-inboxes,
messaging-scroll-to-bottom, imports, system-messages, settings-
assets, sidebar, message-composer) remain migrated.
@rc-layne
Copy link
Copy Markdown

rc-layne Bot commented Apr 24, 2026

🔴 Layne — 2 finding(s)

Found 2 issue(s): 2 high.

Pulling it out of the PR on request. JSON reporter stays in
playwright.config.ts and e2e-timing-report.mts / the local compare
helper still let a human inspect any downloaded CI artifact — enough
for this PR. The scheduled half can ship separately when the pattern
2 rollout is further along.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants