testing-animations-deterministically

Community

Stop flaky Compose animation tests.

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.autoAdvance and driving frames manually.
  • Handle infinite/indeterminate animations safely so InfiniteAnimationPolicy does not fail your test with CancellationException.
  • Avoid mid-animation test hangs and race conditions by mutating Compose state with runOnUiThread (not runOnIdle) 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 required

Components

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.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.