/// <summary> /// Select value in Units2 ComboBox /// </summary> /// <param name="value">Value in ComboBox Units2</param> public void SelectUnits2(string value) { CalculatorApp.ClickOnWindow(); UnitConverterOperators.Units2.SendKeys(value); UnitConverterOperators.Units2.SendKeys(OpenQA.Selenium.Keys.Enter); CalculatorApp.ClickOnWindow(); }
/// <summary> /// Opens the History Flyout. /// </summary> public void OpenHistoryFlyout() { this.ResizeWindowToDisplayHistoryButton(); CalculatorApp.EnsureCalculatorHasFocus(); CalculatorApp.Window.SendKeys(Keys.Control + "h" + Keys.Control); Actions moveToHistoryFlyout = new Actions(WinAppDriver.Instance.CalculatorSession); moveToHistoryFlyout.MoveToElement(HistoryFlyout); moveToHistoryFlyout.Perform(); }
/// <summary> /// Ensure Units1 and Units2 are the same /// </summary> public void EnsureSameUnitsAreSelected() { CalculatorApp.ClickOnWindow(); UnitConverterOperators.Units1.SendKeys(OpenQA.Selenium.Keys.Home); UnitConverterOperators.Units1.SendKeys(OpenQA.Selenium.Keys.Enter); CalculatorApp.ClickOnWindow(); UnitConverterOperators.Units2.SendKeys(OpenQA.Selenium.Keys.Home); UnitConverterOperators.Units2.SendKeys(OpenQA.Selenium.Keys.Enter); CalculatorApp.ClickOnWindow(); }
/// <summary> /// Opens the Memory Flyout. /// </summary> public void OpenMemoryFlyout() { this.ResizeWindowToDisplayMemoryButton(); CalculatorApp.EnsureCalculatorHasFocus(); Actions moveToMemoryButton = new Actions(WinAppDriver.Instance.CalculatorSession); moveToMemoryButton.MoveToElement(MemoryFlyoutButton); moveToMemoryButton.Perform(); CalculatorApp.Window.SendKeys(Keys.Alt + "m" + Keys.Alt); Actions moveToMemoryFlyout = new Actions(WinAppDriver.Instance.CalculatorSession); moveToMemoryFlyout.MoveToElement(MemoryFlyout); moveToMemoryFlyout.Perform(); }
///// <summary> ///// Navigates from AoT(Keep on top) to Standard ///// </summary> public void NavigateToStandardMode() { string source = this.session.PageSource; if (source.Contains("ExitAlwaysOnTopButton")) { this.ExitAlwaysOnTopButton.Click(); Assert.AreEqual("Standard", CalculatorApp.GetCalculatorHeaderText()); } else { source = this.session.PageSource; if (source.Contains("NormalAlwaysOnTopButton")) { return; } else { throw new NotFoundException("Could not find the 'Keep on top' button"); } } }