【发布时间】:2017-04-27 13:11:39
【问题描述】:
我是任何类型的 iOS 编程的新手。我正在尝试为我的一个场景编写 UI 测试用例。
以下是我使用重新编码方法并点击自定义组件时得到的代码。
let button = XCUIApplication().children(matching: .window).element(boundBy: 0).children(matching: .other).element.children(matching: .button).element
在这个自定义组件中有两个按钮。我想知道选择了哪个按钮。为此,我需要识别按钮。但是在我点击自定义视图的地方,我都会得到相同的代码。
如何访问自定义视图中的每个组件。任何帮助都会很棒。
【问题讨论】:
标签: ios iphone unit-testing swift3 xcode-ui-testing