简体   繁体   English

适用于iOS应用程序的UI自动化工具,可识别CALayer对象

[英]UI automation tools for iOS apps that can identify CALayer objects

I'm trying to automate tests that test an app that has CA Layer objects. 我正在尝试自动化测试具有CA Layer对象的应用程序的测试。 UI automation framework given by Apple does not identify CA Layer objects. Apple提供的UI自动化框架无法识别CA Layer对象。 I want a list of ui automation tools that help in identifying CA Layer objects. 我想要一个有助于识别CA Layer对象的ui自动化工具列表。 Can I get the list of tools please? 我可以获得工具清单吗?

UI Automation cannot access the CA Layer objects because they are not exposed to the accessibility mechanism in iOS. UI自动化无法访问CA层对象,因为它们未向iOS中的可访问性机制公开。 You can expose your layers to the accessibility API's by starting with an object that conforms to the UIAccessibilityContainer protocol. 您可以通过从符合UIAccessibilityContainer协议的对象开始,将您的图层公开给辅助功能API。 That object would provide a set of UIAccessibilityElement objects that would mirror the representation of your CA Layers. 该对象将提供一组UIAccessibilityElement对象,这些对象将镜像CA层的表示形式。 At that point, UI Automation would be able to "see" what the user sees when looking at the raw CA layers. 此时,UI Automation将能够“查看”用户在查看原始CA层时看到的内容。

You get two benefits with this strategy. 使用此策略可以获得两个好处。 Your app is now accessible through things like Voice Over for the visually impaired, and you have a way to talk to your app through UI Automation. 现在,您可以通过Voice Over为视障人士访问您的应用,并且您可以通过UI自动化与您的应用进行交流。

This is what Apple recommends for apps that don't use the native UIKit functionality that does accessibility for you. 这就是Apple推荐的应用程序,这些应用程序不使用为您提供辅助功能的本机UIKit功能。 IMHO, I think it's a good idea to follow this path because Apple's betting big on accessibility features and it's only going to go deeper with integration into the OS in the future. 恕我直言,我认为遵循这条道路是一个好主意,因为Apple在可访问性功能方面投入了大量资金,而且未来只会更深入地融入操作系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM