Skip to content

Commit

Permalink
Speed up integration tests.
Browse files Browse the repository at this point in the history
Don't change combo boxes that are already set to the correct value.
  • Loading branch information
grokys committed Feb 4, 2023
1 parent 2951b80 commit f417491
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
21 changes: 15 additions & 6 deletions tests/Avalonia.IntegrationTests.Appium/WindowTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,23 @@ private IDisposable OpenWindow(
if (size.HasValue)
sizeTextBox.SendKeys($"{size.Value.Width}, {size.Value.Height}");

modeComboBox.Click();
_session.FindElementByName(mode.ToString()).SendClick();
if (modeComboBox.GetComboBoxValue() != mode.ToString())
{
modeComboBox.Click();
_session.FindElementByName(mode.ToString()).SendClick();
}

locationComboBox.Click();
_session.FindElementByName(location.ToString()).SendClick();
if (locationComboBox.GetComboBoxValue() != location.ToString())
{
locationComboBox.Click();
_session.FindElementByName(location.ToString()).SendClick();
}

stateComboBox.Click();
_session.FindElementByAccessibilityId($"ShowWindowState{state}").SendClick();
if (stateComboBox.GetComboBoxValue() != state.ToString())
{
stateComboBox.Click();
_session.FindElementByAccessibilityId($"ShowWindowState{state}").SendClick();
}

if (canResizeCheckBox.GetIsChecked() != canResize)
canResizeCheckBox.Click();
Expand Down
14 changes: 10 additions & 4 deletions tests/Avalonia.IntegrationTests.Appium/WindowTests_MacOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,17 @@ private IDisposable OpenWindow(
if (size.HasValue)
sizeTextBox.SendKeys($"{size.Value.Width}, {size.Value.Height}");

modeComboBox.Click();
_session.FindElementByName(mode.ToString()).SendClick();
if (modeComboBox.GetComboBoxValue() != mode.ToString())
{
modeComboBox.Click();
_session.FindElementByName(mode.ToString()).SendClick();
}

locationComboBox.Click();
_session.FindElementByName(location.ToString()).SendClick();
if (locationComboBox.GetComboBoxValue() != location.ToString())
{
locationComboBox.Click();
_session.FindElementByName(location.ToString()).SendClick();
}

if (canResizeCheckBox.GetIsChecked() != canResize)
canResizeCheckBox.Click();
Expand Down

0 comments on commit f417491

Please sign in to comment.