Ejemplo n.º 1
0
        public async Task CreateFolder()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();
                MatterControlUtilities.CreateDownloadsSubFolder();

                //Navigate to Downloads Library Provider
                testRunner.ClickByName("Library Tab");
                testRunner.NavigateToFolder("Downloads Row Item Collection");
                testRunner.NavigateToFolder("-Temporary Row Item Collection");

                string newFolderName = "New Folder";

                testRunner.ClickByName("Create Folder From Library Button");
                testRunner.Delay(2);
                testRunner.Type(newFolderName);
                testRunner.ClickByName("Create Folder Button");

                testRunner.Delay(2);
                Assert.IsTrue(testRunner.WaitForName(newFolderName + " Row Item Collection", 2), $"{newFolderName} exists");

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

            try
            {
                await MatterControlUtilities.RunTest(testToRun);
            }
            catch { }
            finally
            {
                MatterControlUtilities.DeleteDownloadsSubFolder();
            }
        }
Ejemplo n.º 2
0
        public void DownloadsAddButtonAddsMultipleFiles()
        {
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);
                    MatterControlUtilities.CreateDownloadsSubFolder();

                    //Navigate to Downloads Library Provider
                    testRunner.ClickByName("Library Tab");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
                    MatterControlUtilities.NavigateToFolder(testRunner, "-Temporary Row Item Collection");
                    testRunner.ClickByName("Library Add Button");
                    testRunner.Wait(3);

                    testRunner.Wait(2);

                    // Add both files to the FileOpen dialog
                    testRunner.Type(
                        string.Format(
                            "\"{0}\" \"{1}\"",
                            MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl"),
                            MatterControlUtilities.GetTestItemPath("Batman.stl")));

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

                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Fennec Fox", 2), "Fennec Fox item exists");
                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Batman", 2), "Batman item exists");
                    testRunner.Wait(1);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = null;

            try
            {
                testHarness = MatterControlUtilities.RunTest(testToRun);
            }
            catch { }
            finally
            {
                MatterControlUtilities.DeleteDownloadsSubFolder();
            }

            Assert.IsTrue(testHarness.AllTestsPassed(2));
        }
