diff --git a/ActionBar/TemperatureWidgetExtruder.cs b/ActionBar/TemperatureWidgetExtruder.cs index 797fdc663..7d0a1edb9 100644 --- a/ActionBar/TemperatureWidgetExtruder.cs +++ b/ActionBar/TemperatureWidgetExtruder.cs @@ -73,6 +73,7 @@ namespace MatterHackers.MatterControl.ActionBar Margin = theme.ButtonSpacing, ToolTipText = "Load filament".Localize() }; + loadButton.Name = "Load Filament Button"; loadButton.Click += (s, e) => loadFilament.Run(printer.Connection); macroButtons.AddChild(loadButton); diff --git a/ConfigurationPage/RunningMacroPage.cs b/ConfigurationPage/RunningMacroPage.cs index 765e18967..d83a0914b 100644 --- a/ConfigurationPage/RunningMacroPage.cs +++ b/ConfigurationPage/RunningMacroPage.cs @@ -71,6 +71,7 @@ namespace MatterHackers.MatterControl.PrinterControls if (macroData.waitOk | macroData.expireTime > 0) { var okButton = theme.CreateDialogButton("Continue".Localize()); + okButton.Name = "Continue Button"; okButton.Click += (s, e) => { printer.Connection.MacroContinue(); diff --git a/Submodules/agg-sharp b/Submodules/agg-sharp index 518f582e7..c2a6940c7 160000 --- a/Submodules/agg-sharp +++ b/Submodules/agg-sharp @@ -1 +1 @@ -Subproject commit 518f582e71674caf91bdcbcbf0401d46125a73be +Subproject commit c2a6940c756d17cf1c804f0f6ee085565f885910 diff --git a/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs b/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs index 7eea60733..d5d3af359 100644 --- a/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs +++ b/Tests/MatterControl.AutomationTests/SliceSettingsTests.cs @@ -196,14 +196,14 @@ namespace MatterHackers.MatterControl.Tests.Automation // turn on the heater testRunner.ClickByName("Toggle Heater"); - testRunner.Delay(2); + testRunner.Delay(1); // assert the printer is heating Assert.AreEqual(hipsGoalTemp, (int)emulator.CurrentExtruder.TargetTemperature, "The printer should report the expected goal temp"); // turn off the heater testRunner.ClickByName("Toggle Heater"); - testRunner.Delay(2); + testRunner.Delay(1); // assert the printer is off Assert.AreEqual(0, (int)emulator.CurrentExtruder.TargetTemperature, "The printer should report the heaters are off"); @@ -244,8 +244,30 @@ namespace MatterHackers.MatterControl.Tests.Automation // and the on toggle is showing off Assert.IsFalse(heatToggle.Checked); - // Collapse the popup and switch back to the general tab + // test that the load filament button works and closes correctly + testRunner.ClickByName("Temperature Input"); + testRunner.Type("^a"); + testRunner.Type("104"); + testRunner.Type("{Enter}"); + testRunner.Delay(); + testRunner.ClickByName("Load Filament Button"); + testRunner.ClickByName("Continue Button"); + Assert.AreEqual(104, (int)emulator.CurrentExtruder.TargetTemperature); + testRunner.ClickByName("Cancel Wizard Button"); + testRunner.Delay(); + Assert.AreEqual(0, (int)emulator.CurrentExtruder.TargetTemperature); + testRunner.ClickByName("Hotend 0"); + testRunner.ClickByName("Load Filament Button"); + testRunner.ClickByName("Continue Button"); + testRunner.Delay(); + Assert.AreEqual(104, (int)emulator.CurrentExtruder.TargetTemperature); + var systemWindow = testRunner.GetWidgetByName("Cancel Wizard Button", out SystemWindow containingWindow); + // close the window through windows (alt-f4) + testRunner.Type("%{F4}"); + Assert.AreEqual(0, (int)emulator.CurrentExtruder.TargetTemperature); + + // Switch back to the general tab testRunner.ClickByName("General Tab"); testRunner.SelectSliceSettingsField("Printer", SettingsKey.extruder_count); @@ -269,7 +291,7 @@ namespace MatterHackers.MatterControl.Tests.Automation } return Task.CompletedTask; - }, maxTimeToRun: 666, overrideWidth: 1224, overrideHeight: 900); + }); } [Test, RunInApplicationDomain]