File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
maestro-orchestra-models/src/main/java/maestro/orchestra
maestro-orchestra/src/test/java/maestro/orchestra
maestro-test/src/test/kotlin/maestro/test Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -573,7 +573,7 @@ data class EraseTextCommand(
573
573
574
574
data class TakeScreenshotCommand (
575
575
val path : String ,
576
- val cropOn : ElementSelector ? ,
576
+ val cropOn : ElementSelector ? = null ,
577
577
override val label : String? = null ,
578
578
override val optional : Boolean = false ,
579
579
) : Command {
Original file line number Diff line number Diff line change @@ -428,7 +428,7 @@ internal class MaestroCommandSerializationTest {
428
428
fun `serialize TakeScreenshotCommand` () {
429
429
// given
430
430
val command = MaestroCommand (
431
- TakeScreenshotCommand (" screenshot.png" )
431
+ TakeScreenshotCommand (" screenshot.png" , cropOn = ElementSelector (textRegex = " [A-f0-9] " ) )
432
432
)
433
433
434
434
// when
@@ -441,6 +441,10 @@ internal class MaestroCommandSerializationTest {
441
441
{
442
442
"takeScreenshotCommand" : {
443
443
"path" : "screenshot.png",
444
+ "cropOn" : {
445
+ "textRegex" : "[A-f0-9]",
446
+ "optional" : false
447
+ },
444
448
"optional" : false
445
449
}
446
450
}
Original file line number Diff line number Diff line change @@ -3174,7 +3174,7 @@ class IntegrationTest {
3174
3174
@Test
3175
3175
fun `Case 119 - Take cropped screenshot` () {
3176
3176
// Given
3177
- val commands = readCommands(" 118_take_cropped_screenshot " )
3177
+ val commands = readCommands(" 119_take_cropped_screenshot " )
3178
3178
val boundHeight = 100
3179
3179
val boundWidth = 100
3180
3180
@@ -3200,7 +3200,7 @@ class IntegrationTest {
3200
3200
Event .TakeScreenshot ,
3201
3201
)
3202
3202
)
3203
- val file = File (" 118_take_cropped_screenshot_with_filename .png" )
3203
+ val file = File (" 119_take_cropped_screenshot_with_filename .png" )
3204
3204
val image = ImageIO .read(file)
3205
3205
3206
3206
assert (file.exists())
You can’t perform that action at this time.
0 commit comments