Fixing tests

This commit is contained in:
Lars Brubaker 2018-11-05 12:05:09 -08:00
parent 1d1302d801
commit f2e00e7493
3 changed files with 17 additions and 3 deletions

View file

@ -42,9 +42,11 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
public class LoadFilamentWizard : PrinterSetupWizard
{
private bool onlyLoad;
private static double temperatureAtStart;
public static void Start(PrinterConfig printer, ThemeConfig theme, bool onlyLoad)
{
temperatureAtStart = printer.Connection.GetTargetHotendTemperature(0);
// turn off print leveling
var levelingContext = new LoadFilamentWizard(printer, onlyLoad)
{
@ -57,7 +59,7 @@ namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling
});
loadFilamentWizardWindow.Closed += (s, e) =>
{
printer.Connection.TurnOffBedAndExtruders(TurnOff.AfterDelay);
printer.Connection.SetTargetHotendTemperature(0, temperatureAtStart);
};
}

View file

@ -282,7 +282,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.Type("{Enter}");
testRunner.Delay();
testRunner.ClickByName("Load Filament Button");
testRunner.ClickByName("Continue Button");
testRunner.ClickByName("Next Button");
Assert.AreEqual(104, (int)emulator.CurrentExtruder.TargetTemperature);
testRunner.Delay();
testRunner.ClickByName("Cancel Wizard Button");
@ -291,7 +291,7 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.ClickByName("Hotend 0");
testRunner.ClickByName("Load Filament Button");
testRunner.ClickByName("Continue Button");
testRunner.ClickByName("Next Button");
testRunner.Delay();
Assert.AreEqual(104, (int)emulator.CurrentExtruder.TargetTemperature);
var systemWindow = testRunner.GetWidgetByName("Cancel Wizard Button", out SystemWindow containingWindow);

View file

@ -239,6 +239,12 @@ namespace MatterHackers.MatterControl.Tests.Automation
testRunner.WaitForName("Disconnect from printer button");
testRunner.Delay();
if (testRunner.NameExists("Already Loaded Button"))
{
testRunner.ClickByName("Already Loaded Button");
}
// Access through static instance must occur after Connect has occurred and the port has spun up
Emulator.Instance.RunSlow = runSlow;
@ -883,6 +889,12 @@ namespace MatterHackers.MatterControl.Tests.Automation
}
testRunner.ClickByName("Done Button");
testRunner.Delay();
if (testRunner.NameExists("Already Loaded Button"))
{
testRunner.ClickByName("Already Loaded Button");
}
}
/// <summary>