Move CloseMatterControl responsiblity outside of TestMethod

- Behavior is now invoked in parent RunTest call
This commit is contained in:
John Lewin 2016-10-19 12:06:31 -07:00
parent 28699c9197
commit 4d3f5d2521
15 changed files with 6 additions and 128 deletions

View file

@ -99,7 +99,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
return TestContext.CurrentContext.ResolveProjectPath(4, "Tests", "TestData", "QueueItems", queueItemToLoad);
}
public static void CloseMatterControl(AutomationRunner testRunner)
private static void CloseMatterControlViaMenu(AutomationRunner testRunner)
{
SystemWindow mcWindowLocal = MatterControlApplication.Instance;
testRunner.ClickByName("File Menu", 5);
@ -383,7 +383,11 @@ namespace MatterHackers.MatterControl.Tests.Automation
}
MatterControlApplication matterControlWindow = MatterControlApplication.CreateInstance(overrideWidth, overrideHeight);
return AutomationRunner.ShowWindowAndExecuteTests(matterControlWindow, testMethod, maxTimeToRun, defaultTestImages);
var testRunner = AutomationRunner.ShowWindowAndExecuteTests(matterControlWindow, testMethod, maxTimeToRun, defaultTestImages);
MatterControlUtilities.CloseMatterControlViaMenu(testRunner);
return testRunner;
}
public static void LibraryAddSelectionToQueue(AutomationRunner testRunner)

View file

@ -115,8 +115,6 @@ namespace MatterControl.Tests
testRunner.AddTestResult(testRunner.NameExists("SettingsAndControls"));
MatterControlUtilities.SwitchToAdvancedSettings(testRunner);
MatterControlUtilities.CloseMatterControl(testRunner);
};
AutomationRunner testHarness = MatterControlUtilities.RunTest(testToRun, maxTimeToRun: 200);