updating profiles

This commit is contained in:
LarsBrubaker 2020-08-08 22:39:08 -07:00
parent 3af66f1aa3
commit f7457c6758
92 changed files with 33703 additions and 1848 deletions

View file

@ -380,6 +380,58 @@ namespace MatterHackers.MatterControl.Tests.Automation
}, maxTimeToRun: 180);
}
[Test, Category("Emulator")]
public async Task ExtruderT1RecoveryTest()
{
await MatterControlUtilities.RunTest((testRunner) =>
{
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator("Pulse", "S-500"))
{
Assert.AreEqual(1, ApplicationController.Instance.ActivePrinters.Count(), "One printer should exist after add");
var printer = testRunner.FirstPrinter();
printer.Settings.SetValue(SettingsKey.recover_is_enabled, "1");
printer.Settings.SetValue(SettingsKey.extruder_count, "2");
printer.Settings.SetValue(SettingsKey.has_hardware_leveling, "0");
Assert.IsTrue(printer.Connection.RecoveryIsEnabled);
// print a part
testRunner.AddItemToBedplate()
.ClickByName("ItemMaterialButton")
.ClickByName("Material 2 Button");
testRunner.StartPrint(pauseAtLayers: "2;4;6");
testRunner.ClickResumeButton(printer, true, 1); // Resume
// make sure we are printing with extruder 2 (T1)
Assert.AreEqual(0, printer.Connection.GetTargetHotendTemperature(0));
Assert.Greater(printer.Connection.GetTargetHotendTemperature(1), 0);
testRunner.ClickResumeButton(printer, false, 3) // close the pause dialog pop-up do not resume
.ClickByName("Disconnect from printer button")
.ClickByName("Connect to printer button") // Reconnect
.WaitFor(() => printer.Connection.CommunicationState == CommunicationStates.Connected);
// Assert that recovery happens
Assert.IsTrue(PrintRecovery.RecoveryAvailable(printer), "Recovery should be enabled after Disconnect while printing");
// Recover the print
testRunner.ClickButton("Yes Button", "Recover Print");
testRunner.ClickResumeButton(printer, true, 5); // The first pause that we get after recovery should be layer 6.
emulator.RunSlow = true;
// make sure we are printing with extruder 2 (T1)
Assert.AreEqual(0, printer.Connection.GetTargetHotendTemperature(0));
Assert.Greater(printer.Connection.GetTargetHotendTemperature(1), 0);
emulator.RunSlow = false;
testRunner.WaitForPrintFinished(printer);
}
return Task.CompletedTask;
}, maxTimeToRun: 180);
}
[Test, Category("Emulator")]
public async Task TuningAdjustmentsDefaultToOneAndPersists()
{

View file

@ -380,6 +380,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
return widget.TreeLoaded;
});
testRunner.Delay(1000);
// Apply filter
testRunner.ClickByName("Search")
.Type(model)
@ -532,7 +534,6 @@ namespace MatterHackers.MatterControl.Tests.Automation
public static void NavigateToFolder(this AutomationRunner testRunner, string libraryRowItemName)
{
testRunner.EnsureContentMenuOpen();
testRunner.EnsureFoldersVisible();
switch (libraryRowItemName)
{
@ -571,32 +572,6 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.DoubleClickByName(libraryRowItemName);
}
public static void EnsureFoldersVisible(this AutomationRunner testRunner)
{
var checkBox = (ExpandCheckboxButton)testRunner.GetWidgetByName("Show Folders Toggle", out _, secondsToWait: 0.2);
if (checkBox?.Checked == false)
{
var resetEvent = new AutoResetEvent(false);
// Wire up event listener
var listView = testRunner.GetWidgetByName("LibraryView", out _) as LibraryListView;
EventHandler contentReloaded = (s, e) =>
{
resetEvent.Set();
};
listView.ContentReloaded += contentReloaded;
// Start reload
testRunner.ClickByName("Show Folders Toggle");
// Wait for reload
resetEvent.WaitOne();
// Release event listener
listView.ContentReloaded -= contentReloaded;
}
}
public static void EnsureContentMenuOpen(this AutomationRunner testRunner)
{
if (!testRunner.WaitForName("FolderBreadCrumbWidget", secondsToWait: 0.2))
@ -958,6 +933,14 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.Type(pauseAtLayers);
}
if (testRunner.NameExists("SetupPrinter"))
{
testRunner.ClickByName("SetupPrinter")
.ClickByName("Already Loaded Button")
.ClickByName("Cancel Wizard Button")
.OpenPrintPopupMenu();
}
testRunner.ClickByName("Start Print Button");
return testRunner;