Public bug reported:

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'",)" - full 
traceback [3]

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/

** Affects: autopilot (Ubuntu)
     Importance: Undecided
         Status: Confirmed

** Affects: unity8 (Ubuntu)
     Importance: Undecided
         Status: Confirmed

** Also affects: unity8 (Ubuntu)
   Importance: Undecided
       Status: New

** Description changed:

  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'",)"
+ 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'",)" - 
full traceback [3]
  
  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/

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1632354

Title:
  Using ProcessManager causes 'BAMF: ImportError("No module named
  'Xlib'",)' when trying to write tests which switch between windows

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/autopilot/+bug/1632354/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to