Skip to content

Build/Test Tools: Cover replacing an installed theme with an uploaded version - #15970

Closed
huzaifaalmesbah wants to merge 1 commit into
WordPress:trunkfrom
huzaifaalmesbah:tests/theme-upload-replace-e2e
Closed

huzaifaalmesbah wants to merge 1 commit into
WordPress:trunkfrom
huzaifaalmesbah:tests/theme-upload-replace-e2e

Conversation

@huzaifaalmesbah

Copy link
Copy Markdown
Member

Description

Adds an E2E test for replacing an installed theme with an uploaded newer version. The test uploads e2e-test-theme-2.0.zip over the installed 1.0 fixture, checks the version row on the "This theme is already installed." screen, clicks "Replace installed with uploaded", and verifies the new version through the REST API.

It also adds the 2.0 theme fixture (documented in tests/e2e/assets/e2e-test-theme.md, the 1.0 archive is regenerated byte-identical by the same script) and moves the shared upload steps into an uploadTheme() helper.

Follow-up to r64624, which added the same coverage for plugins.

Testing Instructions

  1. npm run env:start
  2. npm run test:e2e -- tests/e2e/specs/themes.test.js
  3. All five theme management tests pass.
  4. To confirm the new test catches a regression, upload e2e-test-theme.zip instead of e2e-test-theme-2.0.zip in the new test: it fails on the Version 1.0 2.0 row.

Trac ticket: https://core.trac.wordpress.org/ticket/54334

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Brainstorming edge-case scenarios and drafting test boilerplate; test architecture, assertions, and local E2E verification were written and validated by me.

… version.

Add an E2E test that uploads a newer version of the fixture theme, checks the version comparison on the "already installed" screen, replaces the installed theme, and verifies the new version through REST. Add a 2.0 theme fixture and move the shared upload steps into a helper.

Follow-up to r64624.

See #54334.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the theme-replacement test coverage and shared upload helper.

No open issues 🎉

What changed in this PR

Adds end-to-end coverage for replacing an installed WordPress theme with an uploaded newer version, extending the existing theme management tests.

Changes:

  • Tests the replacement workflow, checking the installed/uploaded version comparison and confirming version 2.0 through the REST API.
  • Extracts shared upload steps into an uploadTheme() helper.
  • Updates fixture documentation with a script to reproduce both theme versions.
File Description
tests/​e2e/​specs/​themes.test.js Adds the replacement test and reuses a shared upload helper.
tests/​e2e/​assets/​e2e-test-theme.md Documents the 2.0 fixture and generation of both archives.

Review effort: Balanced

@huzaifaalmesbah
huzaifaalmesbah marked this pull request as ready for review November 13, 2026 09:48
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props huzaifaalmesbah.

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 or WordPress.org 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.

@lancewillett lancewillett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, @huzaifaalmesbah. Approving at 30a4a82.

  • The documented script rebuilds both archives byte-identical, and the 1.0 archive is unchanged from trunk.
  • The heading, the Version 1.0 2.0 row and the "Replace installed with uploaded" link match Theme_Installer_Skin in trunk.
  • CI: the serial E2E jobs run 15 tests against trunk's 14, so the new test runs there, and everything passed with no retries.

This completes https://core.trac.wordpress.org/ticket/54334: r64624 covered the plugin half. #1813 can close when this lands.

AI review · claude-opus-5-5

@lancewillett

Copy link
Copy Markdown
Member

wporg-sync pushed a commit that referenced this pull request Nov 13, 2026
… version.

Upload a newer version of the fixture theme over the installed one, replace it, and verify the new version through REST. A second ZIP fixture holds the newer version.

Follow-up to [64624].

Developed in: #15970

Props huzaifaalmesbah, justinahinon, juhise.
Fixes #54334.


git-svn-id: https://develop.svn.wordpress.org/trunk@65520 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 13, 2026
… version.

Upload a newer version of the fixture theme over the installed one, replace it, and verify the new version through REST. A second ZIP fixture holds the newer version.

Follow-up to [64624].

Developed in: WordPress/wordpress-develop#15970

Props huzaifaalmesbah, justinahinon, juhise.
Fixes #54334.

Built from https://develop.svn.wordpress.org/trunk@65520


git-svn-id: http://core.svn.wordpress.org/trunk@64593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
arshidkv12 pushed a commit to arshidkv12/wordpress-develop that referenced this pull request Nov 21, 2026
… version.

Upload a newer version of the fixture theme over the installed one, replace it, and verify the new version through REST. A second ZIP fixture holds the newer version.

Follow-up to [64624].

Developed in: WordPress#15970

Props huzaifaalmesbah, justinahinon, juhise.
Fixes #54334.


git-svn-id: https://develop.svn.wordpress.org/trunk@65520 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants