ios – 如何通过UI测试执行“向左滑动”操作
发布时间:2020-12-14 18:09:43 所属栏目:百科 来源:网络整理
导读:如何通过 Xcode中的UI测试执行“向左滑动”操作以触发segue并更改视图控制器? 录制的代码是 [[[[[[[XCUIApplication alloc] init].otherElements containingType:XCUIElementTypeNavigationBar identifier:@"UIView"] childrenMatchingType:XCUIElementType
如何通过
Xcode中的UI测试执行“向左滑动”操作以触发segue并更改视图控制器?
录制的代码是 [[[[[[[XCUIApplication alloc] init].otherElements containingType:XCUIElementTypeNavigationBar identifier:@"UIView"] childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element tap]; 但似乎它不起作用 – 据我所知,视图控制器不会更改为新的. 解决方法
很难准确判断您要尝试滑动的视图.以下代码将在标题为“Swipe Me”的标签上执行“向左滑动”手势.定位视图后,应该很容易遵循相同的技术.
XCUIApplication *app = [XCUIApplication alloc] init]; [app.labels[@"Swipe Me"] swipeLeft]; Read more about (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |