Skip to content

Suggestion mode 9/9: end-to-end test suite - #82048

Open
adamsilverstein wants to merge 216 commits into
suggest/docsfrom
suggest/e2e
Open

adamsilverstein wants to merge 216 commits into
suggest/docsfrom
suggest/e2e

Conversation

@adamsilverstein

@adamsilverstein adamsilverstein commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

Part of #73411

What's in this PR

Splits the Suggestion mode end-to-end suite out of the wiring PR (#80433). 30 spec files and no production code, covering:

  • mode switching, the keyboard shortcuts, and the experiment-off path
  • inline typing, deletion and formatting, including the multi-block format refusal
  • attribute and structural capture, and the invariant that a block never carries both an inline marker and a whole-attribute proposal for the same edit
  • review decisions, the sidebar summary, undo ordering, and a decision staying provisional until the post is saved
  • persistence: what the save moves out of post_content and puts back for the editor, the front end rendering of pending suggestions, and suggestions outdated by someone else's save
  • overlapping suggestions: one test per gesture, block-level overlaps, and accept/reject orders driven from the shared fixtures in Suggestion mode 5/9: inline suggestion operations #80431
  • post title and post field suggestions, and the post status refusal
  • marker accessibility announcements and marker reveal
  • clipboard strip, external content adoption, List View, and the code editor
  • the note collector, including the reply guard from Suggest mode: keep a suggestion note the collector would trash when it has replies #81997
  • two real-time collaboration specs: typing, and two peers suggesting over the same words

It also carries the e2e helper plugins the specs use, a typing performance spec for Suggesting, and the performance harness changes that let a metric be skipped on the comparison build.

Keeping them here means the wiring PR reviews as code and this one reviews as tests.

Testing

npm run test:e2e -- test/e2e/specs/editor/various/suggestion-mode
npm run test:e2e -- test/e2e/specs/editor/collaboration/collaboration-suggestion-mode
npm run test:e2e -- test/e2e/specs/site-editor/suggestion-mode-intent-shortcuts.spec.ts

Suggestion mode stack

This rebuilds the manually-stacked Suggestion mode work (#73411) as a GitHub Stack of 9 small, independently reviewable PRs, each building on the one below it:

  1. #80427 - editor intent (edit/suggest) + experiment gate
  2. #80428 - suggestion storage, REST controller, provider
  3. #80429 - block-level capture (attribute + structural)
  4. #80430 - inline marker primitive
  5. #80431 - inline suggestion operations
  6. #80432 - review UI (Apply/Reject sidebar + summary)
  7. #80433 - inline live wiring
  8. #82047 - architecture documentation
  9. #82048 - end-to-end test suite

Each follow up fix now sits in the layer that owns the code it changes, rather than piling onto the top of the stack. Overlapping suggestions were briefly their own layer (#86206, now closed); that code sits in the layers that own it, mainly #80431 and #80433. The whole feature can be exercised end-to-end via the combined testing branch #78994 (Playground). Behind the "Suggestion Mode" experiment (Gutenberg > Experiments).


AI Use

Claude Code wrote these specs and carved them out into this PR. I will review and test.

Cover the feature end to end: intent switching and shortcuts, inline
typing, deletion and formatting, attribute and structural capture,
review decisions, undo, persistence and the front end, accessibility
announcements, and multi-author marker tinting.
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 7.95 MB

compressed-size-action

@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Flaky tests detected in 459ed76.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/33450976453
📝 Reported tests:

Should save the changes in /test/e2e/specs/editor/plugins/wp-editor-meta-box.spec.js, passed after 2 failed attempts.
TimeoutError: page.waitForFunction: Timeout 10000ms exceeded.
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/plugins/wp-editor-meta-box.spec.js:34:14
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('role=button[name="Visual"i]')

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/plugins/wp-editor-meta-box.spec.js:33:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Four moderate correctness and synchronization issues remain in the test suite.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds end-to-end coverage for Suggest mode workflows, persistence, accessibility, and editor safeguards.

Changes:

  • Tests capture, review, undo, persistence, and clipboard flows.
  • Covers restrictions, external content, overlays, and intent switching.
  • Validates accessibility, navigation, marker reveal, and shortcuts.
File summaries
File Description
test/e2e/specs/site-editor/suggestion-mode-intent-shortcuts.spec.ts Site Editor shortcut gating
test/e2e/specs/editor/various/suggestion-mode-undo.spec.ts Undo ordering and cleanup
test/e2e/specs/editor/various/suggestion-mode-summary.spec.ts Sidebar summary rendering
test/e2e/specs/editor/various/suggestion-mode-review.spec.ts Accept and reject flows
test/e2e/specs/editor/various/suggestion-mode-post-status.spec.ts Post-status restrictions
test/e2e/specs/editor/various/suggestion-mode-persistence.spec.ts Persistence and front-end rendering
test/e2e/specs/editor/various/suggestion-mode-overlay-retirement.spec.ts Overlay retirement invariants
test/e2e/specs/editor/various/suggestion-mode-multi-block-format.spec.ts Multi-block formatting refusal
test/e2e/specs/editor/various/suggestion-mode-marker-reveal.spec.ts Marker reveal and navigation
test/e2e/specs/editor/various/suggestion-mode-list-view.spec.ts List View behavior
test/e2e/specs/editor/various/suggestion-mode-external-content.spec.ts External content adoption
test/e2e/specs/editor/various/suggestion-mode-experiment-off.spec.ts Disabled-experiment behavior
test/e2e/specs/editor/various/suggestion-mode-code-editor.spec.ts Code Editor restrictions
test/e2e/specs/editor/various/suggestion-mode-clipboard.spec.ts Clipboard sanitization
test/e2e/specs/editor/various/suggestion-mode-a11y.spec.ts Marker accessibility
Review details

Suppressed comments (2)

test/e2e/specs/editor/various/suggestion-mode-persistence.spec.ts:514

  • This likewise publishes a pending cross-parent move at its proposed destination, so readers see an unaccepted structural change. Persist enough source-parent information to restore the original Group A placement, then assert that front-end location here.
		expect( rendered.indexOf( 'Group A traveller' ) ).toBeGreaterThan(
			rendered.indexOf( 'Group B first' )
		);
		expect( rendered.indexOf( 'Group A traveller' ) ).toBeGreaterThan(
			rendered.indexOf( 'Group B second' )
		);

test/e2e/specs/editor/various/suggestion-mode-review.spec.ts:1300

  • A transform schedules two independent note saves, but this waits for only the first response and can leave Suggesting before the second note exists. Wait until both pending notes are observable before switching intent so the rejection actually covers both halves.
		const suggestionSaved = suggestionSavedPromise( page );
		await transformParagraphToQuote( page, editor );
		await suggestionSaved;
  • Files reviewed: 16/16 changed files
  • Comments generated: 4
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@adamsilverstein adamsilverstein added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Sep 4, 2026
…h transform notes

The marker-reveal sampler stopped on a fixed deadline, so on a slow worker
it could give up before the floating cards mounted and the overlap check
passed vacuously. Stop it from the test once the cards are asserted and
require it to have seen all three.

A block transform saves two notes but the test waited for one response
before leaving Suggesting; wait until both are pending so the decision
always exercises grouped resolution.

Point the two front-end move tests at the documented limitations they pin.
…s placed

Headless Chromium only runs animation frames when something paints, so
the frame sampler observed a handful of frames and could stop before the
board placed the cards. Wait for each card's pointer events to come back,
then sample the settled board explicitly and require all three cards.
@coderabbitai

coderabbitai Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include @coderabbitai review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: ded379c0-aaae-4726-8a04-a8c6611d0959

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: 0 B

Total Size: 8.78 MB

From 9155939, not the current head. Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 2ada1e0 trunk % Change
timeToFirstByte 42.45 ms +9.89% -3.53% 45.45 ms +10.34% -5.17% -6.6%
largestContentfulPaint 68 ms +11.76% -2.94% 74 ms +8.11% -8.11% -8.11%
lcpMinusTtfb 26.25 ms +6.29% -7.05% 25.65 ms +22.42% -4.87% 2.34%
wpBeforeTemplate 21.71 ms +7.37% -3.09% 22.72 ms +18.09% -3.79% -4.45%
wpTemplate 17.31 ms +8.09% -7.57% 18.67 ms +5.52% -6.91% -7.28%
wpTotal 39.37 ms +6.83% -4.78% 41.96 ms +11.01% -6.22% -6.17%
wpMemoryUsage 7.86 MB +0% -0% 7.83 MB +0% -0% 0.44%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 2ada1e0 trunk % Change
timeToFirstByte 36.4 ms +7.14% -8.52% 37.65 ms +7.3% -3.59% -3.32%
largestContentfulPaint 66 ms +3.03% -3.03% 68 ms +2.94% -5.88% -2.94%
lcpMinusTtfb 29.6 ms +6.25% -2.36% 28.05 ms +9.09% -1.6% 5.53%
wpBeforeTemplate 19.24 ms +7.33% -5.93% 20.2 ms +4.11% -4.16% -4.75%
wpTemplate 12.99 ms +6.62% -6.08% 14.09 ms +9.3% -3.34% -7.81%
wpTotal 33.08 ms +8.92% -7.95% 34.53 ms +8.25% -3.85% -4.2%
wpMemoryUsage 6.52 MB +0% -0% 6.49 MB +0% -0% 0.55%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 2ada1e0 trunk % Change
mediaProcessingJpeg 247.77 ms +2.95% -0.48% 247.4 ms +1.53% -1.44% 0.15%
mediaProcessingAvif 4011.84 ms +0.6% -0.3% 3957.24 ms +0.37% -0.44% 1.38%
mediaProcessingJpegToAvif 2737.7 ms +0.61% -0.24% 2753.26 ms +0.67% -0.16% -0.57%

media-upload

Metric 2ada1e0 trunk % Change
jpegUploadProcessing 1489.46 ms +1.1% -2.09% 1462.97 ms +0.33% -0.51% 1.81%
pngUploadProcessing 256.1 ms +5.01% -3.97% 247.53 ms +8.17% -2.09% 3.46%
largeJpegUploadProcessing 1460.35 ms +1.23% -0.8% 1460.83 ms +0.95% -0.46% -0.03%
multipleImageUploadProcessing 1544.69 ms +1.97% -1.24% 1543.49 ms +0.19% -0.8% 0.08%

suggestion-mode

Metric 2ada1e0 trunk % Change
suggestionTypeEditing 17.94 ms +10.59% -7.47% 20.02 ms +6.64% -8.89% -10.39%
suggestionTypeSuggesting 25.01 ms +4.2% -7.56% 27.3 ms +8.79% -6.48% -8.39%
suggestionAccept 157 ms +21.97% -1.43% 193 ms +17.49% -10.1% -18.65%

post-editor

Metric 2ada1e0 trunk % Change
serverResponse 521.45 ms +3.22% -9.12% 484.38 ms +7.08% -5.36% 7.65%
firstPaint 412.75 ms +13.86% -2.77% 421.31 ms +10.84% -2.63% -2.03%
domContentLoaded 861.58 ms +2.26% -3.33% 839.14 ms +0.78% -1.12% 2.67%
loaded 862.77 ms +2.27% -3.32% 840.34 ms +0.82% -1.14% 2.67%
firstContentfulPaint 479.53 ms +6.76% -2.83% 476.04 ms +1.27% -1.9% 0.73%
firstBlock 2419.22 ms +5% -2.17% 2393.02 ms +1.21% -1.07% 1.09%
type 17.68 ms +6.56% -5.03% 18.31 ms +7.43% -3.44% -3.44%
typeWithoutInspector 18.29 ms +11.48% -7.22% 18.72 ms +5.34% -6.41% -2.3%
typeWithTopToolbar 24.89 ms +5.06% -6.75% 24.69 ms +2.92% -6.97% 0.81%
typeContainer 8.15 ms +5.89% -4.91% 8.92 ms +6.73% -12% -8.63%
typeSuggest 29.7 ms +5.52% -10.54% 29.32 ms +9.55% -12.24% 1.3%
focus 110.43 ms +3.29% -3.42% 120.2 ms +6.82% -5.92% -8.13%
firstFocus 256.31 ms +0% -0% 276.61 ms +0% -0% -7.34%
selectAll 502.3 ms +0.49% -0.38% 489.16 ms +4.17% -1.14% 2.69%
undo 30.04 ms +5.23% -6.06% 31.73 ms +3.25% -4.32% -5.33%
listViewOpen 39.03 ms +6.76% -3.79% 42.6 ms +6.67% -3.19% -8.38%
inserterOpen 45.32 ms +6.95% -9.93% 43.03 ms +5.02% -11.88% 5.32%
inserterHover 12.12 ms +8.91% -10.81% 11.8 ms +6.36% -10.08% 2.71%
inserterSearch 8.51 ms +3.17% -10.58% 9.27 ms +3.88% -15.53% -8.2%
loadPatterns 666.63 ms +7.28% -2.14% 687.82 ms +3.05% -2.36% -3.08%
wpTotal 511.75 ms +3.02% -9.27% 474.49 ms +7.23% -5.46% 7.85%
wpMemoryUsage 14.88 MB +0% -0% 14.85 MB +0% -0% 0.25%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 2ada1e0 trunk % Change
serverResponse 488.99 ms +2.73% -6.08% 478.26 ms +4.58% -5.02% 2.24%
firstPaint 467.92 ms +4.15% -13.93% 461.65 ms +5.26% -7.08% 1.36%
domContentLoaded 877.99 ms +8.47% -2.06% 872.84 ms +0.89% -1.19% 0.59%
loaded 878.99 ms +8.46% -2.05% 873.79 ms +0.93% -1.19% 0.6%
firstContentfulPaint 487.46 ms +6.96% -0.83% 486.22 ms +2.14% -1.37% 0.26%
firstBlock 2802.22 ms +3.98% -0.76% 2788.87 ms +1.67% -0.37% 0.48%
type 19.98 ms +6.76% -8.41% 19.28 ms +4.98% -4.25% 3.63%
navigate 134.22 ms +1.79% -14.77% 116.94 ms +13.31% -1.91% 14.78%
loadPatterns 1408.2 ms +18.02% -12.73% 1406.26 ms +16.2% -8.05% 0.14%
loadPages 1007.74 ms +2.62% -1.21% 1028.53 ms +4.5% -0.39% -2.02%
wpTotal 479.54 ms +2.75% -6.29% 468.68 ms +4.71% -5.1% 2.32%
wpMemoryUsage 12.92 MB +0% -0% 12.88 MB +0% -0% 0.28%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

From 9155939, not the current head. Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

should undo without broken temporary state in /test/e2e/specs/editor/blocks/image.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

- <!-- wp:image -->
- <figure class="wp-block-image"><img alt=""/></figure>
+ <!-- wp:image {"id":21,"sizeSlug":"full","linkDestination":"none"} -->
+ <figure class="wp-block-image size-full"><img src="http://localhost:8889/wp-content/uploads/2026/11/a1b35173-2cf6-4886-a5d0-ffaa8b6678ca.png" alt="" class="wp-image-21"/></figure>
  <!-- /wp:image -->
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/image.spec.js:432:49

From 9155939, not the current head. Run

adamsilverstein and others added 16 commits November 24, 2026 08:47
Lint JavaScript failed on #82048 and the bundle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018vwYjSVYv6ST6c14oqbUdD
…to end

The filters read the suggestion status from note meta, which only a real
decision and save produce.
Follows the wording change in the layers below.
…the caption

Covers #87432, where the floating card of a suggestion on an image caption
sits level with the top of the image and is scrolled out of view.

Claude-Session: https://claude.ai/code/session_018vwYjTEP8WL7QZukPGELAH
The anchor lookup only matched a note's marker, so a suggestion fell back
to the top of its block. On a tall block such as an image with a caption
that put the card far from the suggested text, often out of view.

Claude-Session: https://claude.ai/code/session_018vwYjTEP8WL7QZukPGELAH
Resizing an image by its drag handle lists the width, height and
aspect ratio attributes one by one, and a crop or rotation lists the
attachment id and URL. Pin the wording a reviewer should read instead.

See #87433.
Covers italics beside an existing caption suggestion, and italics on a
clean caption followed by typing. See #87434.
The save pass makes an accepted or rejected suggestion final, yet the
notes sidebar kept asking to save the post. Pin the expected state, with
and without a reply on the note, for issue #87430.

Claude-Session: https://claude.ai/code/session_018vwYjVWRM5jZLuyWWjTNCE
@adamsilverstein adamsilverstein changed the title Suggestion mode 10/10: end-to-end test suite Suggestion mode 9/9: end-to-end test suite Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] E2E Tests /packages/e2e-tests [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants