public void ClickOnLibraryCheckBoxes()
        {
            // 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)
                {
                    testRunner.ClickByName("Library Tab", 3);
                    MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection");

                    SystemWindow systemWindow;
                    string       itemName = "Row Item " + "Calibration - Box";

                    GuiWidget rowItem = testRunner.GetWidgetByName(itemName, out systemWindow, 3);

                    SearchRegion rowItemRegion = testRunner.GetRegionByName(itemName, 3);

                    testRunner.ClickByName("Library Edit Button", 3);
                    testRunner.Wait(.5);

                    GuiWidget foundWidget    = testRunner.GetWidgetByName("Row Item Select Checkbox", out systemWindow, 3, searchRegion: rowItemRegion);
                    CheckBox  checkBoxWidget = foundWidget as CheckBox;
                    resultsHarness.AddTestResult(checkBoxWidget != null, "We should have an actual checkbox");
                    resultsHarness.AddTestResult(checkBoxWidget.Checked == false, "currently not checked");

                    testRunner.ClickByName("Row Item Select Checkbox", 3, searchRegion: rowItemRegion);
                    testRunner.ClickByName("Library Tab");
                    resultsHarness.AddTestResult(checkBoxWidget.Checked == true, "currently checked");

                    testRunner.ClickByName(itemName, 3);
                    testRunner.ClickByName("Library Tab");
                    resultsHarness.AddTestResult(checkBoxWidget.Checked == false, "currently not checked");

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            // NOTE: In the future we may want to make the "Local Library Row Item Collection" not clickable.
            // If that is the case fix this test to click on a child of "Local Library Row Item Collection" instead.
            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 4);             // make sure we ran all our tests
        }
Beispiel #2
0
        public static void ClickStuff(GuiWidget container, string[] clickThings, double secondsBetweenClicks = .1)
        {
            AutomationRunner clickPreview;

            DrawEventHandler beforeDraw = null;

            beforeDraw = (sender, e) =>
            {
                clickPreview = new AutomationRunner();
                Task.Run(() =>
                {
                    foreach (string clickName in clickThings)
                    {
                        clickPreview.ClickByName(clickName, 10);
                        Thread.Sleep((int)(secondsBetweenClicks * 1000));
                    }
                });

                container.DrawBefore -= beforeDraw;
            };

            container.DrawBefore += beforeDraw;
        }
        public void RenameButtonRenameLocalLibraryItem()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);
                    //Navigate to Local Library
                    testRunner.ClickByName("Library Tab");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection");

                    //Create New Folder
                    testRunner.ClickByName("Create Folder From Library Button");
                    testRunner.Wait(.5);
                    testRunner.Type("New Folder");
                    testRunner.Wait(.5);
                    testRunner.ClickByName("Create Folder Button");

                    //Check for Created Folder
                    string newLibraryFolder    = "New Folder Row Item Collection";
                    bool   newFolderWasCreated = testRunner.WaitForName(newLibraryFolder, 1);
                    resultsHarness.AddTestResult(newFolderWasCreated == true);

                    testRunner.ClickByName("Library Edit Button");
                    testRunner.ClickByName("New Folder Row Item Collection");
                    MatterControlUtilities.LibraryRenameSelectedItem(testRunner);
                    testRunner.Wait(.5);
                    testRunner.Type("Renamed Library Folder");
                    testRunner.ClickByName("Rename Button");

                    //Make sure that renamed Library Folder Exists
                    bool renamedLibraryFolderExists = testRunner.WaitForName("Renamed Library Folder Row Item Collection", 2);
                    resultsHarness.AddTestResult(renamedLibraryFolderExists == 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
        }
