controlling-the-test-clock
CommunityDrive Compose time precisely, frame by frame.
Software Engineering#ui testing#jetpack compose#animation timing#main test clock#test coroutine scheduler#v2 compose rule#compose timeout exception
Authorskydoves
Version1.0.0
Installs0
System Documentation
What problem does it solve?
It solves the confusion of how Compose UI tests progress through time—especially when animations, recomposition, and async coroutines depend on the test clock—so your assertions match what the framework actually did.
Core Features & Use Cases
- Frame-accurate clock control: Advance time by exactly one frame with MainTestClock.advanceTimeByFrame, or step by durations with the correct rounding rules.
- Deterministic animation timing: Understand the 16 ms frame model and the “kick-off” frame so animations start with the right play time.
- v1 to v2 migration reliability: Use runCurrent or advanceTimeBy(0) after state mutations when v2 createComposeRule queues work under the StandardTestDispatcher.
- Test-clock waiting & failure diagnosis: Use advanceTimeUntil for Compose-state conditions and correctly interpret ComposeTimeoutException as a verdict on unmet snapshot/state changes.
Quick Start
Use the controlling-the-test-clock skill to explain why your Compose test clock needs an extra advanceTimeByFrame after setContent and how to fix timing issues caused by v2 task queuing.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: controlling-the-test-clock Download link: https://github.com/skydoves/android-testing-skills/archive/main.zip#controlling-the-test-clock Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.