@wordpress/e2e-test-utils
Version:
End-To-End (E2E) test utils for WordPress.
22 lines (21 loc) • 780 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.switchBlockInspectorTab = switchBlockInspectorTab;
/**
* Clicks on the block inspector tab button with the supplied label and waits
* for the tab switch.
*
* @param { string } label Aria label to find tab button by.
*/
async function switchBlockInspectorTab(label) {
const tabButton = await page.$(`.block-editor-block-inspector__tabs button[aria-label="${label}"]`);
if (!tabButton) {
throw new Error(`Missing block inspector tab: ${label}.`);
}
const id = await (await tabButton.getProperty('id')).jsonValue();
await tabButton.click();
await page.waitForSelector(`div[role="tabpanel"][aria-labelledby="${id}"]`);
}
//# sourceMappingURL=switch-block-inspector-tab.js.map