Android Developers
Essentials
  • Modern Android
  • Quickly bring your app to life with less code, using a modern declarative approach to UI, and the simplicity of Kotlin.
  • Explore Modern Android
  • Adopt Compose for teams
  • Get started
  • Start by creating your first app. Go deeper with our training courses or explore app development on your own.
  • Hello world
  • Training courses
  • Tutorials
  • Kotlin for Android
  • Monetization with Play
  • Extend by device
  • Build apps that give your users seamless experiences from phones to tablets, watches, and more.
  • Tablets and foldables
  • Wear OS
  • Android for Cars
  • Android TV
  • ChromeOS
  • Cross-device SDK
  • Build by category
  • Learn to build for your use case by following Google's prescriptive and opinionated guidance.
  • Games
  • Media apps
  • Health & Fitness
  • Enterprise apps
  • Get the latest
  • Stay in touch with the latest releases throughout the year, join our preview programs, and give us your feedback.
  • Platform releases
  • Android Studio preview
  • Jetpack & Compose libraries
  • Wear OS preview
  • Privacy Sandbox
Design & Plan
  • Kits & more
  • Get one of our Figma kits for Android, Material Design, or Wear OS, and start designing your app's UI today.
  • Go to Android & Material kits
  • Go to Wear OS kits
  • UI Design
  • Design a beautiful user interface using Android best practices.
  • Design for Android
  • Mobile
  • Large screens
  • Wear OS
  • TV
  • Architecture
  • Design robust, testable, and maintainable app logic and services.
  • Introduction
  • Libraries
  • Navigation
  • Modularization
  • Testing
  • Quality
  • Plan for app quality and align with Play store guidelines.
  • Overview
  • Core value
  • User experience
  • Technical quality
  • Privacy & security
  • Build for Billions
  • Create the best experience for entry-level devices
  • Overview
  • About new markets
  • Android (Go edition)
Develop Google Play
  • English
  • Bahasa Indonesia
  • Deutsch
  • Español
  • Español – América Latina
  • Français
  • Português – Brasil
  • Tiếng Việt
  • Türkçe
  • Русский
  • ภาษาไทย
  • 中文 – 简体
  • 中文 – 繁體
  • 日本語
  • 한국어
  • Modern Android
  • Compose