Beispiel #4
0
        public void LibraryQueueViewRefreshesOnAddItem()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    testRunner.ClickByName("Library Tab", 5);

                    MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection");

                    resultsHarness.AddTestResult(testRunner.ClickByName("3D View Edit", 3));

                    resultsHarness.AddTestResult(testRunner.ClickByName("3D View Copy", 3), "Click Copy");
                    // wait for the copy to finish
                    testRunner.Wait(.1);
                    resultsHarness.AddTestResult(testRunner.ClickByName("3D View Delete", 3), "Click Delete");
                    resultsHarness.AddTestResult(testRunner.ClickByName("Save As Menu", 3), "Click Save As Menu");
                    resultsHarness.AddTestResult(testRunner.ClickByName("Save As Menu Item", 3), "Click Save As");

                    testRunner.Wait(1);

                    testRunner.Type("Test Part");
                    resultsHarness.AddTestResult(MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"));

                    resultsHarness.AddTestResult(testRunner.ClickByName("Save As Save Button", 1));

                    // ensure that it is now in the library folder (that the folder updated)
                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item " + "Test Part", 5), "The part we added sholud be in the library");

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, "MC_One_Queue_No_Library");

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 8);             // make sure we ran all our tests
        }
        public void QueueAddButtonAddsGcodeFile()
        {
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    int queueCountBeforeTest = QueueData.Instance.Count;

                    //Click Add button
                    testRunner.ClickByName("Queue Add Button", 2);
                    testRunner.Wait(1);

                    string pathToType = MatterControlUtilities.GetTestItemPath("chichen-itza_pyramid.gcode");

                    testRunner.Type(pathToType);
                    testRunner.Wait(1);
                    testRunner.Type("{Enter}");

                    int queueCountAfterGcodeIsAdded = QueueData.Instance.Count;

                    resultsHarness.AddTestResult(queueCountAfterGcodeIsAdded == queueCountBeforeTest + 1);

                    //stl queue item is added to the queue
                    bool firstQueueItemExists = testRunner.WaitForName("Queue Item " + "chichen-itza_pyramid", 1);
                    resultsHarness.AddTestResult(firstQueueItemExists == true);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            Assert.IsTrue(testHarness.AllTestsPassed(2));
        }
Beispiel #6
0
        public static void AddAndSelectPrinter(this AutomationRunner testRunner, string make, string model)
        {
            SystemWindow systemWindow;

            testRunner.GetWidgetByName("Start Tab", out systemWindow, 10);
            // make sure we wait for MC to be up and running
            testRunner.WaitforDraw(systemWindow);

            // If SelectMake is not visible and the ConnectionWizard is, click Skip
            if (!testRunner.NameExists("Select Make", 0.1))
            {
                if (!testRunner.NameExists("Create Printer", 0.1))
                {
                    // go to the start page
                    testRunner.ClickByName("Start Tab");
                }

                testRunner.ClickByName("Create Printer");
            }

            testRunner.ClickByName("Select Make");
            testRunner.WaitFor(() => testRunner.WidgetExists <PopupWidget>());
            testRunner.Type(make);
            testRunner.Type("{Enter}");
            testRunner.WaitFor(() => !testRunner.WidgetExists <PopupWidget>());


            testRunner.ClickByName("Select Model");
            testRunner.WaitFor(() => testRunner.WidgetExists <PopupWidget>());
            testRunner.Type(model);
            testRunner.Type("{Enter}");
            testRunner.WaitFor(() => !testRunner.WidgetExists <PopupWidget>());

            // An unpredictable period of time will pass between Clicking Save, everything reloading and us returning to the caller.
            // Block until ReloadAll has completed then close and return to the caller, at which point hopefully everything is reloaded.
            testRunner.ClickByName("Save & Continue Button");

            testRunner.WaitFor(() => testRunner.WidgetExists <SetupStepComPortOne>());
            testRunner.ClickByName("Cancel Wizard Button");
            testRunner.WaitFor(() => !testRunner.WidgetExists <SetupStepComPortOne>());
        }
        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
        }
        public static void AddAndSelectPrinter(AutomationRunner testRunner, string make, string model)
        {
            if (!testRunner.NameExists("Select Make"))
            {
                testRunner.ClickByName("Printers... Menu", 2, delayBeforeReturn: .5);
                testRunner.ClickByName("Add New Printer... Menu Item", 5, delayBeforeReturn: .5);
            }

            testRunner.ClickByName("Select Make", 5);
            testRunner.Type(make);
            testRunner.Type("{Enter}");

            testRunner.ClickByName("Select Model", 5);
            testRunner.Type(model);
            testRunner.Type("{Enter}");

            // An unpredictable period of time will pass between Clicking Save, everything reloading and us returning to the caller.
            // Block until ReloadAll has completed then close and return to the caller, at which point hopefully everything is reloaded.
            WaitForReloadAll(testRunner, () => testRunner.ClickByName("Save & Continue Button", 2));

            testRunner.ClickByName("Cancel Wizard Button", 5);
            testRunner.Delay(1);
        }
        public void UndoRedoDelete()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    SystemWindow systemWindow;

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

                    //Get View3DWidget and count MeshGroups before Copy button is clicked
                    GuiWidget    partPreview = testRunner.GetWidgetByName("View3DWidget", out systemWindow, 3);
                    View3DWidget view3D      = partPreview as View3DWidget;

                    string copyButtonName = "3D View Copy";

                    //Click Edit button to make edit controls visible
                    testRunner.ClickByName("3D View Edit");
                    testRunner.Wait(1);
                    int partCountBeforeCopy = view3D.MeshGroups.Count();
                    resultsHarness.AddTestResult(partCountBeforeCopy == 1);

                    for (int i = 0; i <= 4; i++)
                    {
                        testRunner.ClickByName(copyButtonName);
                        testRunner.Wait(1);
                    }

                    testRunner.Wait(1);

                    int meshCountAfterCopy = view3D.MeshGroups.Count();
                    testRunner.ClickByName("3D View Remove");
                    System.Threading.Thread.Sleep(2000);
                    int meshCountAfterRemove = view3D.MeshGroups.Count();
                    resultsHarness.AddTestResult(meshCountAfterRemove == 5);


                    testRunner.ClickByName("3D View Undo");
                    System.Threading.Thread.Sleep(2000);
                    int meshCountAfterUndo = view3D.MeshGroups.Count();
                    resultsHarness.AddTestResult(meshCountAfterUndo == 6);

                    testRunner.ClickByName("3D View Redo");
                    System.Threading.Thread.Sleep(2000);
                    int meshCountAfterRedo = view3D.MeshGroups.Count();
                    resultsHarness.AddTestResult(meshCountAfterRedo == 5);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 4);             // make sure we ran all our tests
        }
Beispiel #10
0
        public static void Complete9StepLeveling(this AutomationRunner testRunner, int numUpClicks = 1)
        {
            // Helper methods
            bool headerExists(string headerText)
            {
                var header     = testRunner.GetWidgetByName("HeaderRow", out _);
                var textWidget = header.Children <TextWidget>().FirstOrDefault();

                return(textWidget?.Text.StartsWith(headerText) ?? false);
            }

            void waitForPage(string headerText)
            {
                testRunner.WaitFor(() => headerExists(headerText));
                Assert.IsTrue(headerExists(headerText), "Expected page not found: " + headerText);
            }

            void waitForPageAndAdvance(string headerText)
            {
                waitForPage(headerText);
                testRunner.ClickByName("Next Button");
            }

            testRunner.Delay();

            testRunner.WaitFor(() => headerExists("Initial Printer Setup"));
            if (headerExists("Initial Printer Setup"))
            {
                // do print leveling steps
                waitForPageAndAdvance("Initial Printer Setup");
            }

            waitForPageAndAdvance("Print Leveling Overview");

            waitForPageAndAdvance("Select Material");

            waitForPageAndAdvance("Homing The Printer");

            waitForPageAndAdvance("Waiting For Printer To Heat");

            for (int i = 0; i < 3; i++)
            {
                var section = (i * 3) + 1;

                waitForPage($"Step {section} of 9");
                for (int j = 0; j < numUpClicks; j++)
                {
                    testRunner.Delay();
                    testRunner.ClickByName("Move Z positive");
                }

                waitForPage($"Step {section} of 9");
                testRunner.ClickByName("Next Button");

                waitForPage($"Step {section + 1} of 9");
                testRunner.ClickByName("Next Button");

                waitForPage($"Step {section + 2} of 9");
                testRunner.ClickByName("Next Button");
            }

            testRunner.ClickByName("Done Button");
        }
