Use different formatter for different currency (#1432)
* Use different formatter for different currency * Add functional tests for currency fraction digit format * Revert "Add functional tests for currency fraction digit format" This reverts commit bd8aab33847425f4dcfd0d76ce310c918729b2fd. * Add TestCurrencyFormattingLogic in UnitConverterViewModelUnitTests * Fix InitializeMultipleConverterTest * Add comment for a line of code * Add default case for switch in ConvertToLocalizedString * Remove trailing decimal Disable decimal input if maxFractionDigits is 0 Fix input may be blocked after switched active * Fix: UpdateIsDecimalEnabled should do nothing for non-currency converter * Remove unnecessary SetValue method * Add a comment * Add functional UI Tests for currency converter Reset currency before tests Fix: input is blocked after switching to currency with less fractional digits * Set Priority=0 for currency format related tests * Truncate digits in display value after switcing To fix incorrect result after switching currency with less fractional digits
This commit is contained in:
@@ -35,6 +35,14 @@ namespace CalculatorUITestFramework
|
||||
AppName.Click();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Click the window (to lose focus on components)
|
||||
/// </summary>
|
||||
public static void ClickOnWindow()
|
||||
{
|
||||
Window.Click();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If the the Dock Panel for the History and Memory lists is not displayed, resize the window
|
||||
/// Two attempts are made, the the lable is not found a "not found" exception is thrown
|
||||
|
@@ -13,5 +13,7 @@ namespace CalculatorUITestFramework
|
||||
public NumberPad NumberPad = new NumberPad();
|
||||
public WindowsElement ClearButton => this.session.TryFindElementByAccessibilityId("ClearEntryButtonPos0");
|
||||
public WindowsElement BackSpaceButton => this.session.TryFindElementByAccessibilityId("BackSpaceButtonSmall");
|
||||
public WindowsElement Units1 => this.session.TryFindElementByAccessibilityId("Units1");
|
||||
public WindowsElement Units2 => this.session.TryFindElementByAccessibilityId("Units2");
|
||||
}
|
||||
}
|
||||
|
@@ -64,5 +64,44 @@ namespace CalculatorUITestFramework
|
||||
}
|
||||
}
|
||||
|
||||
/// <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>
|
||||
/// Select value in Units1 ComboBox
|
||||
/// </summary>
|
||||
/// <param name="value">Value in ComboBox Units1</param>
|
||||
public void SelectUnits1(string value)
|
||||
{
|
||||
CalculatorApp.ClickOnWindow();
|
||||
UnitConverterOperators.Units1.SendKeys(value);
|
||||
UnitConverterOperators.Units1.SendKeys(OpenQA.Selenium.Keys.Enter);
|
||||
CalculatorApp.ClickOnWindow();
|
||||
}
|
||||
|
||||
/// <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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user