testing-animations-deterministically
CommunityStop flaky Compose animation tests.
Software Engineering#jetpack-compose#ui-testing#auto-advance#crossfade#animation-testing#main-test-clock#infinite-animation-policy
Authorskydoves
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill solves flaky Jetpack Compose UI tests caused by indeterminate or time-based animations running differently on CI versus locally.
Core Features & Use Cases
- Make animation timing deterministic by disabling
mainClock.autoAdvanceand driving frames manually. - Handle infinite/indeterminate animations safely so
InfiniteAnimationPolicydoes not fail your test withCancellationException. - Avoid mid-animation test hangs and race conditions by mutating Compose state with
runOnUiThread(notrunOnIdle) while the clock is paused. - Use test-clock waiting correctly with
mainClock.advanceTimeUntil { ... }for state-observable conditions inside the paused-clock window.
Quick Start
Set up your Compose UI test by setting mainClock.autoAdvance = false before setContent, then call advanceTimeByFrame() once to kick off the animation and step it with advanceTimeBy(durationMillis) before asserting the intermediate UI state.
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: testing-animations-deterministically Download link: https://github.com/skydoves/android-testing-skills/archive/main.zip#testing-animations-deterministically 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.