iosswiftframeworksautomated-testskif

Is it possible to change device region from test cases?


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?


Solution

  • 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()
    }