Overview Tutorial Samples Guides For teams
Android Developers
  • Essentials
    • More
    • Overview
    • Tutorial
    • Samples
    • Guides
    • For teams
  • Design & Plan
    • More
  • Develop
  • Google Play
  • Introduction
    • Documentation
    • Why Compose
    • Quick start
    • Thinking in Compose
    • Bill of Materials
      • Using the Bill of Materials
      • BOM to library version mapping
  • UI architecture
    • Lifecycle
    • Side-effects
    • Phases
    • Managing state
      • Overview
      • Where to hoist state
      • Save UI state
    • Architecture
    • Architectural layering
    • CompositionLocal
    • Navigation
  • Develop your app's layout
    • Overview
    • Layout basics
    • Modifiers
    • List of modifiers
    • Pager
    • Flow layouts
    • Custom layouts
    • Build adaptive layouts
    • Alignment lines
    • Intrinsic measurements
    • ConstraintLayout
  • Components
    • Overview
    • Scaffold
    • App bars
    • Button
    • Floating action button
    • Card
    • Chip
    • Dialog
    • Progress indicators
    • Slider
    • Switch
    • Bottom sheets
    • Navigation drawer
    • Snackbar
    • Lists and grids
    • Resources
  • Theming
    • Overview
    • Material Design 3
    • Migrate from Material 2 to Material 3
    • Material Design 2
    • Custom theming
    • Anatomy of a theme
    • Migrating XML themes to Compose
  • Text and typography
    • Overview
    • Display and style text
      • Display text from resource
      • Style text
      • Style paragraph
      • Configure text layout
    • Handle user input
    • Enable user interactions
    • Work with fonts
    • Display emoji
  • Images and graphics
    • Overview
    • Images
      • Overview
      • Loading images
      • ImageBitmap vs ImageVector
      • Material icons
      • Customize an image
      • Custom painter
      • Optimizing performance
    • Graphics
      • Overview
      • Graphics Modifiers
      • Brush
  • Animation
    • Overview
    • Choose an animation API
    • Quick guide
    • Animation modifiers and composables
    • Value-based animations
    • Animated vector drawables
    • Advanced animation example
    • Customize animations
    • Test animations
    • Tools
    • Additional resources
  • Accessibility
    • Semantics
    • Accessibility
  • Touch and input
    • Overview
    • Pointer input
      • Overview
      • Understand gestures
      • Tap and press
      • Scroll
      • Drag, swipe, and fling
      • Migrate from Swipeable to AnchoredDraggable
      • Multi-touch gestures
    • Focus
      • Overview
      • Change focus traversal order
      • Change focus behavior
      • React to focus
    • Handling interactions
  • Performance
    • Overview
    • Tools
    • Best practices
    • Stability
      • Overview
      • Diagnose stability issues
      • Fix stability issues
  • Style guidelines
    • Compose API guidelines
    • Kotlin for Compose
  • UI testing
    • Testing
    • Testing cheat sheet
  • Migrate to Compose
    • Overview
    • Migration strategy
    • Interoperability APIs
      • Overview
      • Using Compose in Views
      • Using Views in Compose
    • Common migration scenarios
      • Migrate RecyclerView to Compose
      • Migrate CoordinatorLayout to Compose
      • Migrate Jetpack Navigation to Navigation Compose
    • Other considerations
    • Adopt Compose for teams
    • Compose and other libraries
    • Compare Compose and View performance
  • Tools
    • Overview
    • Design
      • Preview your UI
      • Preview and debug animations
    • Develop
      • Develop code iteratively
      • Editor actions
    • Debug
      • Inspect your layout
      • Trace app performance
    • Relay designer and developer tooling
      • Overview
      • Install Relay
      • Set up your Android project
      • Basic tutorial
        • Overview
        • Create UI Package in Figma
        • Convert the designs to code in Android Studio
        • Make and propagate design updates
        • Content parameters
      • Advanced tutorial
        • Overview
        • Handling design variants
        • Content parameters
        • Add interaction handlers to designs
      • Relay workflow
        • Overview
        • Create UI Packages
        • Add parameters
        • Check errors
        • Share UI Packages
        • Android Studio workflow
        • Understand UI Package & generated code
        • Figma DevMode
      • Design-to-code translation details
        • Figma Component Properties
        • Children parameters
        • Nested package instances
        • Vector graphics
        • Multiple styles in text
        • Absolute positioning within auto layout
        • Fill color
        • Effects
      • Limitations and troubleshooting
      • Experimental features
        • Mapping styles to Compose theme
        • Mapping components to existing code
      • Releases
  • Leverage system capabilities
    • Window Insets
    • Cutouts
  • Create widgets
    • Overview
    • Glance setup
    • Create an app widget with Glance
    • Handle user interaction with Glance
    • Manage and update GlanceAppWidget
    • Build UI with Glance
    • Implement a Glance theme
    • Glance interoperability
    • Additional resources
  • Modern Android
  • Explore Modern Android
  • Adopt Compose for teams
  • Get started
  • Hello world
  • Training courses
  • Tutorials
  • Kotlin for Android
  • Monetization with Play
  • Extend by device
  • Tablets and foldables
  • Wear OS
  • Android for Cars
  • Android TV
  • ChromeOS
  • Cross-device SDK
  • Build by category
  • Games
  • Media apps
  • Health & Fitness
  • Enterprise apps
  • Get the latest
  • Platform releases
  • Android Studio preview
  • Jetpack & Compose libraries
  • Wear OS preview
  • Privacy Sandbox
  • Kits & more
  • Go to Android & Material kits
  • Go to Wear OS kits
  • UI Design
  • Design for Android
  • Mobile
  • Large screens
  • Wear OS
  • TV
  • Architecture
  • Introduction
  • Libraries
  • Navigation
  • Modularization
  • Testing
  • Quality
  • Overview
  • Core value
  • User experience
  • Technical quality
  • Privacy & security
  • Build for Billions
  • Overview
  • About new markets
  • Android (Go edition)
  • Android Developers
  • Modern Android
  • Compose
  • Guides

Testing cheatsheet

The Compose testing cheat sheet is a quick reference of some of the most useful Compose test APIs. The cheat sheet is also downloadable in PDF format.

Useful Compose testing APIs

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2023-09-27 UTC.

  • WeChat WeChat
    Follow Google Developers on WeChat
  • Twitter Twitter
    Follow @AndroidDev on Twitter
  • YouTube YouTube
    Check out Android Developers on YouTube
  • More Android

    • Android
    • Enterprise
    • Security
    • Source
  • Support

    • Report platform bug
    • Report documentation bug
    • Google Play support
    • Join research studies
  • Documentation

    • Developer guides
    • Design guides
    • API reference
    • Samples
    • Android Studio
Google Developers
  • Android
  • Chrome
  • Firebase
  • Google Cloud Platform
  • All products
  • Privacy
  • License
  • Brand guidelines
  • ICP证合字B2-20070004号
  • Get news and tips by email Subscribe
  • English
  • Bahasa Indonesia
  • Deutsch
  • Español
  • Español – América Latina
  • Français
  • Português – Brasil
  • Tiếng Việt
  • Türkçe
  • Русский
  • ภาษาไทย
  • 中文 – 简体
  • 中文 – 繁體
  • 日本語
  • 한국어