Issue 935 - Updates to Scientific/Graphing Keypad (#1214)
* Switching from Difference between dates to Add or subtract dates ignores the first date field https://github.com/microsoft/calculator/issues/254 Date field needs to persist across Date Difference and Add/Subtract From Date Mode. * Update DateCalculator.xaml.cpp Addressing review comments (white space, small code refactor), also found a null pointer exception during testing, this fix addresses that as well. * Issue 935 - Updates to Scientific/Graphing Keypad Update Scientific and Graphing keyboard layouts to expose square root button at the top level * Updated ScientificModeFunctionalTests/SmokeTest_Cube() Updated broken test to work with changes.
This commit is contained in:
		@@ -953,13 +953,13 @@
 | 
				
			|||||||
                                           ButtonId="XPower2"
 | 
					                                           ButtonId="XPower2"
 | 
				
			||||||
                                           Content=""/>
 | 
					                                           Content=""/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <controls:CalculatorButton x:Name="XPower3Button"
 | 
					                <controls:CalculatorButton x:Name="SquareRootButton"
 | 
				
			||||||
                                           x:Uid="xpower3Button"
 | 
					                                           x:Uid="squareRootButton"
 | 
				
			||||||
                                           Grid.Row="1"
 | 
					                                           Grid.Row="1"
 | 
				
			||||||
                                           Style="{StaticResource SymbolOperatorButtonStyle}"
 | 
					                                           Style="{StaticResource EmphasizedCalcButtonStyle}"
 | 
				
			||||||
                                           AutomationProperties.AutomationId="xpower3Button"
 | 
					                                           AutomationProperties.AutomationId="squareRootButton"
 | 
				
			||||||
                                           ButtonId="Cube"
 | 
					                                           ButtonId="Sqrt"
 | 
				
			||||||
                                           Content=""/>
 | 
					                                           Content=""/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <controls:CalculatorButton x:Name="PowerButton"
 | 
					                <controls:CalculatorButton x:Name="PowerButton"
 | 
				
			||||||
                                           x:Uid="powerButton"
 | 
					                                           x:Uid="powerButton"
 | 
				
			||||||
@@ -1004,13 +1004,13 @@
 | 
				
			|||||||
                    <RowDefinition/>
 | 
					                    <RowDefinition/>
 | 
				
			||||||
                    <RowDefinition/>
 | 
					                    <RowDefinition/>
 | 
				
			||||||
                </Grid.RowDefinitions>
 | 
					                </Grid.RowDefinitions>
 | 
				
			||||||
                <controls:CalculatorButton x:Name="SquareRootButton"
 | 
					                <controls:CalculatorButton x:Name="XPower3Button"
 | 
				
			||||||
                                           x:Uid="squareRootButton"
 | 
					                                           x:Uid="xpower3Button"
 | 
				
			||||||
                                           Style="{StaticResource EmphasizedCalcButtonStyle}"
 | 
					                                           Style="{StaticResource SymbolOperatorButtonStyle}"
 | 
				
			||||||
                                           AutomationProperties.AutomationId="squareRootButton"
 | 
					                                           AutomationProperties.AutomationId="xpower3Button"
 | 
				
			||||||
                                           ButtonId="Sqrt"
 | 
					                                           ButtonId="Cube"
 | 
				
			||||||
                                           Click="ShiftButton_Uncheck"
 | 
					                                           Click="ShiftButton_Uncheck"
 | 
				
			||||||
                                           Content=""/>
 | 
					                                           Content=""/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <controls:CalculatorButton x:Name="CubeRootButton"
 | 
					                <controls:CalculatorButton x:Name="CubeRootButton"
 | 
				
			||||||
                                           x:Uid="cubeRootButton"
 | 
					                                           x:Uid="cubeRootButton"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -998,14 +998,14 @@
 | 
				
			|||||||
                                               Content=""
 | 
					                                               Content=""
 | 
				
			||||||
                                               IsTabStop="false"/>
 | 
					                                               IsTabStop="false"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    <controls:CalculatorButton x:Name="XPower3Button"
 | 
					                    <controls:CalculatorButton x:Name="SquareRootButton"
 | 
				
			||||||
                                               x:Uid="xpower3Button"
 | 
					                                               x:Uid="squareRootButton"
 | 
				
			||||||
                                               Grid.Row="1"
 | 
					                                               Grid.Row="1"
 | 
				
			||||||
                                               Style="{StaticResource SymbolOperatorButtonStyle}"
 | 
					                                               Style="{StaticResource EmphasizedCalcButtonStyle}"
 | 
				
			||||||
                                               AutomationProperties.AutomationId="xpower3Button"
 | 
					                                               AutomationProperties.AutomationId="squareRootButton"
 | 
				
			||||||
                                               ButtonId="Cube"
 | 
					                                               ButtonId="Sqrt"
 | 
				
			||||||
                                               Click="Button_Clicked"
 | 
					                                               Click="Button_Clicked"
 | 
				
			||||||
                                               Content=""
 | 
					                                               Content=""
 | 
				
			||||||
                                               IsTabStop="false"/>
 | 
					                                               IsTabStop="false"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    <controls:CalculatorButton x:Name="PowerButton"
 | 
					                    <controls:CalculatorButton x:Name="PowerButton"
 | 
				
			||||||
@@ -1059,13 +1059,14 @@
 | 
				
			|||||||
                        <RowDefinition/>
 | 
					                        <RowDefinition/>
 | 
				
			||||||
                        <RowDefinition/>
 | 
					                        <RowDefinition/>
 | 
				
			||||||
                    </Grid.RowDefinitions>
 | 
					                    </Grid.RowDefinitions>
 | 
				
			||||||
                    <controls:CalculatorButton x:Name="SquareRootButton"
 | 
					
 | 
				
			||||||
                                               x:Uid="squareRootButton"
 | 
					                    <controls:CalculatorButton x:Name="XPower3Button"
 | 
				
			||||||
                                               Style="{StaticResource EmphasizedCalcButtonStyle}"
 | 
					                                               x:Uid="xpower3Button"
 | 
				
			||||||
                                               AutomationProperties.AutomationId="squareRootButton"
 | 
					                                               Style="{StaticResource SymbolOperatorButtonStyle}"
 | 
				
			||||||
                                               ButtonId="Sqrt"
 | 
					                                               AutomationProperties.AutomationId="xpower3Button"
 | 
				
			||||||
 | 
					                                               ButtonId="Cube"
 | 
				
			||||||
                                               Click="ShiftButton_Uncheck"
 | 
					                                               Click="ShiftButton_Uncheck"
 | 
				
			||||||
                                               Content=""
 | 
					                                               Content=""
 | 
				
			||||||
                                               IsTabStop="false"/>
 | 
					                                               IsTabStop="false"/>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    <controls:CalculatorButton x:Name="CubeRootButton"
 | 
					                    <controls:CalculatorButton x:Name="CubeRootButton"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -83,6 +83,7 @@ namespace CalculatorUITestFramework
 | 
				
			|||||||
        public WindowsElement DegreesButton => this.session.TryFindElementByAccessibilityId("degreesButton");
 | 
					        public WindowsElement DegreesButton => this.session.TryFindElementByAccessibilityId("degreesButton");
 | 
				
			||||||
        public WindowsElement FixedToExponentialButton => this.session.TryFindElementByAccessibilityId("ftoeButton");
 | 
					        public WindowsElement FixedToExponentialButton => this.session.TryFindElementByAccessibilityId("ftoeButton");
 | 
				
			||||||
        public WindowsElement NegateButton => this.session.TryFindElementByAccessibilityId("negateButton");
 | 
					        public WindowsElement NegateButton => this.session.TryFindElementByAccessibilityId("negateButton");
 | 
				
			||||||
 | 
					        public WindowsElement ShiftButton => this.session.TryFindElementByAccessibilityId("shiftButton");
 | 
				
			||||||
        public WindowsElement TrigFlyout => this.session.TryFindElementByAccessibilityId("Trigflyout");
 | 
					        public WindowsElement TrigFlyout => this.session.TryFindElementByAccessibilityId("Trigflyout");
 | 
				
			||||||
        public WindowsElement LightDismiss => this.session.TryFindElementByAccessibilityId("Light Dismiss");
 | 
					        public WindowsElement LightDismiss => this.session.TryFindElementByAccessibilityId("Light Dismiss");
 | 
				
			||||||
        private WindowsElement DegRadGradButton => GetAngleOperatorButton();
 | 
					        private WindowsElement DegRadGradButton => GetAngleOperatorButton();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -69,6 +69,7 @@ namespace CalculatorUITests
 | 
				
			|||||||
        public void SmokeTest_Cube()
 | 
					        public void SmokeTest_Cube()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            page.StandardOperators.NumberPad.Input(3);
 | 
					            page.StandardOperators.NumberPad.Input(3);
 | 
				
			||||||
 | 
					            page.ScientificOperators.ShiftButton.Click();
 | 
				
			||||||
            page.ScientificOperators.XPower3Button.Click();
 | 
					            page.ScientificOperators.XPower3Button.Click();
 | 
				
			||||||
            page.StandardOperators.EqualButton.Click();
 | 
					            page.StandardOperators.EqualButton.Click();
 | 
				
			||||||
            Assert.AreEqual("27", page.CalculatorResults.GetCalculatorResultText());
 | 
					            Assert.AreEqual("27", page.CalculatorResults.GetCalculatorResultText());
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user