Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Run Paparazzi Verification
run: ./gradlew verifyPaparazziDebug

- name: Upload Failure Diffs
if: failure()
uses: actions/upload-artifact@v4
with:
name: paparazzi-failures
path: "**/build/paparazzi/failures/"

- name: Build debug APK
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,18 @@
+ Please, **do not modify readme and other information files** (except for typos)(and if you are better at explaining it then thats also accepted)
+ **Avoid adding new dependencies** unless required. APK size is important.
+ **please explain your changes** atleast try to cause it just helps us work a lot faster than spending time figuring out what you did🥲.

### Snapshot Tests

* Baseline: `app/src/test/snapshots/images`
* Reports: `app/build/reports/paparazzi/debug/index.html`

To verify:
```shell
gradlew verifyPaparazziDebug
```

To update:
```shell
gradlew recordPaparazziDebug
```
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ plugins {
// id 'dev.reformator.stacktracedecoroutinator'
id 'io.sentry.android.gradle' version '6.1.0'
alias(libs.plugins.compose.compiler)
alias(libs.plugins.paparazzi)
}

android {
Expand Down Expand Up @@ -241,6 +242,7 @@ dependencies {
debugImplementation libs.workinspector
debugImplementation libs.compose.ui.tooling
debugImplementation libs.compose.ui.test.manifest
testImplementation libs.compose.ui.tooling

testImplementation libs.junit
testImplementation libs.json
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.github.landwarderer.futon.ui

import app.cash.paparazzi.DeviceConfig
import app.cash.paparazzi.Paparazzi
import org.junit.Rule

abstract class PaparazziRules {
@get:Rule
val paparazzi = Paparazzi(
deviceConfig = DeviceConfig.PIXEL_5,
theme = "Theme.Futon",
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.github.landwarderer.futon.ui.view

import android.widget.LinearLayout
import io.github.landwarderer.futon.R
import io.github.landwarderer.futon.ui.PaparazziRules
import org.junit.Test

class SourcesSnapshotTest: PaparazziRules() {
@Test
fun dialogDownload() {
val view = paparazzi.inflate<LinearLayout>(R.layout.dialog_download)
paparazzi.snapshot(view)
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ webkit = "1.14.0"
workRuntime = "2.10.5"
workinspector = "1.2"
window = "1.3.0"
paparazzi = "2.0.0-alpha05"
composeBom = "2026.03.00"
activityCompose = "1.13.0"
lifecycleViewmodelCompose = "2.10.0"
Expand Down Expand Up @@ -146,6 +147,7 @@ compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }

[plugins]
paparazzi = { id = "app.cash.paparazzi", version.ref = "paparazzi" }
android-application = { id = "com.android.application", version.ref = "gradle" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger" }
kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
Expand Down
Loading