Beispiel #11
0
 /// <summary>
 /// Open the Print popup menu and click the Start Print button
 /// </summary>
 /// <param name="testRunner"></param>
 public static void StartPrint(this AutomationRunner testRunner)
 {
     testRunner.OpenPrintPopupMenu();
     testRunner.ClickByName("Start Print Button");
 }
        public void RemoveAllMenuItemClickedRemovesAll()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    /*
                     * Tests that when the Remove All menu item is clicked
                     * 1. Queue Item count is set to zero
                     * 2. All queue row items that were previously in the queue are removed
                     */

                    bool queueEmpty = true;
                    int  queueItemCountBeforeRemoveAllClicked = QueueData.Instance.Count;

                    if (queueItemCountBeforeRemoveAllClicked != 0)
                    {
                        queueEmpty = false;
                    }

                    resultsHarness.AddTestResult(queueEmpty = true);

                    bool batmanPartExists1     = testRunner.WaitForName("Queue Item " + "Batman", 1);
                    bool foxPartExistst1       = testRunner.WaitForName("Queue Item " + "Fennec_Fox", 1);
                    bool mouthpiecePartExists1 = testRunner.WaitForName("Queue Item " + "2013-01-25_Mouthpiece_v2", 1);

                    resultsHarness.AddTestResult(batmanPartExists1 == true);
                    resultsHarness.AddTestResult(mouthpiecePartExists1 == true);
                    resultsHarness.AddTestResult(foxPartExistst1 == true);


                    testRunner.ClickByName("Queue... Menu", 2);



                    testRunner.ClickByName(" Remove All Menu Item", 2);

                    testRunner.Wait(2);

                    int queueItemCountAfterRemoveAll = QueueData.Instance.Count;

                    if (queueItemCountAfterRemoveAll == 0)
                    {
                        queueEmpty = true;
                    }

                    resultsHarness.AddTestResult(queueEmpty = true);

                    bool batmanPartExists2     = testRunner.WaitForName("Queue Item " + "Batman", 1);
                    bool foxPartExistst2       = testRunner.WaitForName("Queue Item " + "Fennec_Fox", 1);
                    bool mouthpiecePartExists2 = testRunner.WaitForName("Queue Item " + "2013-01-25_Mouthpiece_v2", 1);

                    resultsHarness.AddTestResult(batmanPartExists2 == false);
                    resultsHarness.AddTestResult(mouthpiecePartExists2 == false);
                    resultsHarness.AddTestResult(foxPartExistst2 == false);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, "MC_Three_Queue_Items");

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 8);             // make sure we ran all our tests
        }
Beispiel #13
0
 public static void LibraryRemoveSelectedItem(AutomationRunner testRunner)
 {
     testRunner.ClickByName("LibraryActionMenu");
     testRunner.ClickByName("Remove Menu Item", 1);
 }
Beispiel #14
0
        public static void ReportDrawTimeWhileSwitching(GuiWidget container, string firstWidgetName, string secondWidgetName, double switchTimeSeconds)
        {
            StatisticsTracker testTracker   = new StatisticsTracker("SwitchBetweenTabs");
            bool             clickFirstItem = true;
            bool             done           = false;
            bool             firstDraw      = true;
            AutomationRunner clickPreview;
            Stopwatch        timeSinceLastClick = Stopwatch.StartNew();
            Stopwatch        totalDrawTime      = Stopwatch.StartNew();
            int drawCount = 0;

            DrawEventHandler beforeDraw = (sender, e) =>
            {
                if (firstDraw)
                {
                    clickPreview = new AutomationRunner();
                    Task.Run(() =>
                    {
                        while (!done)
                        {
                            if (clickPreview != null && timeSinceLastClick.Elapsed.TotalSeconds > switchTimeSeconds)
                            {
                                if (clickFirstItem)
                                {
                                    clickPreview.ClickByName(firstWidgetName);
                                }
                                else
                                {
                                    clickPreview.ClickByName(secondWidgetName);
                                }
                                clickFirstItem = !clickFirstItem;
                                timeSinceLastClick.Restart();
                            }
                        }
                    });
                    firstDraw = false;
                }

                totalDrawTime.Restart();
            };

            container.DrawBefore += beforeDraw;

            DrawEventHandler afterDraw = null;

            afterDraw = (sender, e) =>
            {
                totalDrawTime.Stop();
                if (drawCount++ > 30 && testTracker.Count < 100)
                {
                    testTracker.AddValue(totalDrawTime.ElapsedMilliseconds);
                    if (testTracker.Count == 100)
                    {
                        Trace.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(testTracker));
                        container.DrawBefore -= beforeDraw;
                        container.DrawBefore -= afterDraw;
                        done = true;
                    }
                }
            };

            container.DrawAfter += afterDraw;
        }
