mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-26 15:18:19 +08:00
creating custom tasks to record and verify screenshot
- introduces a 'screenshot' flag to include/exclude the screenshot tests from the default test runs
This commit is contained in:
parent
9ef4975025
commit
0f19726fe2
22
build.gradle
22
build.gradle
@ -296,3 +296,25 @@ dependencyAnalysis {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task recordScreenshots(type: GradleBuild) {
|
||||
startParameter.projectProperties.screenshot = ""
|
||||
tasks = [':vector:recordPaparazziGplayDebug']
|
||||
}
|
||||
|
||||
task verifyScreenshots(type: GradleBuild) {
|
||||
startParameter.projectProperties.screenshot = ""
|
||||
tasks = [':vector:verifyPaparazziGplayDebug']
|
||||
}
|
||||
|
||||
ext.initScreenshotTests = { project ->
|
||||
project.apply plugin: 'app.cash.paparazzi'
|
||||
project.android.testOptions.unitTests.all {
|
||||
def screenshotTestCapture = "**/*ScreenshotTest*"
|
||||
if (project.hasProperty("screenshot")) {
|
||||
include screenshotTestCapture
|
||||
} else {
|
||||
exclude screenshotTestCapture
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'dagger.hilt.android.plugin'
|
||||
apply plugin: 'app.cash.paparazzi'
|
||||
|
||||
if (project.hasProperty("coverage")) {
|
||||
apply plugin: 'jacoco'
|
||||
@ -25,6 +24,8 @@ project.android.buildTypes.all { buildType ->
|
||||
]
|
||||
}
|
||||
|
||||
initScreenshotTests(project)
|
||||
|
||||
android {
|
||||
// Due to a bug introduced in Android gradle plugin 3.6.0, we have to specify the ndk version to use
|
||||
// Ref: https://issuetracker.google.com/issues/144111441
|
||||
|
Loading…
Reference in New Issue
Block a user