Is it possible to change device region from test cases?

309 Views Asked by At

Currently, I have used KIF to write test cases for the iOS application. But I the app supports multiple regions and the functionality changes according to the region. Is there a way to change device language via KIF? Or How can I write and run the test cases for different region?

1

There are 1 best solutions below

1
Mosbah On BEST ANSWER

You can do the following in your setup method, but you have to reset the simulator before each run so it's not optimal:

override func setUp() {

super.setUp()

continueAfterFailure = false

XCUIApplication().launchArguments += [“-AppleLanguages”, “(fr)”]

XCUIApplication().launchArguments += [“-AppleLocale”, “fr_FR”]

XCUIApplication().launch()
}