UNPKG

wix-style-react

Version:
45 lines (38 loc) 1.47 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _protractor = require('wix-ui-test-utils/protractor'); Object.defineProperty(exports, 'isFocused', { enumerable: true, get: function get() { return _protractor.isFocused; } }); // TODO: protractor helper methods should be moved to wix-ui-test-utils/protractor /** * Protractor helper for checking the presence of an attribute. */ var hasAttribute = exports.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. */ var hasClass = exports.hasClass = function hasClass(element, className) { return element.getAttribute('class').then(function (classes) { return classes.split(' ').some(function (c) { return c.includes(className); }); }); }; var disableCSSAnimation = exports.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); };