Added unittest for ensuring that when has_hardware_leveling = 1 we dont show the Print Leveling tab in Slice Settings and also that when has_hardware_leveling = 0 we do show Print Leveling
This commit is contained in:
parent
316920638b
commit
2d42ec52e1
6 changed files with 85 additions and 3 deletions
|
|
@ -30,7 +30,7 @@ namespace MatterControl.AutomationTests
|
|||
AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
|
||||
{
|
||||
|
||||
MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD");
|
||||
MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD", true);
|
||||
|
||||
string firstItemName = "Row Item Batman";
|
||||
//Navigate to Downloads Library Provider
|
||||
|
|
|
|||
|
|
@ -0,0 +1,73 @@
|
|||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Image;
|
||||
using MatterHackers.Agg.UI;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using MatterHackers.GuiAutomation;
|
||||
using MatterHackers.Agg.PlatformAbstract;
|
||||
using System.IO;
|
||||
using MatterHackers.MatterControl.CreatorPlugins;
|
||||
using MatterHackers.Agg.UI.Tests;
|
||||
using MatterHackers.MatterControl.PrintQueue;
|
||||
using MatterHackers.MatterControl.DataStorage;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using MatterHackers.MatterControl.UI;
|
||||
using MatterHackers.MatterControl.PrintLibrary.Provider;
|
||||
|
||||
|
||||
namespace MatterHackers.MatterControl.UI
|
||||
{
|
||||
[TestFixture, Category("MatterControl.UI"), RunInApplicationDomain]
|
||||
public class HardwareLevelingUITests
|
||||
{
|
||||
[Test, RequiresSTA, RunInApplicationDomain]
|
||||
public void HasHardwareLevelingHidesLevelingSettings()
|
||||
{
|
||||
Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
|
||||
{
|
||||
AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
|
||||
{
|
||||
//Add printer that has hardware leveling
|
||||
MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD", true);
|
||||
|
||||
testRunner.Wait(1);
|
||||
testRunner.ClickByName("SettingsAndControls");
|
||||
testRunner.Wait(1);
|
||||
testRunner.ClickByName("Slice Settings Tab");
|
||||
testRunner.Wait(1);
|
||||
testRunner.ClickByName("User Level Dropdown");
|
||||
testRunner.Wait(1);
|
||||
testRunner.ClickByName("Advanced Menu Item");
|
||||
testRunner.Wait(1);
|
||||
testRunner.ClickByName("Printer Tab");
|
||||
testRunner.Wait(1);
|
||||
|
||||
//Make sure Print Leveling tab is not visible
|
||||
bool testPrintLeveling = testRunner.WaitForName("Print Leveling Tab", 3);
|
||||
resultsHarness.AddTestResult(testPrintLeveling == false);
|
||||
|
||||
//Add printer that does not have hardware leveling
|
||||
MatterControlUtilities.SelectAndAddPrinter(testRunner, "Deezmaker", "Bukito", false);
|
||||
testRunner.ClickByName("Slice Settings Tab");
|
||||
testRunner.Wait(1);
|
||||
testRunner.ClickByName("Printer Tab");
|
||||
|
||||
//Make sure Print Leveling tab is visible
|
||||
bool printLevelingVisible = testRunner.WaitForName("Print Leveling Tab", 2);
|
||||
resultsHarness.AddTestResult(printLevelingVisible == true);
|
||||
|
||||
MatterControlUtilities.CloseMatterControl(testRunner);
|
||||
}
|
||||
};
|
||||
|
||||
AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);
|
||||
|
||||
Assert.IsTrue(testHarness.AllTestsPassed);
|
||||
Assert.IsTrue(testHarness.TestCount == 2); // make sure we ran all our tests
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -63,6 +63,7 @@
|
|||
<Compile Include="CheckBoxInLibraryIsClickable.cs" />
|
||||
<Compile Include="CreateLibraryFolder.cs" />
|
||||
<Compile Include="ExportItemWindowTests.cs" />
|
||||
<Compile Include="HardwareLevelingUITests.cs" />
|
||||
<Compile Include="LibraryDownloadsTest.cs" />
|
||||
<Compile Include="LocalLibraryTests.cs" />
|
||||
<Compile Include="OptionsTabTests.cs" />
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ namespace MatterHackers.MatterControl.UI
|
|||
}
|
||||
}
|
||||
|
||||
public static void SelectAndAddPrinter(AutomationRunner testRunner, string make, string model)
|
||||
public static void SelectAndAddPrinter(AutomationRunner testRunner, string make, string model, bool firstAdd)
|
||||
{
|
||||
|
||||
string manufacturer = make + " Menu Item";
|
||||
|
|
@ -125,6 +125,13 @@ namespace MatterHackers.MatterControl.UI
|
|||
testRunner.ClickByName("Select a Printer Button");
|
||||
testRunner.Wait(1);
|
||||
|
||||
|
||||
if (!firstAdd)
|
||||
{
|
||||
testRunner.ClickByName("Add new printer button");
|
||||
testRunner.Wait(1);
|
||||
}
|
||||
|
||||
testRunner.ClickByName("Select Make");
|
||||
testRunner.Wait(1);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue