使用 Xcode 7 UITest 测试元素是否可见 [英] Testing if an element is visible with Xcode 7 UITest
问题描述
我想根据元素的 .hidden
属性来验证元素是否可见,但我没有找到使用新的 Xcode 7 UI 测试内容的有效方法.
I want to verify if an element is visible or not depending on its .hidden
property but I don't find a valid way to do that using the new Xcode 7 UI test stuff.
我已经尝试过 myelement.exists
和 myelement.hittable
但它们似乎并没有像我预期的那样工作.我想它们与 hidden
属性一起工作.隐藏元素不应该存在且不可命中……但这不是当前行为(我可以理解 exists
行为……但隐藏元素不应该是不可命中的 IMO).
I've tried with myelement.exists
and myelement.hittable
but they doesn't seems to work as I expected. I suppose they work on conjunction with the hidden
property. An hidden element shouldn't exists and is not hittable... but this is not the current behaviour (I can understand the exists
behaviour... but a hidden element should be not hittable IMO).
还有其他方法可以验证隐藏"的属性值吗?
Is there another way to verify the "hidden" property value?
推荐答案
从 Xcode 7.1 Beta 3 开始,UI 测试当前不支持验证元素的可见性.我建议提交一份雷达,以引起对 Apple 的必要关注.
Xcode 7.1 已修复此问题.hittable
现在检查元素是否正确.
Xcode 7.1 has fixed this issue. hittable
now checks to see if the element is correct.
这篇关于使用 Xcode 7 UITest 测试元素是否可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!