在 Compose 中进行测试
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
编写您的首个 Compose 界面测试。本视频介绍了查找器、断言、操作和匹配器,并简要介绍了语义树。
资源
包含本指南的集合
本指南属于以下精选快速入门集合,这些集合涵盖了更广泛的 Android 开发目标:
Compose 基础知识(视频合集)
本系列视频介绍了各种 Compose API,可让您快速了解可用 API 以及如何使用它们。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Testing in Compose\n\n\u003cbr /\u003e\n\nWrite your first Compose UI test. This video covers finders, assertions,\nactions, and matchers and takes a quick look at the semantics tree. \n\nResources\n---------\n\n- [Testing your Compose layout](https://goo.gle/compose-testing)\n- [Semantics in Compose](https://goo.gle/compose-semantics)\n- [Testing cheatsheet](https://goo.gle/compose-test-sheet)\n- [Accessibility in Compose](https://goo.gle/compose-a11y)\n\nCollections that contain this guide\n-----------------------------------\n\nThis guide is part of these curated Quick Guide collections that cover\nbroader Android development goals: \n\n### Compose basics (video collection)\n\nThis series of videos introduces various Compose APIs, quickly showing you what's available and how to use them. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/compose-basics) \n\nHave questions or feedback\n--------------------------\n\nGo to our frequently asked questions page and learn about quick guides or reach out and let us know your thoughts. \n[Go to FAQ](/quick-guides/faq) [Leave feedback](https://issuetracker.google.com/issues/new?component=1573691&template=1993320)"]]