public void RenameDownloadsPrintItem() { 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); testRunner.Type(MatterControlUtilities.GetTestItemPath("Batman.stl")); testRunner.Wait(1); testRunner.Type("{Enter}"); //Rename added item testRunner.ClickByName("Library Edit Button", .5); testRunner.ClickByName("Row Item Batman"); MatterControlUtilities.LibraryRenameSelectedItem(testRunner); testRunner.Wait(.5); 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 async Task RenameButtonRenamesLocalLibraryFolder() { AutomationTest testToRun = (testRunner) => { testRunner.CloseSignInAndPrinterSelect(); // Navigate to Local Library testRunner.ClickByName("Library Tab"); testRunner.Delay(.2); testRunner.NavigateToFolder("Local Library Row Item Collection"); // Create New Folder testRunner.ClickByName("Create Folder From Library Button"); testRunner.Delay(.5); testRunner.Type("New Folder"); testRunner.Delay(.5); testRunner.ClickByName("Create Folder Button"); testRunner.Delay(.2); // Confirm newly created folder exists Assert.IsTrue(testRunner.WaitForName("New Folder Row Item Collection", 1), "New folder should appear as GuiWidget"); testRunner.ClickByName("Library Edit Button"); testRunner.Delay(.2); testRunner.ClickByName("New Folder Row Item Collection"); testRunner.Delay(.2); MatterControlUtilities.LibraryRenameSelectedItem(testRunner); testRunner.Delay(.5); testRunner.Type("Renamed Library Folder"); testRunner.ClickByName("Rename Button"); testRunner.Delay(.2); // Make sure the renamed Library Folder exists Assert.IsTrue(testRunner.WaitForName("Renamed Library Folder Row Item Collection", 2), "Renamed folder should exist"); return(Task.FromResult(0)); }; await MatterControlUtilities.RunTest(testToRun); }
public void RenameButtonRenameLocalLibraryItem() { // 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"); //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"); MatterControlUtilities.LibraryRenameSelectedItem(testRunner); testRunner.Wait(.5); 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); { MatterControlUtilities.PrepForTestRun(testRunner); //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); MatterControlUtilities.LibraryRenameSelectedItem(testRunner); 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 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(); } }
public async Task RenameButtonRenameLocalLibraryItem() { AutomationTest testToRun = (testRunner) => { testRunner.CloseSignInAndPrinterSelect(); //Navigate To Local Library testRunner.ClickByName("Library Tab"); testRunner.NavigateToFolder("Local Library Row Item Collection"); testRunner.Delay(1); string rowItemToRename = "Row Item Calibration - Box"; testRunner.ClickByName("Library Edit Button"); testRunner.Delay(1); testRunner.ClickByName(rowItemToRename); MatterControlUtilities.LibraryRenameSelectedItem(testRunner); testRunner.Delay(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); Assert.IsTrue(libraryItemWasRenamed == true); Assert.IsTrue(libraryItemBeforeRenameExists == false); return(Task.FromResult(0)); }; await MatterControlUtilities.RunTest(testToRun, overrideWidth : 600); }