【问题标题】:How to cancel a call with XCTest for iOS 14如何使用 XCTest for iOS 14 取消通话
【发布时间】:2021-02-04 15:31:22
【问题描述】:

您好,我正在为 iOS 14 使用 Swift 编写一些 XCTest。

在 iOS 13 中,跳板处理通话屏幕,您可以使用结束通话

let app = XCUIApplication(bundleIdentifier: "com.apple.springboard")

app.buttons["End call"].firstMatch.tap()

但是,跳板似乎不包含 iOS 14 的结束通话按钮!那么如何在 iOS 14 中结束通话呢?

【问题讨论】:

  • hmm 是否有任何按钮关闭或结束通话(我认为应该是)?
  • 是的,但我无法使用跳板应用程序或我自己的应用程序访问它。它存在于其他应用程序中。
  • 我明白了,我们应该在 xcode 中使用可访问性标识符工具捕获类似的“结束呼叫”。你知道它是怎么回事还是我应该放弃答案?

标签: swift xcode testing xctest ios14


【解决方案1】:

您可以尝试通过读取 Apple 的控制台应用程序输出来检查显示的应用程序。 (搜索 FBApplication)

您可能需要与 Phone 应用程序而不是 Springboard 进行交互

iOS 应用的捆绑标识符:https://github.com/rzakhar/XCTApps/blob/master/Sources/XCTApps/iOS.swift

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-22
    • 2016-06-08
    • 2017-02-18
    • 2019-04-14
    • 1970-01-01
    • 2021-03-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多