本文整理汇总了C#中MatterHackers.GuiAutomation.AutomationRunner.ImageExists方法的典型用法代码示例。如果您正苦于以下问题:C# AutomationRunner.ImageExists方法的具体用法?C# AutomationRunner.ImageExists怎么用?C# AutomationRunner.ImageExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatterHackers.GuiAutomation.AutomationRunner
的用法示例。
在下文中一共展示了AutomationRunner.ImageExists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ClickOnBuyButton
public void ClickOnBuyButton()
{
// Run a copy of MatterControl
Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
{
AutomationRunner testRunner = new AutomationRunner(MatterControlUtilities.DefaultTestImages);
{
//Make sure image does not exist before we click the buy button
testRunner.MatchLimit = 500000;
bool imageExists = testRunner.ImageExists("MatterHackersStoreImage.png");
resultsHarness.AddTestResult(imageExists == false, "Web page is not open");
//Click Buy button and test that the MatterHackers store web page is open
testRunner.ClickByName("Buy Materials Button", 5);
bool imageExists2 = testRunner.ImageExists("MatterHackersStoreImage.png", 10);
resultsHarness.AddTestResult(imageExists2 == true, "Web page is open");
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
}
示例2: ClickOnBuyButton
public void ClickOnBuyButton()
{
// Run a copy of MatterControl
Action<AutomationTesterHarness> testToRun = (AutomationTesterHarness resultsHarness) =>
{
AutomationRunner testRunner = new AutomationRunner(MatterControlUITests.DefaultTestImages);
{
//Make sure image does not exist before we click the buy button
testRunner.MatchLimit = 500000;
bool imageExists = testRunner.ImageExists("MatterHackersStoreImage.png");
resultsHarness.AddTestResult(imageExists == false, "Web page is not open");
//Click Buy button and test that the MatterHackers store web page is open
testRunner.ClickByName("Buy Materials Button", secondsToWait: 5);
bool imageExists2 = testRunner.ImageExists("MatterHackersStoreImage.png", 10);
resultsHarness.AddTestResult(imageExists2 == true, "Web page is open");
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, 60);
Assert.IsTrue(testHarness.AllTestsPassed);
Assert.IsTrue(testHarness.TestCount == 2); // make sure we ran all our tests
}