testing-lazy-lists

Standardize Jetpack Compose lazy list testing with semantic scrolling and visibility checks.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/trancee/MeshLink-template --skill testing-lazy-lists-trancee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-lazy-lists
Source: https://github.com/trancee/MeshLink-template/tree/main/.agents/skills/android-testing-skills/compose/patterns/testing-lazy-lists
Command: npx skills add https://github.com/trancee/MeshLink-template --skill testing-lazy-lists-trancee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the common pitfalls in testing Jetpack Compose lazy layouts, such as items being off-screen, incorrectly using assertExists, and failing to handle dynamic scroll states.

Core Features & Use Cases

  • Semantic Scrolling: Provides standardized methods to scroll to specific indices or keys using semantic actions.
  • Visibility Verification: Teaches the correct usage of assertIsDisplayed to ensure items are actually rendered in the viewport.
  • Advanced Probing: Guides the use of state.layoutInfo to verify list state and item placement animations deterministically.

Quick Start

Use the testing-lazy-lists skill to scroll to a specific item key and verify its visibility in your Compose test.

Frequently Asked Questions about testing-lazy-lists

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test off-screen items in a Jetpack Compose LazyColumn?

To test off-screen items in a Jetpack Compose LazyColumn, use semantic scroll primitives like performScrollToIndex to bring the item into the viewport, then verify its visibility using assertIsDisplayed.

Why does assertExists fail for items in a Compose lazy list?

assertExists fails for items in a Compose lazy list because it checks the semantic tree rather than the rendered viewport; you must use assertIsDisplayed to confirm the lazy layout item is actually visible on screen.

How do I verify scroll state and item placement in Compose UI testing?

You can verify scroll state and item placement in Compose UI testing by probing state.layoutInfo, which provides deterministic data about the current list state and the positioning of items within the lazy layout.

What is the best way to handle animations when testing LazyVerticalGrid?

The best way to handle animations when testing LazyVerticalGrid is to use deterministic clock management, ensuring that item placement animations and layout state verification occur predictably during the test.

Do I need stable test tags for semantic scrolling in Jetpack Compose?

Yes, you need stable test tags for semantic scrolling in Jetpack Compose, because standardized semantic scroll primitives and visibility verification rely on consistent tagging to locate items in LazyColumn and LazyRow components.