Merge lp:~canonical-platform-qa/autopilot-gtk/fix-failing-mouse-test_1483815 into lp:autopilot-gtk

Proposed by Christopher Lee on 2015-08-24
Status: Needs review
Proposed branch: lp:~canonical-platform-qa/autopilot-gtk/fix-failing-mouse-test_1483815
Merge into: lp:autopilot-gtk
Diff against target: 21 lines (+4/-0)
1 file modified
tests/autopilot/tests/test_actions.py (+4/-0)
To merge this branch: bzr merge lp:~canonical-platform-qa/autopilot-gtk/fix-failing-mouse-test_1483815
Reviewer Review Type Date Requested Status
Iain Lane (community) Disapprove on 2015-08-24
PS Jenkins bot continuous-integration Needs Fixing on 2015-08-24
Autopilot Hackers 2015-08-24 Pending
Review via email: mp+268869@code.launchpad.net

Commit Message

Fix test; Add wait so dialog button is clickable

Description of the Change

Update sporadically failing test.

Reason for the failure was that the attempt to click the dismiss button was happening before the dialog was fully displayed (and thus able to be clicked).

Using a sleep as I couldn't find any other property status that would indicate that the dialog is fully shown and thus the button could be pressed.

To post a comment you must log in.
Iain Lane (laney) wrote :

I was just looking at the same test failure. For me this didn't fix it. It seem{s,ed} that the problem is that we need to wait a bit after clicking the button for the dialog to be destroyed, in the mouse case. If we had Eventually(raises(... support then this would work, but we don't so need to test the same thing in a roundabout way. Filed

  https://code.launchpad.net/~laney/autopilot-gtk/tests-wait-not-visible/+merge/268928

to hopefully fix this.

review: Disapprove

Unmerged revisions

77. By Christopher Lee on 2015-08-24

Fix test; Add wait so dialog button is clickable

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/tests/test_actions.py'
2--- tests/autopilot/tests/test_actions.py 2013-12-18 10:48:35 +0000
3+++ tests/autopilot/tests/test_actions.py 2015-08-24 04:02:53 +0000
4@@ -16,6 +16,7 @@
5
6 import os.path
7 import os
8+import time
9
10 from autopilot.testcase import AutopilotTestCase
11 from autopilot.introspection.dbus import StateNotFoundError
12@@ -122,6 +123,9 @@
13
14 # close the dialog
15 btn = md.select_single('GtkButton')
16+ # Give the dialog time to show so the button is clickable, unable to
17+ # find a property the query for this.
18+ time.sleep(0.5)
19 self.mouse.click_object(btn)
20 self.assertThat(
21 lambda: self.app.select_single('GtkMessageDialog', visible=True),

Subscribers

People subscribed via source and target branches