Tweak lost password e2e logic (#50666)
This commit is contained in:
parent
a512668e96
commit
88e4a6f0e9
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
|
||||
Tweak the lost password e2e logic
|
|
@ -20,19 +20,19 @@ test.describe( 'Can go to lost password page and submit the form', () => {
|
|||
await page.getByRole( 'button', { name: 'Get New Password' } ).click();
|
||||
|
||||
try {
|
||||
await page.waitForURL( '**/wp-login.php?checkemail=confirm' );
|
||||
await expect(
|
||||
page.getByText( /Check your email for the confirmation link/i )
|
||||
).toBeVisible();
|
||||
} catch ( e ) {
|
||||
// For local testing, the email might not be sent, so we can ignore this error.
|
||||
|
||||
// eslint-disable-next-line jest/no-try-expect
|
||||
await expect(
|
||||
page.getByText(
|
||||
/The email could not be sent. Your site may not be correctly configured to send emails/i
|
||||
)
|
||||
).toBeVisible();
|
||||
} catch ( e ) {
|
||||
// eslint-disable-next-line jest/no-try-expect
|
||||
await page.waitForURL( '**/wp-login.php?checkemail=confirm' );
|
||||
// eslint-disable-next-line jest/no-try-expect
|
||||
await expect(
|
||||
page.getByText( /Check your email for the confirmation link/i )
|
||||
).toBeVisible();
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
|
Loading…
Reference in New Issue