예제 #1
0
        public async Task ClickLibraryEditButtonOpensPartPreviewWindow()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();
                //Navigate to Local Library
                testRunner.ClickByName("Library Tab");
                testRunner.NavigateToFolder("Local Library Row Item Collection");

                testRunner.Delay(1);

                string rowItem = "Row Item Calibration - Box";
                testRunner.ClickByName("Library Edit Button");
                testRunner.Delay(1);
                testRunner.ClickByName(rowItem);

                MatterControlUtilities.LibraryEditSelectedItem(testRunner);

                //Make sure that Export Item Window exists after Export button is clicked
                bool exportItemWindowExists = testRunner.WaitForName("Part Preview Window", 2);
                Assert.IsTrue(exportItemWindowExists == true);

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

            await MatterControlUtilities.RunTest(testToRun);
        }
예제 #2
0
        public void SaveAsToQueue()
        {
            // 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");
                    testRunner.Wait(1);
                    testRunner.ClickByName("Row Item Calibration - Box");
                    MatterControlUtilities.LibraryEditSelectedItem(testRunner);
                    testRunner.Wait(1);

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

                    SystemWindow systemWindow;
                    GuiWidget    partPreview = testRunner.GetWidgetByName("View3DWidget", out systemWindow, 3);
                    View3DWidget view3D      = partPreview as View3DWidget;

                    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 Print Queue
                    testRunner.Type("Save As Print Queue");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Print Queue Row Item Collection");
                    testRunner.Wait(1);
                    testRunner.ClickByName("Save As Save Button");

                    view3D.CloseOnIdle();
                    testRunner.Wait(.5);

                    //Make sure there is a new Queue item with a name that matches the new part
                    testRunner.Wait(1);
                    testRunner.ClickByName("Queue Tab");
                    testRunner.Wait(1);
                    resultsHarness.AddTestResult(testRunner.WaitForName("Queue Item Save As Print Queue", 5));

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            Assert.IsTrue(testHarness.AllTestsPassed(1));
        }
예제 #3
0
        public void ClickLibraryEditButtonOpensPartPreviewWindow()
        {
            // 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");

                    testRunner.Wait(1);

                    string rowItem = "Row Item " + "Calibration - Box";
                    testRunner.ClickByName("Library Edit Button");
                    testRunner.Wait(1);
                    testRunner.ClickByName(rowItem);

                    MatterControlUtilities.LibraryEditSelectedItem(testRunner);

                    //Make sure that Export Item Window exists after Export button is clicked
                    bool exportItemWindowExists = testRunner.WaitForName("Part Preview Window", 2);
                    resultsHarness.AddTestResult(exportItemWindowExists == true);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

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

                    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");
                    MatterControlUtilities.LibraryEditSelectedItem(testRunner);
                    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);
                    }

                    //Get MeshGroupCount before Group is clicked
                    System.Threading.Thread.Sleep(2000);
                    int partsOnBedBeforeRemove = view3D.MeshGroups.Count();
                    resultsHarness.AddTestResult(partsOnBedBeforeRemove == 6);

                    //Check that MeshCount decreases by 1
                    testRunner.ClickByName("3D View Remove");
                    System.Threading.Thread.Sleep(2000);
                    int meshCountAfterRemove = view3D.MeshGroups.Count();
                    resultsHarness.AddTestResult(meshCountAfterRemove == 5);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 3);             // make sure we ran all our tests
        }
예제 #5
0
        public async Task GroupAndUngroup()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();

                SystemWindow systemWindow;

                //Navigate to Local Library
                testRunner.ClickByName("Library Tab");
                testRunner.NavigateToFolder("Local Library Row Item Collection");
                testRunner.Delay(1);
                testRunner.ClickByName("Row Item Calibration - Box");
                MatterControlUtilities.LibraryEditSelectedItem(testRunner);

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

                int partCountBeforeCopy = view3D.MeshGroups.Count;
                Assert.IsTrue(partCountBeforeCopy == 1);

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

                //Get MeshGroupCount before Group is clicked
                System.Threading.Thread.Sleep(2000);
                int partsOnBedBeforeGroup = view3D.MeshGroups.Count;
                Assert.IsTrue(partsOnBedBeforeGroup == 6);

                //Click Group Button and get MeshGroup count after Group button is clicked
                testRunner.ClickByName("3D View Group");
                System.Threading.Thread.Sleep(2000);
                int partsOnBedAfterGroup = view3D.MeshGroups.Count;
                Assert.IsTrue(partsOnBedAfterGroup == 1);

                testRunner.ClickByName("3D View Ungroup");
                System.Threading.Thread.Sleep(2000);
                int partsOnBedAfterUngroup = view3D.MeshGroups.Count;
                Assert.IsTrue(partsOnBedAfterUngroup == 6);

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

            await MatterControlUtilities.RunTest(testToRun, overrideWidth : 600);
        }
