fix(smoke): confirm WordPress admin-email verification screen during login
The smoke login timed out on wp-login.php?action=confirm_admin_email, the periodic 'Administration email verification' interstitial. Login had already succeeded; click 'The email is correct' and continue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AqpXh3hQMMaC74pTjFq4it
This commit is contained in:
@@ -90,10 +90,24 @@ setup('authenticate as WP admin', async ({ browser }) => {
|
|||||||
// indicate a credential rejection or 2FA prompt) and then navigate
|
// indicate a credential rejection or 2FA prompt) and then navigate
|
||||||
// explicitly to wp-admin.
|
// explicitly to wp-admin.
|
||||||
await page.waitForURL(
|
await page.waitForURL(
|
||||||
(url) => !url.pathname.includes('/wp-login.php'),
|
(url) =>
|
||||||
|
!url.pathname.includes('/wp-login.php') ||
|
||||||
|
url.searchParams.get('action') === 'confirm_admin_email',
|
||||||
{ timeout: NAV_TIMEOUT }
|
{ timeout: NAV_TIMEOUT }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// WordPress periodically (every ~6 months) interrupts admin logins with
|
||||||
|
// "Administration email verification" (wp-login.php?action=confirm_admin_email).
|
||||||
|
// The login has already succeeded at that point; confirm and continue so the
|
||||||
|
// smoke gate does not time out on it.
|
||||||
|
if (new URL(page.url()).searchParams.get('action') === 'confirm_admin_email') {
|
||||||
|
console.log('[setup] Admin email verification screen - confirming and continuing');
|
||||||
|
await page.click('#correct-admin-email');
|
||||||
|
await page.waitForURL((url) => !url.pathname.includes('/wp-login.php'), {
|
||||||
|
timeout: NAV_TIMEOUT,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Navigate explicitly into wp-admin to capture the authenticated admin session.
|
// Navigate explicitly into wp-admin to capture the authenticated admin session.
|
||||||
await page.goto('/wp-admin/', { timeout: NAV_TIMEOUT });
|
await page.goto('/wp-admin/', { timeout: NAV_TIMEOUT });
|
||||||
await expect(page).toHaveURL(/\/wp-admin\//, { timeout: 20_000 });
|
await expect(page).toHaveURL(/\/wp-admin\//, { timeout: 20_000 });
|
||||||
|
|||||||
Reference in New Issue
Block a user