diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 62fd8642..39a8d923 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -106,6 +106,8 @@ kotlinx-serialization = "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1" ktor-network = { module = "io.ktor:ktor-network", version = "2.1.1" } +lottie = { module = "com.airbnb.android:lottie", version = "6.5.2" } + mockito = { module = "org.mockito:mockito-inline", version.ref = "mockito" } mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockito" } diff --git a/snapshots/snapshots/build.gradle.kts b/snapshots/snapshots/build.gradle.kts index d1ee69e4..73e18055 100644 --- a/snapshots/snapshots/build.gradle.kts +++ b/snapshots/snapshots/build.gradle.kts @@ -65,6 +65,7 @@ dependencies { api(libs.androidx.test.rules) api(libs.androidx.test.runner) api(libs.compose.ui.test.junit) + api(libs.lottie) testImplementation(libs.junit) } diff --git a/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/EmergeComposeSnapshotReflectiveParameterizedInvoker.kt b/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/EmergeComposeSnapshotReflectiveParameterizedInvoker.kt index ab0e6571..18222ad5 100644 --- a/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/EmergeComposeSnapshotReflectiveParameterizedInvoker.kt +++ b/snapshots/snapshots/src/main/kotlin/com/emergetools/snapshots/compose/EmergeComposeSnapshotReflectiveParameterizedInvoker.kt @@ -5,15 +5,18 @@ import android.util.Log import androidx.compose.ui.tooling.PreviewActivity import androidx.test.ext.junit.rules.ActivityScenarioRule import androidx.test.platform.app.InstrumentationRegistry +import com.airbnb.lottie.LottieTask import com.emergetools.snapshots.EmergeSnapshots import com.emergetools.snapshots.shared.ComposePreviewSnapshotConfig import com.emergetools.snapshots.shared.ComposeSnapshots import kotlinx.serialization.json.Json +import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized import java.io.File +import java.util.concurrent.Executor @RunWith(Parameterized::class) class EmergeComposeSnapshotReflectiveParameterizedInvoker( @@ -79,6 +82,12 @@ class EmergeComposeSnapshotReflectiveParameterizedInvoker( @get:Rule val snapshotRule: EmergeSnapshots = EmergeSnapshots() + @Before + fun setup() { + // https://github.com/cashapp/paparazzi/issues/630#issuecomment-1512516656 + LottieTask.EXECUTOR = Executor(Runnable::run) + } + @Test fun reflectiveComposableInvoker() { Log.i(TAG, "Running snapshot test ${parameter.previewConfig.keyName()}")