Ejemplo n.º 3
0
        public void DownloadsAddButtonAddsZipFiles()
        {
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);
                    MatterControlUtilities.CreateDownloadsSubFolder();

                    // Navigate to Downloads Library Provider
                    testRunner.ClickByName("Library Tab");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
                    MatterControlUtilities.NavigateToFolder(testRunner, "-Temporary Row Item Collection");
                    testRunner.ClickByName("Library Add Button");
                    testRunner.Wait(2);

                    // Add AMF part items to Downloads and then type paths into file dialogs
                    testRunner.Wait(2);
                    testRunner.Type(MatterControlUtilities.GetTestItemPath("Test.zip"));
                    testRunner.Wait(1);
                    testRunner.Type("{Enter}");

                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Chinese Dragon", 2), "Chinese Dragon item exists");
                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item chichen-itza pyramid", 2), "chichen-itza item exists");
                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Circle Calibration", 2), "Circle Calibration item exists");

                    testRunner.Wait(1);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };
            AutomationTesterHarness testHarness = null;

            try
            {
                testHarness = MatterControlUtilities.RunTest(testToRun);
            }
            catch { }

            // Give MatterControl a moment to shutdown
            Thread.Sleep(2000);
            try
            {
                // Then attempt to clean up
                MatterControlUtilities.DeleteDownloadsSubFolder();
            }
            catch { }

            Assert.IsTrue(testHarness.AllTestsPassed(3));
        }
        public void RenameDownloadsPrintItem()
        {
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.CreateDownloadsSubFolder();


                    //Navigate to Downloads Library Provider
                    testRunner.ClickByName("Library Tab");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Temporary Row Item Collection");
                    testRunner.ClickByName("Library Add Button");
                    testRunner.Wait(2);

                    testRunner.Type(MatterControlUtilities.GetTestItemPath("Batman.stl"));
                    testRunner.Wait(1);
                    testRunner.Type("{Enter}");

                    //Rename added item
                    testRunner.ClickByName("Library Edit Button", 2);
                    testRunner.ClickByName("Row Item Batman");
                    testRunner.ClickByName("Rename From Library Button", 2);
                    testRunner.Wait(2);
                    testRunner.Type("Batman Renamed");
                    testRunner.ClickByName("Rename Button");
                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Batman Renamed", 2) == true);


                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };
            AutomationTesterHarness testHarness = null;

            try
            {
                testHarness = MatterControlUtilities.RunTest(testToRun);
            }
            catch { }
            finally
            {
                MatterControlUtilities.CleanupDownloadsDirectory(MatterControlUtilities.PathToDownloadsSubFolder);
            }

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

                    //Navigate to Downloads Library Provider
                    testRunner.ClickByName("Library Tab");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Temporary Row Item Collection");
                    testRunner.ClickByName("Library Add Button");
                    testRunner.Wait(3);

                    string firstRowItemPath    = MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl");
                    string secondRowItemPath   = MatterControlUtilities.GetTestItemPath("Batman.stl");
                    string textForBothRowItems = String.Format("\"{0}\" \"{1}\"", firstRowItemPath, secondRowItemPath);
                    testRunner.Wait(2);
                    testRunner.Type(textForBothRowItems);
                    testRunner.Wait(1);
                    testRunner.Type("{Enter}");

                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Fennec Fox", 2) == true);
                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Batman", 2) == true);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = null;

            try
            {
                testHarness = MatterControlUtilities.RunTest(testToRun);
            }
            catch { }
            finally
            {
                MatterControlUtilities.CleanupDownloadsDirectory(MatterControlUtilities.PathToDownloadsSubFolder);
            }

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 2);             // make sure we ran all our tests
        }
        public void DownloadsAddButtonAddsZipFiles()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.CreateDownloadsSubFolder();


                    //Navigate to Downloads Library Provider
                    testRunner.ClickByName("Library Tab");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Temporary Row Item Collection");
                    testRunner.ClickByName("Library Add Button");
                    testRunner.Wait(2);

                    //Add AMF part items to Downloads and then type paths into file dialogues
                    testRunner.Wait(2);
                    testRunner.Type(MatterControlUtilities.GetTestItemPath("Test.zip"));
                    testRunner.Wait(1);
                    testRunner.Type("{Enter}");


                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Chinese Dragon", 2) == true);
                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item chichen-itza pyramid", 2) == true);
                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Circle Calibration", 2) == true);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };
            AutomationTesterHarness testHarness = null;

            try
            {
                testHarness = MatterControlUtilities.RunTest(testToRun);
            }
            catch { }
            finally
            {
                MatterControlUtilities.CleanupDownloadsDirectory(MatterControlUtilities.PathToDownloadsSubFolder);
            }

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 3);
        }
Ejemplo n.º 7
0
        public void DownloadsAddButtonAddsAMFFiles()
        {
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    MatterControlUtilities.CreateDownloadsSubFolder();

                    //Navigate to Downloads Library Provider
                    testRunner.ClickByName("Library Tab");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
                    MatterControlUtilities.NavigateToFolder(testRunner, "-Temporary Row Item Collection");
                    testRunner.ClickByName("Library Add Button");
                    testRunner.Wait(2);

                    //Add AMF part items to Downloads and then type paths into file dialogues
                    testRunner.Wait(2);
                    testRunner.Type(MatterControlUtilities.GetTestItemPath("Rook.amf"));
                    testRunner.Wait(1);
                    testRunner.Type("{Enter}");

                    resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Rook", 2), "Rook item exists");
                    testRunner.Wait(1);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = null;

            try
            {
                testHarness = MatterControlUtilities.RunTest(testToRun);
            }
            catch { }
            finally
            {
                MatterControlUtilities.DeleteDownloadsSubFolder();
            }

            Assert.IsTrue(testHarness.AllTestsPassed(1));
        }
