Fix instrumented tests: move screenshotTesting out of commonTest

Move core:screenshotTesting from commonTest to androidUnitTest dependencies
to prevent Robolectric's LocalPermissionGranter from leaking into the
instrumented test classpath via KotlinSourceSetTree.test. Add explicit
espresso-core dependency to androidInstrumentedTest.
pull/2064/head
Mercury Li 4 weeks ago
parent a0ac3e1474
commit 0fe9f19b50

@ -114,19 +114,23 @@ kotlin {
commonTest.dependencies {
implementation(projects.core.dataTest)
implementation(projects.core.testing)
implementation(projects.core.screenshotTesting)
// implementation(projects.sync.syncTest)
implementation(libs.kotlin.test)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.uiTest)
}
androidUnitTest.dependencies {
implementation(projects.core.screenshotTesting)
}
androidInstrumentedTest.dependencies {
implementation(projects.core.dataTest)
implementation(projects.core.testing)
implementation(libs.androidx.navigation.testing)
implementation(project.dependencies.platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui.test)
implementation(libs.androidx.test.espresso.core)
implementation(libs.koin.test)
}

@ -89,6 +89,7 @@ androidx-metrics = { group = "androidx.metrics", name = "metrics-performance", v
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "androidxNavigation" }
androidx-navigation-testing = { group = "androidx.navigation", name = "navigation-testing", version.ref = "androidxNavigation" }
androidx-profileinstaller = { group = "androidx.profileinstaller", name = "profileinstaller", version.ref = "androidxProfileinstaller" }
androidx-test-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "androidx-espresso-core" }
androidx-test-core = { group = "androidx.test", name = "core", version.ref = "androidxTestCore" }
androidx-test-ext = { group = "androidx.test.ext", name = "junit-ktx", version.ref = "androidxTestExt" }
androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "androidxTestRules" }

Loading…
Cancel
Save