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)); }
public void CopyButtonClickedMakesCopyOfPartOnBed() { // 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"); testRunner.ClickByName("Row Item Calibration - Box View 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); //Click Copy button and count MeshGroups testRunner.ClickByName(copyButtonName); System.Threading.Thread.Sleep(500); int partCountAfterCopy = view3D.MeshGroups.Count(); resultsHarness.AddTestResult(partCountAfterCopy == 2); testRunner.Wait(1); //Click Copy button a second time and count MeshGroups again testRunner.ClickByName(copyButtonName); System.Threading.Thread.Sleep(500); int partCountAfterSecondCopy = view3D.MeshGroups.Count(); resultsHarness.AddTestResult(partCountAfterSecondCopy == 3); view3D.CloseOnIdle(); testRunner.Wait(.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 }
public void LibraryQueueViewRefreshesOnAddItem() { // Run a copy of MatterControl Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) => { AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages); { MatterControlUtilities.PrepForTestRun(testRunner); testRunner.ClickByName("Library Tab", 5); MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); testRunner.Wait(1); testRunner.ClickByName("Row Item Calibration - Box"); testRunner.ClickByName("Row Item Calibration - Box View Button"); testRunner.Wait(1); SystemWindow systemWindow; GuiWidget partPreview = testRunner.GetWidgetByName("View3DWidget", out systemWindow, 3); View3DWidget view3D = partPreview as View3DWidget; 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 Remove", 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("0Test Part"); resultsHarness.AddTestResult(MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection")); resultsHarness.AddTestResult(testRunner.ClickByName("Save As Save Button", 1)); view3D.CloseOnIdle(); testRunner.Wait(.5); // ensure that it is now in the library folder (that the folder updated) resultsHarness.AddTestResult(testRunner.WaitForName("Row Item " + "0Test Part", 5), "The part we added should be in the library"); testRunner.Wait(.5); MatterControlUtilities.CloseMatterControl(testRunner); } }; AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, queueItemFolderToAdd: QueueTemplate.Three_Queue_Items); Assert.IsTrue(testHarness.AllTestsPassed); Assert.IsTrue(testHarness.TestCount == 8); // make sure we ran all our tests }
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); }
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); }
public async Task LibraryQueueViewRefreshesOnAddItem() { AutomationTest testToRun = (testRunner) => { testRunner.CloseSignInAndPrinterSelect(); testRunner.ClickByName("Library Tab", 5); testRunner.NavigateToFolder("Local Library Row Item Collection"); testRunner.Delay(1); testRunner.ClickByName("Row Item Calibration - Box"); testRunner.ClickByName("Row Item Calibration - Box View Button"); testRunner.Delay(1); SystemWindow systemWindow; GuiWidget partPreview = testRunner.GetWidgetByName("View3DWidget", out systemWindow, 3); View3DWidget view3D = partPreview as View3DWidget; testRunner.ClickByName("3D View Edit", 3); testRunner.ClickByName("3D View Copy", 3); // wait for the copy to finish testRunner.Delay(.1); testRunner.ClickByName("3D View Remove", 3); testRunner.ClickByName("Save As Menu", 3); testRunner.ClickByName("Save As Menu Item", 3); testRunner.Delay(1); testRunner.Type("0Test Part"); testRunner.NavigateToFolder("Local Library Row Item Collection"); testRunner.ClickByName("Save As Save Button", 1); view3D.CloseOnIdle(); testRunner.Delay(.5); // ensure that it is now in the library folder (that the folder updated) Assert.IsTrue(testRunner.WaitForName("Row Item 0Test Part", 5), "The part we added should be in the library"); testRunner.Delay(.5); return(Task.FromResult(0)); }; await MatterControlUtilities.RunTest(testToRun, queueItemFolderToAdd : QueueTemplate.Three_Queue_Items, overrideWidth : 600); }