Ejemplo n.º 8
0
        public async Task DownloadsAddButtonAddsZipFiles()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();
                MatterControlUtilities.CreateDownloadsSubFolder();

                // Navigate to Downloads Library Provider
                testRunner.ClickByName("Library Tab");
                testRunner.NavigateToFolder("Downloads Row Item Collection");
                testRunner.NavigateToFolder("-Temporary Row Item Collection");
                testRunner.ClickByName("Library Add Button");
                testRunner.Delay(2);

                // Add AMF part items to Downloads and then type paths into file dialogs
                testRunner.Delay(2);
                testRunner.Type(MatterControlUtilities.GetTestItemPath("Test.zip"));
                testRunner.Delay(1);
                testRunner.Type("{Enter}");

                Assert.IsTrue(testRunner.WaitForName("Row Item Chinese Dragon", 2), "Chinese Dragon item exists");
                Assert.IsTrue(testRunner.WaitForName("Row Item chichen-itza pyramid", 2), "chichen-itza item exists");
                Assert.IsTrue(testRunner.WaitForName("Row Item Circle Calibration", 2), "Circle Calibration item exists");

                testRunner.Delay(1);

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

            try
            {
                MatterControlUtilities.RunTest(testToRun);
            }
            catch { }

            // Give MatterControl a moment to shutdown
            Thread.Sleep(2000);
            try
            {
                // Then attempt to clean up
                MatterControlUtilities.DeleteDownloadsSubFolder();
            }
            catch { }
        }
Ejemplo n.º 9
0
        public async Task DownloadsAddButtonAddsMultipleFiles()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();
                MatterControlUtilities.CreateDownloadsSubFolder();

                //Navigate to Downloads Library Provider
                testRunner.ClickByName("Library Tab");
                testRunner.NavigateToFolder("Downloads Row Item Collection");
                testRunner.NavigateToFolder("-Temporary Row Item Collection");
                testRunner.ClickByName("Library Add Button");
                testRunner.Delay(3);

                testRunner.Delay(2);

                // Add both files to the FileOpen dialog
                testRunner.Type(
                    string.Format(
                        "\"{0}\" \"{1}\"",
                        MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl"),
                        MatterControlUtilities.GetTestItemPath("Batman.stl")));

                testRunner.Delay(1);
                testRunner.Type("{Enter}");

                Assert.IsTrue(testRunner.WaitForName("Row Item Fennec Fox", 2), "Fennec Fox item exists");
                Assert.IsTrue(testRunner.WaitForName("Row Item Batman", 2), "Batman item exists");
                testRunner.Delay(1);

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

            // TODO: The standard assignment without a try/catch should be used and DeleteDownloadsSubFolder should be called from a TearDown method
            try
            {
                await MatterControlUtilities.RunTest(testToRun);
            }
            catch { }
            finally
            {
                MatterControlUtilities.DeleteDownloadsSubFolder();
            }
        }
Ejemplo n.º 10
0
        public void CreateFolder()
        {
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    MatterControlUtilities.CreateDownloadsSubFolder();

                    //Navigate to Downloads Library Provider
                    testRunner.ClickByName("Library Tab");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
                    MatterControlUtilities.NavigateToFolder(testRunner, "-Temporary Row Item Collection");

                    string newFolderName = "New Folder";

                    testRunner.ClickByName("Create Folder From Library Button");
                    testRunner.Wait(2);
                    testRunner.Type(newFolderName);
                    testRunner.ClickByName("Create Folder Button");

                    testRunner.Wait(2);
                    resultsHarness.AddTestResult(testRunner.WaitForName(newFolderName + " Row Item Collection", 2), $"{newFolderName} exists");

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };

            AutomationTesterHarness testHarness = null;

            try
            {
                testHarness = MatterControlUtilities.RunTest(testToRun);
            }
            catch { }
            finally
            {
                MatterControlUtilities.DeleteDownloadsSubFolder();
            }

            Assert.IsTrue(testHarness.AllTestsPassed(1));
        }
        public void CreateFolder()
        {
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
                {
                    MatterControlUtilities.PrepForTestRun(testRunner);

                    MatterControlUtilities.CreateDownloadsSubFolder();

                    //Navigate to Downloads Library Provider
                    testRunner.ClickByName("Library Tab");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Downloads Row Item Collection");
                    MatterControlUtilities.NavigateToFolder(testRunner, "Temporary Row Item Collection");
                    testRunner.ClickByName("Create Folder From Library Button");
                    testRunner.Wait(2);
                    testRunner.Type("New Folder");
                    testRunner.ClickByName("Create Folder Button");

                    testRunner.Wait(2);
                    resultsHarness.AddTestResult(testRunner.WaitForName("New Folder Row Item Collection", 2) == true);

                    MatterControlUtilities.CloseMatterControl(testRunner);
                }
            };
            AutomationTesterHarness testHarness = null;

            try
            {
                testHarness = MatterControlUtilities.RunTest(testToRun);
            }
            catch { }
            finally
            {
                MatterControlUtilities.CleanupDownloadsDirectory(MatterControlUtilities.PathToDownloadsSubFolder);
            }

            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 1);
        }
Ejemplo n.º 12
0
        public async Task RenameDownloadsPrintItem()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();
                MatterControlUtilities.CreateDownloadsSubFolder();

                //Navigate to Downloads Library Provider
                testRunner.ClickByName("Library Tab");
                testRunner.NavigateToFolder("Downloads Row Item Collection");
                testRunner.NavigateToFolder("-Temporary Row Item Collection");
                testRunner.ClickByName("Library Add Button");
                testRunner.Delay(2);

                testRunner.Type(MatterControlUtilities.GetTestItemPath("Batman.stl"));
                testRunner.Delay(1);
                testRunner.Type("{Enter}");

                //Rename added item
                testRunner.ClickByName("Library Edit Button", .5);
                testRunner.ClickByName("Row Item Batman");
                MatterControlUtilities.LibraryRenameSelectedItem(testRunner);
                testRunner.Delay(.5);
                testRunner.Type("Batman Renamed");
                testRunner.ClickByName("Rename Button");
                Assert.IsTrue(testRunner.WaitForName("Row Item Batman Renamed", 2));

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

            try
            {
                await MatterControlUtilities.RunTest(testToRun);
            }
            catch { }
            finally
            {
                MatterControlUtilities.DeleteDownloadsSubFolder();
            }
        }
Ejemplo n.º 13
0
        public async Task DownloadsAddButtonAddsAMFFiles()
        {
            AutomationTest testToRun = (testRunner) =>
            {
                testRunner.CloseSignInAndPrinterSelect();
                MatterControlUtilities.CreateDownloadsSubFolder();

                //Navigate to Downloads Library Provider
                testRunner.ClickByName("Library Tab");
                testRunner.NavigateToFolder("Downloads Row Item Collection");
                testRunner.NavigateToFolder("-Temporary Row Item Collection");
                testRunner.ClickByName("Library Add Button");
                testRunner.Delay(2);

                //Add AMF part items to Downloads and then type paths into file dialog
                testRunner.Delay(2);
                testRunner.Type(MatterControlUtilities.GetTestItemPath("Rook.amf"));
                testRunner.Delay(1);
                testRunner.Type("{Enter}");

                Assert.IsTrue(testRunner.WaitForName("Row Item Rook", 2), "Rook item exists");
                testRunner.Delay(1);

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

            try
            {
                await MatterControlUtilities.RunTest(testToRun);
            }
            catch { }
            finally
            {
                MatterControlUtilities.DeleteDownloadsSubFolder();
            }
        }
Ejemplo n.º 14
0
 public void Setup()
 {
     MatterControlUtilities.CreateDownloadsSubFolder();
 }