【问题标题】:Tap on SwiftUI LocationButton in UI Test在 UI 测试中点击 SwiftUI LocationButton
【发布时间】:2023-01-11 08:44:28
【问题描述】:

我无法在 Swift UI 测试中点击 LocationButton。这是按钮:

我在 UITest 中处于断点,我尝试了这个但没有运气:

  • app.buttons.count 返回 0
  • app.staticTexts["Current Location"].exists返回false
  • app.buttons["Current Location"].exists返回false

这个按钮有什么特别之处吗?如何在 UITest 中点击它?

【问题讨论】:

  • 您是否尝试使用可访问性标识符?

标签: swift xctest


【解决方案1】:

您找到解决方案了吗?

我试过传递 AccessibilityLabel 和 staticTextx["accesibilityLabel"] 没有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多