Exemplo n.º 1
0
        //DOES NOT WORK
        public void ClickingConfigureNotificationSettingsButtonOpensWindow()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUITests.DefaultTestImages);
                {
                    testRunner.ClickByName("SettingsAndControls", 5);
                    testRunner.Wait(2);
                    testRunner.ClickByName("Configuration Tab", 6);

                    bool printNotificationsWindowExists1 = testRunner.WaitForName("Notification Options Window", 0);
                    resultsHarness.AddTestResult(printNotificationsWindowExists1 == false, "Print Notification Window does not exist");

                    testRunner.ClickByName("Configure Notification Settings Button", 6);
                    bool printNotificationsWindowExists2 = testRunner.WaitForName("Notification Options Window", 3);
                    resultsHarness.AddTestResult(printNotificationsWindowExists2 == true, "Print Notifications Window exists after Configure button is clicked");

                    MatterControlUITests.CloseMatterControl(testRunner);
                }
            };

#if !__ANDROID__
            // Set the static data to point to the directory of MatterControl
            StaticData.Instance = new MatterHackers.Agg.FileSystemStaticData(Path.Combine("..", "..", "..", "..", "StaticData"));
#endif
            bool   showWindow;
            string testDBFolder = "MC_Three_Queue_Items";
            MatterControlUITests.DataFolderState staticDataState     = MatterControlUITests.MakeNewStaticDataForTesting(testDBFolder);
            MatterControlApplication             matterControlWindow = MatterControlApplication.CreateInstance(out showWindow);
            AutomationTesterHarness testHarness = AutomationTesterHarness.ShowWindowAndExectueTests(matterControlWindow, testToRun, 45);
            MatterControlUITests.RestoreStaticDataAfterTesting(staticDataState, true);
            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 2);             // make sure we ran all our tests
        }
Exemplo n.º 2
0
        public void ExportButtonIsDisabledWithNoItemsInQueue()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUITests.DefaultTestImages);
                {
                    //bool exportButtonExists = testRunner.NameExists("Export Queue Button");
                    bool exportButtonExists = testRunner.WaitForName("Export Queue Button", 10);
                    testRunner.Wait(5);
                    resultsHarness.AddTestResult(exportButtonExists == false, "Export button is disabled");

                    MatterControlUITests.CloseMatterControl(testRunner);
                }
            };

#if !__ANDROID__
            // Set the static data to point to the directory of MatterControl
            StaticData.Instance = new MatterHackers.Agg.FileSystemStaticData(Path.Combine("..", "..", "..", "..", "StaticData"));
#endif
            bool   showWindow;
            string testDBFolder = "MC_Fresh_Installation";
            MatterControlUITests.DataFolderState staticDataState     = MatterControlUITests.MakeNewStaticDataForTesting(testDBFolder);
            MatterControlApplication             matterControlWindow = MatterControlApplication.CreateInstance(out showWindow);
            AutomationTesterHarness testHarness = AutomationTesterHarness.ShowWindowAndExectueTests(matterControlWindow, testToRun, 300);
            MatterControlUITests.RestoreStaticDataAfterTesting(staticDataState, true);
            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 1);             // make sure we ran all our tests
        }
Exemplo n.º 3
0
        public void QueueThumbnailWidgetOpensPartPreview()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUITests.DefaultTestImages);
                {
                    bool partPreviewWindowExists1 = testRunner.WaitForName("Part Preview Window Thumbnail", 0);
                    resultsHarness.AddTestResult(partPreviewWindowExists1 == false, "Part Preview Window Does Not Exist");

                    testRunner.ClickByName("Queue Item Thumbnail");

                    SystemWindow containingWindow;
                    GuiWidget    partPreviewWindowExists = testRunner.GetWidgetByName("Part Preview Window Thumbnail", out containingWindow, secondsToWait: 3);
                    resultsHarness.AddTestResult(partPreviewWindowExists != null, "Part Preview Window Exists");
                    partPreviewWindowExists.CloseOnIdle();
                    testRunner.Wait(.5);

                    MatterControlUITests.CloseMatterControl(testRunner);
                }
            };

#if !__ANDROID__
            // Set the static data to point to the directory of MatterControl
            StaticData.Instance = new MatterHackers.Agg.FileSystemStaticData(Path.Combine("..", "..", "..", "..", "StaticData"));
#endif
            bool   showWindow;
            string testDBFolder = "MC_Three_Queue_Items";
            MatterControlUITests.DataFolderState staticDataState     = MatterControlUITests.MakeNewStaticDataForTesting(testDBFolder);
            MatterControlApplication             matterControlWindow = MatterControlApplication.CreateInstance(out showWindow);
            AutomationTesterHarness testHarness = AutomationTesterHarness.ShowWindowAndExectueTests(matterControlWindow, testToRun, 300);
            MatterControlUITests.RestoreStaticDataAfterTesting(staticDataState, true);
            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 2);             // make sure we ran all our tests
        }
Exemplo n.º 4
0
        //Test Works
        public void ClickOnExportButton()
        {
            // Run a copy of MatterControl
            Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
            {
                AutomationRunner testRunner = new AutomationRunner(MatterControlUITests.DefaultTestImages);
                {
                    //Make sure that the export window does not exist
                    bool exportWindowExists1 = testRunner.WaitForName("Export Window Queue", 0);
                    resultsHarness.AddTestResult(exportWindowExists1 == false, "Export window does not exist");

                    testRunner.ClickByName("Export Queue Button", 5);
                    SystemWindow containingWindow;
                    GuiWidget    exportWindow = testRunner.GetWidgetByName("Export Window Queue", out containingWindow, secondsToWait: 5);
                    resultsHarness.AddTestResult(exportWindow != null, "Export window does exist");
                    exportWindow.CloseOnIdle();
                    testRunner.Wait(.5);

                    MatterControlUITests.CloseMatterControl(testRunner);
                }
            };

#if !__ANDROID__
            // Set the static data to point to the directory of MatterControl
            StaticData.Instance = new MatterHackers.Agg.FileSystemStaticData(Path.Combine("..", "..", "..", "..", "StaticData"));
#endif
            bool   showWindow;
            string testDBFolder = "MC_Three_Queue_Items";
            MatterControlUITests.DataFolderState staticDataState     = MatterControlUITests.MakeNewStaticDataForTesting(testDBFolder);
            MatterControlApplication             matterControlWindow = MatterControlApplication.CreateInstance(out showWindow);
            AutomationTesterHarness testHarness = AutomationTesterHarness.ShowWindowAndExectueTests(matterControlWindow, testToRun, 60);
            MatterControlUITests.RestoreStaticDataAfterTesting(staticDataState, true);
            Assert.IsTrue(testHarness.AllTestsPassed);
            Assert.IsTrue(testHarness.TestCount == 2);             // make sure we ran all our tests
        }