Extract ScreenshotHelper to separate testing module

Change-Id: Icf98a4acc9963656530a1a9fc8b156a553a070af
pull/1140/head
Alex Vanyo 9 months ago
parent 9cd430ba7d
commit e3c7018124

@ -113,10 +113,12 @@ dependencies {
testDemoImplementation(libs.robolectric) testDemoImplementation(libs.robolectric)
testDemoImplementation(libs.roborazzi) testDemoImplementation(libs.roborazzi)
testDemoImplementation(projects.core.screenshotTesting)
androidTestImplementation(projects.core.testing) androidTestImplementation(projects.core.testing)
androidTestImplementation(projects.core.dataTest) androidTestImplementation(projects.core.dataTest)
androidTestImplementation(projects.core.datastoreTest) androidTestImplementation(projects.core.datastoreTest)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.androidx.navigation.testing) androidTestImplementation(libs.androidx.navigation.testing)
androidTestImplementation(libs.accompanist.testharness) androidTestImplementation(libs.accompanist.testharness)
androidTestImplementation(libs.hilt.android.testing) androidTestImplementation(libs.hilt.android.testing)

@ -47,6 +47,7 @@ dependencies {
testImplementation(libs.hilt.android.testing) testImplementation(libs.hilt.android.testing)
testImplementation(libs.robolectric) testImplementation(libs.robolectric)
testImplementation(libs.roborazzi) testImplementation(libs.roborazzi)
testImplementation(projects.core.screenshotTesting)
testImplementation(projects.core.testing) testImplementation(projects.core.testing)
androidTestImplementation(libs.androidx.compose.ui.test) androidTestImplementation(libs.androidx.compose.ui.test)

@ -0,0 +1,34 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
alias(libs.plugins.nowinandroid.android.library)
alias(libs.plugins.nowinandroid.android.library.compose)
alias(libs.plugins.nowinandroid.android.hilt)
}
android {
namespace = "com.google.samples.apps.nowinandroid.core.screenshottesting"
}
dependencies {
api(libs.roborazzi)
implementation(libs.accompanist.testharness)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.ui.test)
implementation(libs.robolectric)
implementation(projects.core.common)
implementation(projects.core.designsystem)
}

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2022 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<manifest />

@ -26,7 +26,6 @@ android {
dependencies { dependencies {
api(kotlin("test")) api(kotlin("test"))
api(libs.androidx.compose.ui.test) api(libs.androidx.compose.ui.test)
api(libs.roborazzi)
api(projects.core.analytics) api(projects.core.analytics)
api(projects.core.data) api(projects.core.data)
api(projects.core.model) api(projects.core.model)
@ -34,13 +33,10 @@ dependencies {
debugApi(libs.androidx.compose.ui.testManifest) debugApi(libs.androidx.compose.ui.testManifest)
implementation(libs.accompanist.testharness)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.test.rules) implementation(libs.androidx.test.rules)
implementation(libs.hilt.android.testing) implementation(libs.hilt.android.testing)
implementation(libs.kotlinx.coroutines.test) implementation(libs.kotlinx.coroutines.test)
implementation(libs.kotlinx.datetime) implementation(libs.kotlinx.datetime)
implementation(libs.robolectric.shadows)
implementation(projects.core.common) implementation(projects.core.common)
implementation(projects.core.designsystem) implementation(projects.core.designsystem)
} }

@ -33,6 +33,7 @@ dependencies {
testImplementation(libs.hilt.android.testing) testImplementation(libs.hilt.android.testing)
testImplementation(libs.robolectric) testImplementation(libs.robolectric)
testImplementation(projects.core.testing) testImplementation(projects.core.testing)
testImplementation(projects.core.screenshotTesting)
testDemoImplementation(libs.roborazzi) testDemoImplementation(libs.roborazzi)
androidTestImplementation(projects.core.testing) androidTestImplementation(projects.core.testing)

@ -128,7 +128,6 @@ protobuf-protoc = { group = "com.google.protobuf", name = "protoc", version.ref
retrofit-core = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" } retrofit-core = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" }
retrofit-kotlin-serialization = { group = "com.jakewharton.retrofit", name = "retrofit2-kotlinx-serialization-converter", version.ref = "retrofitKotlinxSerializationJson" } retrofit-kotlin-serialization = { group = "com.jakewharton.retrofit", name = "retrofit2-kotlinx-serialization-converter", version.ref = "retrofitKotlinxSerializationJson" }
robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" } robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" }
robolectric-shadows = { group = "org.robolectric", name = "shadows-framework", version.ref = "robolectric" }
roborazzi = { group = "io.github.takahirom.roborazzi", name = "roborazzi", version.ref = "roborazzi" } roborazzi = { group = "io.github.takahirom.roborazzi", name = "roborazzi", version.ref = "roborazzi" }
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" } room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" } room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }

@ -36,6 +36,7 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
include(":app") include(":app")
include(":app-nia-catalog") include(":app-nia-catalog")
include(":benchmarks") include(":benchmarks")
include(":core:analytics")
include(":core:common") include(":core:common")
include(":core:data") include(":core:data")
include(":core:data-test") include(":core:data-test")
@ -47,10 +48,10 @@ include(":core:designsystem")
include(":core:domain") include(":core:domain")
include(":core:model") include(":core:model")
include(":core:network") include(":core:network")
include(":core:ui")
include(":core:testing")
include(":core:analytics")
include(":core:notifications") include(":core:notifications")
include(":core:screenshot-testing")
include(":core:testing")
include(":core:ui")
include(":feature:foryou") include(":feature:foryou")
include(":feature:interests") include(":feature:interests")

Loading…
Cancel
Save