public void RemoveButtonClickedRemovesSingleItem() { // 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"); testRunner.Wait(1); string rowItem = "Row Item " + "Calibration - Box"; testRunner.ClickByName("Library Edit Button"); testRunner.Wait(1); testRunner.ClickByName(rowItem); testRunner.ClickByName("Library Remove Item Button"); testRunner.Wait(1); //Make sure that Export Item Window exists after Export button is clicked bool rowItemExists = testRunner.WaitForName(rowItem, 2); resultsHarness.AddTestResult(rowItemExists == false); MatterControlUtilities.CloseMatterControl(testRunner); } }; AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); Assert.IsTrue(testHarness.AllTestsPassed); Assert.IsTrue(testHarness.TestCount == 1); // make sure we ran all our tests }
public void CreateFolderStarsOutWithTextFiledFocusedAndEditable() { // 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"); MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); testRunner.ClickByName("Create Folder From Library Button"); testRunner.Wait(.5); testRunner.Type("Test Text"); testRunner.Wait(.5); SystemWindow containingWindow; GuiWidget textInputWidget = testRunner.GetWidgetByName("Create Folder - Text Input", out containingWindow); MHTextEditWidget textWidgetMH = textInputWidget as MHTextEditWidget; resultsHarness.AddTestResult(textWidgetMH != null, "Found Text Widget"); resultsHarness.AddTestResult(textWidgetMH.Text == "Test Text", "Had the right text"); containingWindow.CloseOnIdle(); testRunner.Wait(.5); MatterControlUtilities.CloseMatterControl(testRunner); } }; AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); Assert.IsTrue(testHarness.AllTestsPassed); Assert.IsTrue(testHarness.TestCount == 2); // make sure we ran all our tests }
public void GroupAndUngroup() { // 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); } //Get MeshGroupCount before Group is clicked System.Threading.Thread.Sleep(2000); int partsOnBedBeforeGroup = view3D.MeshGroups.Count(); resultsHarness.AddTestResult(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(); resultsHarness.AddTestResult(partsOnBedAfterGroup == 1); testRunner.ClickByName("3D View Ungroup"); System.Threading.Thread.Sleep(2000); int partsOnBedAfterUngroup = view3D.MeshGroups.Count(); resultsHarness.AddTestResult(partsOnBedAfterUngroup == 6); MatterControlUtilities.CloseMatterControl(testRunner); } }; AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); Assert.IsTrue(testHarness.AllTestsPassed); Assert.IsTrue(testHarness.TestCount == 4); // 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 }
public void AddToQueueFromLibraryButtonAddsItemToQueue() { // 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"); testRunner.Wait(1); testRunner.ClickByName("Library Edit Button"); testRunner.Wait(1); //Select Library Item string rowItemOne = "Row Item " + "Calibration - Box"; testRunner.ClickByName(rowItemOne); testRunner.Wait(1); //Add Library Item to the Print Queue testRunner.ClickByName("Library Add To Queue Button"); testRunner.Wait(2); //Make sure that the Queue Count increases by one int queueCountAfterAdd = QueueData.Instance.Count; bool queueCountIncreasedByOne = false; if (queueCountAfterAdd == 1) { queueCountIncreasedByOne = true; } resultsHarness.AddTestResult(queueCountIncreasedByOne == true); //Navigate to Queue testRunner.ClickByName("Queue Tab"); testRunner.Wait(1); //Make sure that the Print Item was added string queueItem = "Queue Item " + "Calibration - Box"; bool queueItemWasAdded = testRunner.WaitForName(queueItem, 2); resultsHarness.AddTestResult(queueItemWasAdded == 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 }
public void RemoveButtonClickedRemovesMultipleItems() { // 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"); testRunner.Wait(1); testRunner.ClickByName("Library Edit Button"); testRunner.Wait(1); string rowItemPath = MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl"); testRunner.ClickByName("Library Add Button"); testRunner.Wait(2); testRunner.Type(rowItemPath); testRunner.Type("{Enter}"); string rowItemOne = "Row Item " + "Calibration - Box"; testRunner.ClickByName(rowItemOne); string rowItemTwo = "Row Item " + "Fennec Fox"; testRunner.ClickByName(rowItemTwo); testRunner.Wait(1); //Make sure row items exist before remove bool rowItemOneExistsBeforeRemove = testRunner.WaitForName(rowItemOne, 2); bool rowItemTwoExistsBeforeRemove = testRunner.WaitForName(rowItemTwo, 2); resultsHarness.AddTestResult(rowItemOneExistsBeforeRemove == true); resultsHarness.AddTestResult(rowItemTwoExistsBeforeRemove == true); testRunner.ClickByName("Library Remove Item Button"); testRunner.Wait(1); //Make sure both selected items are removed bool rowItemOneExists = testRunner.WaitForName(rowItemOne, 2); bool rowItemTwoExists = testRunner.WaitForName(rowItemTwo, 2); resultsHarness.AddTestResult(rowItemOneExists == false); resultsHarness.AddTestResult(rowItemTwoExists == false); MatterControlUtilities.CloseMatterControl(testRunner); } }; AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); Assert.IsTrue(testHarness.AllTestsPassed); Assert.IsTrue(testHarness.TestCount == 4); // make sure we ran all our tests }
public void LocalLibraryAddButtonAddsMultipleItemsToLibrary() { // Run a copy of MatterControl Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) => { AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages); { //Names of Items to be added string firstItemName = "Row Item " + "Fennec Fox"; string secondItemName = "Row Item " + "Batman"; //Navigate to Local Library testRunner.ClickByName("Library Tab"); MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); //Make sure both Items do not exist before the test begins bool firstItemExists = testRunner.WaitForName(firstItemName, 1); bool secondItemExists = testRunner.WaitForName(secondItemName, 1); resultsHarness.AddTestResult(firstItemExists == false); resultsHarness.AddTestResult(secondItemExists == false); //Click Local Library Add Button testRunner.ClickByName("Library Add Button"); //Get Library Item to Add 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}"); bool firstRowItemWasAdded = testRunner.WaitForName(firstItemName, 2); bool secondRowItemWasAdded = testRunner.WaitForName(secondItemName, 2); resultsHarness.AddTestResult(firstRowItemWasAdded == true); resultsHarness.AddTestResult(secondRowItemWasAdded == true); MatterControlUtilities.CloseMatterControl(testRunner); } }; AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); Assert.IsTrue(testHarness.AllTestsPassed); Assert.IsTrue(testHarness.TestCount == 4); // make sure we ran all our tests }
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 }
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); SystemWindow containingWindow; GuiWidget foundWidget = testRunner.GetWidgetByName("Row Item Select Checkbox", out containingWindow, 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 }
public void LocalLibraryAddButtonAddZipToLibrary() { // Run a copy of MatterControl Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) => { AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages); { //Items in Batman.zip string firstItemName = "Row Item " + "Batman"; string secondItemName = "Row Item " + "2013-01-25 Mouthpiece v2"; //Navigate to Local Library testRunner.ClickByName("Library Tab"); MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); //Make sure that Item does not exist before the test begins bool firstItemInZipExists = testRunner.WaitForName(firstItemName, 1); bool secondItemInZipExists = testRunner.WaitForName(secondItemName, 1); resultsHarness.AddTestResult(firstItemInZipExists == false); resultsHarness.AddTestResult(firstItemInZipExists == false); //Click Local Library Add Button testRunner.ClickByName("Library Add Button"); //Get Library Item to Add string rowItemPath = MatterControlUtilities.GetTestItemPath("Batman.zip"); testRunner.Wait(2); testRunner.Type(rowItemPath); testRunner.Wait(1); testRunner.Type("{Enter}"); bool firstItemInZipWasAdded = testRunner.WaitForName(firstItemName, 2); bool secondItemInZipWasAdded = testRunner.WaitForName(secondItemName, 2); resultsHarness.AddTestResult(firstItemInZipWasAdded == true); resultsHarness.AddTestResult(secondItemInZipWasAdded == true); MatterControlUtilities.CloseMatterControl(testRunner); } }; AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); Assert.IsTrue(testHarness.AllTestsPassed); Assert.IsTrue(testHarness.TestCount == 4); // make sure we ran all our tests }
public void RenameButtonRenameLocalLibraryItem() { // 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"); //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"); testRunner.ClickByName("Rename From Library Button"); testRunner.Wait(1); 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 }
public void RenameButtonRenameLocalLibraryItem() { // 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"); testRunner.Wait(1); string rowItemToRename = "Row Item " + "Calibration - Box"; testRunner.ClickByName("Library Edit Button"); testRunner.Wait(1); testRunner.ClickByName(rowItemToRename); testRunner.ClickByName("Rename From Library Button"); testRunner.Wait(2); testRunner.Type("Library Item Renamed"); testRunner.ClickByName("Rename Button"); string renamedRowItem = "Row Item " + "Library Item Renamed"; bool libraryItemWasRenamed = testRunner.WaitForName(renamedRowItem, 2); bool libraryItemBeforeRenameExists = testRunner.WaitForName(rowItemToRename, 2); resultsHarness.AddTestResult(libraryItemWasRenamed == true); resultsHarness.AddTestResult(libraryItemBeforeRenameExists == false); MatterControlUtilities.CloseMatterControl(testRunner); } }; AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); Assert.IsTrue(testHarness.AllTestsPassed); Assert.IsTrue(testHarness.TestCount == 2); // make sure we ran all our tests }
public void Slicing() { // Run a copy of MatterControl Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) => { AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages); { //Navigate to Local Library MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD", true); 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.Wait(1); testRunner.ClickByName("SettingsAndControls"); testRunner.Wait(1); testRunner.ClickByName("Settings Tab"); testRunner.Wait(1.1); testRunner.ClickByName("Skirt and Raft Tab"); testRunner.Wait(1); testRunner.ClickByName("Create Raft Checkbox"); testRunner.Wait(1); testRunner.ClickByName("Generate Gcode Button"); testRunner.Wait(1.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 LocalLibraryAddButtonAddSingleItemToLibrary() { // Run a copy of MatterControl Action <AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) => { AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages); { string itemName = "Row Item " + "Fennec Fox"; //Navigate to Local Library testRunner.ClickByName("Library Tab"); MatterControlUtilities.NavigateToFolder(testRunner, "Local Library Row Item Collection"); //Make sure that Item does not exist before the test begins bool rowItemExists = testRunner.WaitForName(itemName, 1); resultsHarness.AddTestResult(rowItemExists == false); //Click Local Library Add Button testRunner.ClickByName("Library Add Button"); //Get Library Item to Add string rowItemPath = MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl"); testRunner.Wait(2); testRunner.Type(rowItemPath); testRunner.Wait(1); testRunner.Type("{Enter}"); bool rowItemWasAdded = testRunner.WaitForName(itemName, 2); resultsHarness.AddTestResult(rowItemWasAdded == 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 }
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 LibraryItemThumbnailClickedOpensPartPreview() { // 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"); //Make sure Part Preview Window does not exists before we click the view button bool partPreviewExistsOne = testRunner.WaitForName("Part Preview Window", 1); resultsHarness.AddTestResult(partPreviewExistsOne == false); string libraryRowItemName = "Row Item " + "Calibration - Box"; testRunner.ClickByName(libraryRowItemName); testRunner.Wait(1); //Click Library Item View Button string libraryItemViewButton = "Row Item " + "Calibration - Box" + " View Button"; testRunner.ClickByName(libraryItemViewButton); //Make sure that Part Preview Window opens after View button is clicked bool partPreviewWindowExists = testRunner.WaitForName("Part Preview Window", 1.5); resultsHarness.AddTestResult(partPreviewWindowExists == 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 }
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 }