public void AppiumIOSDriverLazyTest() { Assert.IsNotNull(this.TestObject.AppiumDriver); this.AppiumDriver.Navigate().GoToUrl(Config.GetValueForSection(ConfigSection.AppiumMaqs, "WebSiteBase")); LazyMobileElement lazy = new LazyMobileElement(this.TestObject, By.XPath("//button[@class=\"navbar-toggle\"]"), "Nav toggle"); Assert.IsTrue(lazy.Enabled, "Expect enabled"); Assert.IsTrue(lazy.Displayed, "Expect displayed"); Assert.IsTrue(lazy.ExistsNow, "Expect exists now"); lazy.Click(); }
[Ignore] // Can currently only run WinAppDriver locally with our current setup public void AppiumWinAppDriverTest() { LazyMobileElement lazy = new LazyMobileElement(this.TestObject, By.XPath("//Button[@AutomationId=\"num7Button\"]"), "Seven"); lazy.Click(); Assert.IsTrue(lazy.Enabled, "Expect enabled"); Assert.IsTrue(lazy.Displayed, "Expect displayed"); Assert.IsTrue(lazy.ExistsNow, "Expect exists now"); this.AppiumDriver.FindElementByName("Plus").Click(); this.AppiumDriver.FindElement(By.Name("Three")).Click(); this.AppiumDriver.FindElementByAccessibilityId("equalButton").Click(); Assert.AreEqual("Display is 10", this.AppiumDriver.FindElementByAccessibilityId("CalculatorResults").GetAttribute("Name")); }
public void AppiumLazyTest() { Assert.IsNotNull(this.TestObject.AppiumDriver); this.AppiumDriver.Navigate().GoToUrl(Config.GetValueForSection(ConfigSection.AppiumMaqs, "WebSiteBase")); LazyMobileElement lazy = new LazyMobileElement(this.TestObject, By.XPath("//button[@class=\"navbar-toggle\"]"), "Nav toggle"); Assert.IsTrue(lazy.Enabled, "Expect enabled"); Assert.IsTrue(lazy.Displayed, "Expect displayed"); Assert.IsTrue(lazy.ExistsNow, "Expect exists now"); lazy.Click(); LazyMobileElement missing = new LazyMobileElement(this.TestObject, By.XPath("//button[@class=\"Missing\"]"), "Missing"); this.AppiumDriver.SetWaitDriver(new WebDriverWait(this.AppiumDriver, TimeSpan.FromSeconds(10))); Assert.IsFalse(missing.Exists, "Expect element not to exist"); }