From 4fe2bb8089cf067bfa127bf4f1de2dd788bf3ebc Mon Sep 17 00:00:00 2001 From: Saad Tarhi Date: Fri, 1 Dec 2023 15:54:31 +0100 Subject: [PATCH] Remove unnecessary login as admin from test files The admin profile is set by default --- .../classic-template.block_theme.side_effects.spec.ts | 3 +-- .../price-filter.block_theme.side_effects.spec.ts | 4 +--- .../tests/products/products.block_theme.side_effects.spec.ts | 3 --- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/e2e/tests/classic-template/classic-template.block_theme.side_effects.spec.ts b/tests/e2e/tests/classic-template/classic-template.block_theme.side_effects.spec.ts index c840006e10d..8757abfcc34 100644 --- a/tests/e2e/tests/classic-template/classic-template.block_theme.side_effects.spec.ts +++ b/tests/e2e/tests/classic-template/classic-template.block_theme.side_effects.spec.ts @@ -3,7 +3,7 @@ */ import { BlockData } from '@woocommerce/e2e-types'; import { test, expect } from '@woocommerce/e2e-playwright-utils'; -import { adminFile, cli } from '@woocommerce/e2e-utils'; +import { cli } from '@woocommerce/e2e-utils'; import { deleteAllTemplates } from '@wordpress/e2e-test-utils'; /** @@ -65,7 +65,6 @@ test.afterAll( async () => { for ( const { templateTitle, slug } of Object.values( templates ) ) { test.describe( `${ blockData.name } Block `, () => { - test.use( { storageState: adminFile } ); test( `is rendered on ${ templateTitle } template`, async ( { admin, editorUtils, diff --git a/tests/e2e/tests/price-filter/price-filter.block_theme.side_effects.spec.ts b/tests/e2e/tests/price-filter/price-filter.block_theme.side_effects.spec.ts index bcc5ead69f2..ca0eb33ad30 100644 --- a/tests/e2e/tests/price-filter/price-filter.block_theme.side_effects.spec.ts +++ b/tests/e2e/tests/price-filter/price-filter.block_theme.side_effects.spec.ts @@ -3,7 +3,7 @@ */ import { BlockData } from '@woocommerce/e2e-types'; import { test, expect } from '@woocommerce/e2e-playwright-utils'; -import { adminFile, BASE_URL, cli } from '@woocommerce/e2e-utils'; +import { BASE_URL, cli } from '@woocommerce/e2e-utils'; const blockData: BlockData< { urlSearchParamWhenFilterIsApplied: string; @@ -22,7 +22,6 @@ const blockData: BlockData< { }; test.describe( `${ blockData.name } Block - with All products Block`, () => { - test.use( { storageState: adminFile } ); test.beforeEach( async ( { admin, page, editor } ) => { await admin.createNewPost( { legacyCanvas: true } ); await editor.insertBlock( { name: 'woocommerce/all-products' } ); @@ -92,7 +91,6 @@ test.describe( `${ blockData.name } Block - with All products Block`, () => { } ); // These tests are disabled because there is an issue with the default contents of this page, possible caused by other tests. test.describe( `${ blockData.name } Block - with PHP classic template`, () => { - test.use( { storageState: adminFile } ); test.beforeAll( async () => { await cli( 'npm run wp-env run tests-cli -- wp option update wc_blocks_use_blockified_product_grid_block_as_template false' diff --git a/tests/e2e/tests/products/products.block_theme.side_effects.spec.ts b/tests/e2e/tests/products/products.block_theme.side_effects.spec.ts index be0726527c8..77fa1bca139 100644 --- a/tests/e2e/tests/products/products.block_theme.side_effects.spec.ts +++ b/tests/e2e/tests/products/products.block_theme.side_effects.spec.ts @@ -3,7 +3,6 @@ */ import { BlockData } from '@woocommerce/e2e-types'; import { test, expect } from '@woocommerce/e2e-playwright-utils'; -import { adminFile } from '@woocommerce/e2e-utils'; /** * Internal dependencies @@ -57,7 +56,6 @@ const templates = { }; test.describe( `${ blockData.name } Block `, () => { - test.use( { storageState: adminFile } ); test( 'when Inherit Query from template is enabled all the settings that customize the query should be hidden', async ( { admin, editorUtils, @@ -125,7 +123,6 @@ for ( const { legacyBlockName, } of Object.values( templates ) ) { test.describe( `${ templateTitle } template`, () => { - test.use( { storageState: adminFile } ); test.afterAll( async ( { requestUtils } ) => { await requestUtils.deleteAllTemplates( 'wp_template' ); await requestUtils.deleteAllTemplates( 'wp_template_part' );