Example #1
0
        public void DeleteProfileWorksForGuest()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    // assert no profiles
                    resultsHarness.AddTestResult(ProfileManager.Instance.ActiveProfiles.Count() == 0);

                    MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                    // assert one profile
                    resultsHarness.AddTestResult(ProfileManager.Instance.ActiveProfiles.Count() == 1);

                    MatterControlUtilities.DeleteSelectedPrinter(testRunner);

                    // assert no profiles
                    resultsHarness.AddTestResult(ProfileManager.Instance.ActiveProfiles.Count() == 0);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, overrideWidth: 1224, overrideHeight: 900);

            Assert.IsTrue(testHarness.AllTestsPassed(3));
        }
        public async Task HasHardwareLevelingHidesLevelingSettings()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();

                //Add printer that has hardware leveling
                MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                MatterControlUtilities.SwitchToAdvancedSettings(testRunner);

                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);

                //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);

                return(Task.FromResult(0));
            };

            await MatterControlUtilities.RunTest(testToRun, overrideHeight : 800);
        }
Example #3
0
        public void ClearingCheckBoxClearsUserOverride()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                    //Navigate to Local Library
                    MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness);

                    resultsHarness.AddTestResult(testRunner.ClickByName("Printer Tab", 1), "Switch to Printers tab");
                    resultsHarness.AddTestResult(testRunner.ClickByName("Features Tab", 1), "Switch to Features tab");

                    CheckAndUncheckSetting(resultsHarness, testRunner, SettingsKey.heat_extruder_before_homing, "Heat Before Homing Checkbox", false);

                    CheckAndUncheckSetting(resultsHarness, testRunner, SettingsKey.has_fan, "Has Fan Checkbox", true);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, overrideWidth: 1224, overrideHeight: 900);

            Assert.IsTrue(testHarness.AllTestsPassed(20));
        }
Example #4
0
        public void HasHeatedBedCheckUncheck()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                    //Navigate to Local Library
                    MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness);

                    resultsHarness.AddTestResult(testRunner.ClickByName("Printer Tab"));
                    testRunner.Wait(1);

                    resultsHarness.AddTestResult(testRunner.ClickByName("Features Tab"));
                    testRunner.Wait(2);

                    for (int i = 0; i <= 1000; i++)
                    {
                        resultsHarness.AddTestResult(testRunner.ClickByName("Has Heated Bed Checkbox"));
                        testRunner.Wait(.5);
                    }

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            Assert.IsTrue(testHarness.AllTestsPassed(1010));
        }
        public async Task PrinterNameStaysChanged()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();

                MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                MatterControlUtilities.SwitchToAdvancedSettings(testRunner);

                testRunner.ClickByName("Printer Tab", 1);

                string widgetName = "Printer Name Edit";
                testRunner.ClickByName(widgetName);

                SystemWindow window;
                var          textWidget = testRunner.GetWidgetByName(widgetName, out window);
                string       newName    = "Updated name";
                textWidget.Text = newName;
                testRunner.ClickByName("Printer Tab", 1);
                testRunner.Delay(4);

                //Check to make sure the Printer dropdown gets the name change
                testRunner.ClickByName("Printers... Menu", 2);
                testRunner.Delay(1);
                Assert.IsTrue(testRunner.NameExists(newName + " Menu Item"), "Widget with updated printer name exists");

                //Make sure the Active profile name changes as well
                Assert.IsTrue(ProfileManager.Instance.ActiveProfile.Name == newName, "ActiveProfile has updated name");

                return(Task.FromResult(0));
            };

            await MatterControlUtilities.RunTest(testToRun);
        }
        public static IDisposable LaunchAndConnectToPrinterEmulator(this AutomationRunner testRunner, string make = "Airwolf 3D", string model = "HD", bool runSlow = false)
        {
            // Load the TestEnv config
            var config = TestAutomationConfig.Load();

            // Create the printer
            MatterControlUtilities.AddAndSelectPrinter(testRunner, make, model);

            Emulator emulator = new Emulator();

            emulator.PortName = config.Printer;
            emulator.RunSlow  = runSlow;

            emulator.Startup();

            // edit the com port
            SystemWindow containingWindow;
            var          editButton = testRunner.GetWidgetByName("Edit Printer Button", out containingWindow);

            testRunner.Delay(() => editButton.Enabled, 5);             // Wait until the edit button is ready to click it. Ensures the printer is loaded.
            testRunner.ClickByName("Edit Printer Button", 3);

            testRunner.ClickByName("Serial Port Dropdown", 3);

            testRunner.ClickByName(config.MCPort + " Menu Item", 5);

            testRunner.ClickByName("Cancel Wizard Button");

            // connect to the created printer
            testRunner.ClickByName("Connect to printer button", 2);

            testRunner.WaitForName("Disconnect from printer button", 5);

            return(emulator);
        }
        public void ExportAsGcode()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                    string firstItemName = "Row Item Batman";
                    //Navigate to Downloads Library Provider
                    testRunner.ClickByName("Queue Tab");
                    testRunner.ClickByName("Queue Add Button", 2);

                    //Get parts to add
                    string rowItemPath = MatterControlUtilities.GetTestItemPath("Batman.stl");

                    //Add STL part items to Downloads and then type paths into file dialogue
                    testRunner.Wait(1);
                    testRunner.Type(MatterControlUtilities.GetTestItemPath("Batman.stl"));
                    testRunner.Wait(1);
                    testRunner.Type("{Enter}");

                    //Get test results
                    resultsHarness.AddTestResult(testRunner.WaitForName(firstItemName, 2) == true);

                    testRunner.ClickByName("Queue Edit Button");
                    testRunner.ClickByName(firstItemName);
                    testRunner.ClickByName("Queue Export Button");
                    testRunner.Wait(2);

                    testRunner.WaitForName("Export Item Window", 2);
                    testRunner.ClickByName("Export as GCode Button", 2);
                    testRunner.Wait(2);

                    string gcodeExportPath = MatterControlUtilities.PathToExportGcodeFolder;
                    testRunner.Type(gcodeExportPath);
                    testRunner.Type("{Enter}");
                    testRunner.Wait(2);

                    Console.WriteLine(gcodeExportPath);

                    resultsHarness.AddTestResult(File.Exists(gcodeExportPath) == true);
                    Debugger.Break();

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            Assert.IsTrue(testHarness.AllTestsPassed(2));
        }