Beispiel #15
0
 public static void InvokeLibraryAddDialog(this AutomationRunner testRunner)
 {
     testRunner.ClickByName("Print Library Overflow Menu");
     testRunner.ClickByName("Add Menu Item");
 }
Beispiel #16
0
 public static void NavigateToLibraryHome(this AutomationRunner testRunner)
 {
     testRunner.EnsureContentMenuOpen();
     testRunner.ClickByName("Bread Crumb Button Home");
     testRunner.Delay(.5);
 }
Beispiel #17
0
 public static void OpenUserPopupMenu(this AutomationRunner testRunner)
 {
     testRunner.ClickByName("User Options Menu");
 }
Beispiel #18
0
 public static void SwitchToHardwareTab(this AutomationRunner testRunner)
 {
     testRunner.ClickByName("Hardware Tab");
 }
        public void ClickQueueRoWItemViewAndRemove()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    /*
                     * Tests:
                     * 1. When the remove button on a queue item is clicked the queue tab count decreases by one
                     * 2. When the remove button on a queue item is clicked the item is removed
                     * 3. When the View button on a queue item is clicked the part preview window is opened
                     */


                    testRunner.Wait(2);
                    int  currentQueueItemCount = QueueData.Instance.Count;
                    bool threeItemsInQueue     = true;

                    if (currentQueueItemCount != 3)
                    {
                        threeItemsInQueue = false;
                    }

                    resultsHarness.AddTestResult(threeItemsInQueue == true);
                    resultsHarness.AddTestResult(testRunner.WaitForName("Queue Item " + "Batman", 1));
                    resultsHarness.AddTestResult(testRunner.WaitForName("Queue Item " + "2013-01-25_Mouthpiece_v2", 1));

                    testRunner.ClickByName("Queue Item " + "Batman", 1);
                    testRunner.ClickByName("Queue Item " + "Batman" + " Remove");
                    testRunner.Wait(2);

                    int  queueItemCountAfterRemove = QueueData.Instance.Count;
                    bool correctItemCountAfterRemove;
                    if (queueItemCountAfterRemove == 2)
                    {
                        correctItemCountAfterRemove = true;
                    }
                    else
                    {
                        correctItemCountAfterRemove = false;
                    }


                    resultsHarness.AddTestResult(correctItemCountAfterRemove == true);

                    bool batmanQueueItemExists = testRunner.WaitForName("Queue Item " + "Batman", 1);
                    resultsHarness.AddTestResult(batmanQueueItemExists == false);

                    bool partPreviewWindowExists1 = testRunner.WaitForName("Queue Item " + "2013-01-25_Mouthpiece_v2" + " Part Preview", 1);
                    resultsHarness.AddTestResult(partPreviewWindowExists1 == false);
                    testRunner.ClickByName("Queue Item " + "2013-01-25_Mouthpiece_v2", 1);
                    testRunner.Wait(2);
                    testRunner.ClickByName("Queue Item " + "2013-01-25_Mouthpiece_v2" + " View", 1);

                    bool partPreviewWindowExists2 = testRunner.WaitForName("Queue Item " + "2013-01-25_Mouthpiece_v2" + " Part Preview", 2);
                    resultsHarness.AddTestResult(partPreviewWindowExists2 == true);


                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, "MC_Three_Queue_Items");

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 7);             // make sure we ran all our tests
        }
        public void SaveAsToDownloads()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    //Navigate to Downloads
                    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);

                    //Click Edit button to make edit controls visible
                    testRunner.ClickByName("3D View Edit");
                    testRunner.Wait(1);

                    for (int i = 0; i <= 2; i++)
                    {
                        testRunner.ClickByName("3D View Copy");
                        testRunner.Wait(1);
                    }


                    //Click Save As button to save changes to the part
                    testRunner.ClickByName("Save As Menu");
                    testRunner.Wait(1);
                    testRunner.ClickByName("Save As Menu Item");
                    testRunner.Wait(1);

                    //Type in name of new part and then save to Downloads
                    testRunner.Type("Save As Downloads");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
                    testRunner.Wait(1);
                    testRunner.ClickByName("Save As Save Button");

                    //Make sure there is a new Downloads item with a name that matches the new opart
                    testRunner.Wait(1);
                    testRunner.ClickByName("Library Tab");
                    testRunner.ClickByName("Bread Crumb Button Home");
                    testRunner.Wait(1);
                    MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Save As Downloads", 5));

                    //Do clean up for Downloads
                    testRunner.ClickByName("Row Item Save As Downloads", 2);
                    testRunner.ClickByName("Library Edit Button");
                    testRunner.ClickByName("Library Remove Item Button");

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 1);             // make sure we ran all our tests
        }
