mirror of
https://github.com/xodio/xod.git
synced 2026-03-20 07:36:55 +01:00
25 lines
623 B
JavaScript
25 lines
623 B
JavaScript
import BasePageObject from './BasePageObject';
|
|
|
|
class Menubar extends BasePageObject {
|
|
async clickTopLevelItem(title) {
|
|
const item = await this.elementHandle.xpath(
|
|
`//*[@class="Menubar-submenu-title"][.//text()="${title}"]`
|
|
);
|
|
await item.click();
|
|
}
|
|
|
|
async clickMenuItem(title) {
|
|
const item = await this.page.xpath(
|
|
`//*[@class="Menubar-clickable-item"][starts-with(text(), "${title}")]`
|
|
);
|
|
await item.click();
|
|
}
|
|
}
|
|
|
|
Menubar.findOnPage = async page => {
|
|
const elementHandle = await page.$('.Menubar-root');
|
|
return new Menubar(page, elementHandle);
|
|
};
|
|
|
|
export default Menubar;
|