Skip to content

Tests: Cover Import screen importer listing in admin E2E - #15726

Closed
shail-mehta wants to merge 7 commits into
WordPress:trunkfrom
shail-mehta:tests/52895-import-importers-e2e
Closed

shail-mehta wants to merge 7 commits into
WordPress:trunkfrom
shail-mehta:tests/52895-import-importers-e2e

Conversation

@shail-mehta

@shail-mehta shail-mehta commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Trac ticket: #52895

Adds Import screen e2e coverage from ticket #52895.

What

  • Opens import.php and asserts the Import heading is shown
  • Asserts the WordPress importer exposes an Install WordPress now action via role/text locators

Why

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

  1. Start the local environment if needed: npm run env:start
  2. Run: npm run test:e2e -- tests/e2e/specs/import.test.js
  3. Confirm the listing test passes

Use of AI Tools

  • Cursor

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.

🟡 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

Comment thread tests/e2e/specs/import.test.js Resolved
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>

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 were identified for the added Import screen end-to-end coverage.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

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 recorded for the new Import screen listing and importer installation tests.

No open issues 🎉

Review effort: Balanced

@shail-mehta
shail-mehta marked this pull request as ready for review November 6, 2026 16:00
@github-actions

github-actions Bot commented Nov 6, 2026 •

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 shailu25, lancewillett.

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 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 @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.
@shail-mehta shail-mehta changed the title Tests: Cover Import screen importer listing and plugin install in admin E2E Tests: Nov 7, 2026
@shail-mehta shail-mehta changed the title Tests: Tests: Cover Import screen importer listing in admin E2E Nov 7, 2026
@shail-mehta
shail-mehta requested a balanced review from Copilot November 7, 2026 03:54

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.

🟡 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

Comment thread tests/e2e/specs/import.test.js Resolved
@shail-mehta

Copy link
Copy Markdown
Member Author

Thanks @lancewillett - addressed in the latest commit:

  • Removed the live WordPress.org importer install test
  • Dropped the CSS-class locators and kept the role/text checks for the Import heading and Install WordPress now link

Ready for another look when you have a chance.

@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 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.php shows 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 requests api.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

@shail-mehta

Copy link
Copy Markdown
Member Author

Thanks - I don't have a past Import-screen regression to point to, so I’ll close this.

@shail-mehta shail-mehta closed this Nov 7, 2026
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.

3 participants