Comment 0 for bug 1632354

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

What happened:
1) Writing autopilot tests which are dealing with a multi-window application
2) Within a test I need to switch to the second window which is unfocused
3) Using ProcessManager.get_open_windows() [0] I am able to get a list of the windows, filter by desktop_file and is_focused to then get a Window object which I can use set_focus() [1]
4) With this code snippet [2], it works fine on unity7/X11 but when testing on Unity8/Mir it fails with "BAMF: ImportError("No module named 'Xlib'",)"

What I expected to happen:
I expected at step 4 when running the test on a non-X11 environment (eg Mir) for autopilot to use the relevant backend to allow for switching between windows.

Not sure if this needs to be fixed in autopilot itself, or whether there needs to be a helper written in unity8/mir so I've added autopilot and unity8 to this bug.

0 - https://developer.ubuntu.com/api/autopilot/python/1.5.0/autopilot.process.ProcessManager/#autopilot.process.ProcessManager.get_open_windows
1 - https://developer.ubuntu.com/api/autopilot/python/1.5.0/autopilot.process.Window/#autopilot.process.Window.set_focus
2 - http://pastebin.ubuntu.com/23308384/
3 - http://pastebin.ubuntu.com/23307946/