简体   繁体   English

是否可以从测试用例中更改设备区域?

[英]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.

相关问题 单击确定可以从XCTest中的其他测试用例中调用测试用例 - OK to call test cases from within other test cases in XCTest 是否可以添加注释但不更改ios中的地图视图区域 - is it possible to add annotation but do not change map view region in ios 可以在没有真实设备的情况下测试iPhone应用吗? - Possible to test iPhone app without a real device? 旋转设备时是否可以更改视图? - Is it possible to change views when the device is rotated? 重大区域变化/区域监控 - Significant region change/Region monitoring 是否可以在从 iOS 端显示在设备上之前更改推送通知消息? - It's possible to change push notification message before display on device from iOS side? 将Xcode 5中的各个XCTest单元测试用例定位到通用应用程序的特定iOS设备? - Target individual XCTest unit test cases in Xcode 5 to a specific iOS device for a universal app? 我的测试导航器将一些测试用例从一个测试类复制到另一个 - My Test Navigator copies some test cases from one test class to another 如何更改 Appstore 应用程序 URL ?? (从特定区域到全球) - How to change Appstore App URL ?? (from specific region to global ) OCUnit测试用例未运行 - OCUnit test cases not running
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM