Skip to content

Commit

Permalink
Drop use of adminFile as admin is always logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
WunderBart committed Mar 15, 2024
1 parent f9fb84f commit f206943
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
Expand Up @@ -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
Expand All @@ -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,
Expand Down
Expand Up @@ -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,
Expand All @@ -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`
Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -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();

Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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 } ) => {
Expand Down

0 comments on commit f206943

Please sign in to comment.