Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Remove unnecessary login as admin from test files
Browse files Browse the repository at this point in the history
The admin profile is set by default
  • Loading branch information
tarhi-saad committed Dec 8, 2023
1 parent 4ae8dd1 commit 4fe2bb8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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' } );
Expand Down Expand Up @@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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' );
Expand Down

0 comments on commit 4fe2bb8

Please sign in to comment.