Beispiel #21
0
 public static void LibraryAddSelectionToQueue(AutomationRunner testRunner)
 {
     testRunner.ClickByName("LibraryActionMenu");
     testRunner.ClickByName("Add to Queue Menu Item", 1);
 }
 public static void RemoveAllFromQueue(this AutomationRunner testRunner)
 {
     testRunner.ClickByName("Queue... Menu");
     testRunner.Delay(1);
     testRunner.ClickByName(" Remove All Menu Item");
 }
Beispiel #23
0
 public static void InvokeLibraryCreateFolderDialog(this AutomationRunner testRunner)
 {
     testRunner.ClickByName("Print Library Overflow Menu");
     testRunner.ClickByName("Create Folder Menu Item");
 }
        public void AddToQueueFromLibraryButtonAddsItemsToQueue()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    //Navigate to Local Library
                    testRunner.ClickByName("Library Tab");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection");

                    //Add an item to the library
                    string libraryItemToAdd = MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl");
                    testRunner.ClickByName("Library Add Button");

                    testRunner.Wait(2);
                    testRunner.Type(libraryItemToAdd);
                    testRunner.Wait(2);
                    testRunner.Type("{Enter}");

                    testRunner.Wait(1);
                    testRunner.ClickByName("Library Edit Button");
                    testRunner.Wait(1);


                    //Select both Library Items
                    string rowItemOne = "Row Item " + "Calibration - Box";
                    testRunner.ClickByName(rowItemOne);

                    string rowItemTwo = "Row Item " + "Fennec Fox";
                    testRunner.ClickByName(rowItemTwo);


                    //Click the Add To Queue button
                    testRunner.Wait(1);
                    testRunner.ClickByName("Library Add To Queue Button");
                    testRunner.Wait(2);

                    //Make sure Queue Count increases by the correct amount
                    int  queueCountAfterAdd       = QueueData.Instance.Count;
                    bool queueCountIncreasedByTwo = false;
                    if (queueCountAfterAdd == 2)
                    {
                        queueCountIncreasedByTwo = true;
                    }

                    resultsHarness.AddTestResult(queueCountIncreasedByTwo == true);

                    //Navigate to the Print Queue
                    testRunner.ClickByName("Queue Tab");
                    testRunner.Wait(1);


                    //Test that both added print items exist
                    string queueItemOne         = "Queue Item " + "Calibration - Box";
                    string queueItemTwo         = "Queue Item " + "Fennec_Fox";
                    bool   queueItemOneWasAdded = testRunner.WaitForName(queueItemOne, 2);
                    bool   queueItemTwoWasAdded = testRunner.WaitForName(queueItemTwo, 2);

                    resultsHarness.AddTestResult(queueItemOneWasAdded == true);
                    resultsHarness.AddTestResult(queueItemTwoWasAdded == true);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 3);             // make sure we ran all our tests
        }
Beispiel #25
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
        }
Beispiel #26
0
 public static void LibraryEditSelectedItem(AutomationRunner testRunner)
 {
     testRunner.ClickByName("Edit Menu Item");
     testRunner.Delay(1);             // wait for the new window to open
 }
 public static void ClickSignOut(this AutomationRunner testRunner)
 {
     testRunner.ClickByName("User Options Menu");
     testRunner.ClickByName("Sign Out Menu Item");
     testRunner.Delay(.5);
 }
Beispiel #28
0
 public static void LibraryMoveSelectedItem(this AutomationRunner testRunner)
 {
     testRunner.ClickByName("Print Library Overflow Menu");
     testRunner.ClickByName("Move Menu Item");
 }
Beispiel #29
0
 private static void RemoveAllFromQueue(AutomationRunner testRunner)
 {
     Assert.IsTrue(testRunner.ClickByName("Queue... Menu", 2));
     Assert.IsTrue(testRunner.ClickByName(" Remove All Menu Item", 2));
 }
Beispiel #30
0
 public static void StartSlicing(this AutomationRunner testRunner)
 {
     testRunner.ClickByName("Generate Gcode Button");
 }