Skip to content

test: make the Playwright suite pass its own checks and run them in CI - #26192

Merged
ramonlsouza merged 4 commits into
bigbluebutton:v4.0.x-developfrom
antobinary:test-400-suite-self-checks-in-ci
Oct 30, 2026
Merged

ramonlsouza merged 4 commits into
bigbluebutton:v4.0.x-developfrom
antobinary:test-400-suite-self-checks-in-ci

Conversation

@antobinary

@antobinary antobinary commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Makes bigbluebutton-tests/playwright pass its own three checks (npm run format:check, npm run lint, npm run typecheck) and adds a workflow that runs them on pull requests touching the directory.

The suite's Husky pre-commit hook runs those three checks over the whole directory. On v4.0.x-develop all three fail (20 files not formatted, 195 ESLint errors, one type error), so nobody with node_modules installed can commit there without bypassing the hook. No workflow runs the checks on this directory (ts-code-validation and ts-code-compilation cover bigbluebutton-html5 only), which is how the errors piled up unnoticed.

The fix is mechanical: prettier --write over the directory, then eslint --fix, which sorted the imports of two files. The 22 errors that remained were fixed by hand without changing what any test does: an unused import removed, five unused catch bindings dropped (catch {}), a nested ternary split into two statements with the same values, two promise executors that returned setTimeout's id given a block body, two over-long trailing comments moved above their lines, and ten explicit any in browser-side code (window.editor, GraphQL rows) annotated with the same eslint-disable-next-line comment the suite already uses.

One rule changed: max-len now ignores template literals, as it already ignored strings. Prettier cannot wrap them, and the one it flagged is an assertion message that interpolates a value; splitting it into a concatenation only to satisfy the limit would make it harder to find in the code.

The type error was in exportedAnnotationsOverlap.ts: the step that opens the public chat when it is closed clicked e.userListToggleBtn, a selector the suite does not have (the 4.0 client has no user-list toggle; the chat opens from the sidebar navigation), and then e.chatButton, which matches the public/private switch inside the chat panel and so cannot open a closed panel. The step now clicks the messages sidebar button (e.messagesSidebarButton), as the other tests do. On a default server the moderator's chat is already open (public.chat.startClosed: false), so the step is not reached.

CI: the new playwright-code-validation.yml runs the three checks on pull requests that touch the directory, with the same trigger and checkout steps as ts-code-validation. The README's pre-commit section now names the three checks and the workflow.

Why

A pre-commit hook that always fails gets bypassed, and lint errors that nobody sees accumulate. With the directory clean and the checks in CI, the next unformatted file or unused import shows up as a red check on the pull request that adds it, not 200 problems later.

How to test

cd bigbluebutton-tests/playwright
npm ci
npm run format:check && npm run lint && npm run typecheck
npx playwright test --list

Testing

Check v4.0.x-develop (ac97a8b) This branch
npm run format:check (Prettier 3.6.2) FAIL, 20 files PASS
npm run lint (ESLint 8.57.1) FAIL, 195 errors (170 auto-fixable) PASS, 0 errors
npm run typecheck (TypeScript 5.9.3) FAIL, 1 error PASS
  • Test list (Playwright 1.56.0), npx playwright test --list before and after, compared without the file:line:col prefix (line numbers move with the formatting): PASS, the same 690 tests. The JSON list, compared on titles, tags, annotations and expected status: PASS, identical. The Chromium @ci selection (--project=chromium --grep @ci): PASS, the same 671 tests.
  • Syntax trees of every .ts, .js and .cjs file in the directory, compared ignoring formatting, comments, quotes, trailing commas and redundant parentheses: 164 of the 170 files unchanged; the other six differ exactly by the changes listed above.
  • actionlint 1.7.12 on the new workflow: PASS, no findings. Its first real run is this PR.
  • No test was run against a server: nothing changes what a test does, except the chat-opening step described above, which a default server does not reach.

The suite's Husky pre-commit hook runs npm run format:check, npm run lint
and npm run typecheck over the whole bigbluebutton-tests/playwright
directory. On v4.0.x-develop all three failed (20 files not formatted,
195 ESLint errors, one type error), so nobody with node_modules
installed could commit there without bypassing the hook. No workflow ran
these checks on the directory (ts-code-validation and
ts-code-compilation cover bigbluebutton-html5 only), which is how the
errors piled up unnoticed.

The fix is mechanical: prettier --write over the directory, then eslint
--fix, which sorted the imports of two files. What remained (22 errors)
was fixed by hand without changing what any test does: an unused import
removed, five unused catch bindings dropped (catch {}), a nested ternary
split into two statements with the same values, two promise executors
that returned setTimeout's id given a block body, two over-long trailing
comments moved above their lines, and ten explicit `any` in browser-side
code (window.editor, GraphQL rows) annotated with the same
eslint-disable-next-line comment the suite already uses.

One rule changed: max-len now ignores template literals, as it already
ignored strings. Prettier cannot wrap them, and the one it flagged is an
assertion message that interpolates a value; splitting it into a
concatenation only to satisfy the limit would make it harder to find in
the code.

