Add e2e tests to verify Products by Category/Tag/Attribute templates default to Product Catalog template (#43471)
* Add e2e tests to verify Products by Category/Tag/Attribute templates default to Product Catalog template * Add changefile(s) from automation for the following project(s): woocommerce-blocks --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
5fdbe63530
commit
67fb8d7511
|
@ -42,4 +42,42 @@ test.describe( 'Products by Attribute template', async () => {
|
|||
page.getByText( 'Hello World in the template' )
|
||||
).toHaveCount( 0 );
|
||||
} );
|
||||
|
||||
test( 'defaults to the Product Catalog template', async ( {
|
||||
admin,
|
||||
editorUtils,
|
||||
page,
|
||||
} ) => {
|
||||
// Edit Product Catalog template and verify changes are visible.
|
||||
await admin.visitSiteEditor( {
|
||||
postId: 'woocommerce/woocommerce//archive-product',
|
||||
postType: 'wp_template',
|
||||
} );
|
||||
await editorUtils.enterEditMode();
|
||||
await editorUtils.closeWelcomeGuideModal();
|
||||
await editorUtils.editor.insertBlock( {
|
||||
name: 'core/paragraph',
|
||||
attributes: {
|
||||
content: 'Hello World in the Product Catalog template',
|
||||
},
|
||||
} );
|
||||
await editorUtils.saveTemplate();
|
||||
await page.goto( permalink );
|
||||
await expect(
|
||||
page
|
||||
.getByText( 'Hello World in the Product Catalog template' )
|
||||
.first()
|
||||
).toBeVisible();
|
||||
|
||||
// Verify the edition can be reverted.
|
||||
await admin.visitAdminPage(
|
||||
'site-editor.php',
|
||||
`path=/wp_template/all`
|
||||
);
|
||||
await editorUtils.revertTemplateCustomizations( 'Product Catalog' );
|
||||
await page.goto( permalink );
|
||||
await expect(
|
||||
page.getByText( 'Hello World in the Product Catalog template' )
|
||||
).toHaveCount( 0 );
|
||||
} );
|
||||
} );
|
||||
|
|
|
@ -42,4 +42,42 @@ test.describe( 'Products by Category template', async () => {
|
|||
page.getByText( 'Hello World in the template' )
|
||||
).toHaveCount( 0 );
|
||||
} );
|
||||
|
||||
test( 'defaults to the Product Catalog template', async ( {
|
||||
admin,
|
||||
editorUtils,
|
||||
page,
|
||||
} ) => {
|
||||
// Edit Product Catalog template and verify changes are visible.
|
||||
await admin.visitSiteEditor( {
|
||||
postId: 'woocommerce/woocommerce//archive-product',
|
||||
postType: 'wp_template',
|
||||
} );
|
||||
await editorUtils.enterEditMode();
|
||||
await editorUtils.closeWelcomeGuideModal();
|
||||
await editorUtils.editor.insertBlock( {
|
||||
name: 'core/paragraph',
|
||||
attributes: {
|
||||
content: 'Hello World in the Product Catalog template',
|
||||
},
|
||||
} );
|
||||
await editorUtils.saveTemplate();
|
||||
await page.goto( permalink );
|
||||
await expect(
|
||||
page
|
||||
.getByText( 'Hello World in the Product Catalog template' )
|
||||
.first()
|
||||
).toBeVisible();
|
||||
|
||||
// Verify the edition can be reverted.
|
||||
await admin.visitAdminPage(
|
||||
'site-editor.php',
|
||||
`path=/wp_template/all`
|
||||
);
|
||||
await editorUtils.revertTemplateCustomizations( 'Product Catalog' );
|
||||
await page.goto( permalink );
|
||||
await expect(
|
||||
page.getByText( 'Hello World in the Product Catalog template' )
|
||||
).toHaveCount( 0 );
|
||||
} );
|
||||
} );
|
||||
|
|
|
@ -42,4 +42,42 @@ test.describe( 'Products by Tag template', async () => {
|
|||
page.getByText( 'Hello World in the template' )
|
||||
).toHaveCount( 0 );
|
||||
} );
|
||||
|
||||
test( 'defaults to the Product Catalog template', async ( {
|
||||
admin,
|
||||
editorUtils,
|
||||
page,
|
||||
} ) => {
|
||||
// Edit Product Catalog template and verify changes are visible.
|
||||
await admin.visitSiteEditor( {
|
||||
postId: 'woocommerce/woocommerce//archive-product',
|
||||
postType: 'wp_template',
|
||||
} );
|
||||
await editorUtils.enterEditMode();
|
||||
await editorUtils.closeWelcomeGuideModal();
|
||||
await editorUtils.editor.insertBlock( {
|
||||
name: 'core/paragraph',
|
||||
attributes: {
|
||||
content: 'Hello World in the Product Catalog template',
|
||||
},
|
||||
} );
|
||||
await editorUtils.saveTemplate();
|
||||
await page.goto( permalink );
|
||||
await expect(
|
||||
page
|
||||
.getByText( 'Hello World in the Product Catalog template' )
|
||||
.first()
|
||||
).toBeVisible();
|
||||
|
||||
// Verify the edition can be reverted.
|
||||
await admin.visitAdminPage(
|
||||
'site-editor.php',
|
||||
`path=/wp_template/all`
|
||||
);
|
||||
await editorUtils.revertTemplateCustomizations( 'Product Catalog' );
|
||||
await page.goto( permalink );
|
||||
await expect(
|
||||
page.getByText( 'Hello World in the Product Catalog template' )
|
||||
).toHaveCount( 0 );
|
||||
} );
|
||||
} );
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: add
|
||||
Comment: Add e2e tests to verify Products by Category/Tag/Attribute templates default to Product Catalog template
|
||||
|
Loading…
Reference in New Issue