Repository navigation
[lexical-playground] Chore: Reduce E2E overhead and move focused coverage to faster suites - #9322
Merged
Merged
Conversation
## Description Some e2e tests create a page and initialize the playground before discovering that their editor mode or browser is unsupported. Move the shared skip conditions in AutoLinks, Ruby, grapheme deletion (meta#7163), and the Safari IME regression (meta#8153) to file-level Playwright modifiers. These modifiers depend only on the mode/browser fixtures, so they run before page-dependent setup. Keep the grapheme table's individual skip flag at test declaration time. This covers 104 registered cases across four files and preserves their existing applicability conditions and assertions. Also exclude `__tests__/browser/` from Playwright e2e discovery alongside `__tests__/unit/`, so future Vitest browser tests in the playground test directory are not imported by the e2e runner. ## Test plan Used Playwright 1.62.1 with temporary copies of the four specs, redirecting imports to instrumented page and initialization fixtures. These checks exercise runner ordering without starting browsers or the playground. ### Before `python3 /tmp/lexical-audit-tools/summarize-skips.py` summarizes the JSON reports from the instrumented runs: ```text before plain: 89 skipped, 89 page setups, 87 playground setups before collab: 42 skipped, 42 page setups, 40 playground setups ``` `node /tmp/lexical-audit-tools/verify-discovery.mjs` runs `playwright test --list` using copies of the actual config and temporary e2e/regression/unit/browser fixtures. The unit and browser fixtures throw if imported: ```text before: FAIL — browser tests were imported by the e2e runner ``` ### After The same commands produce: ```text after plain: 89 skipped, 0 page setups, 0 playground setups after collab: 42 skipped, 0 page setups, 0 playground setups PASS: identical skipped test titles and outcomes before/after after: PASS — e2e + regression discovered; unit + browser never imported Listing tests: [chromium] › __tests__/e2e/discovery.test.mjs:2:1 › e2e discovered [chromium] › __tests__/regression/discovery.test.mjs:2:1 › regression discovered Total: 2 tests in 2 files ``` Prettier checked all five changed files using the repository's formatting options (without optional plugins): ```text Checking formatting... All matched files use Prettier code style! ``` `git diff --check` passed. The full browser e2e suite and the repository's Playwright 1.63.0/platform matrix have not been run locally. These checks establish skip ordering and discovery behavior, not CI time savings. Temporary verification fixtures are not included in the PR.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…to unit and browser tests ## Description Stacked on #64 (upstream meta#9322). The e2e suite repeatedly loads the complete playground for matching, grapheme deletion, and native text insertion cases that can run with small editor fixtures. - Move 45 AutoLinks URL/email/invalid/Unicode cases to 90 Node tests of the actual AutoLinkExtension with the playground's URL and email matchers. Test both whole-text and character-by-character insertion, including link edits between commits. Assert link URLs, node structure, surrounding text, and invalid input preservation. - Move the 15 grapheme deletion regressions to browser tests in both rich and plain text modes. Seed the initial document directly, send native Backspace keys, and check the final DOM plus native and Lexical selections. - Move five execCommand and synthetic-paste cases to browser tests, also covering rich/plain modes and preserving Firefox's existing clipboard distinction. Keep the paste-then-execCommand playground case as an integration and collaboration smoke. - Retain 17 AutoLinks playground tests for editing, formatting, paste, unlink/relink and app integration. This removes 65 registered e2e cases. It does not change production code or the CI browser matrix. ## Test plan ### Before `pnpm exec playwright test --project=chromium --list`: ```text Total: 884 tests in 102 files ``` ### After Same discovery command: ```text Total: 819 tests in 101 files ``` `pnpm exec vitest run --project unit packages/lexical-link/src/__tests__/unit --reporter=json --outputFile=/tmp/lexical-migration-link-unit.json`: ```text numTotalTests: 281 numPassedTests: 281 numFailedTests: 0 success: true ``` The 90 new AutoLinks assertions took 304 ms in that run. `VITEST_BROWSER=webkit pnpm exec vitest run --project browser GraphemeDeletion.test.ts NativeTextInsertion.test.ts --no-file-parallelism --reporter=verbose`: ```text Test Files 2 passed (2) Tests 41 passed (41) Duration 3.32s (worker 59%, tests 30%, import 10%, setup 2%) ``` `pnpm exec tsc -p tsconfig.test.json --noEmit`, ESLint and Prettier for the changed files, and `git diff --check` pass. Local runs use the pinned Vitest 5.0.1 and Playwright 1.63.0 dependencies. Chromium could not launch because the container denies its process-singleton socket; permission escalation was rejected by the environment policy. Firefox launched but its Vitest session did not connect. WebKit ran successfully on Linux. Chromium CI and the other platform/engine checks are still pending; this is a draft until that validation is complete. Destination timings are not a measurement of full CI savings.
…ixtures ## Description Move shared editor-mode and platform exclusions in 66 more spec files to Playwright suite modifiers. These modifiers depend only on cheap mode fixtures and run before page creation and playground initialization. Also replace skip checks embedded in beforeEach hooks, which already request the page fixture. Keep per-case exclusions and all existing test registrations and assertions. ## Test plan ### Before Instrumented the original sources with Playwright 1.63.0, retaining registration, fixture dependencies and skip predicates while replacing browser actions with counters. All 584 registered test names and statuses match in four editor modes. ``` Skipped page setups: plain 462; rich 15; collab 122; collab-v2 126 Skipped initialization hooks: plain 208; rich 10; collab 70; collab-v2 74 ``` ### After The same instrumented runner: ``` Skipped page setups: plain 28; rich 3; collab 57; collab-v2 60 Skipped initialization hooks: plain 28; rich 2; collab 27; collab-v2 30 ``` `pnpm exec playwright test --project=webkit --list`: ``` Total: 819 tests in 101 files ``` ESLint, Prettier and git diff --check pass. This validates skip scheduling and discovery; it is not a full browser execution of the changed specs.
…ormatting matrices in Node
## Description
Replace four maximum-indent e2e cases with Node tests using the same
RichTextExtension, ListExtension and configured TabIndentationExtension as the
playground. Assert each intermediate indent, empty and populated blocks,
independently capped nested items, and outdent's lower bound.
Extend the toolbar clearFormatting unit suite with the alignment, indentation,
text-format and inline-style matrix. Remove six equivalent e2e cases, including
collapsed and multi-paragraph selections already covered by the unit suite.
Keep toolbar wiring, mention-picker, link/quote styling, toolbar-state, mixed
content indentation and HTML-paste regression integration coverage.
## Test plan
### Before
`pnpm exec playwright test --project=webkit --list`:
```
Total: 819 tests in 101 files
```
### After
`pnpm exec vitest run --project unit packages/lexical-extension/src/__tests__/unit/IndentationLimits.test.ts packages/lexical-playground/__tests__/unit/ToolbarPluginClearFormatting.test.ts`:
```
Test Files 2 passed (2)
Tests 36 passed (36)
```
`pnpm exec playwright test --project=webkit --list`:
```
Total: 809 tests in 101 files
```
TypeScript, ESLint, Prettier and git diff --check pass. Local e2e execution is
blocked by missing WebKit host libraries; the remaining e2e cases require CI.
…ring ## Description Target the macOS WebKit collaboration job, which took 48.9 minutes at 082d0f6 with only one retried test. Remove the unconditional 50ms delay on every Playwright action; retain E2E_SLOW_MO and the existing debug delay for interactive investigation. Existing explicit readiness and convergence assertions remain. Disable the playground's main and nested debug tree views in test fixtures. Both collaboration clients otherwise serialize and render their editor states on every update. Tests that actually use the debug UI opt back in. Wait for the mounted editor and initial state directly, including through shadow roots, instead of using the debug tree as a readiness signal. Report the slowest test attempts, total playground initialization time and aggregated Playwright API times in successful CI logs as well as failed runs. API attribution totals may overlap and are labeled accordingly. ## Test plan ### Before macOS WebKit collaboration CI at 082d0f6: ``` 1 flaky 206 skipped 612 passed (48.9m) ``` ### After Playwright 1.63.0 reporter probe with an actual HTTP request, an initialization step and a skipped case: ``` 1 skipped 1 passed (596ms) E2E timings: 0.6s elapsed Playground initialization: 1 calls, 0.0s summed across workers ``` `pnpm exec playwright test --project=webkit --list`: ``` Total: 809 tests in 101 files ``` ESLint, Prettier and git diff --check pass. Browser execution and critical-path runtime need the full CI matrix; local WebKit lacks required system libraries.
…rting ## Description The previous commit removed the global action delay and changed playground readiness and debug-view defaults together. The full Chromium canary found 83 failures and 26 flakes, so an isolated Clear test fix is not sufficient. Restore the established 50 ms action delay, debug views and readiness check while retaining the timing reporter and initialization measurements. Keep E2E_SLOW_MO as an explicit override for subsequent controlled experiments. Wait for the Clear command's empty document to commit before typing again, preserving the final assertion that typing after clearing works. Write timing output through process.stdout.write so the CI-only no-console rule passes. ## Test plan ### Before CI lint at 8cbbc76: ``` 45:5 error Unexpected console statement. Only these console methods are allowed: warn, error, time, timeEnd no-console 46:5 error Unexpected console statement. Only these console methods are allowed: warn, error, time, timeEnd no-console 49:5 error Unexpected console statement. Only these console methods are allowed: warn, error, time, timeEnd no-console 53:7 error Unexpected console statement. Only these console methods are allowed: warn, error, time, timeEnd no-console 57:5 error Unexpected console statement. Only these console methods are allowed: warn, error, time, timeEnd no-console 61:7 error Unexpected console statement. Only these console methods are allowed: warn, error, time, timeEnd no-console ``` Chromium canary job 111465280916 at 8cbbc76: ``` 83 failed 26 flaky 666 passed (12.5m) ``` ### After Checked all added/modified JavaScript and TypeScript files on this branch: ``` pnpm exec prettier --check <branch files> All matched files use Prettier code style! CI=true pnpm exec eslint <branch files> CI ESLint exit: 0 ``` With the playground dev server running, Linux WebKit, no retries: ``` E2E_EDITOR_MODE=plain-text pnpm exec playwright test --project=webkit --workers=4 --retries=0 e2e/Clear.spec.mjs e2e/CopyAndPaste/lexical/CopyAndPaste.spec.mjs --grep 'can clear the editor|Basic copy|between sections' --repeat-each=3 9 passed (23.3s) pnpm exec playwright test --project=webkit --workers=4 --retries=0 e2e/Clear.spec.mjs e2e/SelectBlock.spec.mjs e2e/Links.spec.mjs e2e/CopyAndPaste/lexical/CopyAndPaste.spec.mjs --grep 'can clear the editor|Select paragraph|either side of links|Basic copy|between sections' 36 passed (1.2m) ``` An isolated Playwright reporter probe exercises an initialization step, a request API call and a skipped test: ``` 1 skipped 1 passed (581ms) E2E timings: 0.6s elapsed Playground initialization: 1 calls, 0.0s summed across workers ``` The full Chromium, Firefox, Windows and macOS matrices require CI validation. Local Chromium installation was unavailable; its download returned an invalid archive. No speedup is claimed from the failed experimental run.
…ming reporter ## Description Keep the reporter's straightforward console.log calls and add a file-level no-console exception explaining that reporting timings to CI logs is its purpose. This replaces the stdout buffering introduced solely to satisfy lint. ## Test plan ### Before Without the documented exception, CI lint reported six instances of: ``` error Unexpected console statement. Only these console methods are allowed: warn, error, time, timeEnd no-console ``` ### After ``` CI=true pnpm exec eslint packages/lexical-playground/__tests__/utils/timingReporter.mjs ``` Exit 0, no lint diagnostics. ``` pnpm exec prettier --check packages/lexical-playground/__tests__/utils/timingReporter.mjs All matched files use Prettier code style! ``` The isolated Playwright reporter probe passed and printed initialization and API timings. Browser behavior is unchanged by this reporter-only follow-up.
…o browser tests
## Description
The link insertion matrix repeats playground navigation, toolbar link creation
and collaboration setup for 24 position/input combinations. Move the full
matrix into browser unit tests using RichTextExtension and LinkExtension.
Keep two toolbar-driven e2e paths covering typing and serialized Lexical paste,
including convergence in the collaboration projects.
The browser tests preserve native arrow-key collapse from a backwards range,
native typing, and the synthetic clipboard dispatch used by the e2e helper.
Observe the collapsed model selection before dispatching synthetic paste.
They check DOM and model structure, link attributes, and the collapsed caret
remaining outside the link. Only initial document construction is seeded
directly. This removes 22 repeated e2e executions per applicable project.
## Test plan
### Before
The restored WebKit rich-text sample containing the full link matrix passed:
```
36 passed (1.2m)
```
### After
```
VITEST_BROWSER=webkit pnpm exec vitest run --project browser packages/lexical-link/src/__tests__/browser/LinkBoundaryInsertion.test.ts
Test Files 1 passed (1)
Tests 24 passed (24)
Duration 2.23s
```
With the playground and collaboration servers running:
```
E2E_EDITOR_MODE=rich-text-with-collab pnpm exec playwright test --project=webkit --workers=4 --retries=0 e2e/Links.spec.mjs --grep 'either side of links'
2 passed (13.2s)
CI=true pnpm exec eslint packages/lexical-playground/__tests__/e2e/Links.spec.mjs packages/lexical-link/src/__tests__/browser/LinkBoundaryInsertion.test.ts
pnpm run tsc-test
```
Lint and test TypeScript checks exit 0. Local browser validation used Linux
WebKit; local Firefox could not connect to the Vitest browser session and
ran no tests. The other browsers and operating systems remain CI gates. These sample
timings are not a prediction of the full macOS collaboration runtime.
…ertions
## Description
Collaboration assertions format the same expected HTML and both clients' DOM,
often again while polling or checking undo/redo. Reuse the formatter promise
for identical normalized input, including concurrent calls from both clients.
Bound the cache to 128 entries per worker so snapshots do not accumulate for
the lifetime of the full suite. Assertions still read the current DOM every
time and retain the same comparison and polling behavior.
## Test plan
### Before
A local benchmark formats the 20 largest static HTML snapshots from Tables,
List, Links and Markdown ten times for each of two clients (400 calls):
```
{"calls":400,"chars":2435920,"hash":"04ef36e8a18392b13b8d3a84c403676a05f6e5ebdd10b43fcd6f98ba514e549b","milliseconds":4595}
```
### After
The same benchmark produces identical bytes:
```
{"calls":400,"chars":2435920,"hash":"04ef36e8a18392b13b8d3a84c403676a05f6e5ebdd10b43fcd6f98ba514e549b","milliseconds":422}
```
With the playground and collaboration servers running:
```
E2E_EDITOR_MODE=rich-text-with-collab pnpm exec playwright test --project=webkit --workers=4 --retries=0 e2e/Clear.spec.mjs e2e/Links.spec.mjs --grep 'can clear the editor|before a mid-paragraph link, via typing|after an end-of-paragraph link, via pasting Lexical text'
3 passed (14.7s)
CI=true pnpm exec eslint packages/lexical-playground/__tests__/utils/index.mjs
```
Lint exits 0. The browser check used Linux WebKit. The formatter benchmark
measures repeated formatting only; full CI latency still requires measurement.
## Description At 082d0f6, macOS WebKit collaboration took 48.9 minutes and macOS WebKit rich-text took 30.8 minutes. Optimizing shorter jobs cannot shorten that critical path. Partition each of these two jobs across two macOS runners with Playwright's native sharding. Existing fullyParallel mode distributes individual tests; assertions, retries, browser settings and coverage remain the same. The existing build job still builds each playground artifact once. Add numeric shard inputs defaulting to 1/1 to the reusable runner and forward them through both ordinary and collaboration commands. Include the shard in artifact names to prevent upload collisions. Disable fail-fast for the two affected matrices so a failing shard does not hide the other shard's result. This adds two concurrent macOS jobs and duplicates their setup cost; it trades that overhead for a shorter critical path. Other browser/platform jobs keep one shard. In particular, Chromium and Firefox in mac-rich are not duplicated. ## Test plan ### Before Successful upstream job summaries at 082d0f6: ``` collab-mac (webkit): 612 passed (48.9m), 206 skipped, 1 flaky mac-rich (webkit): 779 passed (30.8m), 40 skipped ``` ### After Collected actual Playwright test IDs for each mode with --list --reporter=json, comparing --shard=1/1 against --shard=1/2 and --shard=2/2: ``` rich-text: 787 tests = 394 + 393; no overlap or omissions rich-text-with-collab: 787 tests = 394 + 393; no overlap or omissions ``` Parsed both workflows and expanded their matrices: four mac-rich jobs (one Chromium, one Firefox, two WebKit) and two collab-mac jobs. Verified default 1/1 inputs, forwarding in both command paths, and unique artifacts. ``` pnpm run test-e2e-collab-webkit --list --shard=1/2 Total: 394 tests in 49 files pnpm exec prettier --check .github/workflows/call-e2e-all-tests.yml .github/workflows/call-e2e-test.yml All matched files use Prettier code style! ``` Actual macOS shard durations and scheduling must be measured in CI; no full-run speedup is claimed from collection checks.
…gation ## Description The macOS Firefox browser run caught an intermittent code-block navigation failure: ArrowUp ran before Lexical processed the native move to the start of the line, leaving the caret in the code block instead of its preceding paragraph. Verify both the DOM caret and the committed Lexical caret at the start of the code line before ArrowUp. Preserve the native navigation and the existing paragraph-selection and typing assertions. ## Test plan ### Before On 172beae, all 28 migrated HTML paste cases passed across the browser matrix, but the macOS Firefox code-block boundary case failed (653 passed, 7 skipped, 1 failed). ### After Linux WebKit CodeBlockKeyboard suite: 4 passed. ESLint, Prettier, and git diff --check passed. macOS Firefox remains for CI validation.
…selection tests ## Description The extended matrix exposed three more selection timing failures. Backspace ran before the caret reached the beginning of text after a collapsible, PullQuote select-all could replace the entire host instead of the quote slot, and Firefox's decorator click assertion could read a null selection before selectionchange committed. Wait for both native and Lexical carets before deleting after a collapsible. Reuse a slot-scoped selection checkpoint for PullQuote replacements and verify paragraph boundaries before the merge. Poll the existing decorator selection expectation after the click. ## Test plan ### Before Extended CI on 172beae: https://github.com/facebook/lexical/actions/runs/37248425631 macOS Chromium, Selection > Can't delete backward a Collapsible (all three attempts): ``` - <span data-lexical-text="true">after</span> + <span data-lexical-text="true">fter</span> ``` macOS Chromium, PullQuote > backspace at 2nd-paragraph start merges within the quote slot: ``` Expected: "QUOTE⏎SECOND" Received: null ``` Linux Firefox, HorizontalRule > Clicking between consecutive block decorators creates selection (meta#6775): ``` Error: expect(received).not.toBeNull() Received: null ``` ### After Linux WebKit, PullQuoteSlot plus the consecutive-decorator click test, repeated three times with four workers and retries disabled: ``` rich-text: expected=36, skipped=0, unexpected=0, flaky=0 rich-text-with-collab: expected=33, skipped=3, unexpected=0, flaky=0 ``` Commands: ```sh E2E_EDITOR_MODE=rich-text node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/PullQuoteSlot.spec.mjs e2e/HorizontalRule.spec.mjs --grep 'PullQuote slot host|Clicking between consecutive' --repeat-each=3 --reporter=json E2E_EDITOR_MODE=rich-text-with-collab node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/PullQuoteSlot.spec.mjs e2e/HorizontalRule.spec.mjs --grep 'PullQuote slot host|Clicking between consecutive' --repeat-each=3 --reporter=json ``` ESLint, Prettier, and git diff --check passed. macOS Chromium and Linux Firefox are unavailable locally; CI validates those platform-specific failures.
…ixture ## Description The Linux Firefox browser run timed out while typing in a hashtag fixture. Its pending input then interleaved with the following test. The native typing command used a live :focus selector, which can stop matching when the browser deactivates the test frame and later resolve to another editor. Capture the requesting element with a unique temporary selector and let Playwright focus that element before typing. Bound the command to five seconds, below the test timeout, so an unresolved command cannot wait into a later test. Add a two-editor regression that verifies pending input stays with its original editor and preserves Unicode. Collect Vitest's current .vitest/attachments path in CI as well as the existing artifact paths; the failed Firefox job produced screenshots but uploaded no artifacts. ## Test plan ### Before CI on 2cd6717: https://github.com/facebook/lexical/actions/runs/37249685012 Linux Firefox, Hashtags (rich text: false): ``` Should not break with multiple leading "#" meta#5636 Error: Test timed out in 15000ms. Should not break while skipping invalid hashtags meta#5703 Received: ...#hel...#lwoorld#invalid... ``` New regression against the previous helper and command, Linux WebKit: ```sh VITEST_BROWSER=webkit node node_modules/vitest/vitest.mjs run --project=browser packages/lexical-playground/src/__tests__/browser/NativeTyping.test.ts ``` ``` FAIL pending native input stays with the editor that requested it AssertionError: expected '' to be 'A🙂B' Tests 1 failed (1) ``` ### After ```sh VITEST_BROWSER=webkit node node_modules/vitest/vitest.mjs run --project=browser packages/lexical-playground/src/__tests__/browser ``` ``` Test Files 19 passed (19) Tests 142 passed | 1 skipped (143) Duration 17.02s ``` ESLint, Prettier, TypeScript, and git diff --check passed. Linux Firefox is unavailable locally and is validated in CI.
…and list merges ## Description macOS Chromium exposed two remaining caret races: toggling bold immediately after ArrowUp could format and type in the previous paragraph, and Backspace after Home could delete the last character instead of merging into a list. Assert both native and Lexical caret positions before those actions. The emoji limit test also intermittently produced a rotated partial grapheme after clearing and rapidly inserting seven joined emoji. Verify the empty editor first, then wait for each grapheme insertion and limit transform to commit before sending the next. Preserve the final six-emoji expectation. ## Test plan ### Before macOS Chromium on 2cd6717: https://github.com/facebook/lexical/actions/runs/37249685012 ``` MaxLength > can restrict emojis on boundaries - <span data-lexical-text="true">👨💻👨💻👨💻👨💻👨💻👨💻</span> + <span data-lexical-text="true">💻👨💻👨💻👨💻👨💻👨💻👨</span> ``` ``` Selection > toggle format at the start of paragraph to a different format persists the format - <span data-lexical-text="true">Line3</span> + <br data-lexical-managed-linebreak="true" /> ... + <em class="PlaygroundEditorTheme__textItalic" data-lexical-text="true">Line3</em> ``` ``` Regression meta#7246 > deleteCharacter merges children from block adjacent to ListNode - <li value="1"><span data-lexical-text="true">listparagraph</span></li> + <li value="1"><span data-lexical-text="true">list</span></li> + <p dir="auto"><span data-lexical-text="true">paragrap</span></p> ``` ### After Linux WebKit, the three affected cases repeated three times with four workers and no retries: ``` rich-text: expected=9, skipped=0, unexpected=0, flaky=0 rich-text-with-collab: expected=6, skipped=3, unexpected=0, flaky=0 ``` ```sh E2E_EDITOR_MODE=rich-text node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/MaxLength.spec.mjs e2e/Selection.spec.mjs regression/7246-delete-character-backward-list.spec.mjs --grep 'can restrict emojis on boundaries|toggle format at the start of paragraph to a different format|deleteCharacter merges children' --repeat-each=3 --reporter=json E2E_EDITOR_MODE=rich-text-with-collab node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/MaxLength.spec.mjs e2e/Selection.spec.mjs regression/7246-delete-character-backward-list.spec.mjs --grep 'can restrict emojis on boundaries|toggle format at the start of paragraph to a different format|deleteCharacter merges children' --repeat-each=3 --reporter=json ``` ESLint, Prettier, and git diff --check passed. macOS Chromium is unavailable locally and is validated in CI.
…oration conversion ## Description The macOS WebKit collaboration test sometimes converted the left editor while the right editor still displayed the pasted Markdown code block. The test clicked the whole-document conversion action immediately after pasting, without checking that both peers had received its source. Require the original code-block HTML on both peers before clicking conversion. Keep the existing converted-HTML assertion on both editors and the non-collaboration undo/redo coverage. ## Test plan ### Before macOS WebKit collaboration on 2cd6717: https://github.com/facebook/lexical/actions/runs/37249685012 ``` Markdown > can convert markdown text into rich text Error: innerHTML of contenteditable in right frame did not match - <h1 class="PlaygroundEditorTheme__h1" dir="auto"> + <code ... data-highlight-language="markdown" data-language="markdown"> Timeout 5000ms exceeded while waiting on the predicate 1 flaky ``` ### After Linux WebKit, the affected case repeated three times with retries disabled: ``` rich-text-with-collab: expected=3, skipped=0, unexpected=0, flaky=0 rich-text: expected=3, skipped=0, unexpected=0, flaky=0 ``` ```sh E2E_EDITOR_MODE=rich-text-with-collab node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/Markdown.spec.mjs --grep 'can convert markdown text into rich text' --repeat-each=3 --reporter=json E2E_EDITOR_MODE=rich-text node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/Markdown.spec.mjs --grep 'can convert markdown text into rich text' --repeat-each=3 --reporter=json ``` ESLint, Prettier, and git diff --check passed. macOS WebKit is unavailable locally and is validated in CI.
…ollow-up keys ## Description Firefox exposed two more selection races in browser fixtures. The code-block test could send End before ArrowDown entered the code block, leaving the caret at the end of the preceding paragraph. The character-limit test could send Delete before PageUp/Home reached the first character. Add a shared browser assertion that waits for the native and Lexical carets to agree on the target and offset. Check each transition in the code-block boundary test and both deletion boundaries in the character-limit case. Keep all existing content and selection assertions. ## Test plan ### Before CI on e8c17b8: https://github.com/facebook/lexical/actions/runs/37251396589 macOS Firefox, CodeBlockKeyboard > should not prevent selection and typing outside code block boundaries if block has siblings: ``` - "anchorOffset": 20, + "anchorOffset": 5, - "anchorPath": [1, 0, 0], + "anchorPath": [0, 0, 0], ``` Windows Firefox, CharacterLimit > UTF-8 > rich text: true > can delete text in front and overflow is recomputed: ``` Expected: ...<span data-lexical-text="true">23456</span>... Received: ...<span data-lexical-text="true">12345</span><span class="PlaygroundEditorTheme__characterLimit"><span data-lexical-text="true">6</span></span>... ``` ### After ```sh VITEST_BROWSER=webkit node node_modules/vitest/vitest.mjs run --project=browser packages/lexical-playground/src/__tests__/browser/CodeBlockKeyboard.test.ts packages/lexical-playground/src/__tests__/browser/CharacterLimit.test.ts ``` ``` Test Files 2 passed (2) Tests 20 passed (20) Duration 5.35s ``` ESLint, Prettier, TypeScript, and git diff --check passed. macOS and Windows Firefox are unavailable locally and are validated in CI.
… selection tests ## Description The macOS Chromium first-node table selection test failed all three attempts because its leading paragraph survived setup Backspace. The later shift-selection assertion then saw the trailing paragraph at child index 2 instead of 1. Check native and Lexical caret positions before deleting adjacent paragraphs and before shift-selection in the related first-node, last-node, and surrounding-content variants. Verify the remaining paragraph count after setup deletion. Preserve all existing table-selection expectations and platform exclusions. ## Test plan ### Before macOS Chromium on e8c17b8: https://github.com/facebook/lexical/actions/runs/37251396589 ``` Selection > shift+arrowup into a table, when the table is the first node, selects the whole table - Expected + Received Array [ - 1, + 2, ] Retry #1 Retry #2 1 failed ``` ### After Linux WebKit, all eight adjacent-table selection cases repeated three times, four workers, retries disabled: ``` rich-text: expected=18, skipped=6, unexpected=0, flaky=0 rich-text-with-collab: expected=18, skipped=6, unexpected=0, flaky=0 ``` ```sh E2E_EDITOR_MODE=rich-text node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/Selection.spec.mjs --grep 'into a table' --repeat-each=3 --reporter=json E2E_EDITOR_MODE=rich-text-with-collab node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/Selection.spec.mjs --grep 'into a table' --repeat-each=3 --reporter=json ``` ESLint, Prettier, and git diff --check passed. macOS Chromium is unavailable locally and is validated in CI.
…fter DOM loading ## Description Two Windows Firefox collaboration cases retried before their test actions began: page.goto timed out waiting for the split page's load event. That event includes iframe subresources, while the harness already has explicit checks for each editor's provider connection, rendered paragraph, and initial empty state. For collaboration navigation and recovery reloads, wait for DOMContentLoaded and then run those existing readiness checks. Keep ordinary playground navigation unchanged. Add a collaboration-only regression that deliberately leaves image requests pending. Initialization must complete with both editors ready while the page is still interactive, demonstrating that unrelated load completion is not a prerequisite. ## Test plan ### Before Windows Firefox collaboration on e8c17b8: https://github.com/facebook/lexical/actions/runs/37251396589 ``` Autocomplete > Can autocomplete in the same format as the original text TimeoutError: page.goto: Timeout 30000ms exceeded. ... waiting until "load" Auto Links > Can convert url-like text into links for email TimeoutError: page.goto: Timeout 30000ms exceeded. ... waiting until "load" 2 flaky ``` A local Linux WebKit fault-injection probe held an unrelated image request open and used a two-second navigation budget against the previous helper: ``` expected=0, skipped=0, unexpected=1, flaky=0 TimeoutError: page.goto: Timeout 2000ms exceeded. ... waiting until "load" ``` ### After The same probe and both affected collaboration cases, each repeated three times with retries disabled: ``` expected=9, skipped=0, unexpected=0, flaky=0 ``` The committed Initialization regression, using normal timeout settings, repeated three times in each collaboration mode: ```sh E2E_EDITOR_MODE=rich-text-with-collab node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/Initialization.spec.mjs --repeat-each=3 --reporter=json E2E_EDITOR_MODE=rich-text-with-collab-v2 node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/Initialization.spec.mjs --repeat-each=3 --reporter=json ``` ``` collab v1: expected=3, skipped=0, unexpected=0, flaky=0 collab v2: expected=3, skipped=0, unexpected=0, flaky=0 ``` ESLint, Prettier, and git diff --check passed. Discovery: 658 tests in 100 files. Windows Firefox is unavailable locally and is validated in CI.
…test setup ## Description Native typing imposed a five-second deadline on an entire string. macOS WebKit CI timed out after partially typing the first navigation paragraph. Send one Unicode code point per bounded command so long input can keep making progress, and check that its captured editor remains attached before sending another character. Add a regression that removes the editor during input and verifies no remaining input reaches the next editor. The overflow deletion test intermittently failed before Delete because PageUp/Home had not established the starting caret on Windows Firefox. Set the starting selection through the editor API, retaining native Delete, the DOM/model caret checkpoints, and all overflow HTML assertions. Dedicated navigation tests continue exercising native movement. ## Test plan ### Before Extended CI run 37253261209: ``` FAIL browser (webkit) Navigation.test.ts > native navigation (rich text: true) > can type several paragraphs TimeoutError: locator.pressSequentially: Timeout 5000ms exceeded. FAIL browser (firefox) CharacterLimit.test.ts > character limit UTF-8 > rich text: true > can delete text in front and overflow is recomputed AssertionError: expected false to be true // Object.is equality ``` Linux WebKit, `vitest run --project=browser NativeTyping.test.ts -t 'native input stops'`, with the original helper: ``` AssertionError: promise resolved "undefined" instead of rejecting Tests 1 failed | 2 skipped (3) ``` A temporary slow-input probe (80 characters, 75 ms per keydown) also reproduced: ``` TimeoutError: locator.pressSequentially: Timeout 5000ms exceeded. ``` ### After Linux WebKit, both native-input regressions and the temporary slow-input probe: ``` Test Files 1 passed (1) Tests 3 passed (3) ``` The artificial slow-input probe was removed after validation. Full browser suite with the permanent regression, `VITEST_BROWSER=webkit vitest run --project=browser`: ``` Test Files 60 passed (60) Tests 660 passed | 3 skipped (663) ``` ESLint, Prettier, TypeScript (`tsc --project tsconfig.test.json --noEmit`), and `git diff --check` passed. macOS, Windows, Chromium, and Firefox require CI verification.
…mand ## Description The per-character Vitest commands added enough round trips to time out both multi-paragraph typing cases on macOS Chromium and the rich-text case on macOS WebKit. Send each string through one command, resolve its target element once, and perform the bounded native character actions on the Playwright side. An element handle prevents re-resolving another editor, fails immediately on detachment, and is disposed when the command completes. The Unicode and fixture-removal regressions remain in place. Use three short paragraphs for the multi-paragraph typing test and assert all three texts as well as the final caret. Keep the original long paragraphs for the word/line navigation cases, which initialize them directly. The native typing case still types every character and both paragraph breaks, with unchanged test and action timeouts. ## Test plan ### Before Extended CI run 37258038195 on macOS Chromium: ``` FAIL browser (chromium) Navigation.test.ts > native navigation (rich text: true) > can type several paragraphs FAIL browser (chromium) Navigation.test.ts > native navigation (rich text: false) > can type several paragraphs Error: Test timed out in 15000ms. Tests 2 failed | 659 passed | 2 skipped (663) ``` macOS WebKit: ``` FAIL browser (webkit) Navigation.test.ts > native navigation (rich text: true) > can type several paragraphs Error: Test timed out in 15000ms. Tests 1 failed | 659 passed | 3 skipped (663) ``` ### After Linux WebKit, `VITEST_BROWSER=webkit vitest run --project=browser`: ``` Test Files 60 passed (60) Tests 660 passed | 3 skipped (663) Duration 30.66s ``` Both native-input regressions plus the temporary 80-character, 75-ms-per-keydown probe: ``` Test Files 1 passed (1) Tests 3 passed (3) ``` The temporary slow-input probe was removed after validation. ESLint, Prettier, TypeScript (`tsc --project tsconfig.test.json --noEmit`), and `git diff --check` passed. macOS, Windows, Chromium, and Firefox require CI verification.
zurfyx
approved these changes
Oct 5, 2026
…conflict ## Description Merge upstream main at b47e713 into the E2E audit branch. Resolve the selectAll helper conflict by retaining the combined ControlOrMeta+a keypress and main's subsequent waitForTimerTick. Preserve the upstream timer waits after backward deletion and editor clearing, the triple-click selection fix, and removal of deprecated extension exports. ## Test plan ### Before `git merge --no-commit --no-ff origin/main`: ``` CONFLICT (content): Merge conflict in packages/lexical-playground/__tests__/keyboardShortcuts/index.mjs Automatic merge failed; fix conflicts and then commit the result. ``` ### After Linux WebKit, `VITEST_BROWSER=webkit vitest run --project=browser`: ``` Test Files 60 passed (60) Tests 660 passed | 3 skipped (663) ``` E2E discovery, `playwright test --project=webkit --list`: ``` Total: 658 tests in 100 files ``` TypeScript (`tsc --project tsconfig.test.json --noEmit`), ESLint and Prettier for both merged helpers, and `git diff --check HEAD` passed. No unresolved paths remain. macOS, Windows, Chromium, Firefox, and E2E execution require CI verification.
Merged
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The E2E suite repeatedly initializes the full playground for checks that can run with smaller editor fixtures, and sometimes initializes it before discovering that a test is inapplicable.
This audit reduces that work while retaining playground integration coverage:
The normal 50 ms E2E action delay and debug views remain enabled.
Test plan
Before
E2E discovery: 884 tests in 102 files.
CI exposed intermittent selection/setup failures, native-input timeouts, and input continuing after its fixture was removed.
After
E2E discovery: 658 tests in 100 files — 226 fewer full-playground cases per discovered project.
The static-skip audit compared all 12 platform/editor-mode combinations across three browser projects. Test IDs, titles, and outcomes matched. A native skip-only run confirmed 173 skipped cases with zero playground initializations or Playwright browser API calls.
Full local Linux WebKit browser suite: 660 passed, 3 skipped, across 60 files.
Native-input regressions cover Unicode input, targeting the requesting editor, and stopping after editor removal. A temporary slow-input probe verified continued progress beyond the former whole-string timeout.
CI is green on
33e5087:All seven browser CI configurations passed across Linux, macOS, and Windows.
ESLint, Prettier, TypeScript, and
git diff --checkpassed. Individual commits contain detailed validation results.