From 2b02404b5f1acb04fc2ea2a87a08b273f249b5c7 Mon Sep 17 00:00:00 2001 From: Chris Arriola Date: Wed, 6 Mar 2024 13:36:41 -0800 Subject: [PATCH] Use @SdkSuppress instead of @RequiresApi in test --- .../com/example/compose/rally/AssertScreenshotMatchesGolden.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TestingCodelab/app/src/androidTest/java/com/example/compose/rally/AssertScreenshotMatchesGolden.kt b/TestingCodelab/app/src/androidTest/java/com/example/compose/rally/AssertScreenshotMatchesGolden.kt index 5bfd3f5d6..06f21ceb4 100644 --- a/TestingCodelab/app/src/androidTest/java/com/example/compose/rally/AssertScreenshotMatchesGolden.kt +++ b/TestingCodelab/app/src/androidTest/java/com/example/compose/rally/AssertScreenshotMatchesGolden.kt @@ -23,6 +23,7 @@ import androidx.annotation.RequiresApi import androidx.compose.ui.graphics.asAndroidBitmap import androidx.compose.ui.test.SemanticsNodeInteraction import androidx.compose.ui.test.captureToImage +import androidx.test.filters.SdkSuppress import androidx.test.platform.app.InstrumentationRegistry import java.io.FileOutputStream @@ -35,7 +36,7 @@ import java.io.FileOutputStream * * Screenshots are saved on device in `/data/data/{package}/files`. */ -@RequiresApi(Build.VERSION_CODES.O) +@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O) fun assertScreenshotMatchesGolden( goldenName: String, node: SemanticsNodeInteraction