Fix e2e tests due to duplicate rows when clearing customizations (#44454)

* Fix e2e tests due to duplicate rows when clearing customizations

* Add changelog entry
This commit is contained in:
Albert Juhé Lluveras 2024-02-08 23:15:11 +01:00 committed by GitHub
parent 8b4efc9c03
commit f65a7e45a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 5 deletions

View File

@ -6,7 +6,7 @@ import { BLOCK_THEME_WITH_TEMPLATES_SLUG } from '@woocommerce/e2e-utils';
const testData = {
permalink: '/product/belt',
templateName: 'Product: Belt',
templateName: 'Single Product Belt',
templatePath: 'single-product-belt',
templateType: 'wp_template',
};

View File

@ -373,8 +373,11 @@ export class EditorUtils {
}
async revertTemplateCreation( templateName: string ) {
const templateRow = this.page.getByRole( 'row', {
const templateRow = this.page.getByRole( 'row' ).filter( {
has: this.page.getByRole( 'heading', {
name: templateName,
exact: true,
} ),
} );
templateRow.getByRole( 'button', { name: 'Actions' } ).click();
await this.page
@ -394,8 +397,11 @@ export class EditorUtils {
}
async revertTemplateCustomizations( templateName: string ) {
const templateRow = this.page.getByRole( 'row', {
const templateRow = this.page.getByRole( 'row' ).filter( {
has: this.page.getByRole( 'heading', {
name: templateName,
exact: true,
} ),
} );
templateRow.getByRole( 'button', { name: 'Actions' } ).click();
await this.page

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Comment: Fix e2e tests due to duplicate rows when clearing customizations.