Package com.privalia.qa.specs
Class MobileGSpec
- java.lang.Object
-
- com.privalia.qa.specs.BaseGSpec
-
- com.privalia.qa.specs.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 ( inSeleniumGSpec
) can be used for mobile testing Cast the instance ofWebDriver
toMobileDriver
to access the specific functions for mobile (take the existing functions as reference)- Author:
- José Fernandez
-
-
Field Summary
-
Fields inherited from class com.privalia.qa.specs.BaseGSpec
commonspec
-
-
Constructor Summary
Constructors Constructor Description MobileGSpec(CommonG spec)
Generic constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeApplication()
Closes an applicationvoid
launchApplication()
Launches an application,void
rotateDevice(String orientation)
Changes the device orientation-
Methods inherited from class com.privalia.qa.specs.BaseGSpec
getCommonSpec
-
-
-
-
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 applicationClose 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 orientationExample
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
-
-