UNPKG

wix-style-react

Version:
31 lines (28 loc) 1.2 kB
export { isFocused } from 'wix-ui-test-utils/protractor'; // TODO: protractor helper methods should be moved to wix-ui-test-utils/protractor /** * Protractor helper for checking the presence of an attribute. */ export var hasAttribute = function hasAttribute(elementFinder, attributeName) { return elementFinder.getAttribute(attributeName).then(function (value) { return value !== null; }); }; /** * Protractor helper for checking the presence of a css class name. */ export var hasClass = function hasClass(element, className) { return element.getAttribute('class').then(function (classes) { return classes.split(' ').some(function (c) { return c.includes(className); }); }); }; export var disableCSSAnimation = function disableCSSAnimation() { var css = '* {' + '-webkit-transition-duration: 0s !important;' + 'transition-duration: 0s !important;' + '-webkit-animation-duration: 0s !important;' + 'animation-duration: 0s !important;' + '}', head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); style.type = 'text/css'; style.appendChild(document.createTextNode(css)); head.appendChild(style); };