【问题标题】:Xcode 7 record ui button doesn't appearXcode 7记录ui按钮不出现
【发布时间】:2016-04-21 19:47:20
【问题描述】:

我创建了一个 ui 测试类:

import Foundation
import XCTest
@testable import TestProject

@available(iOS 9.0, *)
class ChangeWishListUITests: XCTestCase {

    func testExample() {
        // Use recording to get started writing UI tests.
        // Use XCTAssert and related functions to verify your tests produce the correct results.


    }

}

在带有 ios 9.3 的 iphone 6 模拟器上运行应用程序:

但是,录制按钮,就像在本教程中一样: https://developer.apple.com/library/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/RecordingUITests.html#//apple_ref/doc/uid/TP40010215-CH75-SW1

没有出现。

【问题讨论】:

标签: ios xcode xctest


【解决方案1】:
  1. 您的光标必须在您要实现的方法内(因为 Xcode 将代码生成到光标位置)

如果这没有帮助:

  1. 当您将 UI 测试添加到现有项目时,有时 Xcode 似乎不稳定。在某些情况下,以下顺序对我有帮助:

    • 清理项目
    • 重启 Xcode
    • 重建项目
    • 在测试方法内部点击设置光标

有时我不得不这样做两次。

  1. 您的模拟器必须至少运行 iOS 9.0

【讨论】:

    【解决方案2】:

    就我而言,我忘记在项目中添加 UI 测试目标并将测试文件分配给该目标

    【讨论】:

      【解决方案3】:

      调试区域被隐藏...

      同时按“shift + command + y”在键盘上切换调试编辑器

      【讨论】:

        猜你喜欢
        • 2022-11-16
        • 2015-10-30
        • 1970-01-01
        • 2023-03-30
        • 2015-12-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-10-26
        相关资源
        最近更新 更多