Skip to content

Commit 59ee970

Browse files
committed
fix: tests
1 parent 9e7d236 commit 59ee970

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

maestro-orchestra-models/src/main/java/maestro/orchestra/Commands.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ data class EraseTextCommand(
573573

574574
data class TakeScreenshotCommand(
575575
val path: String,
576-
val cropOn: ElementSelector?,
576+
val cropOn: ElementSelector? = null,
577577
override val label: String? = null,
578578
override val optional: Boolean = false,
579579
) : Command {

maestro-orchestra/src/test/java/maestro/orchestra/MaestroCommandSerializationTest.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ internal class MaestroCommandSerializationTest {
428428
fun `serialize TakeScreenshotCommand`() {
429429
// given
430430
val command = MaestroCommand(
431-
TakeScreenshotCommand("screenshot.png")
431+
TakeScreenshotCommand("screenshot.png", cropOn = ElementSelector(textRegex = "[A-f0-9]"))
432432
)
433433

434434
// when
@@ -441,6 +441,10 @@ internal class MaestroCommandSerializationTest {
441441
{
442442
"takeScreenshotCommand" : {
443443
"path" : "screenshot.png",
444+
"cropOn" : {
445+
"textRegex" : "[A-f0-9]",
446+
"optional" : false
447+
},
444448
"optional" : false
445449
}
446450
}

maestro-test/src/test/kotlin/maestro/test/IntegrationTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3174,7 +3174,7 @@ class IntegrationTest {
31743174
@Test
31753175
fun `Case 119 - Take cropped screenshot`() {
31763176
// Given
3177-
val commands = readCommands("118_take_cropped_screenshot")
3177+
val commands = readCommands("119_take_cropped_screenshot")
31783178
val boundHeight = 100
31793179
val boundWidth = 100
31803180

@@ -3200,7 +3200,7 @@ class IntegrationTest {
32003200
Event.TakeScreenshot,
32013201
)
32023202
)
3203-
val file = File("118_take_cropped_screenshot_with_filename.png")
3203+
val file = File("119_take_cropped_screenshot_with_filename.png")
32043204
val image = ImageIO.read(file)
32053205

32063206
assert(file.exists())

0 commit comments

Comments
 (0)