Skip to content

test: migrate frontend specs to Playwright (ether/etherpad#7622)#167

Merged
JohnMcLear merged 1 commit intomasterfrom
ci/migrate-frontend-tests
Apr 28, 2026
Merged

test: migrate frontend specs to Playwright (ether/etherpad#7622)#167
JohnMcLear merged 1 commit intomasterfrom
ci/migrate-frontend-tests

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Migrates the legacy mocha+helper frontend specs to Playwright, fitting the new plugin-test-discovery convention proposed in ether/etherpad#7622 / PR ether/etherpad#7623.

Change type: patch (test-only; no production code change).

Why

static/tests/frontend/specs/test.js has been silently dead since core's commit cc80db2d3 (2023-07-02) removed the in-page jQuery test runner. Every CI run of this plugin's Frontend tests workflow has actually been executing core's specs with this plugin loaded — the assertions in this file have never run.

ether/etherpad#7623 adds a Playwright testMatch glob that auto-discovers plugin specs at static/tests/frontend-new/specs/**/*.spec.ts. Migrating to that location restores execution.

What's in this PR

  1. New: static/tests/frontend-new/specs/headings.spec.ts — three Playwright tests mirroring the originals:

    • Heading select has aria-label for accessibility
    • Focus returns to editor after selecting a heading
    • Option select reflects current line's heading
  2. Removed: static/tests/frontend/specs/test.js — dead since 2023, removed to prevent further bit-rot. (The aria-label assertion in the dead file already drifted from the plugin's actual <select> markup at one point — exactly the kind of divergence a dead test can't catch.)

The new file uses import {goToNewPad, ...} from 'ep_etherpad-lite/tests/frontend-new/helper/padHelper'ep_etherpad-lite is symlinked into node_modules by the workspace, so the import resolves anywhere this plugin is installed alongside core.

Test plan

🤖 Generated with Claude Code

The legacy static/tests/frontend/specs/test.js used mocha + the
in-page jQuery `helper.padChrome$` runner, which was removed from
core in 2023 (commit cc80db2d3) without a Playwright replacement.
Since then this file has been silently dead — every CI run of
this plugin's frontend-tests workflow ran *core's* specs with this
plugin loaded, never the assertions in this file.

Migrate to Playwright. The new file lives at the conventional
location ether/etherpad#7623 introduces:

  static/tests/frontend-new/specs/headings.spec.ts

Core's playwright config now auto-discovers any installed plugin's
specs at that path. Once that PR lands and a new ep_headings2
release ships, these tests will start running in:

  - This plugin's own frontend-tests CI (against core+plugin).
  - Core's chrome-with-plugins CI (PR #7609).

The three migrated tests mirror the original assertions:
- Heading select has aria-label for accessibility
- Focus returns to editor after selecting a heading
- Option select is changed when heading is changed

The legacy file is removed because it never executed and would
otherwise bit-rot further (existing aria-label text already drifted
between this file and the plugin's actual select element — a
divergence the dead test couldn't catch).

**Change type:** patch (test-only).
@JohnMcLear JohnMcLear merged commit f1b5a65 into master Apr 28, 2026
3 checks passed
@JohnMcLear JohnMcLear deleted the ci/migrate-frontend-tests branch April 28, 2026 05:15
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.

1 participant