[英]Is it possible to change device region from test cases?
Currently, I have used KIF to write test cases for the iOS application. 目前,我已使用KIF编写iOS应用程序的测试用例。 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 ?
有没有办法通过KIF更改设备语言 ? Or How can I write and run the test cases for different region?
或如何编写和运行不同区域的测试用例?
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()
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.