Skip to content

Commit 34dd728

Browse files
authored
add null default value in compareScreenshot (#6)
1 parent 95f78b0 commit 34dd728

File tree

1 file changed

+3
-3
lines changed
  • android-snaptesting/src/main/java/com/telefonica/androidsnaptesting/screenshots

1 file changed

+3
-3
lines changed

android-snaptesting/src/main/java/com/telefonica/androidsnaptesting/screenshots/ScreenshotsRule.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class ScreenshotsRule(
5151
@RequiresApi(Build.VERSION_CODES.O)
5252
public fun compareScreenshot(
5353
rule: ComposeTestRule,
54-
name: String?,
54+
name: String? = null,
5555
) {
5656
rule.waitForIdle()
5757
val bitmap = rule.onRoot().captureToImage().asAndroidBitmap()
@@ -60,7 +60,7 @@ public class ScreenshotsRule(
6060

6161
public fun compareScreenshot(
6262
activity: Activity,
63-
name: String?,
63+
name: String? = null,
6464
) {
6565
val bitmap = Screenshot.capture(activity).bitmap
6666
compareScreenshot(bitmap, name)
@@ -69,7 +69,7 @@ public class ScreenshotsRule(
6969
@Suppress("MemberVisibilityCanBePrivate")
7070
public fun compareScreenshot(
7171
bitmap: Bitmap,
72-
name: String?
72+
name: String? = null,
7373
) {
7474
val resourceName = "${className}_${name ?: testName}.png"
7575
val fileName = "$resourceName.${System.nanoTime()}"

0 commit comments

Comments
 (0)