Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Investigate E2E CI caching issue #11874

Merged
merged 18 commits into from
Nov 28, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/js/blocks/page-content-wrapper/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Edit = ( {
setAttributes: ( attrs: BlockAttributes ) => void;
} ) => {
const TEMPLATE: InnerBlockTemplate[] = [
[ 'core/post-title', { align: 'wide' } ],
[ 'core/post-title', { align: 'wide', level: 1 } ],
[ 'core/post-content', { align: 'wide' } ],
];

Expand Down
2 changes: 1 addition & 1 deletion src/Utils/BlockTemplateMigrationUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected static function get_default_template( $template_slug ) {
$default_template_content = '
<!-- wp:group {"layout":{"inherit":true,"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:woocommerce/page-content-wrapper {"page":"' . $template_slug . '"} -->
<!-- wp:post-title {"align":"wide"} /-->
<!-- wp:post-title {"align":"wide", "level":1} /-->
<!-- wp:post-content {"align":"wide"} /-->
<!-- /wp:woocommerce/page-content-wrapper --></div>
<!-- /wp:group -->
Expand Down
33 changes: 21 additions & 12 deletions tests/e2e/tests/templates/cart-template.block_theme.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
page,
editorUtils,
} ) => {
await admin.visitSiteEditor();
await page.getByRole( 'button', { name: /Templates/i } ).click();
await page.getByRole( 'button', { name: /Page: Cart/i } ).click();
await admin.visitSiteEditor( {
postId: templatePath,
postType: templateType,
} );
await editorUtils.enterEditMode();
await editorUtils.closeWelcomeGuideModal();
await expect(
page
.frameLocator( 'iframe[title="Editor canvas"i]' )
.locator( 'h2:has-text("Cart")' )
.locator( 'h1:has-text("Cart")' )
.first()
).toBeVisible();
} );
Expand All @@ -33,17 +35,22 @@
page,
editorUtils,
} ) => {
await admin.visitSiteEditor();
await admin.visitSiteEditor( {
postId: templatePath,
postType: templateType,
} );
await editor.page.getByRole( 'button', { name: /Pages/i } ).click();
await editor.page.getByRole( 'button', { name: /Cart/i } ).click();
await editorUtils.enterEditMode();
await editorUtils.closeWelcomeGuideModal();
await expect(
editor.canvas.locator( 'h2:has-text("Cart")' ).first()
editor.canvas.locator( 'h1:has-text("Cart")' ).first()
).toBeVisible();
await editor.openDocumentSettingsSidebar();
await page.getByLabel( 'Template options' ).click();
nielslange marked this conversation as resolved.
Show resolved Hide resolved
await page.getByRole( 'button', { name: 'Edit template' } ).click();
await expect(
editor.canvas.locator( 'h2:has-text("Cart")' ).first()
editor.canvas.locator( 'h1:has-text("Cart")' ).first()
).toBeVisible();
} );

