Skip to content

Commit

Permalink
Merge pull request #488 from YusukeMoriJapan/feature/update-preview-r…
Browse files Browse the repository at this point in the history
…eadme

update preview screenshot docs
  • Loading branch information
takahirom authored Sep 28, 2024
2 parents 0dbd515 + caf1305 commit f416c41
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -991,10 +991,11 @@ After that, you can run the `recordRoborazziDebug` task to generate screenshots
### Customizing the Preview screenshot test
You can customize the generated test by adding the following configuration to your `build.gradle` file:
You can customize the generated test by adding the following configuration to your `build.gradle.kts` file:
```kotlin
roborazzi {
@OptIn(ExperimentalRoborazziApi::class)
generateComposePreviewRobolectricTests {
enable = true
// The package names to scan for Composable Previews.
Expand All @@ -1013,6 +1014,12 @@ roborazzi {
}
```
> **Note**
> If you are using build.gradle instead of build.gradle.kts, you need to use the set method for each assignment, like
> ```kotlin
> generateComposePreviewRobolectricTests.packages.set(["com.example"])
> ```
## Manually adding Compose Preview screenshot tests
Roborazzi provides a helper function for ComposablePreviewScanner.
Expand Down
9 changes: 8 additions & 1 deletion docs/topics/preview_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ After that, you can run the `recordRoborazziDebug` task to generate screenshots

### Customizing the Preview screenshot test

You can customize the generated test by adding the following configuration to your `build.gradle` file:
You can customize the generated test by adding the following configuration to your `build.gradle.kts` file:

```kotlin
roborazzi {
@OptIn(ExperimentalRoborazziApi::class)
generateComposePreviewRobolectricTests {
enable = true
// The package names to scan for Composable Previews.
Expand All @@ -44,6 +45,12 @@ roborazzi {
}
```

> **Note**
> If you are using build.gradle instead of build.gradle.kts, you need to use the set method for each assignment, like
> ```kotlin
> generateComposePreviewRobolectricTests.packages.set(["com.example"])
> ```
## Manually adding Compose Preview screenshot tests
Roborazzi provides a helper function for ComposablePreviewScanner.
Expand Down

0 comments on commit f416c41

Please sign in to comment.