From 3d23fa1345550400c8b9ada56467de19889181c7 Mon Sep 17 00:00:00 2001 From: Filip Ilic Date: Wed, 21 Oct 2026 10:26:50 +0200 Subject: [PATCH] Skip the Yoast e2e tests on WP 7.2's admin 404 too The Playground blueprint does not install Yoast, so these two tests rely on skipping when the Yoast settings page is missing. They detected that by the "Sorry, you are not allowed" message, but WordPress 7.2 (wordpress-develop 6dc9323d3) now answers an unregistered admin page with "The requested page does not exist." and a 404. The skip no longer matched, so both tests waited for a toggle that never renders and timed out. Accept either message. Co-Authored-By: Claude Opus 5.5 --- tests/e2e/specs/yoast-integration.spec.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/e2e/specs/yoast-integration.spec.ts b/tests/e2e/specs/yoast-integration.spec.ts index 9731f884a..f6a913fc6 100644 --- a/tests/e2e/specs/yoast-integration.spec.ts +++ b/tests/e2e/specs/yoast-integration.spec.ts @@ -8,9 +8,14 @@ test.describe( 'Yoast Focus Element', () => { '/wp-admin/admin.php?page=wpseo_page_settings#/crawl-optimization' ); - // Skip if Yoast settings page doesn't load (not installed or wrong version) + // Skip if Yoast settings page doesn't load (not installed or wrong version). + // WP 7.2+ shows a 404 "page does not exist" for unregistered admin pages. if ( - await page.locator( 'text=Sorry, you are not allowed' ).isVisible() + await page + .locator( + 'text=/Sorry, you are not allowed|The requested page does not exist/' + ) + .isVisible() ) { test.skip(); return; @@ -73,7 +78,11 @@ test.describe( 'Yoast Focus Element', () => { // Skip if Yoast settings page doesn't load if ( - await page.locator( 'text=Sorry, you are not allowed' ).isVisible() + await page + .locator( + 'text=/Sorry, you are not allowed|The requested page does not exist/' + ) + .isVisible() ) { test.skip(); return;