草庐IT

firstMatch

全部标签

ios - UI 测试 firstMatch

将.element(boundBy:0)的UI测试代码中的所有实例替换为.firstMatch是否安全?我会这么认为,但Apple的文档对此不是很清楚(尤其是在多个匹配的情况下,尽管我只关心第一个)。https://developer.apple.com/documentation/xctest/xcuielementtypequeryprovider/2902250-firstmatch 最佳答案 与其将element(boundBy:0)与firstMatch交换,不如将它们链接起来。XCUIApplication().cell