woocommerce/tests/e2e-tests/utils/index.js

27 lines
503 B
JavaScript

/**
* Internal dependencies
*/
const flows = require( './flows' );
/**
* Click a tab (on post type edit screen).
*
* @param {string} tabName Tab label.
*/
const clickTab = async ( tabName ) => {
await expect( page ).toClick( '.wc-tabs > li > a', { text: tabName } );
};
/**
* Wait for UI blocking to end.
*/
const uiUnblocked = async () => {
await page.waitForFunction( () => ! Boolean( document.querySelector( '.blockUI' ) ) );
};
module.exports = {
...flows,
clickTab,
uiUnblocked,
};