UNPKG

wix-style-react

Version:
32 lines (29 loc) 881 B
import { isFocused as _isFocused } from 'wix-ui-test-utils/protractor'; var inputDriverFactory = function inputDriverFactory(component) { var input = component.$('input'); var clearButton = component.$('[data-hook="input-clear-button"]'); return { element: function element() { return component; }, enterText: function enterText(text) { return input.clear().sendKeys(text); }, getText: function getText() { return input.getAttribute('value'); }, hasClearButton: function hasClearButton() { return clearButton.isPresent(); }, clickClear: function clickClear() { return clearButton.isPresent() && clearButton.click(); }, click: function click() { return input.click(); }, isFocused: function isFocused() { return _isFocused(input); } }; }; export default inputDriverFactory;