diff --git a/plugins/woocommerce-blocks/tests/e2e/tests/templates/single-product-template.block_theme_with_templates.spec.ts b/plugins/woocommerce-blocks/tests/e2e/tests/templates/single-product-template.block_theme_with_templates.spec.ts index 76e250aa938..7aaae780b70 100644 --- a/plugins/woocommerce-blocks/tests/e2e/tests/templates/single-product-template.block_theme_with_templates.spec.ts +++ b/plugins/woocommerce-blocks/tests/e2e/tests/templates/single-product-template.block_theme_with_templates.spec.ts @@ -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', }; diff --git a/plugins/woocommerce-blocks/tests/e2e/utils/editor/editor-utils.page.ts b/plugins/woocommerce-blocks/tests/e2e/utils/editor/editor-utils.page.ts index 53557c821a7..24599bf9223 100644 --- a/plugins/woocommerce-blocks/tests/e2e/utils/editor/editor-utils.page.ts +++ b/plugins/woocommerce-blocks/tests/e2e/utils/editor/editor-utils.page.ts @@ -373,8 +373,11 @@ export class EditorUtils { } async revertTemplateCreation( templateName: string ) { - const templateRow = this.page.getByRole( 'row', { - name: templateName, + 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', { - name: templateName, + 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 diff --git a/plugins/woocommerce/changelog/44454-fix-e2e-templates-tests-duplicate-rows b/plugins/woocommerce/changelog/44454-fix-e2e-templates-tests-duplicate-rows new file mode 100644 index 00000000000..010c0155e7e --- /dev/null +++ b/plugins/woocommerce/changelog/44454-fix-e2e-templates-tests-duplicate-rows @@ -0,0 +1,4 @@ +Significance: patch +Type: fix +Comment: Fix e2e tests due to duplicate rows when clearing customizations. +