Test: Fix E2E import/export tests for WP 6.2 compatibility#348
Test: Fix E2E import/export tests for WP 6.2 compatibility#348
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 Core Committers: Use this line as a base for the props when committing in SVN: 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 @@
## trunk #348 +/- ##
============================================
- Coverage 34.07% 33.97% -0.11%
Complexity 4410 4410
============================================
Files 291 291
Lines 36914 36914
============================================
- Hits 12578 12541 -37
- Misses 24336 24373 +37
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What
Follow-up to #345 to fix E2E test failures on WordPress 6.2.
Why
The import/export E2E tests were failing on WP 6.2 due to Playwright strict-mode violations. The locator used matched two elements on WP 6.2 (which displays an additional core warning notice), but only one element on newer WordPress versions.
How
Using
.filter({ hasText: ... })to target the specific SCF warning notice by its expected text content rather than relying on element order. This approach is more robust because it explicitly targets the notice we care about, regardless of how many notices are present on the page.Testing Instructions
.wp-env.override.jsonwith{"core": "WordPress/WordPress#6.2"}npm run wp-env startnpm run test:e2e tests/e2e/import-export.spec.ts