From f206943d32ccf2cf3361264ac9d95fd56c63d45b Mon Sep 17 00:00:00 2001 From: Bart Kalisz Date: Fri, 15 Mar 2024 13:45:18 +0100 Subject: [PATCH] Drop use of adminFile as admin is always logged in --- ...-shipping.block_theme.side_effects.spec.ts | 4 +--- ....merchant.block_theme.side_effects.spec.ts | 2 -- ...firmation.block_theme.side_effects.spec.ts | 24 ++++--------------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/plugins/woocommerce-blocks/tests/e2e/tests/cart/cart-checkout-block-shipping.block_theme.side_effects.spec.ts b/plugins/woocommerce-blocks/tests/e2e/tests/cart/cart-checkout-block-shipping.block_theme.side_effects.spec.ts index 7f7835dae475..16edb5dbecb3 100644 --- a/plugins/woocommerce-blocks/tests/e2e/tests/cart/cart-checkout-block-shipping.block_theme.side_effects.spec.ts +++ b/plugins/woocommerce-blocks/tests/e2e/tests/cart/cart-checkout-block-shipping.block_theme.side_effects.spec.ts @@ -2,7 +2,7 @@ * External dependencies */ import { expect, test as base } from '@woocommerce/e2e-playwright-utils'; -import { adminFile, guestFile } from '@woocommerce/e2e-utils'; +import { guestFile } from '@woocommerce/e2e-utils'; /** * Internal dependencies @@ -20,8 +20,6 @@ const test = base.extend< { checkoutPageObject: CheckoutPage } >( { } ); test.describe( 'Merchant → Shipping', () => { - test.use( { storageState: adminFile } ); - test( 'Merchant can enable shipping calculator and hide shipping costs before address is entered', async ( { page, shippingUtils, diff --git a/plugins/woocommerce-blocks/tests/e2e/tests/checkout/additional-fields.merchant.block_theme.side_effects.spec.ts b/plugins/woocommerce-blocks/tests/e2e/tests/checkout/additional-fields.merchant.block_theme.side_effects.spec.ts index ffe816d2f8b0..038565a0ee7b 100644 --- a/plugins/woocommerce-blocks/tests/e2e/tests/checkout/additional-fields.merchant.block_theme.side_effects.spec.ts +++ b/plugins/woocommerce-blocks/tests/e2e/tests/checkout/additional-fields.merchant.block_theme.side_effects.spec.ts @@ -2,7 +2,6 @@ * External dependencies */ import { expect, test as base } from '@woocommerce/e2e-playwright-utils'; -import { adminFile } from '@woocommerce/e2e-utils'; import { installPluginFromPHPFile, uninstallPluginFromPHPFile, @@ -24,7 +23,6 @@ const test = base.extend< { checkoutPageObject: CheckoutPage } >( { } ); test.describe( 'Merchant → Additional Checkout Fields', () => { - test.use( { storageState: adminFile } ); test.beforeAll( async () => { await installPluginFromPHPFile( `${ __dirname }/additional-checkout-fields-plugin.php` diff --git a/plugins/woocommerce-blocks/tests/e2e/tests/checkout/order-confirmation.block_theme.side_effects.spec.ts b/plugins/woocommerce-blocks/tests/e2e/tests/checkout/order-confirmation.block_theme.side_effects.spec.ts index b7dffcc85863..ab3e991bad0b 100644 --- a/plugins/woocommerce-blocks/tests/e2e/tests/checkout/order-confirmation.block_theme.side_effects.spec.ts +++ b/plugins/woocommerce-blocks/tests/e2e/tests/checkout/order-confirmation.block_theme.side_effects.spec.ts @@ -2,7 +2,7 @@ * External dependencies */ import { test as base, expect } from '@woocommerce/e2e-playwright-utils'; -import { adminFile, guestFile } from '@woocommerce/e2e-utils'; +import { guestFile } from '@woocommerce/e2e-utils'; /** * Internal dependencies @@ -38,8 +38,6 @@ const test = base.extend< { pageObject: CheckoutPage } >( { } ); test.describe( 'Shopper → Order Confirmation (logged in user)', () => { - test.use( { storageState: adminFile } ); - test.beforeEach( async ( { admin, editorUtils, localPickupUtils } ) => { await localPickupUtils.disableLocalPickup(); @@ -56,17 +54,13 @@ test.describe( 'Shopper → Order Confirmation (logged in user)', () => { await localPickupUtils.enableLocalPickup(); } ); - test( 'Place order as a logged in user', async ( { - frontendUtils, - pageObject, - page, - } ) => { + test( 'Place order', async ( { frontendUtils, pageObject, page } ) => { await frontendUtils.emptyCart(); await frontendUtils.goToShop(); await frontendUtils.addToCart( SIMPLE_PHYSICAL_PRODUCT_NAME ); await frontendUtils.addToCart( SIMPLE_VIRTUAL_PRODUCT_NAME ); await frontendUtils.goToCheckout(); - await expect( + expect( await pageObject.selectAndVerifyShippingOption( FREE_SHIPPING_NAME, FREE_SHIPPING_PRICE @@ -130,11 +124,7 @@ test.describe( 'Shopper → Order Confirmation (logged in user)', () => { test.describe( 'Shopper → Order Confirmation (guest user)', () => { test.use( { storageState: guestFile } ); - test( 'Place order as guest user', async ( { - frontendUtils, - pageObject, - page, - } ) => { + test( 'Place order', async ( { frontendUtils, pageObject, page } ) => { await page.goto( '/my-account', { waitUntil: 'commit' } ); // Verify that the user is logged out. @@ -147,7 +137,7 @@ test.describe( 'Shopper → Order Confirmation (guest user)', () => { await frontendUtils.addToCart( SIMPLE_PHYSICAL_PRODUCT_NAME ); await frontendUtils.goToCheckout(); - await expect( + expect( await pageObject.selectAndVerifyShippingOption( FREE_SHIPPING_NAME, FREE_SHIPPING_PRICE @@ -164,8 +154,6 @@ test.describe( 'Shopper → Order Confirmation (guest user)', () => { } ); test.describe( 'Shopper → Order Confirmation → Local Pickup', () => { - test.use( { storageState: adminFile } ); - test( 'Confirm shipping address section is hidden, but billing is visible', async ( { pageObject, frontendUtils, @@ -213,8 +201,6 @@ test.describe( 'Shopper → Order Confirmation → Local Pickup', () => { } ); test.describe( 'Shopper → Order Confirmation → Downloadable Products', () => { - test.use( { storageState: adminFile } ); - let confirmationPageUrl: string; test.beforeEach( async ( { frontendUtils, pageObject } ) => {