Skip to content

Commit

Permalink
Merge pull request #17 from shamalip/main
Browse files Browse the repository at this point in the history
Add a note indicating that corner radius will not show up in screensh…
  • Loading branch information
secondsun authored Jan 4, 2024
2 parents 051a8b4 + 945aa96 commit e8d41e7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions appwidget-testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ Then, using screenshot testing tool of your choice capture and compare the scree
activity. For example, following sample uses [Roborazzi](https://github.com/takahirom/roborazzi)
capture and verify the screenshot.

NOTE: The device and screenshot framework you use should support hardware acceleration and
`clipToOutline` to see rounded corners. For robolectric, see this
[issue](https://github.com/robolectric/robolectric/issues/8081#issuecomment-1478137890). When using
an emulator, you may use Espresso's `captureToBitmap` to ensure that the corner radius is captured.

```kotlin
Espresso.onView(ViewMatchers.isRoot())
.captureRoboImage(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ import kotlinx.coroutines.runBlocking
* screenshot tests.
*
* See README.md for usage.
*
* NOTE: The device and screenshot framework you use should support hardware acceleration and
* `clipToOutline` to see rounded corners. For robolectric, see
* https://github.com/robolectric/robolectric/issues/8081#issuecomment-1478137890.
* When using an emulator, you may use Espresso's `captureToBitmap` to ensure that the corner radius
* is captured.
*/
@RequiresApi(Build.VERSION_CODES.O)
public class GlanceScreenshotTestActivity : Activity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ class SampleGlanceScreenshotTest {
fun sampleGlanceContent() {
renderComposable()

// NOTE: The rendering and screenshot framework you use should support hardware acceleration
// and `clipToOutline` to see rounded corners. For robolectric, see this
// [issue](https://github.com/robolectric/robolectric/issues/8081#issuecomment-1478137890).
// When using an emulator, you may use Espresso's `captureToBitmap` to ensure that the
// corner radius is captured.
captureAndVerifyScreenshot("sample_content")
}

Expand Down

0 comments on commit e8d41e7

Please sign in to comment.