diff --git a/mir-ci/mir_ci/tests/robot/suites/mir_flutter_app/button_close_focused.png b/mir-ci/mir_ci/tests/robot/suites/mir_flutter_app/button_close_focused.png deleted file mode 100644 index dba4aa57..00000000 --- a/mir-ci/mir_ci/tests/robot/suites/mir_flutter_app/button_close_focused.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9e8a4de128e996fa15f97ca8b9fa3a93fb8a4dd006b0879799b94e9a205f7b23 -size 830 diff --git a/mir-ci/mir_ci/tests/robot/suites/mir_flutter_app/mir_flutter_app.robot b/mir-ci/mir_ci/tests/robot/suites/mir_flutter_app/mir_flutter_app.robot index 5dbe8427..0562515a 100644 --- a/mir-ci/mir_ci/tests/robot/suites/mir_flutter_app/mir_flutter_app.robot +++ b/mir-ci/mir_ci/tests/robot/suites/mir_flutter_app/mir_flutter_app.robot @@ -1,5 +1,7 @@ *** Settings *** -Resource ${KVM_RESOURCE} +Resource ${KVM_RESOURCE} + +Test Teardown VIDEO.Match ${ZERO_WINDOWS} *** Variables *** @@ -8,8 +10,6 @@ ${T} ${CURDIR} ${ANCHOR_OPTION_TOP_LEFT} ${T}/anchor_option_top_left.png ${ANCHOR_OPTION_BOTTOM_RIGHT} ${T}/anchor_option_bottom_right.png -${BUTTON_CLOSE_FOCUSED} ${T}/button_close_focused.png - ${DIALOG_CUSTOM_POSITIONER} ${T}/dialog_custom_positioner.png ${EXPECTED_SATELLITE_PLACEMENT} ${T}/expected_satellite_placement.png @@ -30,6 +30,8 @@ ${WINDOW_SATELLITE_1} ${T}/window_satellite_1.png ${WINDOW_POPUP_1} ${T}/window_popup_1.png ${WINDOW_TIP_1} ${T}/window_tip_1.png +${ZERO_WINDOWS} ${T}/zero_windows.png + *** Test Cases *** Reference App Opens @@ -43,12 +45,12 @@ Regular Window Opens Floating Regular Window Opens Open FLOATING_REGULAR Window VIDEO.Match ${WINDOW_FLOATING_REGULAR_0_FOCUSED} - Close Focused Toplevel Window + Close Floating Toplevel Window Dialog Window Opens Open DIALOG Window VIDEO.Match ${WINDOW_DIALOG_FOCUSED} - Close Focused Toplevel Window + Close Dialog Window Satellite Window Opens Open REGULAR Window @@ -77,7 +79,7 @@ Floating Regular Window Stays On Top Click LEFT Button Walk Pointer To ${WINDOW_FLOATING_REGULAR_0_NON_FOCUSED} Click LEFT Button - Close Focused Toplevel Window + Close Floating Toplevel Window Dialog Is Modal To Parent Open REGULAR Window @@ -97,7 +99,7 @@ Satellite Is Placed According To Custom Positioner Open FLOATING_REGULAR Window Open SATELLITE Window VIDEO.Match ${EXPECTED_SATELLITE_PLACEMENT} - Close Focused Toplevel Window + Close Floating Toplevel Window Child Windows Move With Parent Open FLOATING_REGULAR Window @@ -117,7 +119,7 @@ Child Windows Move With Parent Release LEFT Button VIDEO.Match ${EXPECTED_WINDOW_AFTER_MOVE} Close Dialog Window - Close Focused Toplevel Window + Close Floating Toplevel Window Slide Constraint Is Applied Set Top Left Custom Positioner @@ -129,7 +131,7 @@ Slide Constraint Is Applied Release LEFT Button Open POPUP Window VIDEO.Match ${EXPECTED_POPUP_PLACEMENT_SLIDE} - Close Focused Toplevel Window + Close Floating Toplevel Window Flip Constraint Is Applied Set Top Left Custom Positioner @@ -165,7 +167,7 @@ Flip Constraint Is Applied Release LEFT Button Open POPUP Window VIDEO.Match ${EXPECTED_POPUP_PLACEMENT_FLIP} - Close Focused Toplevel Window + Close Floating Toplevel Window Resize Constraint Is Applied Set Top Left Custom Positioner @@ -201,7 +203,7 @@ Resize Constraint Is Applied Release LEFT Button Open POPUP Window VIDEO.Match ${EXPECTED_POPUP_PLACEMENT_RESIZE} - Close Focused Toplevel Window + Close Floating Toplevel Window Flip Constraint Precedes Slide Set Top Left Custom Positioner @@ -227,7 +229,7 @@ Flip Constraint Precedes Slide Release LEFT Button Open POPUP Window VIDEO.Match ${EXPECTED_POPUP_PLACEMENT_FLIP} - Close Focused Toplevel Window + Close Floating Toplevel Window Slide Constraint Precedes Resize Set Top Left Custom Positioner @@ -253,19 +255,40 @@ Slide Constraint Precedes Resize Release LEFT Button Open POPUP Window VIDEO.Match ${EXPECTED_POPUP_PLACEMENT_SLIDE} - Close Focused Toplevel Window + Close Floating Toplevel Window *** Keywords *** Close Focused Toplevel Window - Walk Pointer To ${BUTTON_CLOSE_FOCUSED} + Move Pointer To (0, 0) + ${pos}= Move Pointer To ${WINDOW_REGULAR_0_FOCUSED} + ${pos}= Displace ${pos} By (130, 0) + Move Pointer To ${pos} + Click LEFT Button Click LEFT Button + Wait Until Keyword Succeeds 5 1 + ... Run Keyword And Expect Error ImageNotFoundError + ... VIDEO.Match ${WINDOW_REGULAR_0_FOCUSED} 0 + +Close Floating Toplevel Window + Move Pointer To (0, 0) + ${pos}= Move Pointer To ${WINDOW_FLOATING_REGULAR_0_FOCUSED} + ${pos}= Displace ${pos} By (138, 0) + Move Pointer To ${pos} + Click LEFT Button + Wait Until Keyword Succeeds 5 1 + ... Run Keyword And Expect Error ImageNotFoundError + ... VIDEO.Match ${WINDOW_FLOATING_REGULAR_0_FOCUSED} 0 Close Dialog Window - ${pos}= Walk Pointer To ${WINDOW_DIALOG_FOCUSED} + Move Pointer To (0, 0) + ${pos}= Move Pointer To ${WINDOW_DIALOG_FOCUSED} ${pos}= Displace ${pos} By (112, 0) - Walk Pointer To ${pos} + Move Pointer To ${pos} Click LEFT Button + Wait Until Keyword Succeeds 5 1 + ... Run Keyword And Expect Error ImageNotFoundError + ... VIDEO.Match ${WINDOW_DIALOG_FOCUSED} 0 Select ${preset} Positioner Preset ${vertical_distance_between_options}= Set Variable 48 diff --git a/mir-ci/mir_ci/tests/robot/suites/mir_flutter_app/zero_windows.png b/mir-ci/mir_ci/tests/robot/suites/mir_flutter_app/zero_windows.png new file mode 100644 index 00000000..e981ffdc --- /dev/null +++ b/mir-ci/mir_ci/tests/robot/suites/mir_flutter_app/zero_windows.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8334dd490247ee9463d13c4572ee064bbe34b65cef0591212025c5da9a2bd411 +size 1697 diff --git a/mir-ci/mir_ci/tests/test_mir_flutter_app.py b/mir-ci/mir_ci/tests/test_mir_flutter_app.py index cc56cd02..3f11916b 100644 --- a/mir-ci/mir_ci/tests/test_mir_flutter_app.py +++ b/mir-ci/mir_ci/tests/test_mir_flutter_app.py @@ -50,6 +50,8 @@ async def test_mir_flutter_app(self, robot_log, server, app, tmp_path) -> None: async with server_instance, server_instance.program(App(app.command[0], app.app_type)) as app: tuple((tmp_path / k).symlink_to(v) for k, v in assets.items()) - robot = server_instance.program(App(("robot", "-d", tmp_path, "--log", robot_log, tmp_path))) + robot = server_instance.program( + App(("robot", "--exitonfailure", "-d", tmp_path, "--log", robot_log, tmp_path)) + ) async with robot: await robot.wait(120)