Repository navigation
test: add BlockNote shared notes e2e tests - #25165
Conversation
WalkthroughAdds comprehensive Playwright coverage for BlockNote shared notes, including editing, formatting, PDF export, whiteboard conversion, collaboration, permissions, and pinning. It adds BlockNote-specific selectors and utilities, attaches videos for failing tests, and refactors Etherpad tests to use per-test initialization. Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Adds an end-to-end Playwright test suite for the BlockNote shared-notes editor that mirrors the existing Etherpad suite (closes #25125), refactors the Etherpad suite away from beforeEach to per-test initialization, and extends Playwright infrastructure to record/attach per-context videos. A single product-code change adds a data-test="blockNoteToolbar" attribute used by the new selectors.
Changes:
- New
sharednotes/blocknote/Playwright suite (8 tests) usingSharedNotesBlockNote, plus BlockNote-specific selectors incore/elements.ts. - Etherpad spec refactored to instantiate
SharedNotesand callinitializePagesper test (matching the new BlockNote pattern). - Playwright infrastructure:
initializePagesnow records video intotestInfo.outputDir, and the auto fixture infixtures.tscollects/attaches videos after each test.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.spec.ts | New spec defining 8 BlockNote shared-notes tests with per-test initialization. |
| bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts | New SharedNotesBlockNote class implementing the BlockNote variants of each scenario. |
| bigbluebutton-tests/playwright/sharednotes/blocknote/util.ts | Helpers for opening BlockNote shared notes and locating its editable/read-only editors. |
| bigbluebutton-tests/playwright/sharednotes/etherpad/sharednotes.spec.ts | Refactor to per-test SharedNotes instantiation and a shared CREATE_PARAMETER constant. |
| bigbluebutton-tests/playwright/core/elements.ts | Adds BlockNote selectors (container, editable/read-only editors, toolbar, PDF export, etc.). |
| bigbluebutton-tests/playwright/core/helpers.ts | initializePages now configures recordVideo on the new context when testInfo is provided. |
| bigbluebutton-tests/playwright/core/setup/fixtures.ts | Auto fixture collects all context page videos and attaches them to testInfo after each test. |
| bigbluebutton-html5/imports/ui/components/bn-shared-notes/component.tsx | Adds data-test="blockNoteToolbar" to the static formatting toolbar to support new selectors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts`:
- Line 136: Replace the fixed 1s sleeps used via
this.modPage.page.waitForTimeout(1000) with state-based waits: instead of
sleeping in sharednotes.ts (the occurrences around waitForTimeout at lines 136
and 258), wait for a concrete observable condition on the page such as a
selector appearing or specific text syncing using Playwright APIs (e.g.,
page.waitForSelector, page.waitForFunction, or expect(locator).toHaveText) tied
to the SharedNotes UI element or text you expect to be present/updated; update
the code that currently calls this.modPage.page.waitForTimeout to wait for that
selector/text or a DOM attribute change on the shared notes component before
proceeding so tests are deterministic under CI and load.
- Around line 112-119: The request predicate used in
modPage.page.context().waitForEvent is too broad and can match unrelated
document requests; update the predicate so it only resolves for the PDF export
endpoint (e.g., require req.url().includes('/export/pdf') or both
'/hocuspocus/api/documents/' and '/export/pdf') so the wait corresponds to the
click that triggers export (related symbols:
modPage.page.context().waitForEvent, the predicate function, request.url(), and
e.exportNotesAsPDF); adjust the subsequent assertion if needed to rely on the
captured request url matching '/export/pdf'.
In `@bigbluebutton-tests/playwright/sharednotes/etherpad/sharednotes.spec.ts`:
- Line 21: The test title string contains a typo: change the test declaration
test('Formate text in shared notes', ...) to use the correct spelling
test('Format text in shared notes', ...) so the test name is accurate; update
only the string in the test(...) call in sharednotes.spec.ts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0af8da50-76b3-47f6-bd2b-30e86918104a
📒 Files selected for processing (8)
bigbluebutton-html5/imports/ui/components/bn-shared-notes/component.tsxbigbluebutton-tests/playwright/core/elements.tsbigbluebutton-tests/playwright/core/helpers.tsbigbluebutton-tests/playwright/core/setup/fixtures.tsbigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.spec.tsbigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.tsbigbluebutton-tests/playwright/sharednotes/blocknote/util.tsbigbluebutton-tests/playwright/sharednotes/etherpad/sharednotes.spec.ts
GuiLeme
left a comment
There was a problem hiding this comment.
Quick comment here: In order to properly run these tests, we need to first install the package bbb-shared-notes-server, running apt install bbb-shared-notes-server. I'd say it's important to be in the PR description.
Outside of that, the PR is running fine, I tested locally and all tests passes. I just agree with 2 small comments from code-rabbit and github copilot, please, check those out.
- narrow PDF export request predicate to /export/pdf; use ELEMENT_WAIT_EXTRA_LONG_TIME - replace fixed waitForTimeout sleeps with state-based toContainText waits - attach context videos only for failed tests - fix "Formate" typo in Etherpad spec
|
This pull request has conflicts ☹ |
GuiLeme
left a comment
There was a problem hiding this comment.
LGTM!
Reviewed the code and tested locally.
Conflict resolution: - bn-shared-notes/component.tsx: keep upstream's ToolbarWithAccessibleMenus wrapper and Escape handling, re-add data-test="blockNoteToolbar" - core/helpers.ts: keep upstream's opt-in recordVideo flag - core/elements.ts: drop duplicated exportNotesAsPDF key - blocknote tests: merge upstream's empty-notes export regression test (issue 25122) into this branch's suite under upstream's BlockNoteSharedNotes class name; fix stale e.sharedNotes reference Co-Authored-By: Claude Fable 5 <[email protected]>
…5125 Resolve import conflict in blocknote/sharednotes.ts: keep both ELEMENT_WAIT_LONGER_TIME (empty-notes export test from upstream merge) and ELEMENT_WAIT_EXTRA_LONG_TIME (review feedback on PDF export wait). Co-Authored-By: Claude Fable 5 <[email protected]>
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts (1)
149-151: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winNarrow the response predicate to the documents export path. The wait can match unrelated
/export/pdfresponses; include/hocuspocus/api/documents/here too, matching the request assertion above.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts` around lines 149 - 151, Update the waitForEvent response predicate in the shared notes export flow to require both the documents API path “/hocuspocus/api/documents/” and the “/export/pdf” endpoint, matching the preceding request assertion and excluding unrelated PDF responses.
🧹 Nitpick comments (2)
bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts (2)
136-141: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse
startSharedNotesBlockNoteinstead of re-implementing the open-panel flow.This manually replays a subset of
startSharedNotesBlockNote(click sidebar button, wait for panel) but checkse.sharedNotesBackgroundinstead ofe.blockNoteEditable/hideNotesLabel. Since no typing is needed here, the shared utility works just as well and keeps the "notes are open" contract consistent across all flows in this file.♻️ Proposed refactor
- // Open the (empty) BlockNote shared notes panel. Nothing is typed, so the - // document stays empty. - await this.modPage.waitAndClick(e.sharedNotesSidebarButton, ELEMENT_WAIT_LONGER_TIME); - await this.modPage.hasElement( - e.sharedNotesBackground, - 'should display the shared notes panel', - ELEMENT_WAIT_LONGER_TIME, - ); + // Open the (empty) BlockNote shared notes panel. Nothing is typed, so the + // document stays empty. + await startSharedNotesBlockNote(this.modPage);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts` around lines 136 - 141, Replace the manual sidebar click and background-element assertion with the existing startSharedNotesBlockNote utility in the affected flow. Reuse that helper’s established notes-open contract, without adding typing or duplicating panel-opening logic.
386-390: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMinor: hardcoded selection length (
5) and duplicated countdown loop.Both loops assume
e.messagesplits into 5-letter words ("Hello"/"World"); if that shared constant ever changes, this silently mis-selects text. Optional: derive lengths frome.message.split(' ')and extract a smallselectBackwards(page, count)helper to remove the duplicated loop.Also applies to: 399-403
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts` around lines 386 - 390, Replace the hardcoded selection length and duplicated countdown loops around the message-selection steps with a shared selectBackwards helper that accepts the page and count. Derive each count from the actual word lengths in e.message.split(' '), preserving the existing backward-selection behavior for both message words.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts`:
- Around line 212-223: Replace the hardcoded 20000/30000 waits in sharednotes.ts
at lines 212-223, 300, and 341-344 with one appropriately sized
MULTIPLIER-scaled constant, adding it to core/constants.ts or reusing an
existing wait constant; also apply the same timeout to the attendee assertion at
line 348. Update the related hasText and toContainText calls without changing
their assertions.
---
Outside diff comments:
In `@bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts`:
- Around line 149-151: Update the waitForEvent response predicate in the shared
notes export flow to require both the documents API path
“/hocuspocus/api/documents/” and the “/export/pdf” endpoint, matching the
preceding request assertion and excluding unrelated PDF responses.
---
Nitpick comments:
In `@bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts`:
- Around line 136-141: Replace the manual sidebar click and background-element
assertion with the existing startSharedNotesBlockNote utility in the affected
flow. Reuse that helper’s established notes-open contract, without adding typing
or duplicating panel-opening logic.
- Around line 386-390: Replace the hardcoded selection length and duplicated
countdown loops around the message-selection steps with a shared selectBackwards
helper that accepts the page and count. Derive each count from the actual word
lengths in e.message.split(' '), preserving the existing backward-selection
behavior for both message words.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 2a7e78e7-d742-445c-884e-3e42576f876c
📒 Files selected for processing (4)
bigbluebutton-html5/imports/ui/components/bn-shared-notes/component.tsxbigbluebutton-tests/playwright/core/elements.tsbigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.spec.tsbigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- bigbluebutton-tests/playwright/core/elements.ts
- bigbluebutton-html5/imports/ui/components/bn-shared-notes/component.tsx
- bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.spec.ts
| await this.modPage.hasText( | ||
| e.currentSlideText, | ||
| /test/, | ||
| 'should the slide contain the text "test" for the moderator', | ||
| 30000, | ||
| ); | ||
| await this.userPage.hasText( | ||
| e.currentSlideText, | ||
| /test/, | ||
| 'should the slide contain the text "test" for the attendee', | ||
| 20000, | ||
| ); |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Raw 20000/30000 timeouts bypass the file's MULTIPLIER-scaled wait constants. All three sites hardcode timeout values instead of using the ELEMENT_WAIT_TIME/ELEMENT_WAIT_LONGER_TIME/ELEMENT_WAIT_EXTRA_LONG_TIME constants (which scale via MULTIPLIER for slower CI). One missing constant is the root cause.
bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts#L212-L223: replace the raw30000/20000timeouts in thehasTextcalls with a named,MULTIPLIER-scaled constant (e.g. addELEMENT_WAIT_LONG_TIMEtocore/constants.tsor reuse an existing one sized appropriately).bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts#L300-L300: replace the raw20000timeout in the read-onlytoContainTextassertion with the same constant.bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts#L341-L344: replace the raw20000timeout with the same constant (and add a matching timeout to the attendee-side assertion at L348, per the separate comment on that line).
📍 Affects 1 file
bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts#L212-L223(this comment)bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts#L300-L300bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts#L341-L344
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.ts` around
lines 212 - 223, Replace the hardcoded 20000/30000 waits in sharednotes.ts at
lines 212-223, 300, and 341-344 with one appropriately sized MULTIPLIER-scaled
constant, adding it to core/constants.ts or reusing an existing wait constant;
also apply the same timeout to the attendee assertion at line 348. Update the
related hasText and toContainText calls without changing their assertions.
✅ Automated tests have passed! |
a9c0cd5
into
bigbluebutton:v4.0.x-develop
Backport of #25165 (merged on v4.0.x-develop) to v3.0.x-develop, bringing the BlockNote shared-notes e2e coverage to the 3.0 line. Cherry-picked a9c0cd5 with two conflicts resolved: - core/elements.ts: added the BlockNote selectors block at the shared-notes export insertion point. - sharednotes/blocknote/util.ts (add/add): merged the new 4.0 helpers (startSharedNotesBlockNote, getBlockNoteReadOnlyLocator) with the existing 3.0 helpers already present from #25225, keeping a single getBlockNoteEditorLocator. 3.0 adaptations in sharednotes.ts for element renames that only exist on 4.0: - sharedNotesSidebarButton to sharedNotes - messagesSidebarButton to chatButton - lock flow uses manageUsers + lockViewersButton (the 3.0 lock modal has no participant permissions tab) - make-presenter uses userListItem instead of usersListSidebarButton + moreOptionsUserItemButton The "Pin and unpin notes onto whiteboard" scenario is marked fixme on 3.0: a viewer whiteboard does not re-sync to the presenter presentation state after the presenter unpins shared notes (the canvas is not restored). That sync behavior only exists on 4.0.
test: add BlockNote shared notes e2e tests (backport of #25165)
…right suite Both files auto-merged without a conflict but ended up with duplicate top-level declarations, which is a hard SyntaxError for the playwright loader. The whole suite collected 0 tests in 0 files — every spec failed to import, not just the shared-notes ones. sharednotes/blocknote/util.ts 3.0's backport of bigbluebutton#25165 appended its own startSharedNotesBlockNote and getBlockNoteReadOnlyLocator to a file that already defined both. The 3.0 copies open the panel via e.sharedNotes, which does not exist in 4.0's elements.ts at all (renamed to sharedNotesSidebarButton), so they were dead on arrival as well as duplicated. Removed them; the 4.0 definitions at the top of the file already do the same job with the right selectors. whiteboard/whiteboard.spec.ts `import { linkIssue } from '../core/helpers';` landed twice, once from each side, at different points in the import block. This is the same failure mode as 5840bc2 ("restore BlockNote shared-notes helpers dropped in 3.0->4.0 merge") from the previous 3.0 merge: git resolves these files happily because the additions are textually far apart, and nothing in the merge output hints that the result does not parse. Not fixed here, because they predate this merge and are identical on v4.0.x-develop (verified by running tsc against a worktree at 5fa28d6): e.userListToggleBtn in accessibility/document-title.spec.ts, ELEMENT_WAIT_EXTRA_LONG_TIME in presentation/presentation.ts, and e.sharedNotes in sharednotes/blocknote/blocknote.ts. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>


What does this PR do?
Add e2e tests for BlockNote shared notes (8 tests mirroring the Etherpad suite)
Closes Issue(s)
Closes #25125