Switching Android/iOS (Vision)
There are three methods to configure running device os.
- testrun.global.properties
- Platform annotation(@android/@ios)
- @testrun annotation
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
- Put
@testrun
annotation on the test class to specify the testrun.properties file.
@Testrun("testConfig/android/androidSettings/testrun.properties")
class AndroidSettingsDemo : UITest() {
}
- Set
os
parameter in thetestrun.properties
file.
## OS --------------------
os=android
or
## OS --------------------
#os=ios
Just comment it out. android
is default.
Run as iOS
- 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
- Set
os
parameter in thetestrun.properties
file.
## OS --------------------
os=ios