当前位置: 首页>>代码示例>>C#>>正文


C# AutomationRunner.Type方法代码示例

本文整理汇总了C#中MatterHackers.GuiAutomation.AutomationRunner.Type方法的典型用法代码示例。如果您正苦于以下问题:C# AutomationRunner.Type方法的具体用法?C# AutomationRunner.Type怎么用?C# AutomationRunner.Type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MatterHackers.GuiAutomation.AutomationRunner的用法示例。


在下文中一共展示了AutomationRunner.Type方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddToQueueMenuItemAddsSingleFile

		public void AddToQueueMenuItemAddsSingleFile()
		{
			// Run a copy of MatterControl
			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{
				AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
				{

					testRunner.ClickByName("File Menu");
					testRunner.Wait(1);
					testRunner.ClickByName("Add File To Queue Menu Item");
					testRunner.Wait(2);

					string queueItemPath = MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl");

					testRunner.Type(queueItemPath);
					testRunner.Wait(1);
					testRunner.Type("{Enter}");
					testRunner.Wait(2);
					resultsHarness.AddTestResult(testRunner.WaitForName("Queue Item Fennec_Fox", 2));

					int queueCount = QueueData.Instance.Count;

					resultsHarness.AddTestResult(queueCount == 1);

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

			AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

			Assert.IsTrue(testHarness.AllTestsPassed);
			Assert.IsTrue(testHarness.TestCount == 2); // make sure we ran all our tests
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:34,代码来源:FileMenuTest.cs

示例2: ExportAsGcode

		public void ExportAsGcode()
		{
			// Run a copy of MatterControl
			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{
				AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
				{

					MatterControlUtilities.SelectAndAddPrinter(testRunner, "Airwolf 3D", "HD", true);

					string firstItemName = "Row Item Batman";
					//Navigate to Downloads Library Provider
					testRunner.ClickByName("Queue Tab");
					testRunner.ClickByName("Queue Add Button", 2);

					//Get parts to add
					string rowItemPath = MatterControlUtilities.GetTestItemPath("Batman.stl");

					//Add STL part items to Downloads and then type paths into file dialogue
					testRunner.Wait(1);
					testRunner.Type(MatterControlUtilities.GetTestItemPath("Batman.stl"));
					testRunner.Wait(1);
					testRunner.Type("{Enter}");

					//Get test results 
					resultsHarness.AddTestResult(testRunner.WaitForName(firstItemName, 2) == true);

					testRunner.ClickByName("Queue Edit Button");
					testRunner.ClickByName(firstItemName);
					testRunner.ClickByName("Queue Export Button");
					testRunner.Wait(2);

					testRunner.WaitForName("Export Item Window", 2);
					testRunner.ClickByName("Export as GCode Button", 2);
					testRunner.Wait(2);

					string gcodeExportPath = MatterControlUtilities.PathToExportGcodeFolder;
					testRunner.Type(gcodeExportPath);
					testRunner.Type("{Enter}");
					testRunner.Wait(2);

					Console.WriteLine(gcodeExportPath);

					resultsHarness.AddTestResult(File.Exists(gcodeExportPath) == true);
					Debugger.Break();

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

			AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

			Assert.IsTrue(testHarness.AllTestsPassed);
			Assert.IsTrue(testHarness.TestCount == 2);

		}
开发者ID:broettge,项目名称:MatterControl,代码行数:56,代码来源:ExportItemWindowTests.cs

示例3: DownloadsAddButtonAddsMultipleFiles

		public void DownloadsAddButtonAddsMultipleFiles()
		{
			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(3);

					testRunner.Wait(2);

					// Add both files to the FileOpen dialog
					testRunner.Type(
						string.Format(
							"\"{0}\" \"{1}\"",
							MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl"),
							MatterControlUtilities.GetTestItemPath("Batman.stl")));

					testRunner.Wait(1);
					testRunner.Type("{Enter}");

					resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Fennec Fox", 2), "Fennec Fox item exists");
					resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Batman", 2), "Batman item exists");
					testRunner.Wait(1);

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

			AutomationTesterHarness testHarness = null;

			try
			{
				testHarness = MatterControlUtilities.RunTest(testToRun);

			}
			catch { }
			finally
			{
				MatterControlUtilities.DeleteDownloadsSubFolder();
			}

			Assert.IsTrue(testHarness.AllTestsPassed(2));
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:51,代码来源:LibraryDownloadsTest.cs

示例4: DownloadsAddButtonAddsMultipleFiles

		public void DownloadsAddButtonAddsMultipleFiles()
		{
			// Run a copy of MatterControl
			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{

				AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
				{
					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(3);

					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}");

					resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Fennec Fox", 2) == true);
					resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Batman", 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 == 2); // make sure we ran all our tests
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:48,代码来源:LibraryDownloadsTest.cs

示例5: CreateFolderStarsOutWithTextFiledFocusedAndEditable

		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)
				{
					MatterControlUtilities.PrepForTestRun(testRunner);

					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(2));
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:35,代码来源:CreateLibraryFolder.cs

示例6: LocalLibraryAddButtonAddSingleItemToLibrary

		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.PathToQueueItemsFolder("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
		}
开发者ID:Joao-Fonseca,项目名称:MatterControl,代码行数:42,代码来源:LocalLibraryTests.cs

示例7: LibraryQueueViewRefreshesOnAddItem

		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(8));
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:53,代码来源:SqLiteLibraryProvider.cs

示例8: PauseOnLayerDoesPauseOnPrint

		public void PauseOnLayerDoesPauseOnPrint()
		{
			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{
				AutomationRunner testRunner = new AutomationRunner();
				{
					MatterControlUtilities.PrepForTestRun(testRunner, MatterControlUtilities.PrepAction.CloseSignInAndPrinterSelect);

					var emualtorProccess = MatterControlUtilities.LaunchAndConnectToPrinterEmulator(testRunner);

					resultsHarness.AddTestResult(ProfileManager.Instance.ActiveProfile != null);

					MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness);

					resultsHarness.AddTestResult(testRunner.ClickByName("General Tab", 1));
					resultsHarness.AddTestResult(testRunner.ClickByName("Single Print Tab", 1));
					resultsHarness.AddTestResult(testRunner.ClickByName("Layer(s) To Pause:" + " Edit"));
					testRunner.Type("4;2;a;not;6");

					resultsHarness.AddTestResult(testRunner.ClickByName("Layer View Tab"));

					resultsHarness.AddTestResult(testRunner.ClickByName("Generate Gcode Button", 1));
					resultsHarness.AddTestResult(testRunner.ClickByName("Display Checkbox", 10));
					resultsHarness.AddTestResult(testRunner.ClickByName("Sync To Print Checkbox", 1));

					resultsHarness.AddTestResult(testRunner.ClickByName("Start Print Button", 1));

					WaitForLayerAndResume(resultsHarness, testRunner, 2);
					WaitForLayerAndResume(resultsHarness, testRunner, 4);
					WaitForLayerAndResume(resultsHarness, testRunner, 6);

					resultsHarness.AddTestResult(testRunner.WaitForName("Done Button", 30));
					resultsHarness.AddTestResult(testRunner.WaitForName("Print Again Button", 1));

					try
					{
						emualtorProccess.Kill();
					}
					catch {}

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

			AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, maxTimeToRun: 200);
			Assert.IsTrue(testHarness.AllTestsPassed(19));
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:47,代码来源:SliceSetingsTests.cs

示例9: DownloadsAddButtonAddsAMFFiles

		public void DownloadsAddButtonAddsAMFFiles()
		{
			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);

					//Add AMF part items to Downloads and then type paths into file dialogues 
					testRunner.Wait(2);
					testRunner.Type(MatterControlUtilities.GetTestItemPath("Rook.amf"));
					testRunner.Wait(1);
					testRunner.Type("{Enter}");

					resultsHarness.AddTestResult(testRunner.WaitForName("Row Item Rook", 2), "Rook item exists");
					testRunner.Wait(1);

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

			AutomationTesterHarness testHarness = null;

			try
			{
				testHarness = MatterControlUtilities.RunTest(testToRun);

			}
			catch { }
			finally
			{
				MatterControlUtilities.DeleteDownloadsSubFolder();
			}

			Assert.IsTrue(testHarness.AllTestsPassed(1));
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:45,代码来源:LibraryDownloadsTest.cs

示例10: LibraryQueueViewRefreshesOnAddItem

		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 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("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 should be in the library");

					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
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:39,代码来源:SqLiteLibraryProvider.cs

示例11: AddSingleItemToQueue

		public void AddSingleItemToQueue()
		{
			// Run a copy of MatterControl
			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{
				AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
				{

					/*
					 * Tests that Queue Add button adds a single part to queue:
					 * 1. The Queue count is increased by 1
					 * 2. A QueueRowItem is created and added to the queue
					 */

					bool queueDataCountEqualsZero = false;
					bool addedPartIncreasesQueueDataCount = false;
					int queueCountBeforeAdd = QueueData.Instance.Count;

					//Make Sure Queue Count = 0 
					if(queueCountBeforeAdd  == 0)
					{
						queueDataCountEqualsZero = true;
					}

					resultsHarness.AddTestResult(queueDataCountEqualsZero == true, "Queue count is zero before the test starts");

					testRunner.Wait(3);
					//Click Add Button and Add Part To Queue
					testRunner.ClickByName("Queue Add Button", 2);
					testRunner.Wait(2);

					string queueItemPath = MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl");

					testRunner.Type(queueItemPath);
					testRunner.Wait(1);
					testRunner.Type("{Enter}");


					//Make sure single part is added and queue count increases by one
					bool fennecFoxPartWasAdded = testRunner.WaitForName("Queue Item " + "Fennec_Fox", 2);
					resultsHarness.AddTestResult(fennecFoxPartWasAdded == true);

					int queueCountAfterAdd = QueueData.Instance.Count;
					if (queueCountAfterAdd == queueCountBeforeAdd + 1)
					{
						addedPartIncreasesQueueDataCount = true;
					}

					resultsHarness.AddTestResult(addedPartIncreasesQueueDataCount == 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
		}
开发者ID:rorypond,项目名称:MatterControl,代码行数:59,代码来源:PrintQueueTests.cs

示例12: QueueAddButtonAddsGcodeFile

		public void QueueAddButtonAddsGcodeFile()
		{

			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{

				AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
				{

					/* Tests that when the Queue Copy button is clicked:
					* 1. QueueCount = Zero
					* 2. Add button can add single .gcode file to the queue 
					* 3. Queue count inceases by one 
					*/
					int queueCountBeforeTest = QueueData.Instance.Count;
					bool queueCountEqualsZero = false;

					if (queueCountBeforeTest == 0)
					{
						queueCountEqualsZero = true;
					}

					//Make sure queue count equals zero before test begins
					resultsHarness.AddTestResult(queueCountEqualsZero = true);

					//Click Add button 
					testRunner.ClickByName("Queue Add Button", 2);
					testRunner.Wait(1);

					string pathToType = MatterControlUtilities.GetTestItemPath("chichen-itza_pyramid.gcode");

					testRunner.Type(pathToType);
					testRunner.Wait(1);
					testRunner.Type("{Enter}");

					int queueCountAfterGcodeIsAdded = QueueData.Instance.Count;
					bool oneItemAddedToQueue = false;

					if (queueCountAfterGcodeIsAdded == 1)
					{
						oneItemAddedToQueue = true;
					}

					resultsHarness.AddTestResult(oneItemAddedToQueue = true);

					//stl queue item is added to the queue
					bool firstQueueItemExists = testRunner.WaitForName("Queue Item " + "chichen-itza_pyramid", 1);
					resultsHarness.AddTestResult(firstQueueItemExists == 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

		}
开发者ID:rorypond,项目名称:MatterControl,代码行数:58,代码来源:PrintQueueTests.cs

示例13: QueueAddButtonAddsZipFile

		public void QueueAddButtonAddsZipFile()
		{

			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{

				AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
				{

					/* Tests that when the Queue Copy button is clicked:
					* 1. QueueCount = Zero
					* 2. All files in zip are added to queue
					*/
					int queueCountBeforeTest = QueueData.Instance.Count;
					bool queueCountEqualsZero = false;

					if (queueCountBeforeTest == 0)
					{
						queueCountEqualsZero = true;
					}

					//Make sure queue count equals zero before test begins
					resultsHarness.AddTestResult(queueCountEqualsZero = true);

					//Click Add button 
					testRunner.ClickByName("Queue Add Button", 2);

					testRunner.Wait(1);
					
					string pathToType = MatterControlUtilities.GetTestItemPath("Batman.zip");
					testRunner.Type(pathToType);
					testRunner.Wait(1);
					testRunner.Type("{Enter}");

					int queueCountAfterZipIsAdded = QueueData.Instance.Count;
					bool twoItemsAddedToQueue = false;

					if(queueCountAfterZipIsAdded == 2)
					{
						twoItemsAddedToQueue = true;
					}

					resultsHarness.AddTestResult(twoItemsAddedToQueue = true);

					//Mouthpiece & Batman part

					bool firstQueueItemExists = testRunner.WaitForName("Queue Item " + "Batman", 1);
					resultsHarness.AddTestResult(firstQueueItemExists == true);

					bool secondQueueItemExists = testRunner.WaitForName("Queue Item " + "2013-01-25_Mouthpiece_v2", 1);
					resultsHarness.AddTestResult(secondQueueItemExists == 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

		}
开发者ID:rorypond,项目名称:MatterControl,代码行数:61,代码来源:PrintQueueTests.cs

示例14: AddToQueueMenuItemAddsMultipleFiles

		public void AddToQueueMenuItemAddsMultipleFiles()
		{
			// Run a copy of MatterControl
			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{
				AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
				{
					MatterControlUtilities.PrepForTestRun(testRunner);

					testRunner.ClickByName("File Menu");
					testRunner.Wait(1);
					testRunner.ClickByName("Add File To Queue Menu Item");
					testRunner.Wait(2);

					string queueItemPath = MatterControlUtilities.GetTestItemPath("Fennec_Fox.stl");

					string pathToSecondQueueItem = MatterControlUtilities.GetTestItemPath("Batman.stl");
					string textForBothQueueItems = String.Format("\"{0}\" \"{1}\"", queueItemPath, pathToSecondQueueItem);

					int queueBeforeAddCount = QueueData.Instance.Count;

					testRunner.Type(textForBothQueueItems);
					testRunner.Wait(2);
					testRunner.Type("{Enter}");
					testRunner.Wait(2);
					resultsHarness.AddTestResult(testRunner.WaitForName("Queue Item Fennec_Fox", 2));
					resultsHarness.AddTestResult(testRunner.WaitForName("Queue Item Batman", 2));
					
					int queueAfterAddCount = QueueData.Instance.Count;

					resultsHarness.AddTestResult(queueAfterAddCount == queueBeforeAddCount + 2);

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

			AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun);

			Assert.IsTrue(testHarness.AllTestsPassed(3));
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:40,代码来源:FileMenuTest.cs

示例15: RenameButtonRenameLocalLibraryItem

		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
		}
开发者ID:Joao-Fonseca,项目名称:MatterControl,代码行数:43,代码来源:LocalLibraryTests.cs


注:本文中的MatterHackers.GuiAutomation.AutomationRunner.Type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。