Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在XCODE 8、Swift 3中使用UIAutomation_Swift_Unit Testing_Xcode8_Ui Automation - Fatal编程技术网

如何在XCODE 8、Swift 3中使用UIAutomation

如何在XCODE 8、Swift 3中使用UIAutomation,swift,unit-testing,xcode8,ui-automation,Swift,Unit Testing,Xcode8,Ui Automation,导入测试 类UnitTestClass:XCTestCase{ override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This meth

导入测试

类UnitTestClass:XCTestCase{

override func setUp() {
    super.setUp()
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    super.tearDown()
}

func testExample() {

}

我的应用程序中有多个UIViewController类。现在,我想用UIAutomation在Xcode 8、swift 3中测试每个类。在搜索了很多之后,我在Xcode或swift的最新版本中没有得到任何有用的教程或工具。我的应用程序的第一个屏幕是登录屏幕。有人能帮我找到有用的解决方案吗?我相信UIAutomation已经取消了在Xcode 8中预先设置。但您只需执行以下操作即可在Xcode 8中设置UI测试:

  • 将iOS UI测试捆绑包目标添加到项目中
  • 在作为该目标的一部分创建的新测试文件下创建测试方法
  • 在方法中的花括号内单击
  • 单击源代码编辑器下方显示的“录制”图标,开始在模拟器中录制UI操作
  • 观看本节了解更多关于Xcode中UI测试的信息