UNPKG

@wordpress/e2e-test-utils

Version:
20 lines (18 loc) 773 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findSidebarPanelToggleButtonWithTitle = findSidebarPanelToggleButtonWithTitle; /** @typedef {import('puppeteer-core').ElementHandle} ElementHandle */ /** * Finds a sidebar panel with the provided title. * * @param {string} panelTitle The name of sidebar panel. * * @return {?ElementHandle} Object that represents an in-page DOM element. */ async function findSidebarPanelToggleButtonWithTitle(panelTitle) { const buttons = await page.$x(`//div[contains(@class,"editor-sidebar")]//button[@class="components-button components-panel__body-toggle"][contains(text(),"${panelTitle}")]`); return buttons[0]; } //# sourceMappingURL=find-sidebar-panel-toggle-button-with-title.js.map