mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
Now that Bug 23811901 has been fixed, adding Test Method 'KeyboardInput_HistoryHotkeys' to ensure this hotkey functionality doesn't regress
This commit is contained in:
parent
296cf038b9
commit
d62075d25b
1 changed files with 25 additions and 0 deletions
|
@ -362,6 +362,31 @@ namespace CalculatorUITests
|
|||
Assert.IsNotNull(WinAppDriver.Instance.CalculatorSession.FindElementByAccessibilityId("MemoryPaneEmpty")); //verifies the Memory panel's memory clear button hotkey
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Priority(1)]
|
||||
public void KeyboardInput_HistoryHotkeys()
|
||||
{
|
||||
//Verifies history buttons
|
||||
CalculatorApp.EnsureCalculatorHasFocus();
|
||||
CalculatorApp.Window.SendKeys("4");
|
||||
CalculatorApp.Window.SendKeys(Keys.Multiply);
|
||||
CalculatorApp.Window.SendKeys("5");
|
||||
CalculatorApp.Window.SendKeys(Keys.Divide);
|
||||
CalculatorApp.Window.SendKeys("6");
|
||||
CalculatorApp.Window.SendKeys(Keys.Equal);
|
||||
page.HistoryPanel.ResizeWindowToDisplayHistoryButton();
|
||||
CalculatorApp.Window.SendKeys(Keys.Control + "h" + Keys.Control);
|
||||
var historyFlyoutItems = page.HistoryPanel.GetAllHistoryFlyoutListViewItems();
|
||||
Assert.IsTrue(historyFlyoutItems[0].GetValue().Equals("3.333333333333333", StringComparison.InvariantCultureIgnoreCase)); //verifies History button hotkeys
|
||||
Assert.IsTrue(historyFlyoutItems[0].GetExpression().Equals("4 × 5 ÷ 6 =", StringComparison.InvariantCultureIgnoreCase)); //verifies History button hotkeys
|
||||
page.HistoryPanel.ResizeWindowToDisplayHistoryLabel();
|
||||
var historyItems = page.HistoryPanel.GetAllHistoryListViewItems();
|
||||
Assert.IsTrue(historyItems[0].GetValue().Equals("3.333333333333333", StringComparison.InvariantCultureIgnoreCase));
|
||||
Assert.IsTrue(historyItems[0].GetExpression().Equals("4 × 5 ÷ 6 =", StringComparison.InvariantCultureIgnoreCase));
|
||||
CalculatorApp.Window.SendKeys(Keys.Shift + Keys.Control + "d" + Keys.Control + Keys.Shift);
|
||||
Assert.IsNotNull(WinAppDriver.Instance.CalculatorSession.FindElementByAccessibilityId("HistoryEmpty")); //verifies the History panel's clear history button hotkeys
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Arithmetic Operators Functionality via Mixed Input
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue