Setup basic compose screenshot testing infra for regV5.
This commit is contained in:
parent
b724f2b01a
commit
9430c27e64
22 changed files with 189 additions and 0 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
|
@ -1 +1,2 @@
|
|||
*.ai binary
|
||||
**/src/screenshotTest*/reference/**/*.png filter=lfs diff=lfs merge=lfs -text
|
||||
|
|
|
|||
1
.github/workflows/android.yml
vendored
1
.github/workflows/android.yml
vendored
|
|
@ -20,6 +20,7 @@ jobs:
|
|||
# gh api repos/actions/checkout/commits/v6 --jq '.sha'
|
||||
with:
|
||||
submodules: true
|
||||
lfs: true
|
||||
|
||||
- name: set up JDK 17
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ gradle.projectsEvaluated {
|
|||
testTask?.let { dependsOn(it) }
|
||||
|
||||
subproject.tasks.findByName("lintDebug")?.let { dependsOn(it) }
|
||||
subproject.tasks.findByName("validateDebugScreenshotTest")?.let { dependsOn(it) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -126,5 +126,8 @@ annotation class AllNightPreviews
|
|||
@TabletPreviews
|
||||
annotation class AllDevicePreviews
|
||||
|
||||
@Preview(name = "rtl", locale = "ar")
|
||||
annotation class RtlPreview
|
||||
|
||||
@Preview(name = "large font", fontScale = 2f)
|
||||
annotation class LargeFontPreviews
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ plugins {
|
|||
id("com.squareup.wire")
|
||||
alias(libs.plugins.compose.compiler)
|
||||
alias(libs.plugins.kotlinx.serialization)
|
||||
alias(testLibs.plugins.compose.screenshot)
|
||||
}
|
||||
|
||||
android {
|
||||
|
|
@ -23,6 +24,8 @@ android {
|
|||
isIncludeAndroidResources = true
|
||||
}
|
||||
}
|
||||
|
||||
experimentalProperties["android.experimental.enableScreenshotTest"] = true
|
||||
}
|
||||
|
||||
wire {
|
||||
|
|
@ -87,4 +90,9 @@ dependencies {
|
|||
androidTestImplementation(testLibs.androidx.test.ext.junit)
|
||||
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
|
||||
debugImplementation(libs.androidx.compose.ui.test.manifest)
|
||||
|
||||
// Compose screenshot testing
|
||||
screenshotTestImplementation(testLibs.compose.screenshot.validation.api)
|
||||
screenshotTestImplementation(libs.androidx.compose.ui.tooling.core)
|
||||
screenshotTestImplementation(libs.androidx.compose.ui.tooling.preview)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright 2026 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.signal.registration.screens.welcome
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import com.android.tools.screenshot.PreviewTest
|
||||
import org.signal.core.ui.compose.AllDevicePreviews
|
||||
import org.signal.core.ui.compose.Previews
|
||||
import org.signal.core.ui.compose.RtlPreview
|
||||
|
||||
class WelcomeScreenScreenshotTests {
|
||||
@PreviewTest
|
||||
@AllDevicePreviews
|
||||
@RtlPreview
|
||||
@Composable
|
||||
fun WelcomeScreenPhonePreview() {
|
||||
Previews.Preview {
|
||||
WelcomeScreen(onEvent = {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ca027a262cd5878c40e4abd08f966c0ee6bf8f02eeef787f9832e6b9235a5d37
|
||||
size 279488
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6df52102839dd5fff99d087b01b3f59e4bb7ecf4b7cfc97f28e33075b667ab26
|
||||
size 253635
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3af78bd0c9865d3788e824d9075b9d285dc5b721375688a06a5927d1561eff5e
|
||||
size 265333
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:df11120f19a776083bf04a1e2c554d15bea2c063442b8f36b54418e4d45c3792
|
||||
size 52776
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:69b8cc1d72e240f18432b18801eaf7a095c4ace4465884b343ce2aa7332984ac
|
||||
size 53085
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f28158d9ed0aca0f8d2a8279afd4add681d531d2541f4b013e32f5572c1f88e4
|
||||
size 101519
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b42cffa7e3e731e2496d9504154c479d70d524d3240efcdb62b1f166eb9b0f49
|
||||
size 241995
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7d6ef9c041521feeb0cda423cbb612f2ecdffe29a4eb97a9310e5c76192f27e6
|
||||
size 192932
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a6ba17b3a59fc897a23e55f3a76c4ae9613a6f547919f60c077ee8ea59f8d231
|
||||
size 182338
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c27372e794bcb63f49bf0e89cb495cf29c12d7024db7aeffde0db301f0951432
|
||||
size 165171
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9b333000ff39c5d726307d9be2691de4657032cbf4a9a5d946afa94ce3001c73
|
||||
size 435557
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:58ab68ce8d815d9f7aa094e0261075759083f67fcd4d40d8a38b519c9ac3ee78
|
||||
size 395238
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:34263308f2b19c65983e82c7d775478612529b9174a98c11a23ec3b3e3dbebb6
|
||||
size 297926
|
||||
|
|
@ -15,6 +15,7 @@ org.gradle.caching=true
|
|||
org.gradle.configuration-cache=true
|
||||
org.gradle.configuration-cache.problems=fail
|
||||
android.generateSyncIssueWhenLibraryConstraintsAreEnabled=false
|
||||
android.experimental.enableScreenshotTest=true
|
||||
|
||||
# We never want to use auto-provisioning, as it breaks reproducible builds.
|
||||
# This should not be a problem, because we never configure a "javaRepositories"
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue