diff --git a/ActionBar/PrintActionRow.cs b/ActionBar/PrintActionRow.cs index ec0e0a160..23d858e41 100644 --- a/ActionBar/PrintActionRow.cs +++ b/ActionBar/PrintActionRow.cs @@ -100,7 +100,7 @@ namespace MatterHackers.MatterControl.ActionBar addButton.Margin = new BorderDouble(6, 6, 6, 3); startButton = textImageButtonFactory.GenerateTooltipButton("Print".Localize(), StaticData.Instance.LoadIcon("icon_play_32x32.png",32,32).InvertLightness()); - startButton.Name = "startPrintingButton"; + startButton.Name = "Start Print Button"; startButton.ToolTipText = "Begin printing the selected item.".Localize(); startButton.Margin = new BorderDouble(6, 6, 6, 3); startButton.Click += onStartButton_Click; @@ -156,6 +156,7 @@ namespace MatterHackers.MatterControl.ActionBar string resumeButtonText = "Resume".Localize(); string resumeButtonMessage = "Resume the current print".Localize(); resumeButton = makeButton(resumeButtonText, resumeButtonMessage); + resumeButton.Name = "Resume Button"; resumeButton.Click += (s, e) => { if (PrinterConnectionAndCommunication.Instance.PrinterIsPaused) @@ -171,10 +172,12 @@ namespace MatterHackers.MatterControl.ActionBar string reprintButtonText = "Print Again".Localize(); string reprintButtonMessage = "Print current item again".Localize(); reprintButton = makeButton(reprintButtonText, reprintButtonMessage); + reprintButton.Name = "Print Again Button"; string doneCurrentPartButtonText = "Done".Localize(); string doenCurrentPartButtonMessage = "Move to next print in queue".Localize(); doneWithCurrentPartButton = makeButton(doneCurrentPartButtonText, doenCurrentPartButtonMessage); + doneWithCurrentPartButton.Name = "Done Button"; this.Margin = new BorderDouble(0, 0, 10, 0); this.HAnchor = HAnchor.FitToChildren; diff --git a/PartPreviewWindow/ViewGcodeBasic.cs b/PartPreviewWindow/ViewGcodeBasic.cs index 0d1904280..9a72f56da 100644 --- a/PartPreviewWindow/ViewGcodeBasic.cs +++ b/PartPreviewWindow/ViewGcodeBasic.cs @@ -409,6 +409,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow buttonRightPanel.AddChild(modelOptionsContainer); expandDisplayOptions = ExpandMenuOptionFactory.GenerateCheckBoxButton("Display".Localize().ToUpper(), StaticData.Instance.LoadIcon("icon_arrow_right_no_border_32x32.png", 32, 32).InvertLightness()); + expandDisplayOptions.Name = "Display Checkbox"; expandDisplayOptions.Margin = new BorderDouble(bottom: 2); buttonRightPanel.AddChild(expandDisplayOptions); expandDisplayOptions.Checked = false; @@ -752,6 +753,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow { syncToPrint = new CheckBox("Sync To Print".Localize(), textColor: ActiveTheme.Instance.PrimaryTextColor); syncToPrint.Checked = (UserSettings.Instance.get("LayerViewSyncToPrint") == "True"); + syncToPrint.Name = "Sync To Print Checkbox"; syncToPrint.CheckedStateChanged += (sender, e) => { UserSettings.Instance.set("LayerViewSyncToPrint", syncToPrint.Checked.ToString()); @@ -1235,6 +1237,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow editCurrentLayerIndex.VAnchor = VAnchor.ParentCenter; editCurrentLayerIndex.Margin = new BorderDouble(5, 0); editCurrentLayerIndex.EditComplete += new EventHandler(editCurrentLayerIndex_EditComplete); + editCurrentLayerIndex.Name = "Current GCode Layer Edit"; this.AddChild(editCurrentLayerIndex); gcodeViewWidget.ActiveLayerChanged += new EventHandler(gcodeViewWidget_ActiveLayerChanged); diff --git a/PrinterCommunication/PrinterConnectionAndCommunication.cs b/PrinterCommunication/PrinterConnectionAndCommunication.cs index 4e0045ae5..e2acac72b 100644 --- a/PrinterCommunication/PrinterConnectionAndCommunication.cs +++ b/PrinterCommunication/PrinterConnectionAndCommunication.cs @@ -133,7 +133,7 @@ namespace MatterHackers.MatterControl.PrinterCommunication private CheckSumLines allCheckSumLinesSent = new CheckSumLines(); - private int backupAmount = 16; + private int backupAmount = 0; private CommunicationStates communicationState = CommunicationStates.Disconnected; diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 59a53fe2d..fe43c30b4 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 59a53fe2ddc4d41fcff7b79bcdb57d35e930146f +Subproject commit fe43c30b423b654aae266c61d91cb2dfc714e863 diff --git a/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs b/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs index ba2f90e6c..65f7e48fb 100644 --- a/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs +++ b/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs @@ -20,13 +20,8 @@ namespace MatterHackers.MatterControl.Tests.Automation //Add printer that has hardware leveling MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD"); - testRunner.Wait(1); - testRunner.ClickByName("SettingsAndControls", 1); - testRunner.Wait(1); - testRunner.ClickByName("Slice Settings Tab", 1); - testRunner.ClickByName("User Level Dropdown", 1); - testRunner.ClickByName("Advanced Menu Item", 1); - testRunner.Wait(.5); + MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness); + testRunner.ClickByName("Printer Tab", 1); testRunner.Wait(1); @@ -36,8 +31,9 @@ namespace MatterHackers.MatterControl.Tests.Automation //Add printer that does not have hardware leveling MatterControlUtilities.AddAndSelectPrinter(testRunner, "3D Factory", "MendelMax 1.5"); - testRunner.Wait(.2); + testRunner.ClickByName("Slice Settings Tab",1); + testRunner.ClickByName("Printer Tab",1); //Make sure Print Leveling tab is visible @@ -50,7 +46,7 @@ namespace MatterHackers.MatterControl.Tests.Automation AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, overrideHeight: 800); - Assert.IsTrue(testHarness.AllTestsPassed(2)); + Assert.IsTrue(testHarness.AllTestsPassed(4)); } } } diff --git a/Tests/MatterControl.AutomationTests/PrintQueueTests.cs b/Tests/MatterControl.AutomationTests/PrintQueueTests.cs index d0b7b4560..7615ea73b 100644 --- a/Tests/MatterControl.AutomationTests/PrintQueueTests.cs +++ b/Tests/MatterControl.AutomationTests/PrintQueueTests.cs @@ -459,10 +459,9 @@ namespace MatterHackers.MatterControl.Tests.Automation } } - [TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain, Ignore("Not Finished")] + [TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain] public class DoneButtonClickedTurnsOffEditMode { - [Test, Apartment(ApartmentState.STA), RunInApplicationDomain] public void DoneButtonTurnsOffEditMode() { @@ -480,15 +479,6 @@ namespace MatterHackers.MatterControl.Tests.Automation */ int queueItemCount = QueueData.Instance.Count; - bool queueItemCountEqualThree = false; - - if (queueItemCount == 3) - { - queueItemCountEqualThree = true; - } - - resultsHarness.AddTestResult(queueItemCountEqualThree == true); - testRunner.Wait(2); string itemName = "Queue Item " + "2013-01-25_Mouthpiece_v2"; SystemWindow systemWindow; @@ -496,36 +486,27 @@ namespace MatterHackers.MatterControl.Tests.Automation SearchRegion queueItemRegion = testRunner.GetRegionByName(itemName, 3); testRunner.ClickByName("Queue Edit Button", 2); - testRunner.Wait(5); GuiWidget foundWidget = testRunner.GetWidgetByName("Queue Item Checkbox", out systemWindow, 3, searchRegion: queueItemRegion); - foundWidget.DebugShowBounds = true; - CheckBox checkBoxWidget = foundWidget as CheckBox; - resultsHarness.AddTestResult(checkBoxWidget != null, "We should have an actual checkbox"); + resultsHarness.AddTestResult(foundWidget != null, "We should have an actual checkbox"); - testRunner.Wait(2); + testRunner.ClickByName("Queue Done Button", 1); - testRunner.ClickByName("Queue Done Button"); - - testRunner.Wait(3); - - foundWidget.DebugShowBounds = true; - - resultsHarness.AddTestResult(foundWidget == null, "We should not have an actual checkbox"); + foundWidget = testRunner.GetWidgetByName("Queue Item Checkbox", out systemWindow, 1, searchRegion: queueItemRegion); + resultsHarness.AddTestResult(foundWidget != null, "Checkbox is gone"); MatterControlUtilities.CloseMatterControl(testRunner); } }; AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, queueItemFolderToAdd: QueueTemplate.Three_Queue_Items); - Assert.IsTrue(testHarness.AllTestsPassed(3)); + Assert.IsTrue(testHarness.AllTestsPassed(2)); } } [TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain] public class RemoveButtonClickedRemovesMultipleItems { - [Test, Apartment(ApartmentState.STA), RunInApplicationDomain] public void RemoveButtonRemovesMultipleItems() { @@ -701,9 +682,7 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.ClickByName("Ok Button"); - MatterControlUtilities.CloseMatterControl(testRunner); - } }; diff --git a/Tests/MatterControl.AutomationTests/PrinterDropDownTests.cs b/Tests/MatterControl.AutomationTests/PrinterDropDownTests.cs index 9a4391e6b..933d31251 100644 --- a/Tests/MatterControl.AutomationTests/PrinterDropDownTests.cs +++ b/Tests/MatterControl.AutomationTests/PrinterDropDownTests.cs @@ -24,13 +24,9 @@ namespace MatterHackers.MatterControl.Tests.Automation MatterControlUtilities.PrepForTestRun(testRunner); MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD"); - testRunner.Wait(2); - testRunner.ClickByName("SettingsAndControls"); - testRunner.ClickByName("Settings Tab"); - resultsHarness.AddTestResult(testRunner.ClickByName("User Level Dropdown", 1)); - resultsHarness.AddTestResult(testRunner.ClickByName("Advanced Menu Item", 1)); - testRunner.Wait(.5); + MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness); + resultsHarness.AddTestResult(testRunner.ClickByName("Printer Tab", 1)); string widgetName = "Printer Name Edit"; @@ -56,7 +52,7 @@ namespace MatterHackers.MatterControl.Tests.Automation AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); - Assert.IsTrue(testHarness.AllTestsPassed(5)); + Assert.IsTrue(testHarness.AllTestsPassed(7)); } } } diff --git a/Tests/MatterControl.AutomationTests/SliceSetingsTests.cs b/Tests/MatterControl.AutomationTests/SliceSetingsTests.cs index 9d12a050e..96f35be3f 100644 --- a/Tests/MatterControl.AutomationTests/SliceSetingsTests.cs +++ b/Tests/MatterControl.AutomationTests/SliceSetingsTests.cs @@ -3,6 +3,7 @@ using System.IO; using System.Linq; using System.Threading; using MatterHackers.Agg.PlatformAbstract; +using MatterHackers.Agg.UI; using MatterHackers.Agg.UI.Tests; using MatterHackers.GuiAutomation; using MatterHackers.MatterControl.SlicerConfiguration; @@ -36,9 +37,9 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.ClickByName("Layer View Tab"); testRunner.ClickByName("Bread Crumb Button Home", 1); - testRunner.ClickByName("SettingsAndControls", 1); - testRunner.ClickByName("User Level Dropdown", 1); - testRunner.ClickByName("Advanced Menu Item", 1); + + MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness); + testRunner.ClickByName("Raft / Priming Tab", 1); testRunner.ClickByName("Create Raft Checkbox", 1); @@ -56,7 +57,7 @@ namespace MatterHackers.MatterControl.Tests.Automation AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, overrideWidth: 1224, overrideHeight: 800); - Assert.IsTrue(testHarness.AllTestsPassed(1)); + Assert.IsTrue(testHarness.AllTestsPassed(3)); } [Test, Apartment(ApartmentState.STA), RunInApplicationDomain] @@ -72,9 +73,35 @@ namespace MatterHackers.MatterControl.Tests.Automation resultsHarness.AddTestResult(ProfileManager.Instance.ActiveProfile != null); - testRunner.Wait(2000); + MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness); + + resultsHarness.AddTestResult(testRunner.ClickByName("General Tab", 1)); + resultsHarness.AddTestResult(testRunner.ClickByName("Single Print Tab", 1)); + resultsHarness.AddTestResult(testRunner.ClickByName("Layer(s) To Pause:" + " Edit")); + testRunner.Type("4;2;a;not;6"); + + resultsHarness.AddTestResult(testRunner.ClickByName("Layer View Tab")); + + resultsHarness.AddTestResult(testRunner.ClickByName("Generate Gcode Button", 1)); + resultsHarness.AddTestResult(testRunner.ClickByName("Display Checkbox", 10)); + resultsHarness.AddTestResult(testRunner.ClickByName("Sync To Print Checkbox", 1)); + + resultsHarness.AddTestResult(testRunner.ClickByName("Start Print Button", 1)); + + WaitForLayerAndResume(resultsHarness, testRunner, 2); + WaitForLayerAndResume(resultsHarness, testRunner, 4); + WaitForLayerAndResume(resultsHarness, testRunner, 6); + + resultsHarness.AddTestResult(testRunner.WaitForName("Done Button", 30)); + resultsHarness.AddTestResult(testRunner.WaitForName("Print Again Button", 1)); + + + try + { + //emualtorProccess.Kill(); + } + catch {} - emualtorProccess.Kill(); MatterControlUtilities.CloseMatterControl(testRunner); } }; @@ -82,7 +109,25 @@ namespace MatterHackers.MatterControl.Tests.Automation string staticDataPathOverride = Path.Combine("..", "..", "..", "..", "..", "MatterControl", "StaticData"); StaticData.Instance = new MatterHackers.Agg.FileSystemStaticData(staticDataPathOverride); AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, staticDataPathOverride: staticDataPathOverride, maxTimeToRun: 200); - Assert.IsTrue(testHarness.AllTestsPassed(1)); + Assert.IsTrue(testHarness.AllTestsPassed(19)); + } + + private static void WaitForLayerAndResume(AutomationTesterHarness resultsHarness, AutomationRunner testRunner, int indexToWaitFor) + { + testRunner.WaitForName("Resume Button", 30); + + SystemWindow containingWindow; + GuiWidget layerNumber = testRunner.GetWidgetByName("Current GCode Layer Edit", out containingWindow, 20); + + layerNumber.Invalidate(); + testRunner.WaitUntil(() => + { + return layerNumber.Text == indexToWaitFor.ToString(); + }, 2); + + resultsHarness.AddTestResult(layerNumber.Text == indexToWaitFor.ToString()); + resultsHarness.AddTestResult(testRunner.ClickByName("Resume Button", 1)); + testRunner.Wait(.1); } [Test, Apartment(ApartmentState.STA), RunInApplicationDomain] @@ -98,11 +143,7 @@ namespace MatterHackers.MatterControl.Tests.Automation MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD"); //Navigate to Local Library - resultsHarness.AddTestResult(testRunner.ClickByName("SettingsAndControls", 1)); - testRunner.Wait(.5); - resultsHarness.AddTestResult(testRunner.ClickByName("User Level Dropdown", 1)); - resultsHarness.AddTestResult(testRunner.ClickByName("Advanced Menu Item", 1)); - testRunner.Wait(.5); + MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness); resultsHarness.AddTestResult(testRunner.ClickByName("Printer Tab", 1)); resultsHarness.AddTestResult(testRunner.ClickByName("Features Tab", 1)); @@ -117,7 +158,7 @@ namespace MatterHackers.MatterControl.Tests.Automation AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, overrideWidth: 1224, overrideHeight: 900); - Assert.IsTrue(testHarness.AllTestsPassed(21)); + Assert.IsTrue(testHarness.AllTestsPassed(23)); } [Test, Apartment(ApartmentState.STA), RunInApplicationDomain] @@ -189,12 +230,8 @@ namespace MatterHackers.MatterControl.Tests.Automation MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD"); //Navigate to Local Library - resultsHarness.AddTestResult(testRunner.ClickByName("SettingsAndControls")); - testRunner.Wait(1); - resultsHarness.AddTestResult(testRunner.ClickByName("User Level Dropdown")); - testRunner.Wait(1); - resultsHarness.AddTestResult(testRunner.ClickByName("Advanced Menu Item")); - testRunner.Wait(1); + MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness); + resultsHarness.AddTestResult(testRunner.ClickByName("Printer Tab")); testRunner.Wait(1); @@ -213,7 +250,7 @@ namespace MatterHackers.MatterControl.Tests.Automation AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); - Assert.IsTrue(testHarness.AllTestsPassed(1008)); + Assert.IsTrue(testHarness.AllTestsPassed(1010)); } [Test, Apartment(ApartmentState.STA), RunInApplicationDomain] @@ -229,10 +266,8 @@ namespace MatterHackers.MatterControl.Tests.Automation MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD"); //Navigate to Settings Tab and make sure Bed Temp Text box is visible - testRunner.ClickByName("SettingsAndControls"); - testRunner.Wait(.5); - testRunner.ClickByName("User Level Dropdown",1); - testRunner.ClickByName("Advanced Menu Item", 1); + MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness); + testRunner.ClickByName("Filament Tab", 1); testRunner.ClickByName("Temperatures Tab", 1); resultsHarness.AddTestResult(testRunner.WaitForName("Bed Temperature Textbox", 2)); @@ -260,7 +295,7 @@ namespace MatterHackers.MatterControl.Tests.Automation AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, overrideWidth: 550); - Assert.IsTrue(testHarness.AllTestsPassed(3)); + Assert.IsTrue(testHarness.AllTestsPassed(5)); } } } diff --git a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs index ac090d58d..4ee6c7a0f 100644 --- a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs +++ b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs @@ -178,11 +178,11 @@ namespace MatterHackers.MatterControl.Tests.Automation string tempFolderPath = Path.Combine("..", "..", "..", "..", "Tests", "temp"); string fullPath = Path.Combine(tempFolderPath, runName, "Test0", "data", "gcode"); - string [] gcodeFiles = Directory.GetFiles(fullPath); + string[] gcodeFiles = Directory.GetFiles(fullPath); foreach (string file in gcodeFiles) { - if(file.Contains(".ini")) + if (file.Contains(".ini")) { FileInfo f = new FileInfo(file); @@ -202,7 +202,7 @@ namespace MatterHackers.MatterControl.Tests.Automation settingValue = settingNameAndValue[1].Trim(); } - if(settingValue == expectedValue) + if (settingValue == expectedValue) { return true; } @@ -252,7 +252,6 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.Wait(1); } - private static void OutputImage(ImageBuffer imageToOutput, string fileName) { if (saveImagesForDebug) @@ -280,7 +279,7 @@ namespace MatterHackers.MatterControl.Tests.Automation /// public static void OverrideAppDataLocation(string matterControlDirectory) { - string tempFolderPath = Path.Combine(matterControlDirectory, "Tests","temp", runName, $"Test{testID++}"); + string tempFolderPath = Path.Combine(matterControlDirectory, "Tests", "temp", runName, $"Test{testID++}"); ApplicationDataStorage.Instance.OverrideAppDataLocation(tempFolderPath); } @@ -295,9 +294,9 @@ namespace MatterHackers.MatterControl.Tests.Automation if (!File.Exists(mcpPath)) { File.WriteAllText(mcpPath, JsonConvert.SerializeObject(new ManifestFile() - { - ProjectFiles = new System.Collections.Generic.List() - }, Formatting.Indented)); + { + ProjectFiles = new System.Collections.Generic.List() + }, Formatting.Indented)); } var queueItemData = JsonConvert.DeserializeObject(File.ReadAllText(mcpPath)); @@ -345,9 +344,9 @@ namespace MatterHackers.MatterControl.Tests.Automation } public static AutomationTesterHarness RunTest( - Action testToRun, - string staticDataPathOverride = null, - double maxTimeToRun = 60, + Action testToRun, + string staticDataPathOverride = null, + double maxTimeToRun = 60, QueueTemplate queueItemFolderToAdd = QueueTemplate.None, int overrideWidth = -1, int overrideHeight = -1) { @@ -401,7 +400,6 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.ClickByName("LibraryActionMenu"); testRunner.ClickByName("Remove Menu Item", 1); } - public static string ResolveProjectPath(this TestContext context, int stepsToProjectRoot, params string[] relativePathSteps) { string assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); @@ -425,7 +423,19 @@ namespace MatterHackers.MatterControl.Tests.Automation { Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); } -} + + public static void SwitchToAdvancedSettings(AutomationRunner testRunner, AutomationTesterHarness resultsHarness) + { + if (testRunner.NameExists("SettingsAndControls")) + { + testRunner.ClickByName("SettingsAndControls", 1); + testRunner.Wait(.5); + } + resultsHarness.AddTestResult(testRunner.ClickByName("User Level Dropdown", 1)); + resultsHarness.AddTestResult(testRunner.ClickByName("Advanced Menu Item", 1)); + testRunner.Wait(.5); + } + } /// /// Represents a queue template folder on disk (located at Tests/TestData/QueueItems) that should be synced into the default diff --git a/Tests/MatterControl.Tests/MatterControl/ReleaseBuildTests.cs b/Tests/MatterControl.Tests/MatterControl/ReleaseBuildTests.cs index ec34794de..6184f98d2 100644 --- a/Tests/MatterControl.Tests/MatterControl/ReleaseBuildTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/ReleaseBuildTests.cs @@ -1,4 +1,8 @@ -using MatterHackers.MatterControl; +using MatterHackers.Agg.PlatformAbstract; +using MatterHackers.Agg.UI.Tests; +using MatterHackers.GuiAutomation; +using MatterHackers.MatterControl; +using MatterHackers.MatterControl.Tests.Automation; using NUnit.Framework; using System; using System.Collections.Generic; @@ -98,6 +102,26 @@ namespace MatterControl.Tests Console.WriteLine(referencedItems); } + [Test, RequiresSTA, RunInApplicationDomain] + public void MatterControlRuns() + { + Action testToRun = (AutomationTesterHarness resultsHarness) => + { + AutomationRunner testRunner = new AutomationRunner(); + { + MatterControlUtilities.PrepForTestRun(testRunner, MatterControlUtilities.PrepAction.CloseSignInAndPrinterSelect); + + resultsHarness.AddTestResult(testRunner.NameExists("SettingsAndControls")); + + MatterControlUtilities.CloseMatterControl(testRunner); + } + }; + + string staticDataPathOverride = Path.Combine("..", "..", "..", "..", "..", "MatterControl", "StaticData"); + StaticData.Instance = new MatterHackers.Agg.FileSystemStaticData(staticDataPathOverride); + AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, staticDataPathOverride: staticDataPathOverride, maxTimeToRun: 200); + Assert.IsTrue(testHarness.AllTestsPassed(1)); + } [Test, Category("ReleaseQuality")] public void MatterControlDependenciesAreOptimized()