Expand All @@ -53,7 +60,7 @@
await expect(
admin.page
.frameLocator( 'iframe[title="Editor canvas"i]' )
.locator( 'h2:has-text("Cart")' )
.locator( 'h1:has-text("Cart")' )
.first()
).toBeVisible();
} );
Expand All @@ -69,12 +76,13 @@
admin,
editorUtils,
editor,
page,
} ) => {
await admin.visitSiteEditor();
await page.getByRole( 'button', { name: /Templates/i } ).click();
await page.getByRole( 'button', { name: /Page: Checkout/i } ).click();
await admin.visitSiteEditor( {
postId: templatePath,
postType: templateType,
} );
await editorUtils.enterEditMode();
await editorUtils.closeWelcomeGuideModal();
await editor.setContent(
'<!-- wp:woocommerce/classic-shortcode {"shortcode":"cart"} /-->'
);
Expand All @@ -101,6 +109,7 @@
postType: templateType,
} );
await editorUtils.enterEditMode();
await editorUtils.closeWelcomeGuideModal();
await editorUtils.editor.insertBlock( {
name: 'core/paragraph',
attributes: { content: 'Hello World in the template' },
Expand All @@ -109,6 +118,6 @@
await page.goto( permalink, { waitUntil: 'domcontentloaded' } );
await expect(
page.getByText( 'Hello World in the template' ).first()
).toBeVisible();

Check failure on line 121 in tests/e2e/tests/templates/cart-template.block_theme.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright E2E tests - Normal

[blockTheme] › templates/cart-template.block_theme.spec.ts:102:6 › Test editing the cart template › Template can be modified

1) [blockTheme] › templates/cart-template.block_theme.spec.ts:102:6 › Test editing the cart template › Template can be modified Error: Timed out 20000ms waiting for expect(received).toBeVisible() Call log: - expect.toBeVisible with timeout 20000ms - waiting for getByText('Hello World in the template').first() 119 | await expect( 120 | page.getByText( 'Hello World in the template' ).first() > 121 | ).toBeVisible(); | ^ 122 | } ); 123 | } ); 124 | at /home/runner/work/woocommerce-blocks/woocommerce-blocks/tests/e2e/tests/templates/cart-template.block_theme.spec.ts:121:5
} );
} );
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ test.describe( 'Test the checkout header template part', async () => {
postType: templateType,
} );
await editorUtils.enterEditMode();
await editorUtils.closeWelcomeGuideModal();
await editorUtils.editor.insertBlock( {
name: 'core/paragraph',
attributes: { content: 'Hello World in the header' },
Expand Down
25 changes: 17 additions & 8 deletions tests/e2e/tests/templates/checkout-template.block_theme.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ test.describe( 'Test the checkout template', async () => {
page,
editorUtils,
} ) => {
await admin.visitSiteEditor();
await page.getByRole( 'button', { name: /Templates/i } ).click();
await page.getByRole( 'button', { name: /Page: Checkout/i } ).click();
await admin.visitSiteEditor( {
postId: templatePath,
postType: templateType,
} );
await editorUtils.enterEditMode();
await editorUtils.closeWelcomeGuideModal();
await expect(
page
.frameLocator( 'iframe[title="Editor canvas"i]' )
Expand All @@ -33,14 +35,19 @@ test.describe( 'Test the checkout template', async () => {
page,
editorUtils,
} ) => {
await admin.visitSiteEditor();
await admin.visitSiteEditor( {
postId: templatePath,
postType: templateType,
} );
await editor.page.getByRole( 'button', { name: /Pages/i } ).click();
await editor.page.getByRole( 'button', { name: /Checkout/i } ).click();
await editorUtils.enterEditMode();
await editorUtils.closeWelcomeGuideModal();
await expect(
editor.canvas.locator( 'h1:has-text("Checkout")' ).first()
).toBeVisible();
await editor.openDocumentSettingsSidebar();
await page.getByLabel( 'Template options' ).click();
await page.getByRole( 'button', { name: 'Edit template' } ).click();
await expect(
editor.canvas.locator( 'h1:has-text("Checkout")' ).first()
Expand Down Expand Up @@ -69,12 +76,13 @@ test.describe( 'Test editing the checkout template', async () => {
admin,
editorUtils,
editor,
page,
} ) => {
await admin.visitSiteEditor();
await page.getByRole( 'button', { name: /Templates/i } ).click();
await page.getByRole( 'button', { name: /Page: Checkout/i } ).click();
await admin.visitSiteEditor( {
postId: templatePath,
postType: templateType,
} );
await editorUtils.enterEditMode();
await editorUtils.closeWelcomeGuideModal();
await editor.setContent(
'<!-- wp:woocommerce/classic-shortcode {"shortcode":"checkout"} /-->'
);
Expand All @@ -99,6 +107,7 @@ test.describe( 'Test editing the checkout template', async () => {
postType: templateType,
} );
await editorUtils.enterEditMode();
await editorUtils.closeWelcomeGuideModal();
await editorUtils.editor.insertBlock( {
name: 'core/paragraph',
attributes: { content: 'Hello World in the template' },
Expand Down
Loading