Skip to content

refactor: Update alt-text-generation e2e selectors to use ARIA roles#828

Merged
dkotter merged 5 commits into
WordPress:developfrom
Infinite-Null:refactor/alt-text-e2e-locators
Jul 6, 2026
Merged

refactor: Update alt-text-generation e2e selectors to use ARIA roles#828
dkotter merged 5 commits into
WordPress:developfrom
Infinite-Null:refactor/alt-text-e2e-locators

Conversation

@Infinite-Null

@Infinite-Null Infinite-Null commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What, Why, and How?

Part of #778

This PR updates the alt-text-generation E2E tests (tests/e2e/specs/experiments/alt-text-generation.spec.js) to follow Playwright's recommended best practices. It replaces brittle CSS selectors and DOM structure-dependent locators with resilient, user-facing locators such as getByRole, getByText, and other accessibility-based queries.

Changes

  • Replaced CSS and DOM structure-dependent selectors with Playwright user-facing attributes.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Sonnet 4.6
Used for: Code review, PR description

Testing Instructions

Verify that CI passes, or run the updated E2E test locally:

npm run test:e2e tests/e2e/specs/experiments/alt-text-generation.spec.js

Changelog Entry

Developer: Updated alt-text-generation E2E selectors to use Playwright user-facing attributes.

Open WordPress Playground Preview

@Infinite-Null
Infinite-Null requested a review from a team July 3, 2026 09:28
@github-actions

github-actions Bot commented Jul 3, 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. You can also manually ask me to refresh this list by adding the props-bot label.

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

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.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.50%. Comparing base (9db55ee) to head (91bfcb6).

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #828   +/-   ##
==========================================
  Coverage      75.50%   75.50%           
  Complexity      2086     2086           
==========================================
  Files             99       99           
  Lines           8626     8626           
==========================================
  Hits            6513     6513           
  Misses          2113     2113           
Flag Coverage Δ
unit 75.50% <ø> (ø)

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.

@dkotter dkotter added this to the 1.2.0 milestone Jul 6, 2026
@dkotter
dkotter merged commit 12fac2b into WordPress:develop Jul 6, 2026
24 checks passed
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.

2 participants