Example #8
0
        public async Task ExportAsGcode()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();

                MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                string firstItemName = "Queue Item Batman";
                //Navigate to Downloads Library Provider
                testRunner.ClickByName("Queue Tab");
                testRunner.ClickByName("Queue Add Button", 2);

                //Get parts to add
                string rowItemPath = MatterControlUtilities.GetTestItemPath("Batman.stl");

                //Add STL part items to Downloads and then type paths into file dialog
                testRunner.Delay(1);
                testRunner.Type(MatterControlUtilities.GetTestItemPath("Batman.stl"));
                testRunner.Delay(1);
                testRunner.Type("{Enter}");

                //Get test results
                Assert.IsTrue(testRunner.WaitForName(firstItemName, 2) == true);

                testRunner.ClickByName("Queue Export Button");
                testRunner.Delay(2);

                testRunner.WaitForName("Export Item Window", 2);
                testRunner.ClickByName("Export as GCode Button", 2);
                testRunner.Delay(2);

                string gcodeOutputPath = MatterControlUtilities.PathToExportGcodeFolder;

                Directory.CreateDirectory(gcodeOutputPath);

                string fullPathToGcodeFile = Path.Combine(gcodeOutputPath, "Batman");
                testRunner.Type(fullPathToGcodeFile);
                testRunner.Type("{Enter}");
                testRunner.Delay(2);

                Console.WriteLine(gcodeOutputPath);

                Assert.IsTrue(File.Exists(fullPathToGcodeFile + ".gcode") == true);

                return(Task.FromResult(0));
            };

            await MatterControlUtilities.RunTest(testToRun);
        }
        public async Task RaftEnabledPassedToSliceEngine()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();

                MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                // Navigate to Local Library
                testRunner.ClickByName("Library Tab");
                testRunner.NavigateToFolder("Local Library Row Item Collection");
                testRunner.Delay(1);

                testRunner.ClickByName("Row Item Calibration - Box");
                testRunner.Delay(.2);

                // Add the Calibration box to the queue and selects it
                testRunner.ClickByName("Row Item Calibration - Box Print Button");
                testRunner.Delay(1);

                testRunner.ClickByName("Layer View Tab");
                testRunner.Delay(.2);

                testRunner.ClickByName("Bread Crumb Button Home", 1);
                testRunner.Delay(.2);

                MatterControlUtilities.SwitchToAdvancedSettings(testRunner);
                testRunner.Delay(.2);

                testRunner.ClickByName("Raft / Priming Tab", 1);
                testRunner.Delay(.2);

                testRunner.ClickByName("Create Raft Checkbox", 1);
                testRunner.Delay(1.5);

                testRunner.ClickByName("Generate Gcode Button", 1);
                testRunner.Delay(2);

                testRunner.Delay(() => MatterControlUtilities.CompareExpectedSliceSettingValueWithActualVaue("enableRaft", "True"), 10);

                //Call compare slice settings method here
                Assert.IsTrue(MatterControlUtilities.CompareExpectedSliceSettingValueWithActualVaue("enableRaft", "True"));

                return(Task.FromResult(0));
            };

            await MatterControlUtilities.RunTest(testToRun, overrideWidth : 1224, overrideHeight : 800);
        }
Example #10
0
        public void RaftEnabledPassedToSliceEngine()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                    //Navigate to Local Library
                    testRunner.ClickByName("Library Tab");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection");
                    testRunner.Wait(1);
                    testRunner.ClickByName("Row Item Calibration - Box");
                    testRunner.ClickByName("Row Item Calibration - Box Print Button");
                    testRunner.Wait(1);

                    testRunner.ClickByName("Layer View Tab");

                    testRunner.ClickByName("Bread Crumb Button Home", 1);

                    MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness);

                    testRunner.ClickByName("Raft / Priming Tab", 1);

                    testRunner.ClickByName("Create Raft Checkbox", 1);
                    testRunner.Wait(1.5);
                    testRunner.ClickByName("Generate Gcode Button", 1);
                    testRunner.Wait(5);

                    //Call compare slice settings methode here
                    resultsHarness.AddTestResult(MatterControlUtilities.CompareExpectedSliceSettingValueWithActualVaue("enableRaft", "True"));


                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, overrideWidth: 1224, overrideHeight: 800);

            Assert.IsTrue(testHarness.AllTestsPassed(3));
        }
Example #11
0
        public void HasHeatedBedCheckedHidesBedTemperatureOptions()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                    //Navigate to Settings Tab and make sure Bed Temp Text box is visible
                    MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness);

                    testRunner.ClickByName("Filament Tab", 1);
                    testRunner.ClickByName("Temperatures Tab", 1);
                    resultsHarness.AddTestResult(testRunner.WaitForName("Bed Temperature Textbox", 2));

                    //Uncheck Has Heated Bed checkbox and make sure Bed Temp Textbox is not visible
                    testRunner.ClickByName("Printer Tab", 1);
                    testRunner.ClickByName("Features Tab", 1);
                    testRunner.DragByName("Show Reset Connection Checkbox", 1, offset: new Agg.Point2D(-40, 0));
                    testRunner.MoveToByName("Show Reset Connection Checkbox", 1, offset: new Agg.Point2D(0, 120));
                    testRunner.Drop();
                    testRunner.ClickByName("Has Heated Bed Checkbox", 1);
                    testRunner.Wait(.5);
                    testRunner.ClickByName("Filament Tab", 1);
                    bool bedTemperatureTextBoxVisible = testRunner.WaitForName("Bed Temperature Textbox", 2);
                    resultsHarness.AddTestResult(bedTemperatureTextBoxVisible == false);

                    //Make sure Bed Temperature Options are not visible in printer controls
                    testRunner.ClickByName("Controls Tab");
                    bool bedTemperatureControlsWidget = testRunner.WaitForName("Bed Temperature Controls Widget", 2);
                    resultsHarness.AddTestResult(bedTemperatureTextBoxVisible == false);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, overrideWidth: 550);

            Assert.IsTrue(testHarness.AllTestsPassed(5));
        }
        public void PrinterNameStaysChanged()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);

                // Now do the actions specific to this test. (replace this for new tests)
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                    MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness);

                    resultsHarness.AddTestResult(testRunner.ClickByName("Printer Tab", 1), "Click Printer Tab");

                    string widgetName = "Printer Name Edit";
                    testRunner.ClickByName(widgetName);

                    SystemWindow window;
                    var          textWidget = testRunner.GetWidgetByName(widgetName, out window);
                    string       newName    = "Updated name";
                    textWidget.Text = newName;
                    testRunner.ClickByName("Printer Tab", 1);
                    testRunner.Wait(4);

                    //Check to make sure the Printer dropdown gets the name change
                    testRunner.ClickByName("Printers... Menu", 2);
                    testRunner.Wait(1);
                    resultsHarness.AddTestResult(testRunner.NameExists(newName + " Menu Item"), "Widget with updated printer name exists");

                    //Make sure the Active profile name changes as well
                    resultsHarness.AddTestResult(ProfileManager.Instance.ActiveProfile.Name == newName, "ActiveProfile has updated name");

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            Assert.IsTrue(testHarness.AllTestsPassed(5));
        }
        public async Task SettingsStayAsOverrides()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();

                // Add Guest printers
                MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");
                MatterControlUtilities.SwitchToAdvancedSettings(testRunner);


                testRunner.ClickByName("Layer Height Textbox", 2);
                testRunner.Type(".5\n");
                testRunner.Delay(.5);
                Assert.AreEqual(ActiveSliceSettings.Instance.GetValue <double>(SettingsKey.layer_height), .5, "Layer height is what we set it to");
                testRunner.ClickByName("Quality", 2);
                testRunner.ClickByName("Fine Menu", 2);

                testRunner.Delay(.5);
                Assert.AreEqual(ActiveSliceSettings.Instance.GetValue <double>(SettingsKey.layer_height), .1, "Layer height is the fine override");

                MatterControlUtilities.AddAndSelectPrinter(testRunner, "BCN", "Sigma");

                // Check Guest printer count
                Assert.AreEqual(2, ProfileManager.Instance.ActiveProfiles.Count(), "ProfileManager has 2 Profiles");

                // Check if Guest printer names exists in dropdown
                testRunner.ClickByName("Printers... Menu", 2);
                testRunner.ClickByName("Airwolf 3D HD Menu Item", 5);

                testRunner.Delay(1);
                Assert.AreEqual(ActiveSliceSettings.Instance.GetValue <double>(SettingsKey.layer_height), .1, "Layer height is the fine override");

                testRunner.ClickByName("Quality", 2);
                testRunner.ClickByName("- none - Menu Item", 2, delayBeforeReturn: .5);
                Assert.AreEqual(ActiveSliceSettings.Instance.GetValue <double>(SettingsKey.layer_height), .5, "Layer height is what we set it to");

                return(Task.FromResult(0));
            };

            await MatterControlUtilities.RunTest(testToRun, maxTimeToRun : 120);
        }
        public async Task SwitchingMaterialsCausesSettingsChangedEvents()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                EventHandler unregisterEvents        = null;
                int          layerHeightChangedCount = 0;
                ActiveSliceSettings.SettingChanged.RegisterEvent((s, e) =>
                {
                    StringEventArgs stringEvent = e as StringEventArgs;
                    if (stringEvent != null)
                    {
                        if (stringEvent.Data == SettingsKey.layer_height)
                        {
                            layerHeightChangedCount++;
                        }
                    }
                }, ref unregisterEvents);

                testRunner.CloseSignInAndPrinterSelect();

                MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                //Navigate to Local Library
                MatterControlUtilities.SwitchToAdvancedSettings(testRunner);

                testRunner.ClickByName("General Tab", 1);
                testRunner.ClickByName("Layers / Surface Tab", 1);

                Assert.AreEqual(0, layerHeightChangedCount, "No change to layer height yet.");
                testRunner.ClickByName("Quality", 2);
                testRunner.ClickByName("Fine Menu", 2, delayBeforeReturn: .5);
                Assert.AreEqual(1, layerHeightChangedCount, "Changed to fine.");
                testRunner.ClickByName("Quality", 2);
                testRunner.ClickByName("Standard Menu", 2, delayBeforeReturn: .5);
                Assert.AreEqual(2, layerHeightChangedCount, "Changed to standard.");

                return(Task.FromResult(0));
            };

            await MatterControlUtilities.RunTest(testToRun, overrideWidth : 1224, overrideHeight : 900);
        }