예제 #6
0
        public async Task CopyRemoveUndoRedo()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                SystemWindow systemWindow;

                testRunner.CloseSignInAndPrinterSelect();

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

                // Get View3DWidget
                View3DWidget view3D = testRunner.GetWidgetByName("View3DWidget", out systemWindow, 3) as View3DWidget;

                // Click Edit button to make edit controls visible
                testRunner.WaitForName("3D View Copy", 3);
                testRunner.Delay(1);                 // wait for window to finish opening
                Assert.AreEqual(1, view3D.MeshGroups.Count, "Should have 1 part before copy");

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

                Assert.AreEqual(6, view3D.MeshGroups.Count, "Should have 6 parts after batch copy");

                testRunner.ClickByName("3D View Remove", 1);
                testRunner.Delay(() => view3D.MeshGroups.Count == 5, 3);
                Assert.AreEqual(5, view3D.MeshGroups.Count, "Should have 5 parts after Remove");

                testRunner.ClickByName("3D View Undo");
                testRunner.Delay(() => view3D.MeshGroups.Count == 6, 3);
                Assert.AreEqual(6, view3D.MeshGroups.Count, "Should have 6 parts after Undo");

                testRunner.ClickByName("3D View Redo");
                testRunner.Delay(() => view3D.MeshGroups.Count == 5, 3);
                Assert.AreEqual(5, view3D.MeshGroups.Count, "Should have 5 parts after Redo");

                view3D.CloseOnIdle();
                testRunner.Delay(.1);

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

            await MatterControlUtilities.RunTest(testToRun, overrideWidth : 800);
        }
예제 #7
0
        public async Task SaveAsToQueue()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();

                //Navigate to Local Library
                testRunner.ClickByName("Library Tab");
                testRunner.NavigateToFolder("Local Library Row Item Collection");
                testRunner.Delay(1);
                testRunner.ClickByName("Row Item Calibration - Box");
                MatterControlUtilities.LibraryEditSelectedItem(testRunner);

                SystemWindow systemWindow;
                GuiWidget    partPreview = testRunner.GetWidgetByName("View3DWidget", out systemWindow, 3);
                View3DWidget view3D      = partPreview as View3DWidget;

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

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

                //Type in name of new part and then save to Print Queue
                testRunner.Type("Save As Print Queue");
                testRunner.NavigateToFolder("Print Queue Row Item Collection");
                testRunner.Delay(1);
                testRunner.ClickByName("Save As Save Button");

                view3D.CloseOnIdle();
                testRunner.Delay(.5);

                //Make sure there is a new Queue item with a name that matches the new part
                testRunner.Delay(1);
                testRunner.ClickByName("Queue Tab");
                testRunner.Delay(1);
                Assert.IsTrue(testRunner.WaitForName("Queue Item Save As Print Queue", 5));

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

            await MatterControlUtilities.RunTest(testToRun, overrideWidth : 600);
        }
예제 #8
0
        public async Task UndoRedoCopy()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();

                SystemWindow systemWindow;

                // Navigate to Local Library
                testRunner.ClickByName("Library Tab");
                testRunner.NavigateToFolder("Local Library Row Item Collection");
                testRunner.ClickByName("Row Item Calibration - Box");
                MatterControlUtilities.LibraryEditSelectedItem(testRunner);

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

                for (int i = 0; i <= 4; i++)
                {
                    testRunner.ClickByName("3D View Copy");
                    testRunner.Delay(() => view3D.MeshGroups.Count == i + 2, 2);
                    Assert.AreEqual(i + 2, view3D.MeshGroups.Count);
                }

                testRunner.Delay(.2);

                for (int x = 0; x <= 4; x++)
                {
                    int meshCountBeforeUndo = view3D.MeshGroups.Count;
                    testRunner.ClickByName("3D View Undo");
                    testRunner.Delay(() => view3D.MeshGroups.Count == meshCountBeforeUndo - 1, 2);
                    Assert.AreEqual(meshCountBeforeUndo - 1, view3D.MeshGroups.Count);
                }

                testRunner.Delay(.2);

                for (int z = 0; z <= 4; z++)
                {
                    int meshCountBeforeRedo = view3D.MeshGroups.Count;
                    testRunner.ClickByName("3D View Redo");
                    testRunner.Delay(() => view3D.MeshGroups.Count == meshCountBeforeRedo + 1, 2);
                    Assert.AreEqual(meshCountBeforeRedo + 1, view3D.MeshGroups.Count);
                }

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

            await MatterControlUtilities.RunTest(testToRun, overrideWidth : 640);
        }
예제 #9
0
        public void UndoRedoDelete()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    SystemWindow systemWindow;

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

                    //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", 1);
                    int partCountBeforeCopy = view3D.MeshGroups.Count();
                    resultsHarness.AddTestResult(partCountBeforeCopy == 1);
                    testRunner.Wait(.5);

                    for (int i = 0; i <= 4; i++)
                    {
                        testRunner.ClickByName(copyButtonName, 1);
                        testRunner.Wait(.2);
                        int meshCount = view3D.MeshGroups.Count();
                        resultsHarness.AddTestResult(meshCount == partCountBeforeCopy + i + 1);
                    }

                    int meshCountAfterCopy = view3D.MeshGroups.Count();
                    resultsHarness.AddTestResult(meshCountAfterCopy == 6);
                    testRunner.ClickByName("3D View Remove", 1);
                    testRunner.Wait(.1);
                    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);

                    partPreview.CloseOnIdle();
                    testRunner.Wait(.1);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

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

            Assert.IsTrue(testHarness.AllTestsPassed(10));
        }