Commit fd9d091e authored by Iain Lane's avatar Iain Lane Committed by Debarshi Ray

tests: Wait for the UI to be drawn completely

The tests sometimes fail with:
  ValueError: Attempting to generate a mouse event at negative
    coordinates: (-2147483647.5,-2147483647.5)

This is because the UI isn't drawn when we try to interact with it.
This is a race condition. We should wait until the x or y coordinate
is valid before going on with the test.

https://bugzilla.gnome.org/show_bug.cgi?id=777053
parent ae0ef111
......@@ -4,7 +4,7 @@ from testutil import *
from gi.repository import Gio, GLib
import os, sys
import os, time, sys
import pyatspi
from dogtail import tree
from dogtail import utils
......@@ -15,6 +15,10 @@ try:
app = start()
albums_button = app.child('Albums')
x = y = -1
while x < 0 and y < 0:
(x, y) = albums_button.position
time.sleep(0.1)
albums_button.click()
photos_button = app.child('Photos')
photos_button.click()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment