Fixup tests (#1429)
- Removed unneeded "ToString" calls - Fixed typos - Renamed "fEButtonState" to "FEButtonState"
This commit is contained in:
parent
737cd15562
commit
66ad328d00
@ -82,7 +82,7 @@ public void ClearMemoryPanel()
|
|||||||
|
|
||||||
/// <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()
|
||||||
{
|
{
|
||||||
|
@ -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 @@ public class NumberPad
|
|||||||
/// <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) + "-";
|
||||||
|
@ -18,7 +18,7 @@ public enum AngleOperatorState
|
|||||||
Gradians
|
Gradians
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum fEButtonState
|
public enum FEButtonState
|
||||||
{
|
{
|
||||||
Normal,
|
Normal,
|
||||||
Exponential
|
Exponential
|
||||||
@ -133,7 +133,7 @@ public void SetAngleOperator(AngleOperatorState value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetFEButton(fEButtonState value)
|
public void ResetFEButton(FEButtonState value)
|
||||||
{
|
{
|
||||||
if (this.FixedToExponentialButton.GetAttribute("Toggle.ToggleState") != "0")
|
if (this.FixedToExponentialButton.GetAttribute("Toggle.ToggleState") != "0")
|
||||||
{
|
{
|
||||||
|
@ -90,8 +90,7 @@ public string GetAoTToolTipText()
|
|||||||
{
|
{
|
||||||
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>
|
||||||
|
@ -20,7 +20,7 @@ public class StandardCalculatorPage
|
|||||||
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()
|
||||||
{
|
{
|
||||||
|
@ -38,14 +38,14 @@ public void SetupCalculatorSession(TestContext context)
|
|||||||
{
|
{
|
||||||
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();
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ public void Dispose()
|
|||||||
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 @@ private bool Ping()
|
|||||||
}
|
}
|
||||||
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);
|
||||||
|
@ -33,7 +33,7 @@ public static void WaitForDisplayed(this WindowsElement element, int timeout = 2
|
|||||||
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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public void TestInit()
|
|||||||
}
|
}
|
||||||
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]
|
||||||
|
Loading…
Reference in New Issue
Block a user