From 9c109b9e0856635bb4266b4fbe7031aeeeb52769 Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Tue, 7 Nov 2023 01:58:59 +0100 Subject: [PATCH] Fix E2E test: Cart title not found (Admin bar) --- .../templates/cart-template.block_theme.spec.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/e2e/tests/templates/cart-template.block_theme.spec.ts b/tests/e2e/tests/templates/cart-template.block_theme.spec.ts index 0a04c042ce5..adaaef94aee 100644 --- a/tests/e2e/tests/templates/cart-template.block_theme.spec.ts +++ b/tests/e2e/tests/templates/cart-template.block_theme.spec.ts @@ -57,14 +57,19 @@ test.describe( 'Test the cart template', async () => { ).toBeVisible(); } ); - test( 'Admin bar edit site link opens site editor', async ( { admin } ) => { + test( 'Admin bar edit site link opens site editor', async ( { + admin, + editor, + editorUtils, + } ) => { await admin.page.goto( permalink, { waitUntil: 'load' } ); await admin.page.locator( '#wp-admin-bar-site-editor a' ).click(); + await editorUtils.enterEditMode(); + await editorUtils.closeWelcomeGuideModal(); + await editorUtils.waitForSiteEditorFinishLoading(); + await editor.canvas.waitForSelector( 'h1:has-text("Cart block")' ); await expect( - admin.page - .frameLocator( 'iframe[title="Editor canvas"i]' ) - .locator( 'h1:has-text("Cart")' ) - .first() + editor.canvas.locator( 'h1:has-text("Cart block")' ).first() ).toBeVisible(); } ); } );