virt-manager/041-uitests-More-attempts-at-making-manager-reposition-test-reliable.patch

39 lines
1.4 KiB
Diff

Subject: uitests: More attempts at making manager reposition test reliable
From: Cole Robinson crobinso@redhat.com Sat May 6 13:34:13 2023 -0400
Date: Sat May 6 19:43:24 2023 -0400:
Git: 509c95ddb9b3f30ea88a61b065cd920055faa5f4
Signed-off-by: Cole Robinson <crobinso@redhat.com>
diff --git a/tests/uitests/test_manager.py b/tests/uitests/test_manager.py
index b01c3691..10709f09 100644
--- a/tests/uitests/test_manager.py
+++ b/tests/uitests/test_manager.py
@@ -228,17 +228,21 @@ def testManagerWindowReposition(app):
fmenu.find("View Manager", "menu item").click()
lib.utils.check(lambda: manager.active)
+ # Use alt+f7 combo to move window
curxy = manager.title_coordinates()
- newxy = curxy[0] + 200, curxy[1] + 200
- import dogtail.rawinput
- dogtail.rawinput.dragWithTrajectory(curxy, newxy)
- checkxy = manager.position
+ newxy = (curxy[0] + 400, curxy[1] + 400)
+ manager.keyCombo("<alt>F7")
+ app.rawinput.click(*newxy)
+ checkxy = manager.position[0], manager.position[1]
manager.window_close()
host.click_title()
host.find("File", "menu").click()
host.find("View Manager", "menu item").click()
lib.utils.check(lambda: manager.showing)
- assert manager.position == checkxy
+
+ # Results can be off by one or two, but it's not a virt-manager bug
+ assert abs(manager.position[0] - checkxy[0]) in range(3)
+ assert abs(manager.position[1] - checkxy[1]) in range(3)