Merge lp:~dpniel/ubiquity/fix-1480430 into lp:ubiquity

Proposed by Dan Chapman 
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: 6314
Merged at revision: 6325
Proposed branch: lp:~dpniel/ubiquity/fix-1480430
Merge into: lp:ubiquity
Diff against target: 29 lines (+19/-0)
1 file modified
autopilot/ubiquity_autopilot_tests/tests/__init__.py (+19/-0)
To merge this branch: bzr merge lp:~dpniel/ubiquity/fix-1480430
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
Nicholas Skaggs (community) Approve
Review via email: mp+270243@code.launchpad.net

Description of the change

[Autopilot tests] Add workaround for write changes to disk dialog

Unfortunately the dialog buttons have not identifiable properties to be
able to select and click the continue button. So this patch resorts to
a lengthy sleep and keyboard navigation to continue the install.

I will file a separate bug about improving autopilot accessibility of
this dialog as it would mean a change happening in ubiquity itself which
I don't want to include in this commit

To post a comment you must log in.
lp:~dpniel/ubiquity/fix-1480430 updated
6314. By Dan Chapman 

Fix pep8 warnings

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Dan, can you comment on the bug you filed for this issue? It would be nice to include it in the comments.

review: Approve
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Could we not instead provide you a name for that button? Seems like it would be a more solid fix than pressing keys, even if this would work.

I'm happy to take changes to the UI, you don't need to limit yourself to autopilot integration :)

review: Needs Information
Revision history for this message
Dan Chapman  (dpniel) wrote :

After our IRC discussion i've dug into this a little more to refresh my memory. So when the buttons are added to the dialog[1] it's done using gtk.Dialog.add_button() [2].

With this approach I can't see any way that set_name() can be called on each button as the add_button takes care of creation for you with no option to add a name.

I'm happy to try and make changes to the UI with a bit of guidance on what would be the best approach to get name properties on the buttons

[1] http://bazaar.launchpad.net/~ubuntu-installer/ubiquity/trunk/view/head:/ubiquity/frontend/gtk_ui.py#L1789
[2] https://lazka.github.io/pgi-docs/#Gtk-3.0/classes/Dialog.html#Gtk.Dialog.add_button

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

I'm fine with dealing with it as-is for now. Now wouldn't be the time to rewrite parts of the installer.

I filed https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1495581 so as not to forget to fix this better.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'autopilot/ubiquity_autopilot_tests/tests/__init__.py'
2--- autopilot/ubiquity_autopilot_tests/tests/__init__.py 2014-06-30 13:09:16 +0000
3+++ autopilot/ubiquity_autopilot_tests/tests/__init__.py 2015-09-05 12:56:13 +0000
4@@ -113,6 +113,25 @@
5 nxt_button.click()
6
7 if wait:
8+ # When the test clicks "Install now" a confirm overwrite disk
9+ # dialog appears. This is an "ubi_question_dialog" and although
10+ # we can grab it with autopilot we cannot easily select the
11+ # continue button as it has no name or BuilderName properties
12+ # There are two buttons that basically have identical xpaths
13+ # so even identifying the correct button is not really possible.
14+ # We experience the same during the manual partition step when
15+ # creating a new table. The dialog seems to be a generic msg dialog
16+ # that's created on the fly so we can't even add those properties.
17+ # The best we can do here is a bit of damage limitation and use a
18+ # lengthy sleep and keyboard right to the continue button.
19+ print("go_to_next_page() Entering workaround "
20+ "for ubi_question_dialog")
21+ print("If the test failed here it is most likely a timing issue")
22+ # This maybe overkill but better to be safe
23+ time.sleep(20)
24+ self.kbd.press_and_release('Right')
25+ self.kbd.press_and_release('Enter')
26+ print("Workaround ended continuing with wait for next step")
27 # This sleep just bridges a weird error when the next button,
28 # sometimes flickers its sensitive property back to 1 once clicked
29 # and then goes back to 0

Subscribers

People subscribed via source and target branches

to status/vote changes: