Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKohan committed Oct 16, 2024
1 parent 9e7d236 commit 59ee970
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ data class EraseTextCommand(

data class TakeScreenshotCommand(
val path: String,
val cropOn: ElementSelector?,
val cropOn: ElementSelector? = null,
override val label: String? = null,
override val optional: Boolean = false,
) : Command {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ internal class MaestroCommandSerializationTest {
fun `serialize TakeScreenshotCommand`() {
// given
val command = MaestroCommand(
TakeScreenshotCommand("screenshot.png")
TakeScreenshotCommand("screenshot.png", cropOn = ElementSelector(textRegex = "[A-f0-9]"))
)

// when
Expand All @@ -441,6 +441,10 @@ internal class MaestroCommandSerializationTest {
{
"takeScreenshotCommand" : {
"path" : "screenshot.png",
"cropOn" : {
"textRegex" : "[A-f0-9]",
"optional" : false
},
"optional" : false
}
}
Expand Down
4 changes: 2 additions & 2 deletions maestro-test/src/test/kotlin/maestro/test/IntegrationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3174,7 +3174,7 @@ class IntegrationTest {
@Test
fun `Case 119 - Take cropped screenshot`() {
// Given
val commands = readCommands("118_take_cropped_screenshot")
val commands = readCommands("119_take_cropped_screenshot")
val boundHeight = 100
val boundWidth = 100

Expand All @@ -3200,7 +3200,7 @@ class IntegrationTest {
Event.TakeScreenshot,
)
)
val file = File("118_take_cropped_screenshot_with_filename.png")
val file = File("119_take_cropped_screenshot_with_filename.png")
val image = ImageIO.read(file)

assert(file.exists())
Expand Down

0 comments on commit 59ee970

Please # to comment.