UNPKG

@wix/design-system

Version:

@wix/design-system

66 lines (49 loc) 1.85 kB
## PopoverMenu Testkit ### Import - unidriver: `import { PopoverMenuUniDriver } from '@wix/design-system/dist/testkit/unidriver';` - vanilla: `import { PopoverMenuTestkit } from '@wix/design-system/dist/testkit';` - puppeteer: `import { PopoverMenuTestkit } from '@wix/design-system/dist/testkit/puppeteer';` - playwright: `import { PopoverMenuTestkit } from '@wix/design-system/dist/testkit/playwright';` ### API ### exists - signature: exists() - returns: Promise<boolean> - description: Checks whether the component found with the given data hook ### element - signature: element() - returns: Promise<any> - description: Gets the component root element ### click - signature: click() - returns: Promise<void> - description: Clicks on the component root element ### base - signature: base() - returns: UniDriver - description: Returns UniDriver for the base element ### exists - signature: exists() - description: Returns true of popoverMenu exists ### getTriggerElement - signature: getTriggerElement(dataHook) - description: Returns trigger element ### clickAtChild - signature: clickAtChild(index) - description: Select a specific option by its index (requires the menu to be opened) ### clickAtChildByDataHook - signature: clickAtChildByDataHook(dataHook) - description: Select a specific option by its data-hook (requires the menu to be opened) ### isMenuOpen - signature: isMenuOpen() - description: Return true if the menu is opened ### childrenCount - signature: childrenCount() - description: Returns children count ### itemContentAt - signature: itemContentAt(index) - description: Returns text of <PopoverMenu.MenuItem/> of a specific index ### isListItemFocused - signature: isListItemFocused(position) ### getContentElement - signature: getContentElement() - description: Returns the content element (`<Popover.Content/>`)