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

Commit

Permalink
Use upstream utils when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Aljullu committed Apr 2, 2023
1 parent a3c13c2 commit c025afa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/e2e/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import {
enterEditMode,
getAllBlocks,
ensureSidebarOpened,
switchBlockInspectorTab,
} from '@wordpress/e2e-test-utils';
import { addQueryArgs } from '@wordpress/url';
import { WP_ADMIN_DASHBOARD } from '@woocommerce/e2e-utils';
import fs from 'fs';
import { switchBlockInspectorTabWhenGutenbergIsInstalled } from '@woocommerce/blocks-test-utils';

/**
* Internal dependencies
Expand Down Expand Up @@ -506,7 +506,7 @@ export const insertAllProductsBlock = async () => {

export const enableApplyFiltersButton = async () => {
await ensureSidebarOpened();
await switchBlockInspectorTabWhenGutenbergIsInstalled( 'Settings' );
await switchBlockInspectorTab( 'Settings' );

await page.waitForXPath( SELECTORS.editor.filterButtonToggle );

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
/**
* External dependencies
*/
import { switchBlockInspectorTab } from '@wordpress/e2e-test-utils';

/**
* Internal dependencies
*/
import { openSettingsSidebar } from '../e2e/utils.js';
import {
ensureSidebarOpened,
switchBlockInspectorTab,
} from '@wordpress/e2e-test-utils';

export const switchBlockInspectorTabWhenGutenbergIsInstalled = async (
tabName: string
) => {
// Open the sidebar in case it was closed.
await openSettingsSidebar();
await ensureSidebarOpened();

const blockButton = await page.waitForXPath(
"//button[contains(text(), 'Block')]"
Expand Down

0 comments on commit c025afa

Please sign in to comment.