UNPKG

wix-style-react

Version:
22 lines (18 loc) 692 B
import dropdownLayoutDriverFactory from '../DropdownLayout/DropdownLayout.protractor.driver'; import { isFocused } from 'wix-ui-test-utils/protractor'; const driverFactory = component => { const dropdownLayoutDriver = dropdownLayoutDriverFactory( component.$('[data-hook="dropdown-layout-wrapper"]'), ); const input = component.$(`input`); return { ...dropdownLayoutDriver, click: () => component.click(), getInput: () => input, isFocused: () => isFocused(input), element: () => component, /** Check wether the options dropdown is open */ isOptionsShown: () => dropdownLayoutDriver.getDropdown().isDisplayed(), }; }; export default driverFactory;