Revise HardwareLevelingUITests
This commit is contained in:
parent
f6a248f43f
commit
6a1c0b5769
4 changed files with 24 additions and 37 deletions
|
|
@ -1,24 +1,19 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MatterHackers.Agg.UI.Tests;
|
||||
using MatterHackers.GuiAutomation;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace MatterHackers.MatterControl.Tests.Automation
|
||||
{
|
||||
[TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain]
|
||||
[TestFixture, Category("MatterControl.UI.Automation"), RunInApplicationDomain, Apartment(ApartmentState.STA)]
|
||||
public class HardwareLevelingUITests
|
||||
{
|
||||
[Test, Apartment(ApartmentState.STA)]
|
||||
[Test]
|
||||
public async Task HasHardwareLevelingHidesLevelingSettings()
|
||||
{
|
||||
AutomationTest testToRun = (testRunner) =>
|
||||
await MatterControlUtilities.RunTest((testRunner) =>
|
||||
{
|
||||
testRunner.CloseSignInAndPrinterSelect();
|
||||
|
||||
//Add printer that has hardware leveling
|
||||
// Add printer that has hardware leveling
|
||||
MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");
|
||||
|
||||
testRunner.SwitchToAdvancedSliceSettings();
|
||||
|
|
@ -26,40 +21,31 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
testRunner.ClickByName("Printer Tab", 1);
|
||||
testRunner.Delay(1);
|
||||
|
||||
//Make sure Print Leveling tab is not visible
|
||||
bool testPrintLeveling = testRunner.WaitForName("Print Leveling Tab", 3);
|
||||
Assert.IsTrue(testPrintLeveling == false);
|
||||
Assert.IsFalse(testRunner.WaitForName("Print Leveling Tab", 3), "Print leveling should not exist for an Airwolf HD");
|
||||
|
||||
//Add printer that does not have hardware leveling
|
||||
// Add printer that does not have hardware leveling
|
||||
MatterControlUtilities.AddAndSelectPrinter(testRunner, "3D Factory", "MendelMax 1.5");
|
||||
|
||||
testRunner.ClickByName("Slice Settings Tab", 1);
|
||||
|
||||
testRunner.ClickByName("Printer Tab", 1);
|
||||
|
||||
//Make sure Print Leveling tab is visible
|
||||
bool printLevelingVisible = testRunner.WaitForName("Print Leveling Tab", 2);
|
||||
Assert.IsTrue(printLevelingVisible == true);
|
||||
Assert.IsTrue(testRunner.WaitForName("Print Leveling Tab", 3), "Print leveling should exist for a 3D Factory MendelMax");
|
||||
|
||||
return Task.FromResult(0);
|
||||
};
|
||||
|
||||
await MatterControlUtilities.RunTest(testToRun, overrideHeight: 800);
|
||||
}, overrideHeight: 800);
|
||||
}
|
||||
|
||||
[Test, Apartment(ApartmentState.STA)]
|
||||
[Test]
|
||||
public async Task SoftwareLevelingRequiredCorrectWorkflow()
|
||||
{
|
||||
AutomationTest testToRun = (testRunner) =>
|
||||
await MatterControlUtilities.RunTest((testRunner) =>
|
||||
{
|
||||
testRunner.CloseSignInAndPrinterSelect();
|
||||
|
||||
// make a jump start printer
|
||||
using (var emulator = testRunner.LaunchAndConnectToPrinterEmulator("JumpStart", "V1", runSlow: false))
|
||||
{
|
||||
// make sure it is showing the correct button
|
||||
Assert.IsTrue(!testRunner.WaitForName("Start Print Button", .5), "Start Print hidden");
|
||||
Assert.IsTrue(testRunner.WaitForName("Finish Setup Button", .5), "Finish Setup showing");
|
||||
Assert.IsFalse(testRunner.WaitForName("Start Print Button", .5), "Start Print should not be visible if PrintLeveling is required");
|
||||
Assert.IsTrue(testRunner.WaitForName("Finish Setup Button", .5), "Finish Setup should be visible if PrintLeveling is required");
|
||||
|
||||
// do print leveling
|
||||
testRunner.ClickByName("Next Button", .5);
|
||||
|
|
@ -76,8 +62,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
testRunner.ClickByName("Done Button", 1);
|
||||
|
||||
// make sure the button has changed to start print
|
||||
Assert.IsTrue(testRunner.WaitForName("Start Print Button", 5), "Start Print showing");
|
||||
Assert.IsTrue(!testRunner.WaitForName("Finish Setup Button", 1), "Finish Setup hidden");
|
||||
Assert.IsTrue(testRunner.WaitForName("Start Print Button", 5), "Start Print should be visible after leveling the printer");
|
||||
Assert.IsFalse(testRunner.WaitForName("Finish Setup Button", 1), "Finish Setup should not be visible after leveling the printer");
|
||||
|
||||
// reset to defaults and make sure print leveling is cleared
|
||||
testRunner.SwitchToAdvancedSliceSettings();
|
||||
|
|
@ -88,14 +74,12 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
testRunner.Delay(1);
|
||||
|
||||
// make sure it is showing the correct button
|
||||
Assert.IsTrue(!testRunner.WaitForName("Start Print Button", 1), "Start Print hidden");
|
||||
Assert.IsTrue(testRunner.WaitForName("Finish Setup Button", 1), "Finish Setup showing");
|
||||
Assert.IsTrue(!testRunner.WaitForName("Start Print Button", 1), "Start Print should be visible after reset to Defaults");
|
||||
Assert.IsTrue(testRunner.WaitForName("Finish Setup Button", 1), "Finish Setup should not be visible after reset to Defaults");
|
||||
}
|
||||
|
||||
return Task.FromResult(0);
|
||||
};
|
||||
|
||||
await MatterControlUtilities.RunTest(testToRun);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -505,8 +505,8 @@ namespace MatterHackers.MatterControl.Tests.Automation
|
|||
|
||||
testRunner.Delay(5);
|
||||
Assert.AreEqual(0, emulator.ExtruderGoalTemperature, "We need to set the temp to 0.");
|
||||
// TODO: chagne this to checking that the fan speed is 0 - when the emulator tracks fan speed.
|
||||
Assert.AreEqual(1, fanChangedCount, "We expected to see fan chage on quiting.");
|
||||
// TODO: change this to checking that the fan speed is 0 - when the emulator tracks fan speed.
|
||||
Assert.AreEqual(1, fanChangedCount, "We expected to see fan change on quiting.");
|
||||
}
|
||||
|
||||
return Task.FromResult(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue