[e2e tests] Update locators for Customers page in page-loads spec (#50559)

This commit is contained in:
Adrian Moldovan 2024-08-13 11:04:41 +01:00 committed by GitHub
parent 03049e0d17
commit 7802209887
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 5 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
E2E tests: fix flakiness in page-loads customer page test

View File

@ -53,7 +53,7 @@ if ( process.env.CI ) {
reporter.push( [ reporter.push( [
'html', 'html',
{ {
outputFolder: `${ testsResultsPath }/playwright-report`, outputFolder: `${ testsRootPath }/playwright-report`,
open: 'on-failure', open: 'on-failure',
}, },
] ); ] );

View File

@ -22,8 +22,8 @@ const wcPages = [
{ {
name: 'Customers', name: 'Customers',
heading: 'Customers', heading: 'Customers',
element: '#search-inline-input-0', element: '.woocommerce-dropdown-button__labels',
text: 'Move backward for selected items', text: 'All Customers',
}, },
{ {
name: 'Reports', name: 'Reports',
@ -206,8 +206,7 @@ for ( const currentPage of wcPages ) {
} ) => { } ) => {
await page await page
.locator( .locator(
`li.wp-menu-open > ul.wp-submenu > li:has-text("${ currentPage.subpages[ i ].name }")`, `li.wp-menu-open > ul.wp-submenu > li:has-text("${ currentPage.subpages[ i ].name }")`
{ waitForLoadState: 'networkidle' }
) )
.click(); .click();