2018-10-03 12:32:26 -07:00
|
|
|
|
using System.Threading;
|
2016-10-25 06:17:37 -07:00
|
|
|
|
using System.Threading.Tasks;
|
2016-02-01 17:20:18 -08:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
2016-05-11 09:13:56 -07:00
|
|
|
|
namespace MatterHackers.MatterControl.Tests.Automation
|
2016-02-01 17:20:18 -08:00
|
|
|
|
{
|
2017-06-03 08:20:09 -07:00
|
|
|
|
[TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain, Apartment(ApartmentState.STA)]
|
2016-02-01 17:20:18 -08:00
|
|
|
|
public class HardwareLevelingUITests
|
|
|
|
|
|
{
|
2017-06-03 08:20:09 -07:00
|
|
|
|
[Test]
|
2016-10-25 06:17:37 -07:00
|
|
|
|
public async Task HasHardwareLevelingHidesLevelingSettings()
|
2016-02-01 17:20:18 -08:00
|
|
|
|
{
|
2017-06-03 08:20:09 -07:00
|
|
|
|
await MatterControlUtilities.RunTest((testRunner) =>
|
2016-02-01 17:20:18 -08:00
|
|
|
|
{
|
2018-02-08 15:42:07 -08:00
|
|
|
|
testRunner.WaitForFirstDraw();
|
|
|
|
|
|
|
2017-06-03 08:20:09 -07:00
|
|
|
|
// Add printer that has hardware leveling
|
2017-06-04 09:01:56 -07:00
|
|
|
|
testRunner.AddAndSelectPrinter("Airwolf 3D", "HD");
|
2016-02-01 17:20:18 -08:00
|
|
|
|
|
2017-12-28 09:02:44 -08:00
|
|
|
|
testRunner.SwitchToPrinterSettings();
|
|
|
|
|
|
testRunner.ClickByName("Features Tab");
|
2018-04-05 16:16:43 -07:00
|
|
|
|
testRunner.ClickByName("Slice Settings Overflow Menu");
|
|
|
|
|
|
testRunner.ClickByName("Expand All Menu Item");
|
2017-12-28 09:02:44 -08:00
|
|
|
|
Assert.IsFalse(testRunner.WaitForName("print_leveling_solution Row", .5), "Print leveling should not exist for an Airwolf HD");
|
2016-02-01 17:20:18 -08:00
|
|
|
|
|
2017-06-03 08:20:09 -07:00
|
|
|
|
// Add printer that does not have hardware leveling
|
2017-06-04 09:01:56 -07:00
|
|
|
|
testRunner.AddAndSelectPrinter("3D Factory", "MendelMax 1.5");
|
2016-09-20 14:32:22 -07:00
|
|
|
|
|
2017-12-28 09:02:44 -08:00
|
|
|
|
testRunner.SwitchToPrinterSettings();
|
|
|
|
|
|
testRunner.ClickByName("Features Tab");
|
2018-04-05 16:16:43 -07:00
|
|
|
|
testRunner.ClickByName("Slice Settings Overflow Menu");
|
|
|
|
|
|
testRunner.ClickByName("Expand All Menu Item");
|
2017-12-28 09:02:44 -08:00
|
|
|
|
Assert.IsTrue(testRunner.WaitForName("print_leveling_solution Row"), "Print leveling should exist for a 3D Factory MendelMax");
|
2016-10-25 06:17:37 -07:00
|
|
|
|
|
2017-06-04 08:35:29 -07:00
|
|
|
|
return Task.CompletedTask;
|
2017-06-03 08:20:09 -07:00
|
|
|
|
}, overrideHeight: 800);
|
2016-02-01 17:20:18 -08:00
|
|
|
|
}
|
2016-09-26 15:59:29 -07:00
|
|
|
|
|
2017-06-11 07:59:13 -07:00
|
|
|
|
[Test, Category("Emulator")]
|
2016-10-25 06:17:37 -07:00
|
|
|
|
public async Task SoftwareLevelingRequiredCorrectWorkflow()
|
2016-09-26 15:59:29 -07:00
|
|
|
|
{
|
2017-06-03 08:20:09 -07:00
|
|
|
|
await MatterControlUtilities.RunTest((testRunner) =>
|
2016-09-26 15:59:29 -07:00
|
|
|
|
{
|
2016-10-19 11:10:30 -07:00
|
|
|
|
// make a jump start printer
|
2017-06-02 19:57:15 -07:00
|
|
|
|
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator("JumpStart", "V1", runSlow: false))
|
2016-10-19 11:10:30 -07:00
|
|
|
|
{
|
2017-01-10 13:43:12 -08:00
|
|
|
|
// make sure it is showing the correct button
|
2018-12-06 11:59:37 -08:00
|
|
|
|
testRunner.OpenPrintPopupMenu(false, false);
|
2017-01-10 13:43:12 -08:00
|
|
|
|
|
2018-11-22 11:11:59 -08:00
|
|
|
|
// HACK: automatically resuming setup wizard. Long term we want a better plan
|
2019-01-23 23:02:46 -08:00
|
|
|
|
testRunner.ClickByName("SetupPrinter");
|
2018-11-22 11:11:59 -08:00
|
|
|
|
|
2018-10-03 12:28:23 -07:00
|
|
|
|
testRunner.Complete9StepLeveling();
|
2017-01-10 13:43:12 -08:00
|
|
|
|
|
|
|
|
|
|
// make sure the button has changed to start print
|
2017-12-14 16:22:59 -08:00
|
|
|
|
Assert.IsTrue(testRunner.WaitForName("PrintPopupMenu"), "Start Print should be visible after leveling the printer");
|
2019-01-23 23:02:46 -08:00
|
|
|
|
Assert.IsFalse(testRunner.WaitForName("SetupPrinter", .5), "Finish Setup should not be visible after leveling the printer");
|
2017-01-10 13:43:12 -08:00
|
|
|
|
|
|
|
|
|
|
// reset to defaults and make sure print leveling is cleared
|
2017-12-14 16:19:22 -08:00
|
|
|
|
testRunner.SwitchToSliceSettings();
|
2017-01-10 13:43:12 -08:00
|
|
|
|
|
2018-09-10 10:42:18 -07:00
|
|
|
|
testRunner.ClickByName("Printer Overflow Menu");
|
2017-06-09 20:12:25 -07:00
|
|
|
|
testRunner.ClickByName("Reset to Defaults Menu Item");
|
2017-06-14 09:56:51 -07:00
|
|
|
|
testRunner.ClickByName("Yes Button");
|
2017-01-10 13:43:12 -08:00
|
|
|
|
|
2018-12-06 11:59:37 -08:00
|
|
|
|
testRunner.OpenPrintPopupMenu(false, false);
|
|
|
|
|
|
|
2017-01-10 13:43:12 -08:00
|
|
|
|
// make sure it is showing the correct button
|
2019-01-23 23:02:46 -08:00
|
|
|
|
Assert.IsTrue(testRunner.WaitForName("SetupPrinter"), "Finish Setup should be visible after reset to Defaults");
|
2017-01-10 12:24:01 -08:00
|
|
|
|
}
|
2016-09-26 15:59:29 -07:00
|
|
|
|
|
2017-06-04 08:35:29 -07:00
|
|
|
|
return Task.CompletedTask;
|
2017-06-03 08:20:09 -07:00
|
|
|
|
});
|
2016-09-26 15:59:29 -07:00
|
|
|
|
}
|
2016-02-01 17:20:18 -08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|