Skip to content

Tests: Cover export and erase personal data request flows in admin E2E - #15688

Closed
shail-mehta wants to merge 4 commits into
WordPress:trunkfrom
shail-mehta:tests/52895-export-personal-data-e2e
Closed

shail-mehta wants to merge 4 commits into
WordPress:trunkfrom
shail-mehta:tests/52895-export-personal-data-e2e

Conversation

@shail-mehta

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

Copy link
Copy Markdown
Member

Trac Ticket: #52895

Adds admin e2e coverage for Export and Erase Personal Data request creation from ticket #52895.

What

  • Creates a subscriber test user per case
  • Opens export-personal-data.php and erase-personal-data.php
  • Submits a request by username with confirmation email unchecked
  • Asserts “Request added successfully.” and that the requester email link appears in the list
  • Confirms the requester email link still appears after searching requests
  • Cleans up the request and user afterward (does not trigger download or erasure)

Why

Ticket #52895 covers both Export and Erase Personal Data. The flows are the same aside from screen, checkbox label, and username prefix, so one looped spec (like taxonomies.test.js) keeps them in sync. Supersedes #15668.

How

New Playwright spec: tests/e2e/specs/personal-data-requests.test.js, looping over both screens.

Testing instructions

  1. Start the local environment if needed: npm run env:start
  2. Run: npm run test:e2e -- tests/e2e/specs/personal-data-requests.test.js
  3. Confirm both Export and Erase cases pass

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.

🟢 Approval recommended

No active review issues are reported for the added export-personal-data request creation and search coverage.

No open issues 🎉

What changed in this PR

Adds Playwright coverage for creating and finding an Export Personal Data request in WordPress admin, supporting ticket #52895 without triggering a file download.

Changes:

  • Creates a temporary subscriber and submits a request by username with confirmation email disabled.
  • Verifies the success notice and requester email link before and after searching.
  • Cleans up the request and temporary user afterward.
File Description
tests/​e2e/​specs/​export-personal-data.test.js Adds the export request creation and search test, including setup and cleanup.

Review effort: Balanced

@shail-mehta
shail-mehta marked this pull request as ready for review November 6, 2026 14:53
@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. Adding a request from the form is not covered yet, and creating your own user keeps it safe in parallel.

This spec and #15668 (erase) are the same test on two screens: the same setup, cleanup, steps and checks, apart from the screen, the checkbox label and the username prefix. Please combine them into one spec that loops over both screens, the way taxonomies.test.js loops over categories and tags, and close the other PR. That halves the code to maintain.

AI review · claude-opus-5-5

Loop over both privacy request screens in one spec, matching the taxonomies pattern, so export and erase stay in sync.
@shail-mehta shail-mehta changed the title Tests: Cover export personal data request flow in admin E2E Tests: Cover export and erase personal data request flows in admin E2E Nov 7, 2026
@shail-mehta

Copy link
Copy Markdown
Member Author

Thanks @lancewillett — updated.

Combined Export and Erase into one looped spec (tests/e2e/specs/personal-data-requests.test.js), following the taxonomies.test.js pattern. Closing #15668 in favor of this PR.

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 identified for the added export and erasure request-creation tests.

No open issues 🎉

Review effort: Balanced

@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.

Approved at f2639d1. Combining export and erase into one looped spec works well, and it covers something nothing else does: no PHPUnit or E2E test exercises the Tools screens' "Send Request" form handler. The locators follow the r65275 pattern, and cleanup removes only the request and user the test created.

CI is green: parallel 39 and 38 passed, serial 72 and 72. The one retry was in general-settings-invalid-timezone.test.js, not this spec; #15750 addresses that one.

AI review · claude-opus-5-5

@lancewillett

Copy link
Copy Markdown
Member

One small fix before this lands: Prettier wants the const row = page.getByRole( 'row' ).filter( … ) line in afterEach (line 47) split across chained lines. npx prettier --write tests/e2e/specs/personal-data-requests.test.js fixes it. The E2E specs on trunk all pass Prettier. I'll re-check the new head.

AI review · claude-opus-5-5

@shail-mehta

Copy link
Copy Markdown
Member Author

Thanks! Addressed in 6bc3cb6

@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.

Re-checked at 6bc3cb6. The new commit only reformats the afterEach line, Prettier passes, and E2E is green in all four jobs. Ready to land.

AI review · claude-opus-5-5

wporg-sync pushed a commit that referenced this pull request Nov 7, 2026
Add a requester by username on the Export Personal Data and Erase Personal Data screens, and check for the success notice and the requester in the list, including after a search. The two screens share one looped spec.

Developed in: #15688

Props shailu25.
See #52895.


git-svn-id: https://develop.svn.wordpress.org/trunk@65330 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 7, 2026
Add a requester by username on the Export Personal Data and Erase Personal Data screens, and check for the success notice and the requester in the list, including after a search. The two screens share one looped spec.

Developed in: WordPress/wordpress-develop#15688

Props shailu25.
See #52895.

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


git-svn-id: http://core.svn.wordpress.org/trunk@64470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@lancewillett

Copy link
Copy Markdown
Member

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