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

                    MatterControlUtilities.SelectAndAddPrinter(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);
            Assert.IsTrue(testHarness.TestCount == 2);
        }
Exemplo n.º 2
0
        public void RaftEnabledPassedToSliceEngine()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD", true);

                    //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");
                    testRunner.Wait(1);
                    testRunner.ClickByName("SettingsAndControls");
                    testRunner.Wait(1);
                    testRunner.ClickByName("User Level Dropdown");
                    testRunner.Wait(1);
                    testRunner.ClickByName("Advanced Menu Item");
                    testRunner.Wait(1);
                    testRunner.ClickByName("Skirt and Raft Tab");
                    testRunner.Wait(1);

                    testRunner.ClickByName("Create Raft Checkbox");
                    testRunner.Wait(1.5);
                    testRunner.ClickByName("Save Slice Settings Button");
                    testRunner.ClickByName("Generate Gcode Button");
                    testRunner.Wait(5);

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


                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 1);             // make sure we ran all our tests
        }
Exemplo n.º 3
0
        public void HasHeatedBedCheckedHidesBedTemperatureOptions()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD", true);

                    //Navigate to Settings Tab and make sure Bed Temp Text box is visible
                    testRunner.ClickByName("SettingsAndControls");
                    testRunner.Wait(1);
                    testRunner.ClickByName("User Level Dropdown");
                    testRunner.Wait(1);
                    testRunner.ClickByName("Advanced Menu Item");
                    testRunner.Wait(1);
                    testRunner.ClickByName("Filament Tab");
                    testRunner.Wait(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");
                    testRunner.Wait(1);
                    testRunner.ClickByName("Features Tab");
                    testRunner.Wait(1);
                    testRunner.ClickByName("Has Heated Bed Checkbox");
                    testRunner.Wait(.5);
                    testRunner.ClickByName("Filament Tab");
                    testRunner.Wait(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);

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 3);             // make sure we ran all our tests
        }
Exemplo n.º 4
0
        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
        }
        public void HasHeatedBedCheckUncheck()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

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

                    //Navigate to Local Library
                    testRunner.ClickByName("SettingsAndControls");
                    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);

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

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

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 0);             // make sure we ran all our tests
        }