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


C# AutomationRunner.GetWidgetByName方法代码示例

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


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

示例1: ClickOnLibraryCheckBoxes

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

				// Now do the actions specific to this test. (replace this for new tests)
				{
					testRunner.ClickByName("Library Tab");
					testRunner.Wait(1);
					SystemWindow systemWindow;
					GuiWidget rowItem = testRunner.GetWidgetByName("Local Library Row Item Collection", out systemWindow);
					testRunner.Wait(1);

					SearchRegion rowItemRegion = testRunner.GetRegionByName("Local Library Row Item Collection");

					testRunner.ClickByName("Library Edit Button");
					testRunner.Wait(1);

					SystemWindow containingWindow;
					GuiWidget foundWidget = testRunner.GetWidgetByName("Row Item Select Checkbox", out containingWindow, 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", searchRegion: rowItemRegion);
					testRunner.Wait(.5);
					resultsHarness.AddTestResult(checkBoxWidget.Checked == true, "currently checked");

					testRunner.ClickByName("Local Library Row Item Collection");
					testRunner.Wait(.5);
					resultsHarness.AddTestResult(checkBoxWidget.Checked == false, "currently not checked");

					MatterControlUITests.CloseMatterControl(testRunner);
				}

			};

#if !__ANDROID__
			// Set the static data to point to the directory of MatterControl
			StaticData.Instance = new MatterHackers.Agg.FileSystemStaticData(Path.Combine("..", "..", "..", "..", "StaticData"));
#endif
			bool showWindow;
			MatterControlApplication matterControlWindow = MatterControlApplication.CreateInstance(out showWindow);
			AutomationTesterHarness testHarness = AutomationTesterHarness.ShowWindowAndExectueTests(matterControlWindow, testToRun, 1000);

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

示例2: ClickOnLibraryCheckBoxes

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

示例3: 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

示例4: ClickingShowTerminalButtonOpensTerminal

		public void ClickingShowTerminalButtonOpensTerminal()
		{
			// Run a copy of MatterControl
			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{
				AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
				{
					testRunner.ClickByName("SettingsAndControls", 5);
					testRunner.Wait(2);
					testRunner.ClickByName("Options Tab", 6);

					bool terminalWindowExists1 = testRunner.WaitForName("Gcode Terminal", 0);
					resultsHarness.AddTestResult(terminalWindowExists1 == false, "Terminal Window does not exist");

					testRunner.ClickByName("Show Terminal Button", 6);
					testRunner.Wait(1);

					SystemWindow containingWindow;
					GuiWidget terminalWindow = testRunner.GetWidgetByName("Gcode Terminal", out containingWindow, 3);
					resultsHarness.AddTestResult(terminalWindow != null, "Terminal Window exists after Show Terminal button is clicked");
					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
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:32,代码来源:OptionsTabTests.cs

示例5: HighlightWidget

		private static void HighlightWidget(AutomationRunner testRunner, string widgetNameToHighlight)
		{
			SystemWindow containingWindow;
			var autoLevelRowItem = testRunner.GetWidgetByName(widgetNameToHighlight, out containingWindow, .2);
			if (autoLevelRowItem != null)
			{
				AttentionGetter.GetAttention(autoLevelRowItem);
			}
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:9,代码来源:AttentionGetter.cs

示例6: CopyButtonClickedMakesCopyOfPartOnBed

		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(3));
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:56,代码来源:PartPreviewTests.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: PrinterNameStaysChanged

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

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

					MatterControlUtilities.SwitchToAdvancedSettings(testRunner, resultsHarness);

					resultsHarness.AddTestResult(testRunner.ClickByName("Printer Tab", 1), "Click Printer Tab");

					string widgetName = "Printer Name Edit";
					testRunner.ClickByName(widgetName);

					SystemWindow window;
					var textWidget = testRunner.GetWidgetByName(widgetName, out window);
					string newName = "Updated name";
					textWidget.Text = newName;
					testRunner.ClickByName("Printer Tab", 1);
					testRunner.Wait(4);

					//Check to make sure the Printer dropdown gets the name change 
					testRunner.ClickByName("Printers... Menu", 2);
					testRunner.Wait(1);
					resultsHarness.AddTestResult(testRunner.NameExists(newName + " Menu Item"), "Widget with updated printer name exists");

					//Make sure the Active profile name changes as well
					resultsHarness.AddTestResult(ProfileManager.Instance.ActiveProfile.Name == newName, "ActiveProfile has updated name");

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

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

示例9: ClickingShowTerminalButtonOpensTerminal

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

					testRunner.ClickByName("SettingsAndControls", 5);
					testRunner.Wait(2);
					testRunner.ClickByName("Configuration Tab", 6);

					bool terminalWindowExists1 = testRunner.WaitForName("Gcode Terminal", 0);
					resultsHarness.AddTestResult(terminalWindowExists1 == false, "Terminal Window does not exist");

					testRunner.ClickByName("Show Terminal Button", 6);
		
					SystemWindow containingWindow;
					GuiWidget terminalWindow = testRunner.GetWidgetByName("Gcode Terminal", out containingWindow, secondsToWait: 3);
					resultsHarness.AddTestResult(terminalWindow != null, "Terminal Window exists after Show Terminal button is clicked");
					containingWindow.CloseOnIdle();
					testRunner.Wait(.5);

					MatterControlUITests.CloseMatterControl(testRunner);
				}
			};

#if !__ANDROID__
			// Set the static data to point to the directory of MatterControl
			StaticData.Instance = new MatterHackers.Agg.FileSystemStaticData(Path.Combine("..", "..", "..", "..", "StaticData"));
#endif
			bool showWindow;
			string testDBFolder = "MC_Three_Queue_Items";
			MatterControlUITests.DataFolderState staticDataState = MatterControlUITests.MakeNewStaticDataForTesting(testDBFolder);
			MatterControlApplication matterControlWindow = MatterControlApplication.CreateInstance(out showWindow);
			AutomationTesterHarness testHarness = AutomationTesterHarness.ShowWindowAndExectueTests(matterControlWindow, testToRun, 45);
			MatterControlUITests.RestoreStaticDataAfterTesting(staticDataState, true);
			Assert.IsTrue(testHarness.AllTestsPassed);
			Assert.IsTrue(testHarness.TestCount == 2); // make sure we ran all our tests
		}
开发者ID:lyming531,项目名称:MatterControl,代码行数:40,代码来源:OptionsTabTests.cs

示例10: SaveAsToQueue

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

示例11: UndoRedoDelete

		public void UndoRedoDelete()
		{
			// 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.ClickByName("Row Item Calibration - Box", 1);
					MatterControlUtilities.LibraryEditSelectedItem(testRunner);

					//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", 1);
					int partCountBeforeCopy = view3D.MeshGroups.Count();
					resultsHarness.AddTestResult(partCountBeforeCopy == 1);
					testRunner.Wait(.5);

					for (int i = 0; i <= 4; i++)
					{
						testRunner.ClickByName(copyButtonName, 1);
						testRunner.Wait(.2);
						int meshCount = view3D.MeshGroups.Count();
						resultsHarness.AddTestResult(meshCount == partCountBeforeCopy + i + 1);
					}

					int meshCountAfterCopy = view3D.MeshGroups.Count();
					resultsHarness.AddTestResult(meshCountAfterCopy == 6);
					testRunner.ClickByName("3D View Remove", 1);
					testRunner.Wait(.1);
					int meshCountAfterRemove = view3D.MeshGroups.Count();
					resultsHarness.AddTestResult(meshCountAfterRemove == 5);

					testRunner.ClickByName("3D View Undo");
					System.Threading.Thread.Sleep(2000);
					int meshCountAfterUndo = view3D.MeshGroups.Count();
					resultsHarness.AddTestResult(meshCountAfterUndo == 6);

					testRunner.ClickByName("3D View Redo");
					System.Threading.Thread.Sleep(2000);
					int meshCountAfterRedo = view3D.MeshGroups.Count();
					resultsHarness.AddTestResult(meshCountAfterRedo == 5);

					partPreview.CloseOnIdle();
					testRunner.Wait(.1);

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

			AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, overrideWidth: 800);

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

示例12: EditButtonTurnsOnEditMode

		public void EditButtonTurnsOnEditMode()
		{
			//Run a copy of MatterControl
			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{
				AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
				{
					/*
					 *Tests that when the edit button is clicked we go into editmode (print queue items have checkboxes on them)  
					 *1. After Edit button is clicked print queue items have check boxes
					 *2. Selecting multiple queue itema and then clicking the Remove button removes the item 
					 *3. Selecting multiple queue items and then clicking the Remove button decreases the queue tab count by one
					 */

					bool checkboxExists = testRunner.WaitForName("Queue Item Checkbox", 2);

					resultsHarness.AddTestResult(checkboxExists == false);

					int queueItemCount = QueueData.Instance.Count;
					bool queueItemCountEqualThree = false;

					if (queueItemCount == 3)
					{
						queueItemCountEqualThree = true;
					}

					resultsHarness.AddTestResult(queueItemCountEqualThree == true);

					testRunner.Wait(2);

					SystemWindow systemWindow;

					string itemName = "Queue Item " + "2013-01-25_Mouthpiece_v2";

					GuiWidget queueItem = testRunner.GetWidgetByName(itemName, out systemWindow, 3);

					SearchRegion queueItemRegion = testRunner.GetRegionByName(itemName, 3);

					testRunner.ClickByName("Queue Edit Button", 2);

					testRunner.Wait(5);

					SystemWindow containingWindow;
					GuiWidget foundWidget = testRunner.GetWidgetByName("Queue Item Checkbox", out containingWindow, 3, searchRegion: queueItemRegion);
					CheckBox checkBoxWidget = foundWidget as CheckBox;
					resultsHarness.AddTestResult(checkBoxWidget != null, "We should have an actual checkbox");


					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

			AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, null, null, "Three_Queue_Items");
			Assert.IsTrue(testHarness.AllTestsPassed);
			Assert.IsTrue(testHarness.TestCount == 3); // make sure we ran all our tests
		}
开发者ID:Joao-Fonseca,项目名称:MatterControl,代码行数:56,代码来源:PrintQueueTests.cs

示例13: ClickCreateButton

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

					/*
					 * Tests that clicking the create button opens create tools plugin window
					 */

					//Make sure that plugin window does not exist
					bool pluginWindowExists1 = testRunner.WaitForName("Plugin Chooser Window", 0);
					resultsHarness.AddTestResult(pluginWindowExists1 == false, "Plugin window does not exist");

					testRunner.ClickByName("Design Tool Button", 5);

					//Test that the plugin window does exist after the create button is clicked
					SystemWindow containingWindow;
					GuiWidget pluginWindowExists = testRunner.GetWidgetByName("Plugin Chooser Window", out containingWindow, secondsToWait: 3);
					resultsHarness.AddTestResult(pluginWindowExists != null, "Plugin Chooser Window");
					pluginWindowExists.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

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

示例14: DoneButtonTurnsOffEditMode

		public void DoneButtonTurnsOffEditMode()
		{
			//Run a copy of MatterControl
			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{
				AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
				{
					/*
					 *Tests that when one item is selected  
					 *1. Queue Item count equals three before the test starts 
					 *2. Selecting multiple queue itema and then clicking the Remove button removes the item 
					 *3. Selecting multiple queue items and then clicking the Remove button decreases the queue tab count by one
					 */

					int queueItemCount = QueueData.Instance.Count;
					bool queueItemCountEqualThree = false;

					if (queueItemCount == 3)
					{
						queueItemCountEqualThree = true;
					}

					resultsHarness.AddTestResult(queueItemCountEqualThree == true);
					testRunner.Wait(2);

					string itemName = "Queue Item " + "2013-01-25_Mouthpiece_v2";
					SystemWindow systemWindow;
					GuiWidget queueItem = testRunner.GetWidgetByName(itemName, out systemWindow, 3);
					SearchRegion queueItemRegion = testRunner.GetRegionByName(itemName, 3);

					testRunner.ClickByName("Queue Edit Button", 2);
					testRunner.Wait(5);

					GuiWidget foundWidget = testRunner.GetWidgetByName("Queue Item Checkbox", out systemWindow, 3, searchRegion: queueItemRegion);
					foundWidget.DebugShowBounds = true;
					CheckBox checkBoxWidget = foundWidget as CheckBox;
					resultsHarness.AddTestResult(checkBoxWidget != null, "We should have an actual checkbox");

					testRunner.Wait(2);

					testRunner.ClickByName("Queue Done Button");

					testRunner.Wait(3);

					foundWidget.DebugShowBounds = true;

					resultsHarness.AddTestResult(foundWidget == null, "We should not have an actual checkbox");

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

			AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, queueItemFolderToAdd: QueueTemplate.Three_Queue_Items);
			Assert.IsTrue(testHarness.AllTestsPassed);
			Assert.IsTrue(testHarness.TestCount == 3); // make sure we ran all our tests
		}
开发者ID:rorypond,项目名称:MatterControl,代码行数:56,代码来源:PrintQueueTests.cs

示例15: QueueThumbnailWidgetOpensPartPreview

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

					/*
					 * Tests that clicking a queue item thumbnail opens a Part Preview window
					 */ 

					bool partPreviewWindowExists1 = testRunner.WaitForName("Part Preview Window Thumbnail", 0);
					resultsHarness.AddTestResult(partPreviewWindowExists1 == false, "Part Preview Window Does Not Exist");

					testRunner.ClickByName("Queue Item Thumbnail");

					SystemWindow containingWindow;
					GuiWidget partPreviewWindowExists = testRunner.GetWidgetByName("Part Preview Window", out containingWindow, 3);
					resultsHarness.AddTestResult(partPreviewWindowExists != null, "Part Preview Window Exists");
					partPreviewWindowExists.CloseOnIdle();
					testRunner.Wait(.5);

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

			AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, queueItemFolderToAdd: QueueTemplate.Three_Queue_Items);
			Assert.IsTrue(testHarness.AllTestsPassed);
			Assert.IsTrue(testHarness.TestCount == 2); // make sure we ran all our tests
		}
开发者ID:rorypond,项目名称:MatterControl,代码行数:31,代码来源:PrintQueueTests.cs


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