Example #15
0
        public static Process LaunchAndConnectToPrinterEmulator(AutomationRunner testRunner, bool runSlow = false, string make = "Airwolf 3D", string model = "HD")
        {
            // Load the TestEnv config
            var config = TestAutomationConfig.Load();

            // Create the printer
            MatterControlUtilities.AddAndSelectPrinter(testRunner, make, model);

            var process = new Process();

            process.StartInfo = new ProcessStartInfo()
            {
                FileName  = "python",
                Arguments = string.Format("{0} {1}{2}",
                                          StaticData.Instance.MapPath("../PrinterEmulator.py"),
                                          config.Printer,
                                          runSlow ? " slow" : ""),

                WindowStyle = ProcessWindowStyle.Minimized
            };

            process.Start();

            // edit the com port
            testRunner.ClickByName("Edit Printer Button");
            testRunner.Wait(2);

            testRunner.ClickByName("Com Port Dropdown");

            testRunner.ClickByName(config.MCPort + " Menu Item", 1);

            testRunner.ClickByName("Cancel Wizard Button");

            // connect to the created printer
            testRunner.ClickByName("Connect to printer button", 2);

            testRunner.Wait(2);

            return(process);
        }
Example #16
0
        public void HasHardwareLevelingHidesLevelingSettings()
        {
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);
                    //Add printer that has hardware leveling
                    MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                    MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness);

                    testRunner.ClickByName("Printer Tab", 1);
                    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.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);
                    resultsHarness.AddTestResult(printLevelingVisible == true);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, overrideHeight: 800);

            Assert.IsTrue(testHarness.AllTestsPassed(4));
        }
        public async Task HasHeatedBedCheckedHidesBedTemperatureOptions()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();

                MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                //Navigate to Settings Tab and make sure Bed Temp Text box is visible
                MatterControlUtilities.SwitchToAdvancedSettings(testRunner);

                testRunner.ClickByName("Filament Tab", 1);
                testRunner.ClickByName("Temperatures Tab", 1);
                Assert.IsTrue(testRunner.WaitForName("Extruder Temperature Textbox", 2));
                Assert.IsTrue(testRunner.WaitForName("Bed Temperature Textbox", 2));

                //Uncheck Has Heated Bed checkbox and make sure Bed Temp Textbox is not visible
                testRunner.ClickByName("Printer Tab", 1);
                testRunner.ClickByName("Features Tab", 1);
                testRunner.DragByName("Show Reset Connection Checkbox", 1, offset: new Agg.Point2D(-40, 0));
                testRunner.MoveToByName("Show Reset Connection Checkbox", 1, offset: new Agg.Point2D(0, 120));
                testRunner.Drop();
                testRunner.ClickByName("Has Heated Bed Checkbox", 1);
                testRunner.Delay(.5);
                testRunner.ClickByName("Filament Tab", 1);
                bool bedTemperatureTextBoxVisible = testRunner.WaitForName("Bed Temperature Textbox", 2);
                Assert.IsTrue(bedTemperatureTextBoxVisible == false);

                //Make sure Bed Temperature Options are not visible in printer controls
                testRunner.ClickByName("Controls Tab");
                bool bedTemperatureControlsWidget = testRunner.WaitForName("Bed Temperature Controls Widget", 2);
                Assert.IsTrue(bedTemperatureTextBoxVisible == false);

                return(Task.FromResult(0));
            };

            await MatterControlUtilities.RunTest(testToRun, overrideWidth : 550);
        }
        public async Task ClearingCheckBoxClearsUserOverride()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();

                MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                //Navigate to Local Library
                MatterControlUtilities.SwitchToAdvancedSettings(testRunner);

                testRunner.ClickByName("Printer Tab", 1);
                testRunner.ClickByName("Features Tab", 1);

                CheckAndUncheckSetting(testRunner, SettingsKey.heat_extruder_before_homing, "Heat Before Homing Checkbox", false);

                CheckAndUncheckSetting(testRunner, SettingsKey.has_fan, "Has Fan Checkbox", true);

                return(Task.FromResult(0));
            };

            await MatterControlUtilities.RunTest(testToRun, overrideWidth : 1224, overrideHeight : 900);
        }
        public async Task DeleteProfileWorksForGuest()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();

                // assert no profiles
                Assert.IsTrue(ProfileManager.Instance.ActiveProfiles.Count() == 0);

                MatterControlUtilities.AddAndSelectPrinter(testRunner, "Airwolf 3D", "HD");

                // assert one profile
                Assert.IsTrue(ProfileManager.Instance.ActiveProfiles.Count() == 1);

                MatterControlUtilities.DeleteSelectedPrinter(testRunner);

                // assert no profiles
                Assert.IsTrue(ProfileManager.Instance.ActiveProfiles.Count() == 0);

                return(Task.FromResult(0));
            };

            await MatterControlUtilities.RunTest(testToRun, overrideWidth : 1224, overrideHeight : 900);
        }