Fix e2e Google for WooCommerce strict mode violation error (#50189)

* Fix e2e Google for WooCommerce strict mode violation error

* Add changelog

* Fix test
This commit is contained in:
Chi-Hsuan Huang 2024-08-01 12:27:00 +08:00 committed by GitHub
parent e8dfe754dd
commit c9f20f87d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 20 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix e2e Google for WooCommerce strict mode violation error

View File

@ -264,22 +264,13 @@ test.describe( 'Store owner can complete the core profiler', () => {
} catch ( e ) {
console.log( 'Checkbox not present for MailPoet' );
}
try {
await page
.getByText(
'Drive sales with Google for WooCommerceReach millions of active shoppers across'
)
.getByRole( 'checkbox' )
.check( { timeout: 2000 } );
} catch ( e ) {
// Temporary fix until rebranding is done.
await page
.getByText(
'Drive sales with Google Listings & AdsReach millions of active shoppers across'
)
.getByRole( 'checkbox' )
.check( { timeout: 2000 } );
}
await page
.getByText(
'Drive sales with Google for WooCommerceReach millions of active shoppers across'
)
.getByRole( 'checkbox' )
.check( { timeout: 2000 } );
await page.getByRole( 'button', { name: 'Continue' } ).click();
} );
@ -319,11 +310,13 @@ test.describe( 'Store owner can complete the core profiler', () => {
).toBeVisible();
await expect(
page.getByText(
/(Google for WooCommerce|Google Listings & Ads)/,
{ exact: true }
)
page
.getByRole( 'cell', {
name: 'Google for WooCommerce Get',
} )
.getByRole( 'strong' )
).toBeVisible();
await expect( page.getByText( 'MailPoet' ) ).toBeHidden();
await expect( page.getByText( 'Jetpack' ) ).toBeHidden();
} );