This commit is contained in:
tain 2021-01-13 23:05:11 +08:00
commit 95d57812aa
14 changed files with 25 additions and 15 deletions

View file

@ -27,7 +27,7 @@ jobs:
downloadDirectory: $(Build.SourcesDirectory) downloadDirectory: $(Build.SourcesDirectory)
vstsFeed: WindowsInboxApps vstsFeed: WindowsInboxApps
vstsFeedPackage: calculator-internals vstsFeedPackage: calculator-internals
vstsPackageVersion: 0.0.53 vstsPackageVersion: 0.0.54
- template: ./build-single-architecture.yaml - template: ./build-single-architecture.yaml
parameters: parameters:

View file

@ -80,7 +80,7 @@ jobs:
downloadDirectory: $(Build.SourcesDirectory) downloadDirectory: $(Build.SourcesDirectory)
vstsFeed: WindowsInboxApps vstsFeed: WindowsInboxApps
vstsFeedPackage: calculator-internals vstsFeedPackage: calculator-internals
vstsPackageVersion: 0.0.53 vstsPackageVersion: 0.0.54
- powershell: | - powershell: |
# Just modify this line to indicate where your en-us PDP file is. Leave the other lines alone. # Just modify this line to indicate where your en-us PDP file is. Leave the other lines alone.

View file

@ -177,6 +177,7 @@
<muxc:NavigationViewItem x:Name="AboutButton" <muxc:NavigationViewItem x:Name="AboutButton"
x:Uid="AboutButton" x:Uid="AboutButton"
Style="{StaticResource NavViewItemStyle}" Style="{StaticResource NavViewItemStyle}"
KeyDown="OnAboutButtonKeyDown"
Tapped="OnAboutButtonClick"> Tapped="OnAboutButtonClick">
<muxc:NavigationViewItem.Icon> <muxc:NavigationViewItem.Icon>
<FontIcon FontFamily="{StaticResource CalculatorFontFamily}" Glyph="&#xe946;"/> <FontIcon FontFamily="{StaticResource CalculatorFontFamily}" Glyph="&#xe946;"/>

View file

@ -432,6 +432,14 @@ void MainPage::OnAboutButtonClick(Object ^ sender, ItemClickEventArgs ^ e)
ShowAboutPage(); ShowAboutPage();
} }
void MainPage::OnAboutButtonKeyDown(Object ^ sender, KeyRoutedEventArgs ^ e)
{
if (e->Key == VirtualKey::Space || e->Key == VirtualKey::Enter)
{
ShowAboutPage();
}
}
void MainPage::OnAboutFlyoutOpened(_In_ Object ^ sender, _In_ Object ^ e) void MainPage::OnAboutFlyoutOpened(_In_ Object ^ sender, _In_ Object ^ e)
{ {
// Keep Ignoring Escape till the About page flyout is opened // Keep Ignoring Escape till the About page flyout is opened

View file

@ -55,6 +55,7 @@ public
_In_ Microsoft::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs ^ e); _In_ Microsoft::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs ^ e);
void OnAboutButtonClick(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::Controls::ItemClickEventArgs ^ e); void OnAboutButtonClick(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::Controls::ItemClickEventArgs ^ e);
void OnAboutButtonKeyDown(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::Input::KeyRoutedEventArgs ^ e);
void OnAboutFlyoutOpened(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e); void OnAboutFlyoutOpened(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e);
void OnAboutFlyoutClosed(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e); void OnAboutFlyoutClosed(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ e);
void AlwaysOnTopButtonClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e); void AlwaysOnTopButtonClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);

View file

