E2E: Add a browse command to drive the local site from the command line by ellatrix · Pull Request #85525 · WordPress/gutenberg · GitHub
Skip to content

E2E: Add a browse command to drive the local site from the command line - #85525

Merged
ellatrix merged 13 commits into
trunkfrom
claude/workflow-checking-work-6fcbb0
Oct 26, 2026
Merged

ellatrix merged 13 commits into
trunkfrom
claude/workflow-checking-work-6fcbb0

Conversation

@ellatrix

@ellatrix ellatrix commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

What?

Adds npm run browse, a way to drive a browser on the local WordPress site from the command line with the e2e test utils, plus a browse agent skill that explains how to check a change with it.

Why?

Agents (and people) checking a change by hand need to open the editor, set up content, use the keyboard and read back the result, one step at a time. Today that means writing a throwaway Playwright script or an e2e test for every check.

How?

  • playwright-cli keeps one browser open between commands. Any command that isn't ours (snapshot, click, type, press, screenshot, ...) goes straight to it.
  • npm run browse -- open opens the dashboard, logged in through RequestUtils.setupRest().
  • npm run browse -- <command> runs a curated list of readable commands that call the e2e test utils on the open page:
    • new-post, edit-post, site-editor: Admin navigation. new-post also takes content as block markup, set with editor.setContent(), because WordPress escapes markup passed in the URL.
    • content: prints the post's block markup, or sets it.
    • blocks: prints the blocks with all attributes, as JSON, or sets them from the same shape.
    • insert, transform, keys, focus, save, publish.
    • api <method> <path> [data]: REST calls as admin, like curl, through requestUtils.rest().
  • Arguments are read as JSON when they are JSON, otherwise as text.
  • A browser we connect to has no baseURL, so browse resolves page.goto() paths against WP_BASE_URL itself, as the test fixture already does for subdirectory installs. The e2e test utils are unchanged.
  • Each checkout gets its own browser, profile and session, so parallel worktrees don't share one. Chrome picks its own debugging port and writes it to the profile, so no port needs assigning. Snapshots and the profile go to the ignored test/e2e/artifacts/browse folder.

@playwright/cli depends on a pre-release playwright-core (1.64.0-alpha).

Testing Instructions

  1. Start the test site (npm run wp-env-test start) or set WP_BASE_URL to another local site.
  2. npm run browse -- open: a browser opens on the dashboard, logged in.
  3. npm run browse -- new-post, then npm run browse -- content '<!-- wp:paragraph --><p>Hi</p><!-- /wp:paragraph -->'.
  4. npm run browse -- content prints the same markup.
  5. npm run browse -- insert '{"name":"core/heading"}', npm run browse -- focus prints the heading, then npm run browse -- keys primary+z.
  6. npm run browse -- blocks prints only the paragraph Hi.
  7. npm run browse -- snapshot, click <ref>, type and press work on the same page.
  8. npm run browse -- api POST /wp/v2/posts '{"title":"Hi"}' prints the new post; npm run browse -- api GET /wp/v2/nope prints WordPress's error message.
  9. npm run browse -- close, then npm run browse -- blocks says no browser is open.

Testing Instructions for Keyboard

No UI changes.

Use of AI Tools

Written with Claude Code (Claude Opus 5.5).

🤖 Generated with Claude Code

`npm run browse` keeps one browser open on the checkout's WordPress site.
`open`, `new-post` and `blocks` use the e2e test utils; any other command
goes to playwright-cli in the same browser. A new skill tells agents how
to check a change with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 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: ellatrix <ellatrix@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.56 MB