The type error was in exportedAnnotationsOverlap.ts: the step that opens
the public chat when it is closed clicked e.userListToggleBtn, a
selector the suite does not have (the 4.0 client has no user-list
toggle; the chat opens from the sidebar navigation), and then
e.chatButton, which matches the public/private switch inside the chat
panel and so cannot open a closed panel. The step now clicks the
messages sidebar button, as the other tests do. The step is not reached
on a default server, where the moderator's chat is already open.

The change was checked to be behaviour-neutral. Comparing the syntax
trees of every .ts, .js and .cjs file before and after, ignoring
formatting, comments, quotes, trailing commas and redundant parentheses,
160 of the 166 files are unchanged and the other six differ exactly by
the changes listed above. The whole suite lists the same 679 tests with
the same titles, tags, annotations and expected status before and
after, and the Chromium @ci selection the same 660.

A new workflow, playwright-code-validation, runs the same three checks
on pull requests that touch the directory, with the same trigger and
checkout steps as ts-code-validation. The README's pre-commit section
now names the three checks and the workflow.
@antobinary antobinary added this to the Release 4.0 milestone Oct 22, 2026
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ecd563ed-6668-4911-9484-bcb4f6aea79a
Commits

Reviewing files that changed from the base of the PR and between 0d75a51 and 93eeee6.

Files selected for processing: 5
  • bigbluebutton-tests/playwright/README.md
  • bigbluebutton-tests/playwright/breakout/breakout.spec.ts
  • bigbluebutton-tests/playwright/core/page.ts
  • bigbluebutton-tests/playwright/parameters/disabledFeatures.ts
  • bigbluebutton-tests/playwright/user/cursorReplay.spec.ts
Files skipped from review as they are similar to previous changes: 4
  • bigbluebutton-tests/playwright/parameters/disabledFeatures.ts
  • bigbluebutton-tests/playwright/breakout/breakout.spec.ts
  • bigbluebutton-tests/playwright/core/page.ts
  • bigbluebutton-tests/playwright/README.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

Adds a GitHub Actions workflow that runs formatting, lint, and TypeScript checks for pull requests that change Playwright files or the workflow. Most Playwright source changes reformat existing code. One presentation helper changes which button it clicks when chat messages are not visible. Cursor replay initialization now uses APOLLO_CLIENT_SETTINGS_OVERRIDE.

Priority: Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: paultrudel, prlanzarin

Merge Risk: Minimal · up to 93eee

The change adds Playwright validation and mostly reformats tests. No actionable merge blocker is established; merge after the normal checks pass.

Pre-merge checks: Passed 5
Check name Status Explanation
Description check Passed The description clearly explains the formatting, lint, type-check, and CI workflow changes in the pull request.
Title check Passed The title clearly summarizes the main changes: making the Playwright suite pass its checks and running those checks in CI.
Docstring Coverage Passed Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
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.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

Resolves the conflict in bigbluebutton-tests/playwright/user/user.spec.ts.
This branch only reformats that file, and v4.0.x-develop added four
hideUserList talking-indicator tests between the hunks it reformats, so
the resolution takes v4.0.x-develop's version and runs prettier --write
over it again. Ignoring whitespace and trailing commas, the result is
identical to v4.0.x-develop's file. user/lockViewers.ts merged cleanly.

On the merged tree format:check, lint and typecheck all pass. The files
v4.0.x-develop added since dda8d28 were already clean apart from
user.spec.ts. The suite now lists 690 tests (Chromium @ci: 671), with the
same titles, tags, annotations and expected status as v4.0.x-develop
ac97a8b. Comparing syntax trees against it, 164 of the 170 .ts, .js
and .cjs files are unchanged, and the other six are the six described in
the branch's commit.
77a8dc5 renamed APOLLO_CLIENT_SETTINGS_MODULE to
APOLLO_CLIENT_SETTINGS_OVERRIDE, passed as createClientSettingsOverride,
but this test still imported the old name. The import was undefined, so
the test created its meeting without the override, found no Apollo
client and skipped itself, and the typecheck this branch adds fails on
it. With the new name it runs again: it passes in 22 seconds on a 4.0
server, where it was skipped before.
@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@ramonlsouza
ramonlsouza merged commit 5c7279f into bigbluebutton:v4.0.x-develop Oct 30, 2026
34 checks passed
antobinary added a commit that referenced this pull request Nov 6, 2026
4.0.2 (#26192) adds the "Playwright tests - validate code" workflow,
which runs prettier, eslint and tsc on bigbluebutton-tests/playwright
for every pull request that touches it. On v4.1.x-develop, 20 test
files were not prettier-formatted. The merge brings 4.0.2's formatting
for 19 of them. The one left is a 4.1-only line: the "leaves only the
device test in the Audio tab when showAudioFilters is false" case in
options/audioProcessingMode.spec.ts (e4ef15b), whose destructured
fixture list is too long for one line. Prettier and eslint both
reported it, so the new job failed on the merged tree.

Format that line as prettier writes it. No code change.
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