Switching Android/iOS (Vision)

There are three methods to configure running device os.

testrun.global.properties

You can switch device os with parameter os in properties file.

Run as Android

Set os parameter in the testrun.global.properties file.

## OS --------------------
os=android

or

## OS --------------------
#os=ios

Just comment it out. android is default.

Run as iOS

Set os parameter in the testrun.global.properties file.

## OS --------------------
os=ios



Platform annotation (@android/@ios)

You can switch device os with platform annotation on test classes.

Run as Android

@android
class AndroidSettingsVisionDemo : VisionTest() {

}

Run as iOS

@ios
class iOSSettingsVisionDemo : VisionTest() {

}



@testrun annotation

You can specify arbitrary testrun.properties with @testrun annotation.

Run as Android

  1. Put @testrun annotation on the test class to specify the testrun.properties file.
@Testrun("testConfig/android/androidSettings/testrun.properties")
class AndroidSettingsDemo : UITest() {

}
  1. Set os parameter in the testrun.properties file.
## OS --------------------
os=android

or

## OS --------------------
#os=ios

Just comment it out. android is default.

Run as iOS

  1. Put @testrun annotation on the test class to specify the testrun.properties file.
@Testrun("testConfig/vision/ios/iOSSettings/testrun.properties")
class iOSSettingsVisionDemo : VisionTest() {

}

testrun.properties

  1. Set os parameter in the testrun.properties file.
## OS --------------------
os=ios

Link