Merge pull request #3646 from larsbrubaker/master
Wrote a new test to validate that system os close reports to macro page
This commit is contained in:
commit
37d7604516
4 changed files with 29 additions and 5 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 518f582e71674caf91bdcbcbf0401d46125a73be
|
||||
Subproject commit c2a6940c756d17cf1c804f0f6ee085565f885910
|
||||
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue