Skip to content

E2E[Content Classification]: Prefer user-facing attributes #859

Merged
dkotter merged 2 commits into
WordPress:developfrom
yogeshbhutkar:e2e/content-classification
Jul 13, 2026
Merged

E2E[Content Classification]: Prefer user-facing attributes #859
dkotter merged 2 commits into
WordPress:developfrom
yogeshbhutkar:e2e/content-classification

Conversation

@yogeshbhutkar

@yogeshbhutkar yogeshbhutkar commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What, Why, and How?

Closes #778

Playwright recommends using user-facing locators (example, getByRole) instead of CSS classes or DOM-structure selectors wherever possible. This is because CSS classes and markup structure are implementation details that can change during design or refactoring without changing the actual user experience, which can make tests fail even though the feature still works (Docs).

This PR updates the Content Classification E2E spec to follow the Playwright best practices by replacing hard-coded page.locator(...) calls with role-based locators. This should make the test less brittle because it now targets the UI the way a user, or assistive technology, understands it rather than depending on implementation details.

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.6 Sol
Used for: Code review

Testing Instructions

  • CI should be green.

Changelog Entry

Changed - Updated Content Classification E2E selectors to use Playwright user-facing attributes

Open WordPress Playground Preview

Added unique IDs for classification hints and suggestions in the SuggestionPanel component to improve accessibility. Updated ARIA attributes to ensure proper screen reader support for the suggestion list and hint messages.
Replaced locator queries with Playwright's user-facing attributes for improved accessibility in the Content Classification experiment tests.
@yogeshbhutkar
yogeshbhutkar force-pushed the e2e/content-classification branch from a998efc to 6a31fef Compare July 13, 2026 06:18
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.04%. Comparing base (f006132) to head (6a31fef).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #859   +/-   ##
==========================================
  Coverage      77.04%   77.04%           
  Complexity      2231     2231           
==========================================
  Files            103      103           
  Lines           9214     9214           
==========================================
  Hits            7099     7099           
  Misses          2115     2115           
Flag Coverage Δ
unit 77.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yogeshbhutkar
yogeshbhutkar marked this pull request as ready for review July 13, 2026 07:03
@yogeshbhutkar
yogeshbhutkar requested a review from a team July 13, 2026 07:03
@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. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @hasanmehmood.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: hasanmehmood.

Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org>
Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org>

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

@dkotter dkotter added this to the 1.2.0 milestone Jul 13, 2026
@dkotter
dkotter merged commit a3a0250 into WordPress:develop Jul 13, 2026
25 checks passed
@yogeshbhutkar
yogeshbhutkar deleted the e2e/content-classification branch July 14, 2026 03:36
@jeffpaul

Copy link
Copy Markdown
Member

@hasanmehmood if you can provide your WPORG username and link it to your GitHub profile, then I can ensure you're properly crediting in the WP AI release and receive the AI Contributor badge; thanks!

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.

E2E: Prefer user-facing attributes

3 participants