diff --git a/src/CalculatorUITestFramework/StandardAoTCalculatorPage.cs b/src/CalculatorUITestFramework/StandardAoTCalculatorPage.cs index dea1e021..066d32d8 100644 --- a/src/CalculatorUITestFramework/StandardAoTCalculatorPage.cs +++ b/src/CalculatorUITestFramework/StandardAoTCalculatorPage.cs @@ -143,11 +143,11 @@ namespace CalculatorUITestFramework } /// - /// Increases the size of the window until History label for the History panel is visible + /// Increases the height of the window until invert button is visible /// private void GrowWindowToShowInvertButton(int height) { - if (height > 1000) + if (height > 700) { throw new NotFoundException("Could not find the Invert Button"); } @@ -158,45 +158,7 @@ namespace CalculatorUITestFramework WinAppDriver.Instance.CalculatorSession.Manage().Window.Size = new Size(width, height); //give window time to render new size System.Threading.Thread.Sleep(10); - GrowWindowToShowInvertButton(width + 100); - } - } - /// - /// If the Invert button is not displayed, resize the window - /// Two attempts are made, the the button is not found a "not found" exception is thrown - /// - public void ResizeAoTWindowToDiplayInvertButton() - { - Point newWindowPostion = new Point(8, 8); - WinAppDriver.Instance.CalculatorSession.Manage().Window.Position = newWindowPostion; - string source0 = this.session.PageSource; - if (source0.Contains("invertButton")) - { - return; - } - else - { - Size newWindowSize = new Size(502, 502); - WinAppDriver.Instance.CalculatorSession.Manage().Window.Size = newWindowSize; - string source1 = this.session.PageSource; - if (source1.Contains("invertButton")) - { - return; - } - else - { - Size newWindowSize2 = new Size(750, 750); - WinAppDriver.Instance.CalculatorSession.Manage().Window.Size = newWindowSize2; - } - string source2 = this.session.PageSource; - if (source2.Contains("invertButton")) - { - return; - } - else - { - throw new NotFoundException("Could not find the Invert Button"); - } + GrowWindowToShowInvertButton(height + 100); } } }