示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KMultiSelectComponent{T}"/> class.
 /// </summary>
 /// <param name="selector">The selector.</param>
 /// <param name="driver">The driver.</param>
 /// <param name="configuration">The configuration.</param>
 /// <param name="parent">The parent.</param>
 public KMultiSelectComponent(By selector,
                              IWebDriver driver,
                              KMultiSelectConfiguration configuration,
                              T parent)
     : base(configuration,
            selector,
            driver,
            parent)
 {
     this.configuration = configuration;
     this.animationData = configuration.AnimationOptions;
 }
示例#2
0
        /// <inheritDoc/>
        protected virtual void WaitForAnimationEnd(
            KMultiSelectAnimationOptions animationData = null)
        {
            var data = animationData ?? this.animationData;

            if (!data.AnimationsEnabled)
            {
                return;
            }

            WrappedDriver
            .Wait(data.AnimationDuration)
            .Until(d => IsExpanded);
        }
示例#3
0
        /// <inheritDoc/>
        protected virtual void WaitForAnimationStart(
            KMultiSelectAnimationOptions animationData = null)
        {
            var data = animationData ?? this.animationData;

            if (!data.AnimationsEnabled)
            {
                return;
            }

            var eventName = IsExpanded ? "close" : "open";
            var promise   = GetPromiseForKendoEvent(eventName);

            WrappedDriver.Wait(
                data.AnimationDuration,
                new[] { typeof(TimeoutException) })
            .Until(d => promise.Finished);
        }
示例#4
0
        /// <inheritDoc/>
        protected virtual bool IsCurrentlyAnimating(
            KMultiSelectAnimationOptions animationData = null)
        {
            var animationContainer = ListContainerElement.GetParentElement();
            var initialHeight      = animationContainer.GetCssValue("height");
            var result             = false;

            WrappedDriver.Wait(
                TimeSpan.FromMilliseconds(100),
                new[] { typeof(TimeoutException) })
            .Until(d =>
            {
                result = animationContainer.GetCssValue("height")
                         != initialHeight;

                return(result);
            });

            return(result);
        }