Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Drives a persistent logged-in browser on the local WordPress site to check editor and admin changes from the command line.
14% 95%+81 ptsof test cases passed
Passed 20 of 21 test cases with the skill, and 3 of 21 without it.
3 of 3 safety checks passed
Not used yet
npm run browse drives one browser on this checkout's WordPress site. The browser stays open between commands, so each command continues where the last one stopped. It uses WP_BASE_URL, like the e2e tests, and defaults to http://localhost:8889.
Always pass the command after --, so npm does not take its flags. Run npm run browse -- open first: it opens the browser on the dashboard, logged in as admin.
Each one calls an e2e test util from packages/e2e-test-utils-playwright/src, which shows the options it takes. Arguments are read as JSON when they are JSON, otherwise as text.
| Command | Does | Test util |
|---|---|---|
new-post [options] | Opens a new post, e.g. new-post '{"postType":"page","content":"<block markup>"}'. | admin.createNewPost, editor.setContent |
edit-post <id> | Opens a post in the editor. | admin.editPost |
site-editor [options] | Opens the site editor. | admin.visitSiteEditor |
content [markup] | Prints the post's block markup, or sets it. | editor.getEditedPostContent, editor.setContent |
blocks [blocks] | Prints the blocks with all their attributes, as JSON, or sets them from the same shape, e.g. blocks '[{"name":"core/heading","attributes":{"content":"Hi"}}]'. | editor.getBlocks, editor.insertBlock |
insert <block> | Inserts a block, in the shape blocks prints, e.g. insert '{"name":"core/heading","attributes":{"level":3}}'. | editor.insertBlock |
transform <name> | Transforms the selected block, e.g. transform core/paragraph. | editor.transformBlockTo |
keys <keys> | Presses keys, with primary for Cmd or Ctrl, e.g. keys primary+z. | pageUtils.pressKeys |
focus | Prints what has keyboard focus. | editor.getFocusOwnerLabel |
save, publish | Saves a draft, or publishes. | editor.saveDraft, editor.publishPost |
api <method> <path> [data] | Calls the REST API as admin, like curl, e.g. api POST /wp/v2/posts '{"title":"Hi"}'. Needs no browser. | requestUtils.rest |
Any other command goes to playwright-cli in the same browser: snapshot (the page as text, with refs), click <ref>, type <text>, press <key>, goto <full URL>, screenshot, close. Run npm run browse -- --help for the full list; its first lines point to playwright-cli's own skill.
To record a video of a check, wrap the steps in video-start and video-stop, which prints the file's path. It records everything on the page, including the commands above. video-chapter <title> marks a step, and video-show-actions labels each action on screen.
open, then set the page up, for example with new-post.blocks or snapshot before acting.blocks, including attributes, and snapshot or screenshot for what is on screen.npm run browse -- open
npm run browse -- new-post '{"content":"<!-- wp:paragraph --><p>Hi</p><!-- /wp:paragraph -->"}'
Next to this one in the catalogue, plus more from the same author.