1ef9096 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric aca8c02 trunk % Change
timeToFirstByte 43.8 ms +11.19% -6.05% 41.7 ms +15.95% -3% 5.04%
largestContentfulPaint 76 ms +7.89% -10.53% 72 ms +5.56% -5.56% 5.56%
lcpMinusTtfb 28.7 ms +19.86% -5.57% 27.7 ms +7.04% -4.51% 3.61%
wpBeforeTemplate 22.92 ms +20.03% -3.4% 22.4 ms +18.79% -1.7% 2.32%
wpTemplate 16.24 ms +3.2% -4.31% 16.11 ms +5.28% -4.47% 0.81%
wpTotal 40.5 ms +10.57% -5.95% 38.42 ms +16.35% -2.68% 5.41%
wpMemoryUsage 7.68 MB +0% -0% 7.65 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric aca8c02 trunk % Change
timeToFirstByte 32 ms +5.62% -2.19% 32.1 ms +7.01% -1.87% -0.31%
largestContentfulPaint 72 ms +0% -0% 72 ms +2.78% -5.56% 0%
lcpMinusTtfb 39.45 ms +2.28% -4.06% 39.35 ms +2.03% -6.61% 0.25%
wpBeforeTemplate 19.6 ms +2.55% -1.12% 19.72 ms +4.72% -0.86% -0.61%
wpTemplate 9.64 ms +4.56% -2.28% 9.69 ms +5.06% -1.34% -0.52%
wpTotal 29.6 ms +5.84% -2.33% 29.55 ms +7.24% -1.22% 0.17%
wpMemoryUsage 6.26 MB +0% -0% 6.22 MB +0% -0% 0.54%
wpDbQueries 9 +0% -0% 9 +0% -0% 0%

media-processing

Metric aca8c02 trunk % Change
mediaProcessingJpeg 324.52 ms +0.2% -0.31% 323.63 ms +0.15% -1.6% 0.28%
mediaProcessingAvif 4776.86 ms +0.08% -0.05% 4824.77 ms +0.32% -0.48% -0.99%
mediaProcessingJpegToAvif 3347.35 ms +0.17% -0.51% 3351.23 ms +0.5% -0.26% -0.12%

media-upload

Metric aca8c02 trunk % Change
jpegUploadProcessing 1186.02 ms +22.2% -22.7% 956.63 ms +46.77% -3.22% 23.98%
pngUploadProcessing 193.2 ms +5.57% -3.3% 189.8 ms +2.63% -4.86% 1.79%
largeJpegUploadProcessing 928.19 ms +51.3% -1.49% 1171.51 ms +19.83% -20.87% -20.77%
multipleImageUploadProcessing 1479.23 ms +0.59% -0.5% 1500.01 ms +1.52% -1.02% -1.39%

post-editor

Metric aca8c02 trunk % Change
serverResponse 257.39 ms +8.02% -8.24% 244.31 ms +5.62% -5.39% 5.35%
firstPaint 184.39 ms +80.53% -12.77% 319.88 ms +1.89% -1.52% -42.36%
domContentLoaded 558.78 ms +1.72% -1.42% 526.84 ms +1.6% -1.34% 6.06%
loaded 559.49 ms +1.75% -1.38% 527.64 ms +1.6% -1.37% 6.04%
firstContentfulPaint 338.16 ms +0.95% -1.82% 320.91 ms +1.56% -1.23% 5.38%
firstBlock 1908.81 ms +1.86% -3.57% 1752.86 ms +0.49% -1.72% 8.9%
type 13.59 ms +5.3% -2.21% 13.13 ms +10.89% -1.75% 3.5%
typeWithoutInspector 13.78 ms +3.12% -4.86% 13.2 ms +8.48% -3.26% 4.39%
typeWithTopToolbar 16.26 ms +9.53% -4.43% 15.8 ms +3.23% -1.9% 2.91%
typeContainer 6 ms +5.33% -9.33% 5.87 ms +4.26% -4.94% 2.21%
focus 73.02 ms +6.83% -4.01% 73.63 ms +8.94% -9.11% -0.83%
firstFocus 141.81 ms +0% -0% 134.33 ms +0% -0% 5.57%
selectAll 300.96 ms +3.27% -4.96% 306.75 ms +7.03% -1.56% -1.89%
listViewOpen 44.75 ms +7.64% -5.59% 43.98 ms +9.35% -4.96% 1.75%
inserterOpen 26.88 ms +14.73% -1.82% 26.32 ms +3.31% -5.93% 2.13%
inserterHover 8.4 ms +11.79% -7.5% 8.82 ms +10.2% -6.35% -4.76%
inserterSearch 6.43 ms +5.91% -6.53% 6.5 ms +3.69% -6.92% -1.08%
loadPatterns 410.75 ms +5.41% -2.18% 462.18 ms +2.62% -3.33% -11.13%
wpTotal 250.94 ms +7.79% -8.47% 237.67 ms +5.92% -5.42% 5.58%
wpMemoryUsage 14.71 MB +0% -0% 14.68 MB +0% -0% 0.24%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric aca8c02 trunk % Change
serverResponse 309.06 ms +1.83% -4.73% 305.95 ms +6.85% -8.34% 1.02%
firstPaint 225.45 ms +6.28% -20.19% 189.27 ms +7.35% -5.58% 19.12%
domContentLoaded 685.09 ms +0.38% -0.56% 684.96 ms +1.65% -1.23% 0.02%
loaded 685.84 ms +0.43% -0.5% 685.87 ms +1.66% -1.21% 0%
firstContentfulPaint 391.61 ms +1.48% -1.85% 384.34 ms +3.19% -1.77% 1.89%
firstBlock 3132.82 ms +0.87% -1.48% 3140.48 ms +1.6% -1.74% -0.24%
type 16.07 ms +8.77% -8.03% 16.56 ms +5.37% -6.76% -2.96%
navigate 112.4 ms +4.17% -7.54% 102.07 ms +8.48% -0.72% 10.12%
loadPatterns 1005.88 ms +9.17% -6.23% 994.1 ms +11.92% -4.72% 1.18%
loadPages 981.53 ms +1.73% -0.87% 1039.6 ms +4.37% -2.5% -5.59%
wpTotal 301.04 ms +1.85% -4.91% 297.95 ms +7.1% -8.67% 1.04%
wpMemoryUsage 12.73 MB +0% -0% 12.70 MB +0% -0% 0.24%
wpDbQueries 44 +2.27% -0% 44.5 +1.12% -1.12% -1.12%

