Skip to content

Code Quality: Extract model selection helpers for E2E tests#786

Merged
dkotter merged 1 commit into
WordPress:developfrom
Infinite-Null:refactor/e2e-model-selection-helpers
Jun 26, 2026
Merged

Code Quality: Extract model selection helpers for E2E tests#786
dkotter merged 1 commit into
WordPress:developfrom
Infinite-Null:refactor/e2e-model-selection-helpers

Conversation

@Infinite-Null

@Infinite-Null Infinite-Null commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Extracts repeated inline Developer Tools menu interactions from E2E tests into two reusable utility functions in helpers.ts.

Changes

tests/e2e/utils/helpers.ts

  • Added enableModelSelection( page ) — opens the Developer Tools menu, asserts the menu heading and description are visible, toggles Model Selection on (idempotent: skips if already enabled), and verifies the menu stays open after toggling.
  • Added disableModelSelection( page ) — opens the Developer Tools menu, verifies the checkmark SVG is present, toggles Model Selection off (idempotent: skips if already disabled), and closes the menu.

tests/e2e/specs/admin/settings.spec.js

Replaced all inline Developer Tools menu interaction blocks across the following tests with the new helpers:

  • Can use developer mode
  • Developer settings save button appears, values persist after save, and reset does not require explicit save
  • Unsaved developer settings do not persist on page reload
  • Developer mode settings are hidden for disabled visual feature cards

Testing

No new test coverage required, existing E2E tests exercise both helpers as part of their normal flow.

Open WordPress Playground Preview

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

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 Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.50%. Comparing base (56cef56) to head (2f0615f).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #786   +/-   ##
==========================================
  Coverage      76.50%   76.50%           
  Complexity      1868     1868           
==========================================
  Files             89       89           
  Lines           7985     7985           
==========================================
  Hits            6109     6109           
  Misses          1876     1876           
Flag Coverage Δ
unit 76.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.

@jeffpaul
jeffpaul requested a review from dkotter June 26, 2026 19:59
@jeffpaul jeffpaul added this to the 1.1.0 milestone Jun 26, 2026
@jeffpaul jeffpaul moved this to Needs review in WordPress AI Roadmap Jun 26, 2026
@dkotter
dkotter merged commit 265ec3f into WordPress:develop Jun 26, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from Needs review to Done in WordPress AI Roadmap Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants