Skip to content

Add CLI integration test for creating a site from a custom Blueprint#3961

Draft
gcsecsey wants to merge 4 commits into
trunkfrom
stu-1871-migrate-blueprints-tests
Draft

Add CLI integration test for creating a site from a custom Blueprint#3961
gcsecsey wants to merge 4 commits into
trunkfrom
stu-1871-migrate-blueprints-tests

Conversation

@gcsecsey

@gcsecsey gcsecsey commented Jun 25, 2026

Copy link
Copy Markdown
Member

Related issues

How AI was used in this PR

I used Claude to review the existing Playwright blueprint tests and the new CLI e2e harness from #3947, plan the migration, and to write the test. I reviewd and verified all changes.

Proposed Changes

Blueprint coverage currently lives only in apps/studio/e2e/blueprints.test.ts, which boots the entire desktop app through Playwright to create a site from a custom Blueprint and then inspects wp-admin — slow, flaky, and coupled to the UI. This continues the "Migrate Studio E2E tests to CLI" effort by exercising the same capability directly through the CLI.

  • Adds a real integration test that runs studio site create --blueprint <file> against an isolated config directory and asserts on the result: a site is created from a custom Blueprint, and the Blueprint's install steps land their files on disk. Because the Blueprint is applied during create even with --no-start, the test can verify real effects (a theme and a plugin installed) without booting a server. It covers four step types from the original suite — install theme, install plugin, run PHP, and WP-CLI.
  • Closes a gap in the Add CLI integration test for site create (custom name, domain, HTTPS) #3947 harness: the helper isolated the config directory but not the legacy Electron appdata directory, so the Studio-compatibility startup migration could find a real pre-split appdata-v1.json and abort the CLI on a developer's machine (it passed in CI only because CI starts clean). The harness now isolates that path too, which also fixes the sibling create.e2e.test.ts locally.

Per the issue, activation/option-state assertions (which require reading the site's SQLite database) and error/validation cases are left as follow-ups, and the Playwright blueprints.test.ts is kept for now.

Testing Instructions

  1. Build the CLI: npm run cli:build.
  2. Run the new suite (needs a network connection — the install steps download from wordpress.org):
    npm test -- apps/cli/commands/site/tests/create-blueprint.e2e.test.ts --tagsFilter='e2e'
    Confirm all four tests pass.
  3. Confirm the fast suite is unaffected:
    npm test -- apps/cli/commands/site/tests/create-blueprint.e2e.test.ts --tagsFilter='!e2e'
    The four tests are skipped.
  4. Regression check for the harness fix — confirm the sibling test also passes:
    npm test -- apps/cli/commands/site/tests/create.e2e.test.ts --tagsFilter='e2e'

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

Base automatically changed from stu-1867-add-cli-create-e2e-test to trunk June 26, 2026 07:18
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.

2 participants