mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-21 22:03:11 -07:00
Fix GrowWindowToShowInvertButton
This commit is contained in:
parent
8991076343
commit
a3f4a2bb73
1 changed files with 3 additions and 41 deletions
|
@ -143,11 +143,11 @@ namespace CalculatorUITestFramework
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue