Skip to content

Build/Test Tools: Cover plugin upload, replacement and management. - #8075

Closed
juhi123 wants to merge 4 commits into
WordPress:trunkfrom
juhi123:add/plugin-tests
Closed

juhi123 wants to merge 4 commits into
WordPress:trunkfrom
juhi123:add/plugin-tests

Conversation

@juhi123

@juhi123 juhi123 commented Jan 2, 2025 •

Copy link
Copy Markdown

Adds three focused browser checks for plugin management:

  • Upload a plugin ZIP, activate it, and deactivate it through the plugin row controls. Verify both saved status changes through REST.
  • Upload a newer version, choose “Replace current with uploaded,” and verify that the installed version changes from 1.0 to 2.0.
  • Confirm deletion of an inactive plugin, reload the list, and verify that the plugin is absent through REST.

Two 251-byte fixture archives replace the bundled Akismet versions. They contain only plugin headers; no third-party plugin code or update availability is needed. The fixture documentation includes their source and regeneration instructions. The network-dependent update-notice assertion is removed.

Each case installs its own prerequisite and cleans up only the fixture plugin. A preexisting fixture makes setup fail without deleting it. The fixed fixture slug assumes the test environment is not shared with another simultaneous run, matching the current CI setup. These cases target single-site plugin management.

This carries the activation/deactivation scenarios forward from #8050, by the same author. That PR remains open pending review of this consolidation.

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

Props

juhise authored this PR and the activation/deactivation scenarios in #8050.

Verification

  • All three cases passed three local single-site Chromium repetitions without retries (9 checks, 55.8 seconds).

  • The fixture was removed and the original local multisite configuration restored afterward.

  • Scoped E2E plugin and five-steps audits found no blockers.

  • JavaScript syntax and whitespace checks passed.

Fixtures

The archives are committed, not built at test time. Trunk already keeps ZIP fixtures for tests, including a plugin archive for install tests at tests/phpunit/data/plugins/link-manager.zip. Building them in the spec would need a ZIP library that core does not declare. The note beside each archive lists its full contents and a script that rebuilds it byte for byte.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-6
Used for: Refreshing and consolidating the tests, preparing small fixture archives, and local validation and audits.

@github-actions

github-actions Bot commented Jan 2, 2025 •

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. You can also manually ask me to refresh this list by adding the props-bot label.

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

Props juhise, lancewillett.

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

@github-actions

github-actions Bot commented Jan 2, 2025

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@lancewillett lancewillett changed the title Add Playwright E2E test to add plugin and remove plugin Build/Test Tools: Cover plugin upload, replacement and management. Oct 12, 2026
@lancewillett

Copy link
Copy Markdown
Member

Refreshed in 076b40e. Three independent cases cover upload with activation/deactivation, replacement with a newer version, and confirmed deletion. The activation/deactivation scenarios carry forward your work in #8050.

Two tiny fixture archives replace Akismet. Each case checks saved state and cleans up only its own fixture. All nine local checks passed without retries (55.8 seconds); scoped E2E and five-steps audits found no blockers.

Fresh CI and independent review are next. #8050 remains open pending the consolidation decision, with its contribution recorded in the description.

AI review · gpt-6

@lancewillett

lancewillett commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Review of 076b40e. One small requested change; the tests themselves are sound.

Requested change: put the fixtures in the existing assets folder

This PR adds a new tests/e2e/test-data/ folder. Trunk already has tests/e2e/assets/ for E2E fixtures, used by media-upload.test.js:19 for sample.svg. Please move the two ZIP files and their note there, and update the path in uploadPlugin().

What I checked

  • Scope: one new spec with three cases: upload, activate, and deactivate; replace an installed version with an uploaded one; delete after confirmation.
  • Fixtures: I listed both archives without extracting them. Each is 251 bytes and holds one file, e2e-test-plugin/e2e-test-plugin.php, with only a plugin header. They match the note in the PR, and they differ only in the version line.
  • Assertions: each case checks the screen and then the saved state over REST: status after activate and deactivate, version 1.0 then 2.0 after replace, and absence after delete and reload.
  • Isolation: setup fails without touching anything if the fixture plugin is already installed. Cleanup deactivates and deletes only that plugin, and only when the test installed it.
  • Strings: the install, update, replace, and delete messages match trunk.

CI

Run 38281150390 is green. All three new cases passed on the first attempt in both E2E jobs.

One existing test was retried in each job: login-localize-script.test.js:45, the failure tracked in Trac 66290, which #14205 fixes. Not from this PR.

AI review · claude-opus-5-5

@lancewillett

Copy link
Copy Markdown
Member

Moved the fixture archives and their documentation into the existing tests/e2e/assets/ directory in a54d884. Updated the upload path and regeneration instructions. All three local cases passed without retries (19.5 seconds); multisite was restored afterward.

@lancewillett

Copy link
Copy Markdown
Member

Re-review of a54d884. The requested change is in; no open findings.

  • The move: both archives and their note now sit in tests/e2e/assets/, and the spec and the rebuild script point there. The two archives are byte-identical to the ones I inspected at 076b40e.
  • CI: run 38282114016 is green. All three new cases passed on the first attempt in both E2E jobs.
  • Fixtures: committed archives are the chosen approach here; the description now gives the reasons.

One existing test was retried in one job: login-localize-script.test.js:45, the failure tracked in Trac 66290, which #14205 fixes. Not from this PR.

AI review · claude-opus-5-5

@lancewillett

Copy link
Copy Markdown
Member

wporg-sync pushed a commit that referenced this pull request Oct 20, 2026
Add browser checks for plugin upload, activation and deactivation, replacement with a newer uploaded version, and deletion. Verify saved plugin status, version, and removal through REST.

Use small local ZIP fixtures containing only plugin headers. Install prerequisites for each case and clean up only the fixture plugin.

Developed in: #8075

Props juhise, lucatume.
See #52895.


git-svn-id: https://develop.svn.wordpress.org/trunk@64624 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Oct 20, 2026
Add browser checks for plugin upload, activation and deactivation, replacement with a newer uploaded version, and deletion. Verify saved plugin status, version, and removal through REST.

Use small local ZIP fixtures containing only plugin headers. Install prerequisites for each case and clean up only the fixture plugin.

Developed in: WordPress/wordpress-develop#8075

Props juhise, lucatume.
See #52895.

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


git-svn-id: http://core.svn.wordpress.org/trunk@63774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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