Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix
Comment: Fix e2e tests due to duplicate rows when clearing customizations.