Code Quality: Extract model selection helpers for E2E tests#786
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Extracts repeated inline Developer Tools menu interactions from E2E tests into two reusable utility functions in
helpers.ts.Changes
tests/e2e/utils/helpers.tsenableModelSelection( 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.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.jsReplaced all inline Developer Tools menu interaction blocks across the following tests with the new helpers:
Can use developer modeDeveloper settings save button appears, values persist after save, and reset does not require explicit saveUnsaved developer settings do not persist on page reloadDeveloper mode settings are hidden for disabled visual feature cardsTesting
No new test coverage required, existing E2E tests exercise both helpers as part of their normal flow.