@ -82,7 +82,7 @@ namespace CalculatorUITestFramework
/// <summary> /// <summary>
/// If the Memory label is not displayed, resize the window /// If the Memory label is not displayed, resize the window
/// Two attempts are made, the the lable is not found a "not found" exception is thrown /// Two attempts are made, and if the label is not found, a "not found" exception is thrown
/// </summary> /// </summary>
public void ResizeWindowToDisplayMemoryLabel() public void ResizeWindowToDisplayMemoryLabel()
{ {

View file

@ -3,6 +3,7 @@
using OpenQA.Selenium.Appium.Windows; using OpenQA.Selenium.Appium.Windows;
using System; using System;
using System.Globalization;
namespace CalculatorUITestFramework namespace CalculatorUITestFramework
{ {
@ -29,7 +30,7 @@ namespace CalculatorUITestFramework
/// <param name="number">Number to be entered into the calculator.</param> /// <param name="number">Number to be entered into the calculator.</param>
public void Input(double number) public void Input(double number)
{ {
string numberStr = number.ToString(); string numberStr = number.ToString(CultureInfo.InvariantCulture);
if (numberStr.StartsWith("-")) if (numberStr.StartsWith("-"))
{ {
numberStr = numberStr.Substring(1) + "-"; numberStr = numberStr.Substring(1) + "-";

View file

@ -18,7 +18,7 @@ namespace CalculatorUITestFramework
Gradians Gradians
} }
public enum fEButtonState public enum FEButtonState
{ {
Normal, Normal,
Exponential Exponential
@ -133,7 +133,7 @@ namespace CalculatorUITestFramework
} }
} }
public void ResetFEButton(fEButtonState value) public void ResetFEButton(FEButtonState value)
{ {
if (this.FixedToExponentialButton.GetAttribute("Toggle.ToggleState") != "0") if (this.FixedToExponentialButton.GetAttribute("Toggle.ToggleState") != "0")
{ {

View file

@ -90,8 +90,7 @@ namespace CalculatorUITestFramework
{ {
throw new NotFoundException("Could not find 'Keep on top' button or 'Back to full view' button"); throw new NotFoundException("Could not find 'Keep on top' button or 'Back to full view' button");
} }
var ToolTipText = ToolTip.Text.ToString(); return ToolTip.Text;
return ToolTipText;
} }
///// <summary> ///// <summary>

View file

@ -20,7 +20,7 @@ namespace CalculatorUITestFramework
private WindowsDriver<WindowsElement> session => WinAppDriver.Instance.CalculatorSession; private WindowsDriver<WindowsElement> session => WinAppDriver.Instance.CalculatorSession;
/// <summary> /// <summary>
/// Navigates the caclulator to Standard mode and ensures that it is in standard mode /// Navigates the calculator to Standard mode and ensures that it is in standard mode
/// </summary> /// </summary>
public void NavigateToStandardCalculator() public void NavigateToStandardCalculator()
{ {

View file

@ -38,14 +38,14 @@ namespace CalculatorUITestFramework
{ {
this.windowsDriverService = new WindowsDriverServiceBuilder().Build(); this.windowsDriverService = new WindowsDriverServiceBuilder().Build();
this.windowsDriverService.OutputDataReceived += new DataReceivedEventHandler((sender, e) => this.windowsDriverService.OutputDataReceived += (sender, e) =>
{ {
var outputData = e.Data?.Replace("\0", string.Empty); var outputData = e.Data?.Replace("\0", string.Empty);
if (!String.IsNullOrEmpty(outputData)) if (!String.IsNullOrEmpty(outputData))
{ {
Console.WriteLine(outputData); Console.WriteLine(outputData);
} }
}); };
this.windowsDriverService.Start(); this.windowsDriverService.Start();

View file

@ -122,7 +122,7 @@ namespace CalculatorUITestFramework
public Uri ServiceUrl public Uri ServiceUrl
{ {
// Note: append /wd/hub to the URL if you're directing the test at Appium // Note: append /wd/hub to the URL if you're directing the test at Appium
get { return new Uri($"http://{this.IP.ToString()}:{Convert.ToString(this.Port)}"); } get { return new Uri($"http://{this.IP}:{Convert.ToString(this.Port)}"); }
} }
private void DestroyProcess() private void DestroyProcess()
@ -158,7 +158,7 @@ namespace CalculatorUITestFramework
} }
else else
{ {
status = new Uri(service.ToString() + "/status"); status = new Uri(service + "/status");
} }
DateTime endTime = DateTime.Now.Add(this.InitializationTimeout); DateTime endTime = DateTime.Now.Add(this.InitializationTimeout);

View file

@ -33,7 +33,7 @@ namespace CalculatorUITestFramework
Thread.Sleep(10); Thread.Sleep(10);
} }
timer.Stop(); timer.Stop();
Assert.Fail(String.Format("{0} was not displayed in {1} ms", element, timeout)); Assert.Fail($"{element} was not displayed in {timeout} ms");
} }
} }
} }

View file

@ -54,7 +54,7 @@ namespace CalculatorUITests
} }
CalculatorApp.EnsureCalculatorHasFocus(); CalculatorApp.EnsureCalculatorHasFocus();
page.ScientificOperators.SetAngleOperator(AngleOperatorState.Degrees); page.ScientificOperators.SetAngleOperator(AngleOperatorState.Degrees);
page.ScientificOperators.ResetFEButton(fEButtonState.Normal); page.ScientificOperators.ResetFEButton(FEButtonState.Normal);
} }
[TestCleanup] [TestCleanup]