wix-style-react
Version:
41 lines (39 loc) • 1.39 kB
JavaScript
import { mouseEnter, isFocused as _isFocused } from 'wix-ui-test-utils/protractor';
import { browser } from 'protractor';
var toggleSwitchDriverFactory = function toggleSwitchDriverFactory(component) {
return {
element: function element() {
return component;
},
hover: function hover() {
return mouseEnter(component.$('textarea'));
},
click: function click() {
return component.$('textarea').click();
},
isFocused: function isFocused() {
return _isFocused(component.$('textarea'));
},
isHovered: function isHovered() {
return component.$(':hover').isPresent();
},
sendKeys: function sendKeys(keys) {
return component.$('textarea').sendKeys(keys);
},
getOffsetHeight: function getOffsetHeight() {
return component.$('textarea').getAttribute('offsetHeight');
},
getScrollHeight: function getScrollHeight() {
return component.$('textarea').getAttribute('scrollHeight');
},
getRowCount: function getRowCount() {
return component.$('textarea').getAttribute('rows').then(function (rowCount) {
return +rowCount;
});
},
setLineHeight: function setLineHeight(lineHeight) {
return browser.executeScript("document.querySelector('textarea').style.lineHeight = '".concat(lineHeight, "'"));
}
};
};
export default toggleSwitchDriverFactory;