public void RemoveButtonClickedRemovesSingleItem() { // 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.LibraryRemoveSelectedItem(testRunner); testRunner.Wait(1); //Make sure that Export Item Window exists after Export button is clicked bool rowItemExists = testRunner.WaitForName(rowItem, 1); resultsHarness.AddTestResult(rowItemExists == false); MatterControlUtilities.CloseMatterControl(testRunner); } }; AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun); Assert.IsTrue(testHarness.AllTestsPassed(1)); }
public async Task RemoveButtonClickedRemovesSingleItem() { 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.LibraryRemoveSelectedItem(testRunner); testRunner.Delay(1); //Make sure that Export Item Window exists after Export button is clicked bool rowItemExists = testRunner.WaitForName(rowItem, 1); Assert.IsTrue(rowItemExists == false); return(Task.FromResult(0)); }; await MatterControlUtilities.RunTest(testToRun); }
public void RemoveButtonClickedRemovesMultipleItems() { // 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("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}"); testRunner.Wait(1); string rowItemOne = "Row Item " + "Calibration - Box"; testRunner.ClickByName(rowItemOne, 1); string rowItemTwo = "Row Item " + "Fennec Fox"; testRunner.ClickByName(rowItemTwo, 1); 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); MatterControlUtilities.LibraryRemoveSelectedItem(testRunner); 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 async Task RemoveButtonClickedRemovesMultipleItems() { 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("Library Edit Button"); testRunner.Delay(1); string rowItemPath = MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl"); testRunner.ClickByName("Library Add Button"); testRunner.Delay(2); testRunner.Type(rowItemPath); testRunner.Type("{Enter}"); testRunner.Delay(1); string rowItemOne = "Row Item Calibration - Box"; testRunner.ClickByName(rowItemOne, 1); string rowItemTwo = "Row Item Fennec Fox"; testRunner.ClickByName(rowItemTwo, 1); testRunner.Delay(1); // Make sure row items exist before remove Assert.IsTrue(testRunner.WaitForName(rowItemOne, 2), "rowItemOne should exist before remove"); Assert.IsTrue(testRunner.WaitForName(rowItemTwo, 2), "rowItemTwo should exist before remove"); // Remove items MatterControlUtilities.LibraryRemoveSelectedItem(testRunner); testRunner.Delay(1); // Make sure both selected items are removed Assert.IsFalse(testRunner.WaitForName(rowItemOne, 2), "rowItemOne should *not* exist after remove"); Assert.IsFalse(testRunner.WaitForName(rowItemTwo, 2), "rowItemTwo should *not* exist after remove"); return(Task.FromResult(0)); }; await MatterControlUtilities.RunTest(testToRun); }