Need a way to ensure the toolbar is visible when clicking a button using the emulator
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu UI Toolkit |
Fix Released
|
Critical
|
Tim Peeters | ||
ubuntu-ui-toolkit (Ubuntu) |
Fix Released
|
Undecided
|
Tim Peeters |
Bug Description
Since revision 805 in lp:ubuntu-ui-toolkit, the default behaviour of the toolbar changed: it is initially shown, and automatically hides after a timeout of 5 seconds if not interacted with.
This broke a number of existing autopilot tests in apps. The most affected app seems to be gallery-app. This is particularly visible on desktop and/or slow configurations: autopilot sees the toolbar up, starts moving the cursor towards one of its buttons, but before it reaches it the toolbar has started automatically hiding and when the cursor reaches the position where the button was it’s no longer there.
A possible workaround is to first ensure that the toolbar is hidden, then reveal it, and then click the button (when manually revealed, the toolbar won’t autohide). This is not really clean though, doesn’t really simulate what a real user would do, and it’s error prone (those failures are race conditions, so they may surface at any time, making the tests flaky).
The proper way to fix the problem without requiring updates to the existing autopilot tests is to ensure that when open_toolbar() is called, even if it’s already open some interaction with it happens, to ensure it won’t autohide.
Related branches
- PS Jenkins bot: Approve (continuous-integration)
- Leo Arias (community): Approve (code review, test analysis, ran tests)
- Ubuntu SDK team: Pending requested
-
Diff: 195 lines (+80/-37)2 files modifiedtests/autopilot/ubuntuuitoolkit/emulators.py (+53/-30)
tests/autopilot/ubuntuuitoolkit/tests/test_emulators.py (+27/-7)
Changed in ubuntu-ui-toolkit: | |
assignee: | nobody → Tim Peeters (tpeeters) |
importance: | Undecided → Critical |
status: | New → In Progress |
Changed in ubuntu-ui-toolkit (Ubuntu): | |
assignee: | nobody → Tim Peeters (tpeeters) |
Changed in ubuntu-ui-toolkit: | |
status: | Fix Committed → Fix Released |
I’m not sure the approach in the linked branch (revision 826) is correct. I wouldn’t expect Toolbar. click_button( ) to reveal the toolbar on my behalf if it isn’t up yet (the goal of the emulators is to provide primitives to ease the interaction with the widgets like a normal user would). And it would make all the existing code like this redundant:
self. main_view. open_toolbar( ).click_ button( "…")
because open_toolbar() could then be removed.
I think what we really need is open_toolbar() to do some sort of dummy interaction with the toolbar itself even if it’s already up, to prevent it from later auto-hiding.
A first step would be to have open_toolbar() move the cursor to the toolbar’s position even if it’s already open, thus reducing the mouse move needed to access a button. This wouldn’t be enough, but I’m willing to bet it would already fix a number of issues we’re seeing on otto.