本文整理汇总了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));
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}