diff --git a/plugins/woocommerce/changelog/e2e-fix-skipped-mini-cart-test b/plugins/woocommerce/changelog/e2e-fix-skipped-mini-cart-test new file mode 100644 index 00000000000..4db74363691 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-fix-skipped-mini-cart-test @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +E2E tests: fixing skipped mini cart test diff --git a/plugins/woocommerce/tests/e2e-pw/tests/shopper/mini-cart.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/shopper/mini-cart.spec.js index e64fb431b56..3758d6274a2 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/shopper/mini-cart.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/shopper/mini-cart.spec.js @@ -16,7 +16,7 @@ const totalInclusiveTax = +singleProductSalePrice + 5 + 2.5; let productId, countryTaxId, stateTaxId, shippingZoneId; -test.describe.skip( 'Mini Cart block page', () => { +test.describe( 'Mini Cart block page', () => { test.use( { storageState: process.env.ADMINSTATE } ); test.beforeAll( async ( { baseURL } ) => { @@ -176,9 +176,11 @@ test.describe.skip( 'Mini Cart block page', () => { // customize font size and weight await page.getByLabel( 'Large', { exact: true } ).click(); await page.getByRole( 'button', { name: 'Font weight' } ).click(); - await page - .getByRole( 'option', { name: 'Black', exact: true } ) - .click(); + // choose Light via kb press due to encountered issue with normal click + await page.keyboard.press( 'ArrowDown' ); + await page.keyboard.press( 'ArrowDown' ); + await page.keyboard.press( 'ArrowDown' ); + await page.keyboard.press( 'Enter' ); // publish created mini cart page await page @@ -215,7 +217,7 @@ test.describe.skip( 'Mini Cart block page', () => { ); await expect( page.locator( miniCartBlock ) ).toHaveAttribute( 'data-style', - '{"typography":{"fontWeight":"900"}}' + '{"typography":{"fontWeight":"300"}}' ); await page.locator( miniCartButton ).click(); await expect( @@ -280,9 +282,8 @@ test.describe.skip( 'Mini Cart block page', () => { await page.goto( miniCartPageSlug ); await page.locator( miniCartButton ).click(); await page.getByRole( 'link', { name: 'Go to checkout' } ).click(); - await expect( - page.getByRole( 'heading', { name: 'Checkout', exact: true } ) - ).toBeVisible(); + await expect( page.url() ).toContain( '/checkout' ); + await expect( page.getByText( 'Place order' ) ).toBeVisible(); await expect( page.locator( miniCartButton ) ).toBeHidden(); // shopping cart is very sensitive to cookies, so be explicit