Android上的辅助功能测试自动化 [英] Accessibility test automation on Android

查看:306
本文介绍了Android上的辅助功能测试自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始研究在Android上自动进行辅助功能测试。网络上没有太多信息。
有没有人探索过或目前正在这样做?如果是这样,您可以分享您的想法/方法吗?

I recently started looking into automating accessibility testing on Android. There isn't much information out there on the web. Has anyone explored this or are currently doing this? If so, can you share your ideas/approach?

似乎Android的uiautomator依赖于可访问性功能,但它不支持测试可访问性。如果它依赖于可访问性功能,是否意味着仅通过使用uiautomator执行UI测试就可以完成诸如可访问标签之类的基本验证?

Seems like Android's uiautomator relies on Accessibility features working but it doesn't support testing Accessibility. If it relies on Accessibility features, does that mean that basic validation like accessible label exists, etc. can be done by just executing UI tests using uiautomator?

推荐答案

这是一个对Android中的辅助功能测试的详尽介绍。基本上可以归结为:

Here's a great introduction to Accessibility testing in Android. It basically boils down to:


  • 使用辅助功能扫描器

  • 手动打开话语提示测试您的应用程序以查找听力障碍问题

  • 要查找字体缩放和布局问题,请使用大文本

  • 绝对是棉绒检查,但请确保将没有contentDescription的图像设置为Severity = Error

  • 您发现或正在发生的任何/所有可访问性问题,如果以后违反该可访问性问题,编写一个Espresso测试失败

  • 对于自动化,您还将如果需要听力受损的功能,则需要考虑如何对某些屏幕伪像进行视觉验证和音频分析。

  • Manually test your app for visual issues with Accessibility Scanner
  • Turn on TalkBack and manually test your app to find hearing impaired issues
  • To find font scaling and layout issues, use Large Text
  • Definitely lint check, but make sure that 'Image without contentDescription' is set to Severity = Error
  • Any/all accessibility issues you find or that are reoccurring, write an Espresso test to fail when that accessibility issue is violated in the future
  • For automation, you'll also need to consider how to perform visual validation of certain screen artifacts and audio analysis if hearing impaired functionality is a requirement.

此外,我建议您观看

Also, I recommend watching this presentation from GTAC 2015 on accessibility testing for some great context on the topic.

对于GTAC 2015上有关该主题的一些重要上下文的演示文稿。

For automated tests that check for accessibility, I'd very much recommend starting with issues that can be identified in elements that are shared across screens (menus, layouts, themes, custom controls). While they won't catch the one-off errors that will occasionally pop up, they'll address issues that happen everywhere in your app, a 'prioritize by volume' approach if you will.

此外,如果您的团队使用Android Studio,那么您绝对希望提高编写编写与代码一起驻留的Espresso测试的能力。质量检查是开发过程的一部分。除非存在一些合法的博洛尼亚文,否则访问测试所在的子文件夹应该不是问题。例如,将 androidTest文件夹拆分为子模块您具有测试人员的拉/推权限,但仅对应用程序其余部分具有读取权限,因此您可以编译和运行自己的权限。如果您正在编写Appium测试,可能很难要求您的开发团队在构建过程中将其作为自己的BVT /烟气测试过程的一部分运行,但这并非闻所未闻。

Also, if your team uses Android Studio then you definitely want to push for the ability to write Espresso tests that reside with the code. QA are part of the development process, period. Getting access to a subfolder where your tests reside shouldn't be a problem unless there some legal bologna to deal with. For instance, split out the 'androidTest' folder as a submodule where you have pull/push rights as a tester, but only read rights to the rest of the app so you can compile and run yourself. If you're writing Appium tests, it may be harder to ask your dev team to run them as part of their own BVT/smoke test process during builds, but not unheard of.

关于视觉分析音频注入/确认,这些是高级功能,您可能需要使用某些服务或商业工具

As for visual analysis and audio injection/confirmation, these are advanced capabilities that you'll probably need to use some service or commercial tool for.

祝你好运!

这篇关于Android上的辅助功能测试自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