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


C# AutomationRunner.GetRegionByName方法代码示例

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


在下文中一共展示了AutomationRunner.GetRegionByName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: NavigateToFolder

		//This is Temporary and will probably be moved once we get a functional test harness!!!
		public static bool NavigateToFolder(AutomationRunner testRunner, string libraryRowItemName)
		{
			bool goodNavigate = true;
			SearchRegion libraryRowItemRegion = testRunner.GetRegionByName(libraryRowItemName, 3);
			goodNavigate &= testRunner.ClickByName(libraryRowItemName);
			goodNavigate &= testRunner.MoveToByName(libraryRowItemName);
			testRunner.Wait(.5);
			goodNavigate &= testRunner.ClickByName("Open Collection", searchRegion: libraryRowItemRegion);
			testRunner.Wait(.5);

			return goodNavigate;
		}
开发者ID:broettge,项目名称:MatterControl,代码行数:13,代码来源:PerformanceTests.cs

示例4: GetWidgetByNameTestRegionSingleWindow

		public void GetWidgetByNameTestRegionSingleWindow()
		{
			int leftClickCount = 0;

			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{
				AutomationRunner testRunner = new AutomationRunner();
				testRunner.ClickByName("left");
				testRunner.Wait(.5);
				resultsHarness.AddTestResult(leftClickCount == 1, "Got left button click");

				SearchRegion rightButtonRegion = testRunner.GetRegionByName("right");

				testRunner.ClickByName("left", searchRegion: rightButtonRegion);
				testRunner.Wait(.5);

				resultsHarness.AddTestResult(leftClickCount == 1, "Did not get left button click");
			};

			SystemWindow buttonContainer = new SystemWindow(300, 200);

			Button leftButton = new Button("left", 10, 40);
			leftButton.Name = "left";
			leftButton.Click += (sender, e) => { leftClickCount++; };
			buttonContainer.AddChild(leftButton);
			Button rightButton = new Button("right", 110, 40);
			rightButton.Name = "right";
			buttonContainer.AddChild(rightButton);

			AutomationTesterHarness testHarness = AutomationTesterHarness.ShowWindowAndExectueTests(buttonContainer, testToRun, 10);

			Assert.IsTrue(testHarness.AllTestsPassed);
			Assert.IsTrue(testHarness.TestCount == 2); // make sure we can all our tests
		}
开发者ID:glocklueng,项目名称:agg-sharp,代码行数:34,代码来源:AutomationRunnerTests.cs

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

示例6: NavigateToFolder

		//This is Temporary and will probably be moved once we get a functional test harness!!!
		public static void NavigateToFolder(AutomationRunner testRunner, string libraryRowItemName)
		{
			SearchRegion libraryRowItemRegion = testRunner.GetRegionByName(libraryRowItemName, 3);
			testRunner.ClickByName(libraryRowItemName);
			testRunner.MoveToByName(libraryRowItemName);
			testRunner.Wait(.5);
			testRunner.ClickByName("Open Collection", searchRegion: libraryRowItemRegion);
			testRunner.Wait(.5);
		}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:10,代码来源:PerformanceTests.cs

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

示例8: EditButtonTurnsOnOffEditMode

		public void EditButtonTurnsOnOffEditMode()
		{
			//Run a copy of MatterControl
			Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
			{
				AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
				{
					MatterControlUtilities.PrepForTestRun(testRunner);
					/*
					 *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);

					resultsHarness.AddTestResult(QueueData.Instance.Count == 4);

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

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

					{
						testRunner.ClickByName("Queue Done Button", 2);

						testRunner.Wait(.5);

						SystemWindow containingWindow;
						GuiWidget foundWidget = testRunner.GetWidgetByName("Queue Item Checkbox", out containingWindow, 1, searchRegion: queueItemRegion);
						resultsHarness.AddTestResult(foundWidget == null, "We should not have an actual checkbox");
					}

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

			AutomationTesterHarness testHarness = MatterControlUtilities.RunTest(testToRun, queueItemFolderToAdd: QueueTemplate.Three_Queue_Items, overrideWidth: 600);
			Assert.IsTrue(testHarness.AllTestsPassed(4));
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:52,代码来源:PrintQueueTests.cs


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