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


C# AutomationRunner.NameExists方法代码示例

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


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

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

示例2: SwitchToAdvancedSettings

		public static void SwitchToAdvancedSettings(AutomationRunner testRunner, AutomationTesterHarness resultsHarness)
		{
			if (testRunner.NameExists("SettingsAndControls"))
			{
				testRunner.ClickByName("SettingsAndControls", 1);
				testRunner.Wait(.5);
			}
			resultsHarness.AddTestResult(testRunner.ClickByName("User Level Dropdown", 1), "Click Settings Mode dropdown");
			resultsHarness.AddTestResult(testRunner.ClickByName("Advanced Menu Item", 1), "Click 'Advanced' settings");
			testRunner.Wait(.5);
		}
开发者ID:tellingmachine,项目名称:MatterControl,代码行数:11,代码来源:MatterControlUtilities.cs

示例3: SwitchToAdvancedSettings

		public static void SwitchToAdvancedSettings(AutomationRunner testRunner)
		{
			if (testRunner.NameExists("SettingsAndControls"))
			{
				testRunner.ClickByName("SettingsAndControls", 1);
				testRunner.Wait(.5);
			}
			testRunner.ClickByName("User Level Dropdown", 1);
			testRunner.ClickByName("Advanced Menu Item", 1);
			testRunner.Wait(.5);
		}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:11,代码来源:MatterControlUtilities.cs

示例4: AddAndSelectPrinter

		public static void AddAndSelectPrinter(AutomationRunner testRunner, string make, string model)
		{
			if (!testRunner.NameExists("Select Make"))
			{
				testRunner.ClickByName("Printers... Menu", 2, delayBeforeReturn: .5);
				testRunner.ClickByName("Add New Printer... Menu Item", 5, delayBeforeReturn: .5);
			}

			testRunner.ClickByName("Select Make", 5);
			testRunner.Type(make);
			testRunner.Type("{Enter}");

			testRunner.ClickByName("Select Model", 5);
			testRunner.Type(model);
			testRunner.Type("{Enter}");

			// An unpredictable period of time will pass between Clicking Save, everything reloading and us returning to the caller.
			// Block until ReloadAll has completed then close and return to the caller, at which point hopefully everything is reloaded.
			WaitForReloadAll(testRunner, () => testRunner.ClickByName("Save & Continue Button", 2));

			testRunner.ClickByName("Cancel Wizard Button", 5);
			testRunner.Wait(1);
		}
开发者ID:unlimitedbacon,项目名称:MatterControl,代码行数:23,代码来源:MatterControlUtilities.cs

示例5: MatterControlRuns

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

					resultsHarness.AddTestResult(testRunner.NameExists("SettingsAndControls"));

					MatterControlUtilities.CloseMatterControl(testRunner);
				}
			};

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


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