ci(playwright): discover plugin frontend specs (closes #7622)#7623
ci(playwright): discover plugin frontend specs (closes #7622)#7623JohnMcLear merged 2 commits intoether:developfrom
Conversation
…ugin_packages Adds two new globs to the Playwright testMatch so any installed plugin shipping specs at the conventional location is picked up automatically: - ../node_modules/ep_*/static/tests/frontend-new/specs/**/*.spec.ts (covers `pnpm add -w ep_*` workspace installs, e.g. CI's with-plugins matrix and dev-time pnpm installs) - plugin_packages/ep_*/static/tests/frontend-new/specs/**/*.spec.ts (covers admin-UI / live-plugin-manager installs into src/plugin_packages) Mirrors the equivalent backend pattern (`mocha ... ../node_modules/ep_*/static/tests/backend/specs/**`) which already auto-discovers plugin backend specs. This re-enables coverage that was lost in commit cc80db2 (2023-07) when the legacy in-page jQuery test runner was removed without a Playwright replacement. Until now plugin frontend tests have been silently dead: every plugin's CI runs `pnpm run test-ui` but core's testDir scoped only to `tests/frontend-new/`, so plugin specs at `static/tests/frontend/specs/test.js` were never executed and their green badges were misleading. See ether#7622. doc/PLUGIN_FRONTEND_TESTS.md documents the new convention, the import path for shared helpers (ep_etherpad-lite/tests/...), and a mocha+helper → Playwright translation table for plugin maintainers who want to migrate. Existing core test discovery is unchanged (143 tests in 38 files listed before and after). Closes ether#7622. **Change type:** patch (test infra; no production behavior change). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Review Summary by QodoEnable automatic plugin frontend test discovery in Playwright
WalkthroughsDescription• Auto-discover plugin frontend specs from node_modules and plugin_packages • Enable Playwright to run plugin tests alongside core tests • Document plugin frontend test convention and migration guide • Mirror existing backend plugin test discovery pattern Diagramflowchart LR
A["Playwright Config"] -->|testMatch globs| B["Core Tests"]
A -->|testMatch globs| C["Plugin Tests<br/>node_modules"]
A -->|testMatch globs| D["Plugin Tests<br/>plugin_packages"]
B --> E["Test Execution"]
C --> E
D --> E
File Changes1. src/playwright.config.ts
|
Code Review by Qodo
1.
|
The legacy mocha+helper specs in static/tests/frontend/ have been silently dead since core removed the in-page jQuery test runner in 2023 (cc80db2d3). Migrate to Playwright at the new conventional location ether/etherpad#7623 introduces: static/tests/frontend-new/specs/ Once that core PR lands and a new release of this plugin ships, the specs will run automatically in: - This plugin's own frontend-tests CI (against core+plugin). - Core's chrome-with-plugins CI (ether/etherpad#7609). The legacy file is removed because it never executed and would otherwise rot further. Change type: patch (test-only).
The legacy mocha+helper specs in static/tests/frontend/ have been silently dead since core removed the in-page jQuery test runner in 2023 (cc80db2d3). Migrate to Playwright at the new conventional location ether/etherpad#7623 introduces: static/tests/frontend-new/specs/ Once that core PR lands and a new release of this plugin ships, the specs will run automatically in: - This plugin's own frontend-tests CI (against core+plugin). - Core's chrome-with-plugins CI (ether/etherpad#7609). The legacy file is removed because it never executed and would otherwise rot further. Change type: patch (test-only).
The legacy mocha+helper specs in static/tests/frontend/ have been silently dead since core removed the in-page jQuery test runner in 2023 (cc80db2d3). Migrate to Playwright at the new conventional location ether/etherpad#7623 introduces: static/tests/frontend-new/specs/ Once that core PR lands and a new release of this plugin ships, the specs will run automatically in: - This plugin's own frontend-tests CI (against core+plugin). - Core's chrome-with-plugins CI (ether/etherpad#7609). The legacy file is removed because it never executed and would otherwise rot further. Change type: patch (test-only).
The legacy mocha+helper specs in static/tests/frontend/ have been silently dead since core removed the in-page jQuery test runner in 2023 (cc80db2d3). Migrate to Playwright at the new conventional location ether/etherpad#7623 introduces: static/tests/frontend-new/specs/ Once that core PR lands and a new release of this plugin ships, the specs will run automatically in: - This plugin's own frontend-tests CI (against core+plugin). - Core's chrome-with-plugins CI (ether/etherpad#7609). The legacy file is removed because it never executed and would otherwise rot further. Change type: patch (test-only).
The legacy mocha+helper specs in static/tests/frontend/ have been silently dead since core removed the in-page jQuery test runner in 2023 (cc80db2d3). Migrate to Playwright at the new conventional location ether/etherpad#7623 introduces: static/tests/frontend-new/specs/ Once that core PR lands and a new release of this plugin ships, the specs will run automatically in: - This plugin's own frontend-tests CI (against core+plugin). - Core's chrome-with-plugins CI (ether/etherpad#7609). The legacy file is removed because it never executed and would otherwise rot further. Change type: patch (test-only).
The legacy mocha+helper specs in static/tests/frontend/ have been silently dead since core removed the in-page jQuery test runner in 2023 (cc80db2d3). Migrate to Playwright at the new conventional location ether/etherpad#7623 introduces: static/tests/frontend-new/specs/ Once that core PR lands and a new release of this plugin ships, the specs will run automatically in: - This plugin's own frontend-tests CI (against core+plugin). - Core's chrome-with-plugins CI (ether/etherpad#7609). The legacy file is removed because it never executed and would otherwise rot further. The l10n.js spec is intentionally not migrated yet — language-switching tests are global state and need extra care; will follow up. Change type: patch (test-only).
…her#7623 Three real Qodo findings on the previous commit, all fixed: 1) test-ui's positional arg `tests/frontend-new/specs` filtered out plugin spec paths added to testMatch — the very thing the PR was trying to enable. Drop the positional. Discovery is now driven by per-project testMatch. 2) The single project-wide testMatch I added excluded tests/frontend-new/admin-spec, breaking pnpm run test-admin and the frontend-admin-tests workflow. Split into three projects: - chromium : core specs + plugin specs - firefox : core specs + plugin specs - chromium-admin : admin specs only test-admin now runs --project=chromium-admin (no positional). Net coverage unchanged for both workflows. 3) New code re-indented to 2 spaces per .editorconfig. Discovery verified locally: --project=chromium → 143 tests in 38 files (core) --project=firefox → 143 tests in 38 files (core) --project=chromium-admin → 11 tests in 4 files (admin) With a plugin spec installed at the conventional path: --project=chromium → +1 file, +N tests as expected. **Change type:** patch (test infra; no production behavior change). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
/review |
|
Persistent review updated to latest commit 89c6186 |
This plugin previously had no frontend test coverage. Add minimal smoke tests at the conventional location ether/etherpad#7623 introduces: static/tests/frontend-new/specs/ Once that core PR lands and a new release of this plugin ships, the specs will run automatically in: - This plugin's own frontend-tests CI (against core+plugin). - Core's chrome-with-plugins CI (ether/etherpad#7609). Coverage is intentionally minimal (plugin-loaded smoke + a plugin-specific structural assertion) — these are scaffolding for plugin-specific behaviour tests to grow into. Better than the prior zero-test baseline. Change type: patch (test-only).
This plugin previously had no frontend test coverage. Add minimal smoke tests at the conventional location ether/etherpad#7623 introduces: static/tests/frontend-new/specs/ Once that core PR lands and a new release of this plugin ships, the specs will run automatically in: - This plugin's own frontend-tests CI (against core+plugin). - Core's chrome-with-plugins CI (ether/etherpad#7609). Coverage is intentionally minimal (plugin-loaded smoke + a plugin-specific structural assertion) — these are scaffolding for plugin-specific behaviour tests to grow into. Better than the prior zero-test baseline. Change type: patch (test-only).
This plugin previously had no frontend test coverage. Add minimal smoke tests at the conventional location ether/etherpad#7623 introduces: static/tests/frontend-new/specs/ Once that core PR lands and a new release of this plugin ships, the specs will run automatically in: - This plugin's own frontend-tests CI (against core+plugin). - Core's chrome-with-plugins CI (ether/etherpad#7609). Coverage is intentionally minimal (plugin-loaded smoke + a plugin-specific structural assertion) — these are scaffolding for plugin-specific behaviour tests to grow into. Better than the prior zero-test baseline. Change type: patch (test-only).
Summary
Closes #7622.
Adds two new globs to Playwright's
testMatchso any installed plugin shipping specs at the conventional location is picked up automatically:../node_modules/ep_*/static/tests/frontend-new/specs/**/*.spec.ts—pnpm add -wworkspace installs (CI's with-plugins jobs, dev workspace).plugin_packages/ep_*/static/tests/frontend-new/specs/**/*.spec.ts— admin-UI / live-plugin-manager installs intosrc/plugin_packages.Mirrors the equivalent backend pattern that has worked for years:
Change type: patch (test infra; no production behavior change).
Why this is a real gap
Plugin frontend tests have been silently dead since commit
cc80db2d3(2023-07-02), when the legacy in-page jQuery test runner was removed without a Playwright replacement. Every plugin still shipsstatic/tests/frontend/specs/test.js(mocha +helper.padChrome$style) and every plugin's CI runspnpm run test-ui— buttest-uiresolves toplaywright test tests/frontend-new/specs --project=chromium, scoped to core only. Plugin specs are never imported by any runner, anywhere.PR #7609 caught one direction of regression — core changes that break core's tests when plugins are loaded. This PR closes the other direction — core (or plugin) changes that break a plugin's own behavior tests. Both directions matter.
Verified locally
The migrated
ep_headings2spec (3 tests) runs and produces real signal — found a real a11y bug in published v0.2.79 where#heading-selectionlacks anaria-label(the fix is already in ep_headings2 master, just unreleased). That's exactly the kind of regression the existing infrastructure couldn't surface.The
ep_headings2migration ships in a separate PR against ether/ep_headings2. After this PR lands and ep_headings2 publishes a new version, #7609'swith-pluginsjob will start exercising plugin specs too.Documentation
doc/PLUGIN_FRONTEND_TESTS.mddocuments:static/tests/frontend-new/specs/*.spec.ts)ep_etherpad-lite/tests/frontend-new/helper/padHelper)Test plan
🤖 Generated with Claude Code