Repository navigation
Tests: Cover Import screen importer listing in admin E2E - #15726
shail-mehta wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The import E2E test expects “Run WordPress” instead of the actual “Run WordPress Importer” link, causing a timeout even when installation succeeds.
1 open issue
What changed in this PR
Adds Playwright coverage for the admin Import screen’s WordPress importer installation flow, supporting the scope described in ticket #52895 without testing import execution.
Changes:
- Checks the Import screen, WordPress importer listing, and Install Now action.
- Installs the importer through the UI and checks the resulting run action and plugin presence.
- Adds cleanup before and after each test, with longer timeouts for installation.
| File | Description |
|---|---|
tests/e2e/specs/import.test.js |
Adds importer listing and installation tests with REST-based plugin cleanup. |
Review effort: Balanced
Update the selector for the 'Run Importer' link to improve visibility check. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
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: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
lancewillett
left a comment
There was a problem hiding this comment.
Thanks @shail-mehta. The install test downloads the WordPress Importer from WordPress.org during the run, so it depends on the live network and needs a five-minute timeout. Trac #63914 is removing live external requests from the tests, so please drop that test.
For the listing test, please use role and text locators in place of the CSS classes (table.importers, .importer-title), as the other specs now do (r65275). The Install WordPress now link check already covers what matters there.
AI review · claude-opus-5-5
Remove the network-backed install coverage and CSS-class locators so the Import screen check stays offline-friendly and uses role/text locators.
There was a problem hiding this comment.
🟡 Changes recommended
The importer test still makes a live server-side WordPress.org request when cached importer data is missing or expired, leaving it vulnerable to external latency and timeouts without deterministic server-side fixtures.
1 open issue
Review effort: Balanced
|
Thanks @lancewillett - addressed in the latest commit:
Ready for another look when you have a chance. |
lancewillett
left a comment
There was a problem hiding this comment.
Thanks for dropping the install step and the class locators. Without the install step, though, I don't think the test that's left clears the bar from #52895 comment 207: new E2E tests should tie to a broken feature or a regression, not add coverage for its own sake.
- What's left: it checks that
import.phpshows a heading and an "Install WordPress now" link. I couldn't find a past Import screen bug this would have caught. If you know of one, please link it and I'll take another look. - It still touches the network: loading the screen calls
wp_get_popular_importers(), which requestsapi.wordpress.org/core/importers/1.1/on a cold cache. The test only passes offline because the built-in fallback list also includes the WordPress importer. - The cleanup has nothing to clean up: nothing in the suite installs the importer now, so
deleteWordPressImporter()only runs against a developer's local site, where it would delete a real plugin.
Unless there's a regression to point to, I'd close this one. That keeps the suite smaller, and the Import step in #52895 can wait for a case that needs it.
AI review · claude-opus-5-5
|
Thanks - I don't have a past Import-screen regression to point to, so I’ll close this. |

Trac ticket: #52895
Adds Import screen e2e coverage from ticket #52895.
What
import.phpand asserts the Import heading is shownWhy
Ticket #52895 asks for Import coverage. Installing importer plugins hits WordPress.org and needs a long timeout, which conflicts with #63914 removing live external requests from tests, so this PR covers listing/actions only.
How
New Playwright spec:
tests/e2e/specs/import.test.js. Locators follow the user-facing role/text pattern from r65275. Cleanup removes a leftover WordPress importer plugin so the Install action remains visible.Testing instructions
npm run env:startnpm run test:e2e -- tests/e2e/specs/import.test.jsUse of AI Tools