diff --git a/ActionBar/PrinterActionRow.cs b/ActionBar/PrinterActionRow.cs index 66931c26e..ee2e100c8 100644 --- a/ActionBar/PrinterActionRow.cs +++ b/ActionBar/PrinterActionRow.cs @@ -138,7 +138,7 @@ namespace MatterHackers.MatterControl.ActionBar Cursor = Cursors.Hand, Margin = new BorderDouble(0, 6, rightMarginForWideScreenMode, 3) }; - printerSelector.AddPrinter += (s, e) => WizardWindow.ShowPrinterSetup(); + printerSelector.AddPrinter += (s, e) => WizardWindow.ShowPrinterSetup(true); // make sure the control can get smaller but maintains its height printerSelector.MinimumSize = new Vector2(0, connectPrinterButton.MinimumSize.y); printerSelectorAndEditButton.AddChild(printerSelector); diff --git a/ActionBar/PrinterSelector.cs b/ActionBar/PrinterSelector.cs index 2cd456ee7..4f2893173 100644 --- a/ActionBar/PrinterSelector.cs +++ b/ActionBar/PrinterSelector.cs @@ -53,6 +53,8 @@ namespace MatterHackers.MatterControl { Rebuild(); + this.Name = "Printers... Menu"; + this.SelectionChanged += (s, e) => { string printerID = this.SelectedValue; diff --git a/ApplicationView/MainApplicationWidget.cs b/ApplicationView/MainApplicationWidget.cs index cc94d88f6..8820fe053 100644 --- a/ApplicationView/MainApplicationWidget.cs +++ b/ApplicationView/MainApplicationWidget.cs @@ -478,14 +478,15 @@ namespace MatterHackers.MatterControl UiThread.RunOnIdle(() => WizardWindow.ShowPrinterSetup()); } else - { //If user in logged in sync before checking to prompt to create printer + { + //If user in logged in sync before checking to prompt to create printer ApplicationController.SyncPrinterProfiles().ContinueWith((task) => { ApplicationController.Instance.ReloadAdvancedControlsPanel(); if (!ProfileManager.Instance.ActiveProfiles.Any()) { - // Start the setup wizard if no profiles exist - UiThread.RunOnIdle(() => WizardWindow.ShowPrinterSetup()); + // Start the setup wizard if no profiles exist + UiThread.RunOnIdle(() => WizardWindow.ShowPrinterSetup()); } }); } diff --git a/ApplicationView/MenuRow/MenuOptionFile.cs b/ApplicationView/MenuRow/MenuOptionFile.cs index de05c7b1d..744093c80 100644 --- a/ApplicationView/MenuRow/MenuOptionFile.cs +++ b/ApplicationView/MenuRow/MenuOptionFile.cs @@ -34,7 +34,7 @@ namespace MatterHackers.MatterControl { return new List { - new MenuItemAction("Add Printer".Localize(), () => WizardWindow.ShowPrinterSetup()), + new MenuItemAction("Add Printer".Localize(), () => WizardWindow.ShowPrinterSetup(true)), new MenuItemAction("Add File To Queue".Localize(), importFile_Click), new MenuItemAction("Redeem Design Code".Localize(), () => RedeemDesignCode?.Invoke(this, null)), new MenuItemAction("Enter Share Code".Localize(), () => EnterShareCode?.Invoke(this, null)), diff --git a/PrinterControls/PrinterConnections/ShowAuthPanel.cs b/PrinterControls/PrinterConnections/ShowAuthPanel.cs index fdff54c7e..4219da26f 100644 --- a/PrinterControls/PrinterConnections/ShowAuthPanel.cs +++ b/PrinterControls/PrinterConnections/ShowAuthPanel.cs @@ -56,9 +56,9 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections "Remote Monitoring".Localize(), "Check on your prints from anywhere. With cloud monitoring, you have access to your printer no matter where you go.".Localize()); - var nextButton = textImageButtonFactory.Generate("Skip".Localize()); - nextButton.Name = "Connection Wizard Skip Sign In Button"; - nextButton.Click += (sender, e) => + var skipButton = textImageButtonFactory.Generate("Skip".Localize()); + skipButton.Name = "Connection Wizard Skip Sign In Button"; + skipButton.Click += (sender, e) => { if (!ProfileManager.Instance.ActiveProfiles.Any()) { @@ -86,7 +86,7 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections UiThread.RunOnIdle(WizardWindow.Close); }; - footerRow.AddChild(nextButton); + footerRow.AddChild(skipButton); footerRow.AddChild(new HorizontalSpacer()); footerRow.AddChild(createAccountButton); footerRow.AddChild(signInButton); diff --git a/SetupWizard/SyncingPrintersPage.cs b/SetupWizard/SyncingPrintersPage.cs index 8da85c775..5a76bd447 100644 --- a/SetupWizard/SyncingPrintersPage.cs +++ b/SetupWizard/SyncingPrintersPage.cs @@ -12,7 +12,6 @@ namespace MatterHackers.MatterControl.SetupWizard { public class SyncingPrintersPage: WizardPage { - public SyncingPrintersPage() { TextWidget syncingText = new TextWidget("Syncing Profiles...".Localize(),textColor: ActiveTheme.Instance.PrimaryTextColor); diff --git a/SetupWizard/WizardWindow.cs b/SetupWizard/WizardWindow.cs index aa1e7daaa..58748f606 100644 --- a/SetupWizard/WizardWindow.cs +++ b/SetupWizard/WizardWindow.cs @@ -56,7 +56,7 @@ namespace MatterHackers.MatterControl wizardWindow.ChangeToPage(wizardPage); } - public static void ShowPrinterSetup() + public static void ShowPrinterSetup(bool userRequestedNewPrinter = false) { WizardWindow wizardWindow = GetWindow("PrinterSetup"); wizardWindow.Title = "Setup Wizard".Localize(); @@ -70,7 +70,7 @@ namespace MatterHackers.MatterControl } else { - wizardWindow.ChangeToSetupPrinterForm(); + wizardWindow.ChangeToSetupPrinterForm(userRequestedNewPrinter); } } @@ -117,10 +117,11 @@ namespace MatterHackers.MatterControl base.OnClosed(e); } - public void ChangeToSetupPrinterForm() + public void ChangeToSetupPrinterForm(bool userRequestedNewPrinter = false) { bool showAuthPanel = ShouldShowAuthPanel?.Invoke() ?? false; - if (showAuthPanel) + if (showAuthPanel + && !userRequestedNewPrinter) { ChangeToPage(); } diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 91012f74f..0690f3c3d 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 91012f74f49c4c80f9889cf98f038bff892f09ff +Subproject commit 0690f3c3de22f17f3a504dfb63ccd3b779e8e60d diff --git a/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs b/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs index 4eab0cfc3..f7e17e02e 100644 --- a/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs +++ b/Tests/MatterControl.AutomationTests/ExportItemWindowTests.cs @@ -21,7 +21,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { MatterControlUtilities.PrepForTestRun(testRunner); - MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD", true); + MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD"); string firstItemName = "Row Item Batman"; //Navigate to Downloads Library Provider diff --git a/Tests/MatterControl.AutomationTests/FileMenuTest.cs b/Tests/MatterControl.AutomationTests/FileMenuTest.cs index a2889945f..f12b8521b 100644 --- a/Tests/MatterControl.AutomationTests/FileMenuTest.cs +++ b/Tests/MatterControl.AutomationTests/FileMenuTest.cs @@ -23,9 +23,9 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.Wait(1); testRunner.ClickByName("Add Printer Menu Item"); testRunner.Wait(1); - resultsHarness.AddTestResult(testRunner.WaitForName("Printer Connection Window", 3)); + resultsHarness.AddTestResult(testRunner.WaitForName("Select Make", 3)); - testRunner.ClickByName("Setup Connection Cancel Button"); + testRunner.ClickByName("Cancel Wizard Button"); MatterControlUtilities.CloseMatterControl(testRunner); } diff --git a/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs b/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs index 9d1e4170a..4668b434c 100644 --- a/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs +++ b/Tests/MatterControl.AutomationTests/HardwareLevelingUITests.cs @@ -18,18 +18,15 @@ namespace MatterHackers.MatterControl.Tests.Automation { MatterControlUtilities.PrepForTestRun(testRunner); //Add printer that has hardware leveling - MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD", true); + MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD"); testRunner.Wait(1); - testRunner.ClickByName("SettingsAndControls"); + testRunner.ClickByName("SettingsAndControls", 1); testRunner.Wait(1); - testRunner.ClickByName("Slice Settings Tab"); - testRunner.Wait(1); - testRunner.ClickByName("User Level Dropdown"); - testRunner.Wait(1); - testRunner.ClickByName("Advanced Menu Item"); - testRunner.Wait(1); - testRunner.ClickByName("Printer Tab"); + testRunner.ClickByName("Slice Settings Tab", 1); + testRunner.ClickByName("User Level Dropdown", 1); + testRunner.ClickByName("Advanced Menu Item", 1); + testRunner.ClickByName("Printer Tab", 1); testRunner.Wait(1); //Make sure Print Leveling tab is not visible @@ -37,10 +34,10 @@ namespace MatterHackers.MatterControl.Tests.Automation resultsHarness.AddTestResult(testPrintLeveling == false); //Add printer that does not have hardware leveling - MatterControlUtilities.SelectAndAddPrinter(testRunner, "Deezmaker", "Bukito", false); - testRunner.ClickByName("Slice Settings Tab"); - testRunner.Wait(1); - testRunner.ClickByName("Printer Tab"); + MatterControlUtilities.SelectAndAddPrinter(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 bool printLevelingVisible = testRunner.WaitForName("Print Leveling Tab", 2); diff --git a/Tests/MatterControl.AutomationTests/LibraryDownloadsTest.cs b/Tests/MatterControl.AutomationTests/LibraryDownloadsTest.cs index 3cb1297be..5cce2681c 100644 --- a/Tests/MatterControl.AutomationTests/LibraryDownloadsTest.cs +++ b/Tests/MatterControl.AutomationTests/LibraryDownloadsTest.cs @@ -197,10 +197,10 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.Type("{Enter}"); //Rename added item - testRunner.ClickByName("Library Edit Button", 2); + testRunner.ClickByName("Library Edit Button", .5); testRunner.ClickByName("Row Item Batman"); - testRunner.ClickByName("Rename From Library Button", 2); - testRunner.Wait(2); + MatterControlUtilities.LibraryRenameSelectedItem(testRunner); + testRunner.Wait(.5); testRunner.Type("Batman Renamed"); testRunner.ClickByName("Rename Button"); resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Batman Renamed", 2) == true); diff --git a/Tests/MatterControl.AutomationTests/LocalLibraryTests.cs b/Tests/MatterControl.AutomationTests/LocalLibraryTests.cs index 8dddda1d3..4d894f6ef 100644 --- a/Tests/MatterControl.AutomationTests/LocalLibraryTests.cs +++ b/Tests/MatterControl.AutomationTests/LocalLibraryTests.cs @@ -236,7 +236,7 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.ClickByName("Library Edit Button"); testRunner.Wait(1); testRunner.ClickByName(rowItemToRename); - testRunner.ClickByName("Rename From Library Button"); + MatterControlUtilities.LibraryRenameSelectedItem(testRunner); testRunner.Wait(2); @@ -294,8 +294,8 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.ClickByName("Library Edit Button"); testRunner.ClickByName("New Folder Row Item Collection"); - testRunner.ClickByName("Rename From Library Button"); - testRunner.Wait(1); + MatterControlUtilities.LibraryRenameSelectedItem(testRunner); + testRunner.Wait(.5); testRunner.Type("Renamed Library Folder"); testRunner.ClickByName("Rename Button"); @@ -338,7 +338,6 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.ClickByName(rowItem); MatterControlUtilities.LibraryEditSelectedItem(testRunner); - testRunner.ClickByName("Library Edit Item Button"); //Make sure that Export Item Window exists after Export button is clicked bool exportItemWindowExists = testRunner.WaitForName("Part Preview Window", 2); @@ -378,7 +377,7 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.Wait(1); testRunner.ClickByName(rowItem); - testRunner.ClickByName("Library Remove Item Button"); + MatterControlUtilities.LibraryRemoveSelectedItem(testRunner); testRunner.Wait(1); diff --git a/Tests/MatterControl.AutomationTests/PartPreviewTests.cs b/Tests/MatterControl.AutomationTests/PartPreviewTests.cs index 64aa37d41..176dd4224 100644 --- a/Tests/MatterControl.AutomationTests/PartPreviewTests.cs +++ b/Tests/MatterControl.AutomationTests/PartPreviewTests.cs @@ -58,7 +58,7 @@ namespace MatterHackers.MatterControl.Tests.Automation int partCountAfterSecondCopy = view3D.MeshGroups.Count(); resultsHarness.AddTestResult(partCountAfterSecondCopy == 3); view3D.CloseOnIdle(); - System.Threading.Thread.Sleep(500); + testRunner.Wait(.5); MatterControlUtilities.CloseMatterControl(testRunner); @@ -88,7 +88,7 @@ namespace MatterHackers.MatterControl.Tests.Automation MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); testRunner.Wait(1); testRunner.ClickByName("Row Item Calibration - Box"); - testRunner.ClickByName("Row Item Calibration - Box Print Button"); + MatterControlUtilities.LibraryEditSelectedItem(testRunner); testRunner.Wait(1); //Get View3DWidget and count MeshGroups before Copy button is clicked @@ -152,7 +152,7 @@ namespace MatterHackers.MatterControl.Tests.Automation MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); testRunner.Wait(1); testRunner.ClickByName("Row Item Calibration - Box"); - testRunner.ClickByName("Row Item Calibration - Box Print Button"); + MatterControlUtilities.LibraryEditSelectedItem(testRunner); testRunner.Wait(1); //Get View3DWidget and count MeshGroups before Copy button is clicked @@ -194,7 +194,7 @@ namespace MatterHackers.MatterControl.Tests.Automation Assert.IsTrue(testHarness.TestCount == 3); // make sure we ran all our tests } - [Test, RequiresSTA, RunInApplicationDomain] + [Test, RequiresSTA, RunInApplicationDomain, Ignore("Not Finished")] public void UndoRedoCopy() { // Run a copy of MatterControl @@ -211,7 +211,7 @@ namespace MatterHackers.MatterControl.Tests.Automation MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); testRunner.Wait(1); testRunner.ClickByName("Row Item Calibration - Box"); - testRunner.ClickByName("Row Item Calibration - Box Print Button"); + MatterControlUtilities.LibraryEditSelectedItem(testRunner); testRunner.Wait(1); //Get View3DWidget and count MeshGroups before Copy button is clicked @@ -284,10 +284,8 @@ namespace MatterHackers.MatterControl.Tests.Automation //Navigate to Local Library testRunner.ClickByName("Library Tab"); MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); - testRunner.Wait(1); - testRunner.ClickByName("Row Item Calibration - Box"); - testRunner.ClickByName("Row Item Calibration - Box Print Button"); - testRunner.Wait(1); + testRunner.ClickByName("Row Item Calibration - Box", 1); + MatterControlUtilities.LibraryEditSelectedItem(testRunner); //Get View3DWidget and count MeshGroups before Copy button is clicked GuiWidget partPreview = testRunner.GetWidgetByName("View3DWidget", out systemWindow, 3); @@ -296,36 +294,42 @@ namespace MatterHackers.MatterControl.Tests.Automation string copyButtonName = "3D View Copy"; //Click Edit button to make edit controls visible - testRunner.ClickByName("3D View Edit"); - testRunner.Wait(1); + testRunner.ClickByName("3D View Edit", 1); int partCountBeforeCopy = view3D.MeshGroups.Count(); resultsHarness.AddTestResult(partCountBeforeCopy == 1); for (int i = 0; i <= 4; i++) { - testRunner.ClickByName(copyButtonName); - testRunner.Wait(1); + testRunner.ClickByName(copyButtonName, 1); + testRunner.Wait(.2); + int meshCount = view3D.MeshGroups.Count(); + resultsHarness.AddTestResult(meshCount == partCountBeforeCopy + i + 1); } - testRunner.Wait(1); - int meshCountAfterCopy = view3D.MeshGroups.Count(); - testRunner.ClickByName("3D View Remove"); - System.Threading.Thread.Sleep(2000); + resultsHarness.AddTestResult(meshCountAfterCopy == 6); + testRunner.ClickByName("3D View Remove", 1); + testRunner.Wait(.1); int meshCountAfterRemove = view3D.MeshGroups.Count(); resultsHarness.AddTestResult(meshCountAfterRemove == 5); + // TODO: undo redo have been removed until 2.0 + if (false) + { + testRunner.ClickByName("3D View Undo"); + System.Threading.Thread.Sleep(2000); + int meshCountAfterUndo = view3D.MeshGroups.Count(); + resultsHarness.AddTestResult(meshCountAfterUndo == 6); - testRunner.ClickByName("3D View Undo"); - System.Threading.Thread.Sleep(2000); - int meshCountAfterUndo = view3D.MeshGroups.Count(); - resultsHarness.AddTestResult(meshCountAfterUndo == 6); + testRunner.ClickByName("3D View Redo"); + System.Threading.Thread.Sleep(2000); + int meshCountAfterRedo = view3D.MeshGroups.Count(); + resultsHarness.AddTestResult(meshCountAfterRedo == 5); + } + + partPreview.CloseOnIdle(); + testRunner.Wait(.1); - testRunner.ClickByName("3D View Redo"); - System.Threading.Thread.Sleep(2000); - int meshCountAfterRedo = view3D.MeshGroups.Count(); - resultsHarness.AddTestResult(meshCountAfterRedo == 5); - MatterControlUtilities.CloseMatterControl(testRunner); } }; @@ -333,7 +337,7 @@ namespace MatterHackers.MatterControl.Tests.Automation AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); Assert.IsTrue(testHarness.AllTestsPassed); - Assert.IsTrue(testHarness.TestCount == 4); // make sure we ran all our tests + Assert.IsTrue(testHarness.TestCount == 8); // make sure we ran all our tests } [Test, RequiresSTA, RunInApplicationDomain] @@ -351,20 +355,23 @@ namespace MatterHackers.MatterControl.Tests.Automation MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); testRunner.Wait(1); testRunner.ClickByName("Row Item Calibration - Box"); - testRunner.ClickByName("Row Item Calibration - Box Print Button"); + MatterControlUtilities.LibraryEditSelectedItem(testRunner); testRunner.Wait(1); //Click Edit button to make edit controls visible testRunner.ClickByName("3D View Edit"); testRunner.Wait(1); - + + SystemWindow systemWindow; + GuiWidget partPreview = testRunner.GetWidgetByName("View3DWidget", out systemWindow, 3); + View3DWidget view3D = partPreview as View3DWidget; + for (int i = 0; i <= 2; i++) { testRunner.ClickByName("3D View Copy"); testRunner.Wait(1); } - //Click Save As button to save changes to the part testRunner.ClickByName("Save As Menu"); testRunner.Wait(1); @@ -377,7 +384,10 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.Wait(1); testRunner.ClickByName("Save As Save Button"); - //Make sure there is a new Queue item with a name that matcheds the new opart + view3D.CloseOnIdle(); + testRunner.Wait(.5); + + //Make sure there is a new Queue item with a name that matches the new part testRunner.Wait(1); testRunner.ClickByName("Queue Tab"); testRunner.Wait(1); @@ -392,126 +402,5 @@ namespace MatterHackers.MatterControl.Tests.Automation Assert.IsTrue(testHarness.AllTestsPassed); Assert.IsTrue(testHarness.TestCount == 1); // make sure we ran all our tests } - - [Test, RequiresSTA, RunInApplicationDomain] - public void SaveAsToLocalLibrary() - { - // Run a copy of MatterControl - Action testToRun = (AutomationTesterHarness resultsHarness) => - { - AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages); - { - MatterControlUtilities.PrepForTestRun(testRunner); - - //Navigate to Local Library - testRunner.ClickByName("Library Tab"); - MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); - testRunner.Wait(1); - testRunner.ClickByName("Row Item Calibration - Box"); - testRunner.ClickByName("Row Item Calibration - Box Print Button"); - testRunner.Wait(1); - - //Click Edit button to make edit controls visible - testRunner.ClickByName("3D View Edit"); - testRunner.Wait(1); - - for (int i = 0; i <= 2; i++) - { - testRunner.ClickByName("3D View Copy"); - testRunner.Wait(1); - } - - - //Click Save As button to save changes to the part - testRunner.ClickByName("Save As Menu"); - testRunner.Wait(1); - testRunner.ClickByName("Save As Menu Item"); - testRunner.Wait(1); - - //Type in name of new part and then save to Local Library - testRunner.Type("Save As Local Library"); - MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); - testRunner.Wait(1); - testRunner.ClickByName("Save As Save Button"); - - //Make sure there is a new Local Library item with a name that matcheds the new opart - testRunner.Wait(1); - testRunner.ClickByName("Library Tab"); - testRunner.Wait(10); - resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Save As Local Library", 5)); - - MatterControlUtilities.CloseMatterControl(testRunner); - } - }; - - AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); - - Assert.IsTrue(testHarness.AllTestsPassed); - Assert.IsTrue(testHarness.TestCount == 1); // make sure we ran all our tests - } - - [Test, RequiresSTA, RunInApplicationDomain] - public void SaveAsToDownloads() - { - // Run a copy of MatterControl - Action testToRun = (AutomationTesterHarness resultsHarness) => - { - AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages); - { - MatterControlUtilities.PrepForTestRun(testRunner); - - //Navigate to Downloads - testRunner.ClickByName("Library Tab"); - MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); - testRunner.Wait(1); - testRunner.ClickByName("Row Item Calibration - Box"); - testRunner.ClickByName("Row Item Calibration - Box Print Button"); - testRunner.Wait(1); - - //Click Edit button to make edit controls visible - testRunner.ClickByName("3D View Edit"); - testRunner.Wait(1); - - for (int i = 0; i <= 2; i++) - { - testRunner.ClickByName("3D View Copy"); - testRunner.Wait(1); - } - - - //Click Save As button to save changes to the part - testRunner.ClickByName("Save As Menu"); - testRunner.Wait(1); - testRunner.ClickByName("Save As Menu Item"); - testRunner.Wait(1); - - //Type in name of new part and then save to Downloads - testRunner.Type("Save As Downloads"); - MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection"); - testRunner.Wait(1); - testRunner.ClickByName("Save As Save Button"); - - //Make sure there is a new Downloads item with a name that matches the new opart - testRunner.Wait(1); - testRunner.ClickByName("Library Tab"); - testRunner.ClickByName("Bread Crumb Button Home"); - testRunner.Wait(1); - MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection"); - resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Save As Downloads", 5)); - - //Do clean up for Downloads - testRunner.ClickByName("Row Item Save As Downloads", 2); - testRunner.ClickByName("Library Edit Button"); - testRunner.ClickByName("Library Remove Item Button"); - - MatterControlUtilities.CloseMatterControl(testRunner); - } - }; - - AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); - - Assert.IsTrue(testHarness.AllTestsPassed); - Assert.IsTrue(testHarness.TestCount == 1); // make sure we ran all our tests - } } } diff --git a/Tests/MatterControl.AutomationTests/SliceSetingsTests.cs b/Tests/MatterControl.AutomationTests/SliceSetingsTests.cs index d5d877952..0b71dcc89 100644 --- a/Tests/MatterControl.AutomationTests/SliceSetingsTests.cs +++ b/Tests/MatterControl.AutomationTests/SliceSetingsTests.cs @@ -18,7 +18,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { MatterControlUtilities.PrepForTestRun(testRunner); - MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD", true); + MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD"); //Navigate to Local Library testRunner.ClickByName("Library Tab"); @@ -72,7 +72,7 @@ namespace MatterHackers.MatterControl.Tests.Automation { MatterControlUtilities.PrepForTestRun(testRunner); - MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD", true); + MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD"); //Navigate to Local Library testRunner.ClickByName("SettingsAndControls"); @@ -113,28 +113,26 @@ namespace MatterHackers.MatterControl.Tests.Automation { MatterControlUtilities.PrepForTestRun(testRunner); - MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD", true); + MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD"); //Navigate to Settings Tab and make sure Bed Temp Text box is visible testRunner.ClickByName("SettingsAndControls"); - testRunner.Wait(1); - testRunner.ClickByName("User Level Dropdown"); - testRunner.Wait(1); - testRunner.ClickByName("Advanced Menu Item"); - testRunner.Wait(1); - testRunner.ClickByName("Filament Tab"); - testRunner.Wait(1); + testRunner.Wait(.5); + testRunner.ClickByName("User Level Dropdown",1); + testRunner.ClickByName("Advanced Menu Item", 1); + testRunner.ClickByName("Filament Tab", 1); + testRunner.ClickByName("Temperatures Tab", 1); resultsHarness.AddTestResult(testRunner.WaitForName("Bed Temperature Textbox", 2)); //Uncheck Has Heated Bed checkbox and make sure Bed Temp Textbox is not visible - testRunner.ClickByName("Printer Tab"); - testRunner.Wait(1); - testRunner.ClickByName("Features Tab"); - testRunner.Wait(1); - testRunner.ClickByName("Has Heated Bed Checkbox"); + testRunner.ClickByName("Printer Tab",1); + testRunner.ClickByName("Features Tab", 1); + testRunner.DragByName("Show Reset Connection Checkbox", 1, offset: new Agg.Point2D(-40, 0)); + testRunner.MoveToByName("Show Reset Connection Checkbox", 1, offset: new Agg.Point2D(0, 120)); + testRunner.Drop(); + testRunner.ClickByName("Has Heated Bed Checkbox", 1); testRunner.Wait(.5); - testRunner.ClickByName("Filament Tab"); - testRunner.Wait(1); + testRunner.ClickByName("Filament Tab", 1); bool bedTemperatureTextBoxVisible = testRunner.WaitForName("Bed Temperature Textbox", 2); resultsHarness.AddTestResult(bedTemperatureTextBoxVisible == false); diff --git a/Tests/MatterControl.AutomationTests/SqLiteLibraryProvider.cs b/Tests/MatterControl.AutomationTests/SqLiteLibraryProvider.cs index 2b5dfc17a..487517051 100644 --- a/Tests/MatterControl.AutomationTests/SqLiteLibraryProvider.cs +++ b/Tests/MatterControl.AutomationTests/SqLiteLibraryProvider.cs @@ -1,5 +1,7 @@ -using MatterHackers.Agg.UI.Tests; +using MatterHackers.Agg.UI; +using MatterHackers.Agg.UI.Tests; using MatterHackers.GuiAutomation; +using MatterHackers.MatterControl.PartPreviewWindow; using NUnit.Framework; using System; @@ -21,6 +23,14 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.ClickByName("Library Tab", 5); MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); + testRunner.Wait(1); + testRunner.ClickByName("Row Item Calibration - Box"); + testRunner.ClickByName("Row Item Calibration - Box View Button"); + testRunner.Wait(1); + + SystemWindow systemWindow; + GuiWidget partPreview = testRunner.GetWidgetByName("View3DWidget", out systemWindow, 3); + View3DWidget view3D = partPreview as View3DWidget; resultsHarness.AddTestResult(testRunner.ClickByName("3D View Edit", 3)); @@ -33,13 +43,18 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.Wait(1); - testRunner.Type("Test Part"); + testRunner.Type("0Test Part"); resultsHarness.AddTestResult(MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection")); resultsHarness.AddTestResult(testRunner.ClickByName("Save As Save Button", 1)); + view3D.CloseOnIdle(); + testRunner.Wait(.5); + // ensure that it is now in the library folder (that the folder updated) - resultsHarness.AddTestResult(testRunner.WaitForName("Row Item " + "Test Part", 5), "The part we added should be in the library"); + resultsHarness.AddTestResult(testRunner.WaitForName("Row Item " + "0Test Part", 5), "The part we added should be in the library"); + + testRunner.Wait(.5); MatterControlUtilities.CloseMatterControl(testRunner); } diff --git a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs index 698d6083e..41e9a6723 100644 --- a/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs +++ b/Tests/MatterControl.Tests/MatterControl/MatterControlUtilities.cs @@ -167,42 +167,29 @@ namespace MatterHackers.MatterControl.Tests.Automation return false; } - public static void SelectAndAddPrinter(AutomationRunner testRunner, string make, string model, bool firstAdd) + public static void SelectAndAddPrinter(AutomationRunner testRunner, string make, string model) { - string manufacturer = make + " Menu Item"; string printer = model + " Menu Item"; string printerProfile = String.Format("{0} {1} Profile", make, model); + testRunner.ClickByName("Printers... Menu", 2); - testRunner.ClickByName("Select a Printer Button"); - testRunner.Wait(1); + testRunner.ClickByName("Add New Printer... Menu Item", 2); - if (!firstAdd) - { - testRunner.ClickByName("Add new printer button"); - testRunner.Wait(1); - } + testRunner.ClickByName("Connection Wizard Skip Sign In Button", 2); - testRunner.ClickByName("Select Make"); - testRunner.Wait(1); + testRunner.ClickByName("Select Make", 2); - testRunner.ClickByName(manufacturer); - testRunner.Wait(1); + testRunner.ClickByName(manufacturer, 2); - testRunner.ClickByName("Select Model"); - testRunner.Wait(1); + testRunner.ClickByName("Select Model", 2); - testRunner.ClickByName(printer); - testRunner.Wait(1); + testRunner.ClickByName(printer, 2); - testRunner.ClickByName("Save & Continue Button"); - testRunner.Wait(1); + testRunner.ClickByName("Save & Continue Button", 2); - testRunner.ClickByName("Setup Connection Cancel Button"); - testRunner.Wait(2); - - testRunner.ClickByName(printerProfile); + testRunner.ClickByName("Cancel Wizard Button", 2); testRunner.Wait(1); } @@ -343,6 +330,18 @@ namespace MatterHackers.MatterControl.Tests.Automation testRunner.ClickByName("LibraryActionMenu"); testRunner.ClickByName("Edit Menu Item", 1); } + + public static void LibraryRenameSelectedItem(AutomationRunner testRunner) + { + testRunner.ClickByName("LibraryActionMenu"); + testRunner.ClickByName("Rename Menu Item", 1); + } + + public static void LibraryRemoveSelectedItem(AutomationRunner testRunner) + { + testRunner.ClickByName("LibraryActionMenu"); + testRunner.ClickByName("Remove Menu Item", 1); + } } /// diff --git a/Tests/MatterControl.Tests/MatterControl/PerformanceTests.cs b/Tests/MatterControl.Tests/MatterControl/PerformanceTests.cs index 9ad0f9710..b8b66eda4 100644 --- a/Tests/MatterControl.Tests/MatterControl/PerformanceTests.cs +++ b/Tests/MatterControl.Tests/MatterControl/PerformanceTests.cs @@ -169,23 +169,23 @@ namespace MatterHackers.MatterControl public static void RenameLibraryItem(GuiWidget container, double secondsBetweenClicks = .1) { - AutomationRunner testrunner; + AutomationRunner testRunner; DrawEventHandler beforeDraw = null; beforeDraw = (sender, e) => { - testrunner = new AutomationRunner(); + testRunner = new AutomationRunner(); Task.Run(() => { - testrunner.ClickByName("Library Tab"); - NavigateToFolder(testrunner, "Local Library Row Item Collection"); + testRunner.ClickByName("Library Tab"); + NavigateToFolder(testRunner, "Local Library Row Item Collection"); - testrunner.ClickByName("Library Edit Button"); - testrunner.ClickByName("Row Item Calibration - Box"); - testrunner.Wait(2); - testrunner.ClickByName("Rename From Library Button"); - testrunner.Wait(2); - testrunner.Type("Renamed Calibration Cube"); - testrunner.ClickByName("Rename Button"); + testRunner.ClickByName("Library Edit Button"); + testRunner.ClickByName("Row Item Calibration - Box"); + testRunner.Wait(.5); + MatterControlUtilities.LibraryRenameSelectedItem(testRunner); + testRunner.Wait(.5); + testRunner.Type("Renamed Calibration Cube"); + testRunner.ClickByName("Rename Button"); }); @@ -196,25 +196,25 @@ namespace MatterHackers.MatterControl public static void CreateAndRenameLocalLibraryFolder(GuiWidget container, double secondsBetweenClicks = .1) { - AutomationRunner testrunner; + AutomationRunner testRunner; DrawEventHandler beforeDraw = null; beforeDraw = (sender, e) => { - testrunner = new AutomationRunner(); + testRunner = new AutomationRunner(); Task.Run(() => { - testrunner.ClickByName("Library Tab"); - NavigateToFolder(testrunner, "Local Library Row Item Collection"); - testrunner.ClickByName("Create Folder From Library Button"); - testrunner.Wait(2); - testrunner.Type("New Folder"); - testrunner.ClickByName("Create Folder Button"); - testrunner.ClickByName("Library Edit Button"); - testrunner.ClickByName("Row Item New Folder"); - testrunner.ClickByName("Rename From Library Button"); - testrunner.Wait(2); - testrunner.Type("Renamed Folder"); - testrunner.ClickByName("Rename Button"); + testRunner.ClickByName("Library Tab"); + NavigateToFolder(testRunner, "Local Library Row Item Collection"); + testRunner.ClickByName("Create Folder From Library Button"); + testRunner.Wait(2); + testRunner.Type("New Folder"); + testRunner.ClickByName("Create Folder Button"); + testRunner.ClickByName("Library Edit Button"); + testRunner.ClickByName("Row Item New Folder"); + MatterControlUtilities.LibraryRenameSelectedItem(testRunner); + testRunner.Wait(.5); + testRunner.Type("Renamed Folder"); + testRunner.ClickByName("Rename Button"); });