1ef9096 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.

Backspace in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  -  5
+ Received  + 11

@@ -1,25 +1,31 @@
  Array [
    Object {
      "innerBlocks": Array [
        Object {
          "attributes": Object {
-           "content": "1",
+           "content": "1‸a",
          },
-         "innerBlocks": Array [
+         "innerBlocks": Array [],
+         "name": "core/list-item",
+       },
        Object {
+         "attributes": Object {
+           "content": "2",
+         },
          "innerBlocks": Array [
            Object {
              "attributes": Object {
-                   "content": "a‸2",
+               "ordered": false,
+               "values": "",
              },
-                 "name": "core/list-item",
-               },
+             "innerBlocks": Array [
                Object {
                  "attributes": Object {
                    "content": "b",
                  },
+                 "innerBlocks": Array [],
                  "name": "core/list-item",
                },
              ],
              "name": "core/list",
            },

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:2041:42
Custom Completer: should allow newlines after multiple option completions in /test/e2e/specs/editor/various/autocomplete-and-mentions.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

@@ -5,15 +5,15 @@
  <!-- wp:paragraph -->
  <p>🫐 test</p>
  <!-- /wp:paragraph -->

  <!-- wp:paragraph -->
- <p>🫐 test</p>
+ <p>🍎 test</p>
  <!-- /wp:paragraph -->

  <!-- wp:paragraph -->
- <p>🫐 test</p>
+ <p>~🍎 test</p>
  <!-- /wp:paragraph -->

  <!-- wp:paragraph -->
  <p></p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/autocomplete-and-mentions.spec.js:466:6
Custom Completer: should not insert disabled options in /test/e2e/specs/editor/various/autocomplete-and-mentions.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

  <!-- wp:paragraph -->
- <p>Sorry, we are all out of ~g grapes.</p>
+ <p>Sorry, we are all out of 🍎 grapes.</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/autocomplete-and-mentions.spec.js:391:7
Delete (forward) in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  -  2
+ Received  + 25

@@ -1,25 +1,48 @@
  Array [
    Object {
      "innerBlocks": Array [
        Object {
          "attributes": Object {
-           "content": "1",
+           "content": "‸",
          },
          "innerBlocks": Array [
            Object {
+             "attributes": Object {
+               "ordered": false,
+               "values": "",
+             },
              "innerBlocks": Array [
                Object {
                  "attributes": Object {
-                   "content": "a‸2",
+                   "content": "a",
                  },
+                 "innerBlocks": Array [],
                  "name": "core/list-item",
+               },
+             ],
+             "name": "core/list",
            },
+         ],
+         "name": "core/list-item",
+       },
+       Object {
+         "attributes": Object {
+           "content": "2",
+         },
+         "innerBlocks": Array [
            Object {
              "attributes": Object {
+               "ordered": false,
+               "values": "",
+             },
+             "innerBlocks": Array [
+               Object {
+                 "attributes": Object {
                    "content": "b",
                  },
+                 "innerBlocks": Array [],
                  "name": "core/list-item",
                },
              ],
              "name": "core/list",
            },

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:2056:42
does not select blocks in the canvas preview when editing from the sidebar (Site Editor v2) in /test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeVisible() failed

Locator: getByRole('listbox', { name: 'Search results' })
Expected: visible
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeVisible" getByRole('listbox', { name: 'Search results' }) with timeout 5000ms
  - waiting for getByRole('listbox', { name: 'Search results' })

    at LinkControl.useLinkControlSearch (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:423:33)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:179:3
moves selected text within a paragraph in /test/e2e/specs/editor/various/draggable-blocks.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

  Array [
    Object {
      "attributes": Object {
-       "content": "second First third",
+       "content": "First second third",
      },
      "name": "core/paragraph",
    },
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:1209:41
preserves an opaque PNG without format conversion in /test/e2e/specs/editor/various/client-side-media-processing.spec.js, passed after 1 failed attempt.
Error: apiRequestContext.fetch: socket hang up
Call log:
  - → GET http://localhost:8891/wp-json/wp/v2/media?per_page=100
    - user-agent: Playwright/1.63.0 (x64; ubuntu 24.04) node/24.20 CI/1
    - accept: */*
    - accept-encoding: gzip,deflate,br
    - X-WP-Nonce: 911f995d1b
    - cookie: wordpress_test_cookie=WP%20Cookie%20check; wordpress_logged_in_da433b7faafd8180ebeb1624ceeeab7e=admin%7C1793206196%7CdYaCtRoo1vkO99AboDV0la9unTmB94IXeemYVMloGQf%7Cfbd508a73dc373223ea722edea34a014078e2bd8bdf6e570c07ecb8672663acb; wp-settings-time-1=1793033496

    at RequestUtils.rest (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/rest.ts:111:39)
    at RequestUtils.listMedia (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/media.ts:24:30)
    at RequestUtils.deleteAllMedia (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/request-utils/media.ts:85:27)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/client-side-media-processing.spec.js:215:22
should be immediately saved on indentation in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

@@ -1,8 +1,8 @@
  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>one<!-- wp:list -->
+ <li>ne<!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
  <li></li>
  <!-- /wp:list-item --></ul>
  <!-- /wp:list --></li>
  <!-- /wp:list-item --></ul>

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:694:52
should change the indented list type in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('role=toolbar[name="Block tools"i]').locator('role=button[name="Indent"]')

    at Editor.clickBlockToolbarButton (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/editor/click-block-toolbar-button.ts:17:15)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:727:3
should create paragraph on split at end and merge back with content in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 1
+ Received  + 1

@@ -1,8 +1,8 @@
  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>one</li>
+ <li></li>
  <!-- /wp:list-item --></ul>
  <!-- /wp:list -->

  <!-- wp:paragraph -->
  <p></p>

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:461:52
should cut and paste individual blocks with collapsed selection in /test/e2e/specs/editor/various/copy-cut-paste.spec.js, passed after 1 failed attempt.
Error: expect(string).toMatchSnapshot(expected) failed

  @@ -1,3 +1,3 @@
   <!-- wp:paragraph -->
  -<p>2Cut - collapsed selection</p>
  +<p>2</p>
   <!-- /wp:paragraph -->


    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/copy-cut-paste.spec.js:45:49
should format text across blocks in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 2 failed attempts.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

@@ -1,9 +1,9 @@
  Array [
    Object {
      "attributes": Object {
-       "content": "ab",
+       "content": "b",
      },
      "name": "core/paragraph",
    },
    Object {
      "attributes": Object {

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:2170:41
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('toolbar', { name: 'Block tools' }).getByRole('button', { name: 'Bold' })
    - locator resolved to <button id="_r_3s_" type="button" tabindex="-1" aria-label="Bold" aria-pressed="true" data-toolbar-item="true" class="components-button components-toolbar-button is-compact is-pressed has-icon">…</button>
  - attempting click action
    - waiting for element to be visible, enabled and stable

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:2229:14
should gradually multi-select in /test/e2e/specs/editor/various/multi-block-selection.spec.js, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 1
+ Received  + 1

  Array [
    Object {
-     "name": "core/column",
+     "name": "core/paragraph",
    },
  ]

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/multi-block-selection.spec.js:1145:5
should indent and outdent a list item when its content is fully selected in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 7
+ Received  + 7

  <!-- wp:list -->
  <ul class="wp-block-list"><!-- wp:list-item -->
- <li>a<!-- wp:list -->
- <ul class="wp-block-list"><!-- wp:list-item -->
- <li>b</li>
+ <li></li>
+ <!-- /wp:list-item --></ul>
- <!-- /wp:list-item --></ul>
+ <!-- /wp:list -->
+
- <!-- /wp:list --></li>
- <!-- /wp:list-item --></ul>
+ <!-- wp:paragraph -->
+ <p>b</p>
- <!-- /wp:list -->
+ <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:819:52
should indent and outdent level 1 in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for locator('role=toolbar[name="Block tools"i]').locator('role=button[name="Indent"]')

    at Editor.clickBlockToolbarButton (/home/runner/work/gutenberg/gutenberg/packages/e2e-test-utils-playwright/src/editor/click-block-toolbar-button.ts:17:15)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/list.spec.js:775:3
should indent and outdent level 2 in /test/e2e/specs/editor/blocks/list.spec.js, passed after 1 failed attempt.

Truncated. See the full report.

1ef9096 Run

`npm run browse -- <helper>.<method> [args]` now calls any method of
`admin`, `editor`, `pageUtils` or `requestUtils`, in place of hand-written
commands. `Admin` takes a `baseURL` like `RequestUtils` (the fixture passes
the project's, `WP_BASE_URL` otherwise), so its navigation also works
outside the test runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the [Tool] E2E Test Utils /packages/e2e-test-utils-playwright label Oct 25, 2026
`npm run gb` maps readable commands to the e2e test utils: `new-post`,
`edit-post`, `site-editor`, `content` (get or set), `blocks`, `insert`,
`transform`, `keys`, `focus`, `save`, `publish`, and `api` for REST calls
like curl.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ellatrix ellatrix changed the title E2E: Add a browse command to drive the local site from the command line E2E: Add a gb command to drive the local site from the command line Oct 25, 2026
ellatrix and others added 2 commits October 25, 2026 10:21
`new-post` takes `content` as block markup and sets it with
`editor.setContent()`, since WordPress escapes markup in the URL.
`blocks` with an argument sets the blocks from the shape it prints.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`npm run browse -- gb <command>` runs our commands, so they read apart
from playwright-cli's: `npm run browse -- click e12` still goes to
playwright-cli, and `open` opens the shared browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ellatrix ellatrix changed the title E2E: Add a gb command to drive the local site from the command line E2E: Add a browse command to drive the local site from the command line Oct 25, 2026
ellatrix and others added 6 commits October 25, 2026 10:28
Our commands run directly, like `npm run browse -- blocks`; any other
command still goes to playwright-cli.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`npm run browse -- insert heading '{"level":3}'` inserts a core/heading;
names with a namespace are used as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Back to passing the block straight to `editor.insertBlock()`, in the
same shape `blocks` prints, nested blocks included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`Admin` only builds full URLs from `baseURL` when it's passed in, so an
`Admin` created by hand keeps following the browser context's `baseURL`.
`browse` passes it, and the test fixture no longer needs to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`browse` resolves `page.goto()` paths against `WP_BASE_URL` on the page it
connects to, as the test fixture does, so `Admin` needs no new option and
the published e2e test utils stay as they are on trunk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the [Tool] E2E Test Utils /packages/e2e-test-utils-playwright label Oct 25, 2026
Runs open, new-post, insert, blocks and api the way an agent does, and checks
the blocks and the REST response exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ellatrix
ellatrix marked this pull request as ready for review October 26, 2026 17:31
@ellatrix ellatrix added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Oct 26, 2026
@ellatrix

Copy link
Copy Markdown
Member Author

Let's try it, it's private and we can iterate as it gets used.

@ellatrix
ellatrix merged commit 65068cd into trunk Oct 26, 2026
102 of 103 checks passed
@ellatrix
ellatrix deleted the claude/workflow-checking-work-6fcbb0 branch October 26, 2026 17:35
@github-actions github-actions Bot added this to the Gutenberg 24.4 milestone Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[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.

1 participant