terminal/src/host/ft_uia/Common/SliderMeta.cs
Dustin Howett d4d59fa339 Initial release of the Windows Terminal source code
This commit introduces all of the Windows Terminal and Console Host source,
under the MIT license.
2019-05-02 15:29:04 -07:00

64 lines
1.9 KiB
C#

//----------------------------------------------------------------------------------------------------------------------
// <copyright file="SliderMeta.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <summary>Range Value Slider metadata information helper class.</summary>
//----------------------------------------------------------------------------------------------------------------------
namespace Conhost.UIA.Tests.Common
{
using System;
using System.Globalization;
using WEX.Logging.Interop;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium;
public struct SliderMeta
{
/// <summary>
/// When testing a slider, this is the position we expect to set it to.
/// </summary>
public enum ExpectedPosition
{
Maximum,
Minimum
}
public AppiumWebElement Slider { get; private set; }
public string ValueName { get; private set; }
public bool IsV2Property { get; private set; }
public NativeMethods.Wtypes.PROPERTYKEY? PropKey { get; private set; }
public SliderMeta(AppiumWebElement slider, string valueName, bool isV2Property, NativeMethods.Wtypes.PROPERTYKEY? propKey)
: this()
{
this.Slider = slider;
this.ValueName = valueName;
this.IsV2Property = isV2Property;
this.PropKey = propKey;
}
public void SetToMaximum()
{
this.Slider.Click();
this.Slider.SendKeys(Keys.End);
}
public void SetToMinimum()
{
this.Slider.Click();
this.Slider.SendKeys(Keys.Home);
}
public int GetMaximum()
{
return 100;
}
public int GetMinimum()
{
return 30;
}
}
}