ios - 如何使用 EarlGrey 中的辅助功能 ID 从 UI 标签/文本字段中捕获文本值?
问题描述
我正在使用 EarlGrey 框架,但不确定使用可访问性 ID 时从 UI 标签/文本字段中捕获文本值的方法。
解决方案
你可以grey_accessibilityID("")
像这样使用:
class MyFirstEarlGreyTest: XCTestCase {
func testExample() {
EarlGrey
.select(elementWithMatcher: grey_accessibilityID("phone_number_text_field"))
.assert(grey_sufficientlyVisible())
.perform(grey_replaceText("1234"))
}
}
我希望这有帮助!
推荐阅读
- java - InputStreamReader ClassPath 处的 NULL 指针
- java - Java 泛型新对象
- mysql - Pytest RuntimeError:未找到应用程序。在视图函数中工作或推送应用程序上下文
- sql - SQL Server 中“全部除外”的替代方案
- nlp - 使用 NLP 匹配标签
- node.js - 首次登录失败,刷新页面强制用户在Angular+(Node/express).js中注销
- ios - 如何从字符串转换或类型转换为 binaryInteger?
- javascript - 为什么它没有在输出中显示范围值?
- flutter - 如何在颤动中展开和折叠容器
- erlang - maps:from_list 是否保证保留相反的顺序?