Class MobileGSpec


  • public class MobileGSpec
    extends BaseGSpec
    Step definition for Appium (mobile testing).

    This class contains the functionality that is only available in the MobileDriver. most of the steps definitions for selenium ( in SeleniumGSpec) can be used for mobile testing Cast the instance of WebDriver to MobileDriver to access the specific functions for mobile (take the existing functions as reference)

    Author:
    José Fernandez
    • Constructor Detail

      • MobileGSpec

        public MobileGSpec​(CommonG spec)
        Generic constructor.
        Parameters:
        spec - object
    • Method Detail

      • launchApplication

        @Given("^I open the application$")
        public void launchApplication()
        Launches an application,

        Launches the app, which was provided in the capabilities at session creation, and (re)starts the session.

         Example:
         
              Scenario: Opening an closing the app
                  Given I open the application
                  And I wait '5' seconds
         
         
        See Also:
        closeApplication()
      • closeApplication

        @Given("^I close the application$")
        public void closeApplication()
        Closes an application

        Close the app which was provided in the capabilities at session creation and quits the session.

         Example:
         
              Scenario: Opening an closing the app
                  Given I open the application
                  And I wait '5' seconds
                  Given I close the application
         
         
        See Also:
        launchApplication()
      • rotateDevice

        @Given("^I rotate the device to \'(landscape|portrait)\' mode$")
        public void rotateDevice​(String orientation)
                          throws Throwable
        Changes the device orientation
         Example
         
              Scenario: Changing orientation
                  Given I rotate the device to 'landscape' mode
                  And I wait '3' seconds
                  Given I rotate the device to 'portrait' mode
         
         
        Parameters:
        orientation - Device orientation (portrait/landscape)
        Throws:
        Throwable - Throwable