public void RunBeforeEach() { server.respondToInit (); DesiredCapabilities capabilities = new DesiredCapabilities(); driver = new AppiumDriver (new Uri("http://127.0.0.1:4724/wd/hub"), capabilities); server.clear (); }
/// <summary> /// Initializes a new instance of the <see cref="MultiTouchActions"/> class. /// </summary> /// <param name="driver">The <see cref="IWebDriver"/> object on which the actions built will be performed.</param> public MultiTouchAction(AppiumDriver driver) { if (driver == null) { throw new ArgumentException("The IWebDriver object must implement or wrap a driver that implements IHasTouchScreen.", "driver"); } this._Driver = driver; }
public CalculatorTests(TestFixture fixture) { driver = fixture.driver; calc = new CalculatorPO(driver); }
public WindowsAlarmApp(AppiumDriver <AppiumWebElement> driver, TimeOutDuration timeout) { _driver = driver; PageFactory.InitElements(driver, this, new AppiumPageObjectMemberDecorator(timeout)); }
public static void CleanUp() { _driver.Quit(); _driver.Dispose(); _driver = null; }
/// <summary> /// Get the wait default wait driver /// </summary> /// <param name="driver">Brings in an AppiumDriver</param> /// <param name="timeoutTime">How long is the timeout</param> /// <param name="waitTime">How long to wait before rechecking</param> /// <returns>A web driver wait</returns> public static WebDriverWait GetWaitDriver(AppiumDriver <IWebElement> driver, TimeSpan timeoutTime, TimeSpan waitTime) { return(new WebDriverWait(new SystemClock(), driver, timeoutTime, waitTime)); }
/// <summary> /// Cancels the Touch Action /// </summary> public void Cancel() { this.driver = null; steps.Clear(); }
public TwitterMobilePageFactory(AppiumDriver <AppiumWebElement> driver) { Driver = driver; }
public IReadOnlyCollection <AndroidElement> GetElements(AppiumDriver <AndroidElement> driver, string elementName) { return(base.GetElements(driver, _screenName, elementName)); }
/// <summary> /// Initializes a new instance of the <see cref="MultiTouchAction"/> class. /// </summary> /// <param name="driver">The <see cref="IWebDriver"/> the driver to be used.</param> public MultiAction(AppiumDriver driver) { this.driver = driver; }
public void WriteTextToField(AppiumDriver <AndroidElement> driver, string text, string field) { base.WriteTextToField(driver, _screenName, text, field); }
public AndroidElement GetElement(AppiumDriver <AndroidElement> driver, string elementName) { return(base.GetElement(driver, _screenName, elementName)); }
public void ClickElement(AppiumDriver <AndroidElement> driver, string elementName) { base.ClickElement(driver, _screenName, elementName); }
/// <summary> /// Bring element in Focus /// </summary> /// <param name="driver">Driver</param> /// <param name="element">Element to bring to focus</param> public static void MoveTo(this AppiumDriver <AppiumWebElement> driver, AppiumWebElement element) { MoveTo(driver, element, 0, 0); }
/// <summary> /// Override the driver /// This allows you to use something other than the default tests object driver. /// </summary> /// <param name="appiumDriver">The override driver</param> public void OverrideDriver(AppiumDriver <IWebElement> appiumDriver) { this.AppiumDriver = appiumDriver; }
/// <summary> /// Initializes a new instance of the <see cref="RemoteTouchScreen"/> class. /// </summary> /// <param name="driver">The <see cref="RemoteWebDriver"/> for which the touch screen will be managed.</param> public RemoteMultiTouchScreen(AppiumDriver driver) : base(driver) { _Driver = driver; }
/// <summary> /// Initializes a new instance of the <see cref="LazyMobileElement" /> class /// </summary> /// <param name="testObject">The base Appium test object</param> /// <param name="appiumDriver">The Appium driver</param> /// <param name="locator">The 'by' selector for the element</param> /// <param name="userFriendlyName">A user friendly name, for logging purposes</param> public LazyMobileElement(AppiumTestObject testObject, AppiumDriver <IWebElement> appiumDriver, By locator, [CallerMemberName] string userFriendlyName = null) : base(testObject, appiumDriver, () => appiumDriver.GetWaitDriver(), locator, userFriendlyName) { }
public SpeedPage(AppiumDriver <AndroidElement> driver) { _driver = driver; }
public TouchAction(AppiumDriver driver) { this.driver = driver; }
/// <summary> /// Initializes a new instance of the <see cref="AppiumTestObject" /> class /// </summary> /// <param name="appiumDriver">The test's Appium driver</param> /// <param name="logger">The test's logger</param> /// <param name="fullyQualifiedTestName">The test's fully qualified test name</param> public AppiumTestObject(AppiumDriver <IWebElement> appiumDriver, Logger logger, string fullyQualifiedTestName) : base(logger, fullyQualifiedTestName) { this.ManagerStore.Add(typeof(MobileDriverManager).FullName, new MobileDriverManager(() => appiumDriver, this)); this.SoftAssert = new AppiumSoftAssert(this); }
/// <summary> /// Cancels the Touch Action /// </summary> public void Cancel() { this.driver = null; steps.Clear (); }
public IdeasModel(AppiumDriver <IWebElement> driver, ExtentTest test) : base(driver, test) { }
public StepsToMenuOptions(AppiumDriver <IWebElement> driver) { this.driver = driver; }
public TimePicker(AppiumDriver <AndroidElement> driver) { this.driver = driver; }
/// <summary> /// Get the wait default wait driver /// </summary> /// <param name="driver">Brings in an AppiumDriver</param> /// <returns>An WebDriverWait</returns> public static WebDriverWait GetDefaultWaitDriver(AppiumDriver <IWebElement> driver) { return(GetWaitDriver(driver, AppiumConfig.GetMobileTimeout(), AppiumConfig.GetMobileWaitTime())); }
public void CreateAppiumDriver(string deviceName) { MobileDriverFactory mobileDriverFactory = new MobileDriverFactory(); AppiumDriver = mobileDriverFactory.CreateDriver(deviceName); }
public PageActions() { pageDriver = BaseClass.AppDriver; }
public EulaScreen(AppiumDriver <IWebElement> driver) : base(driver) { }
/// <summary> /// Create a TestBase for your specific project (see TestBaseStarAppIos, for example) and call this method. /// The Setup annotation was removed to prevent it being called when there is a project specific Setup (see above). /// </summary> public static void Setup() { // Log Before Action Log.BeforeAction(); // Perform the action try { // Create a variable to serve as a flag for if a new session needs to be created or not bool createNewSession = false; // Create a variable to hold the Test's WebDriver AppiumDriver <AppiumWebElement> driver = null; // Is the global WebDriver varaiable set? if (Session.driver != null) { // Create a variable to hold the Session Info Dictionary <string, object> sessionInfo = null; // Try to get the Session Info (which only works if there is a valid session) from the global variable // Note: We need to use the same Appium session (driver) for all test or we could lose the device in the cloud. try { sessionInfo = Session.driver.SessionDetails; } catch { /* do nothing */ } // Check the Session Info variable has some content if (sessionInfo != null) { // Use the existing session Log.WriteLine(" [INFO] Using the existing session."); driver = Session.driver; } else { // Set the flag to create a new session to true createNewSession = true; } } // Should we create a new session? if (createNewSession == true) { // Wait 60 seconds to timeout any existing sessions (in SauceLab's TestObject) if (ConfigurationManager.AppSettings["appConfig"].ToString().Contains("SauceLabs")) { Sleep.Milliseconds(60000, "Waiting 60 seconds to kill the current session (in SauceLab's TestObject)."); } // Create a new session Log.WriteLine(" [INFO] Creating a new session."); driver = Session.Create(); } // Save a reference to the current Test's driver (session) in its TestContext TestContext.Set("driver", driver); // Reset the app AppBase.ResetApp(); // Logging - After action success Log.Success(); } catch (Exception e) { // Logging - After action exception Log.Failure(e.Message); // Fail current test Assert.Fail(e.Message); } finally { // Logging - After action Log.Finally(); } }
public void RunBeforeAll() { server = new FakeAppium (4753); server.Start (); server.respondToInit (); DesiredCapabilities capabilities = new DesiredCapabilities(); driver = new AppiumDriver (new Uri("http://127.0.0.1:4753/wd/hub"), capabilities); server.clear (); }
public AreaPage(AppiumDriver <AndroidElement> driver) { _driver = driver; }
/// <summary> /// Sets the driver. /// </summary> /// <param name="driver">The <see cref="IWebDriver"/> the driver to be used.</param> public void setDriver(AppiumDriver driver) { this.driver = driver; }
public AnimalPage(AppiumDriver <AppiumWebElement> driver) : base(driver) { }
/// <summary> /// Override the Appium driver /// </summary> /// <param name="appiumDriver">New Appium driver</param> public void OverrideWebDriver(AppiumDriver <IWebElement> appiumDriver) { this.AppiumManager.OverrideDriver(appiumDriver); }
/// <summary> /// Initializes a new instance of the AndroidElement class. /// </summary> /// <param name="parent">Driver in use.</param> /// <param name="id">ID of the element.</param> public AndroidElement(AppiumDriver parent, string id) : base(parent, id) { }
public LoginPage(AppiumDriver <AndroidElement> driver) => this.driver = driver;
/// <summary> /// Initializes a new instance of the <see cref="MultiTouchAction"/> class. /// </summary> /// <param name="driver">The <see cref="IWebDriver"/> the driver to be used.</param> /// <param name="element">The <see cref="IWebDriver"/> the element on which the actions built will be performed.</param> public MultiAction(AppiumDriver driver, IWebElement element) { this.driver = driver; this.element = element; }
/// <summary> /// Set wait driver /// </summary> /// <param name="driver">The appium driver</param> /// <param name="waiter">Web Driver Wait</param> public static void SetWaitDriver(this AppiumDriver <IWebElement> driver, WebDriverWait waiter) { waitCollection.AddOrUpdate(driver, waiter, (oldkey, oldvalue) => waiter); }
/// <summary> /// Cancels the Multi Action /// </summary> public void Cancel() { this.driver = null; this.element = null; actions.Clear (); }
/// <summary> /// Remove the stored wait driver /// </summary> /// <param name="driver">The appium driver</param> /// <returns>True if the wait driver was removed</returns> public static bool RemoveWaitDriver(this AppiumDriver <IWebElement> driver) { return(waitCollection.TryRemove(driver, out WebDriverWait temp)); }