Fix flaky e2e test and update login util (#48446)
This commit is contained in:
parent
8a69728312
commit
08e44d0c4c
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
|
||||
E2E tests: fixing flaky merchant user create and logging
|
|
@ -80,7 +80,11 @@ for ( const userData of users ) {
|
|||
|
||||
await test.step( 'verify the new user can login', async () => {
|
||||
await page.context().clearCookies();
|
||||
await page.goto( '/wp-admin' );
|
||||
await page.goto( '/wp-login.php' );
|
||||
await expect(
|
||||
page.getByLabel( 'Username or Email Address' )
|
||||
).toBeVisible();
|
||||
|
||||
await logIn( page, userData.username, user.password, false );
|
||||
|
||||
const expectedTitle =
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
const { expect } = require( '../fixtures/fixtures' );
|
||||
const logIn = async ( page, username, password, assertSuccess = true ) => {
|
||||
await page.getByLabel( 'Username or Email Address' ).click();
|
||||
await page
|
||||
.getByLabel( 'Username or Email Address' )
|
||||
.click( { delay: 100 } );
|
||||
await page.getByLabel( 'Username or Email Address' ).fill( username );
|
||||
await page.getByRole( 'textbox', { name: 'Password' } ).click();
|
||||
await page
|
||||
.getByRole( 'textbox', { name: 'Password' } )
|
||||
.click( { delay: 100 } );
|
||||
await page.getByRole( 'textbox', { name: 'Password' } ).fill( password );
|
||||
await page.getByRole( 'button', { name: 'Log In' } ).click();
|
||||
|
||||
|
|
Loading…
Reference in New Issue