Merge lp:~pitti/autopilot-gtk/update-tests into lp:autopilot-gtk

Proposed by Martin Pitt on 2014-05-19
Status: Merged
Approved by: Christopher Lee on 2014-05-20
Approved revision: 74
Merged at revision: 73
Proposed branch: lp:~pitti/autopilot-gtk/update-tests
Merge into: lp:autopilot-gtk
Diff against target: 117 lines (+26/-40)
3 files modified
debian/control (+3/-2)
debian/tests/control (+3/-2)
tests/autopilot/tests/test_gnome_app.py (+20/-36)
To merge this branch: bzr merge lp:~pitti/autopilot-gtk/update-tests
Reviewer Review Type Date Requested Status
Christopher Lee (community) 2014-05-19 Approve on 2014-05-20
PS Jenkins bot continuous-integration Approve on 2014-05-19
Review via email: mp+220075@code.launchpad.net

Commit message

* Update build and test deps for autopilot-legacy
* Replace gnome-system-log test with gnome-calculator test

Description of the change

This adjusts dependencies for the autopilot-legacy rename, and fixes the test
failures due to gnome-system-log changing in between.

To post a comment you must log in.
Christopher Lee (veebers) wrote :

LGTM, will be good to be able to run this with py3 soon:-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-12-18 17:47:19 +0000
3+++ debian/control 2014-05-19 14:56:52 +0000
4@@ -2,14 +2,15 @@
5 Priority: extra
6 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
7 XSBC-Original-Maintainer: Allan LeSage <allan.lesage@canonical.com>
8-Build-Depends: autopilot-desktop (>= 1.4),
9+Build-Depends: autopilot-desktop-legacy (>= 1.4),
10 bamfdaemon,
11 at-spi2-core,
12 cmake,
13 dbus-x11,
14 debhelper (>= 9),
15- gnome-system-log,
16+ gnome-calculator,
17 gsettings-desktop-schemas,
18+ gnome-icon-theme-symbolic,
19 libglib2.0-dev,
20 libgtk-3-dev,
21 libxpathselect-dev (>= 1.4),
22
23=== modified file 'debian/tests/control'
24--- debian/tests/control 2013-12-18 17:47:19 +0000
25+++ debian/tests/control 2014-05-19 14:56:52 +0000
26@@ -1,11 +1,12 @@
27 Tests: autopilot
28 Depends: @,
29- autopilot-desktop (>= 1.4),
30+ autopilot-desktop-legacy (>= 1.4),
31 bamfdaemon,
32 at-spi2-core,
33 xvfb,
34 dbus-x11,
35- gnome-system-log,
36+ gnome-calculator,
37 gsettings-desktop-schemas,
38+ gnome-icon-theme-symbolic,
39 python-gi,
40 gir1.2-gtk-3.0
41
42=== renamed file 'tests/autopilot/tests/test_gnome_system_log.py' => 'tests/autopilot/tests/test_gnome_app.py'
43--- tests/autopilot/tests/test_gnome_system_log.py 2013-09-27 06:14:10 +0000
44+++ tests/autopilot/tests/test_gnome_app.py 2014-05-19 14:56:52 +0000
45@@ -1,4 +1,4 @@
46-# blackbox testing of autopilot API against gnome-system-log
47+# blackbox testing of autopilot API against gnome-calculator
48 # Author: Martin Pitt <martin.pitt@ubuntu.com>
49 # Copyright (C) 2013 Canonical Ltd
50 #
51@@ -17,7 +17,7 @@
52
53 from autopilot.testcase import AutopilotTestCase
54 from autopilot.matchers import Eventually
55-from testtools.matchers import Equals, NotEquals
56+from testtools.matchers import Equals
57
58
59 class GnomeAppTest(AutopilotTestCase):
60@@ -28,39 +28,23 @@
61 self.patch_environment('LANGUAGE', '')
62 self.patch_environment('LANG', '')
63 self.patch_environment('LC_MESSAGES', 'C')
64- self.app = self.launch_test_application('gnome-system-log', '/etc/issue')
65-
66- def test_filename_label(self):
67- """Find file name label"""
68-
69- l = self.app.select_single('GtkLabel', label=u'<b>issue</b>')
70+ self.app = self.launch_test_application('gnome-calculator')
71+
72+ def test_builder_button(self):
73+ """Find button by builder ID"""
74+
75+ l = self.app.select_single(BuilderName='calc_result_button')
76 self.assertNotEqual(l, None)
77 self.assertEqual(l.visible, True)
78-
79- def test_search(self):
80- """Run a search"""
81-
82- revealer = self.app.select_single('GdRevealer')
83- if revealer:
84- # search bar not visible by default
85- self.assertEqual(revealer.child_revealed, False)
86- else:
87- # g-s-l < 3.8 did not have the GdRevealer object yet
88- findbar = self.app.select_single('LogviewFindbar')
89- self.assertEqual(findbar.visible, False)
90-
91- search_btn = self.app.select_single('GtkToggleButton')
92- self.assertNotEqual(search_btn, None)
93- self.mouse.click_object(search_btn)
94-
95- # should trigger search bar
96- if revealer:
97- self.assertThat(lambda: revealer.child_revealed, Eventually(Equals(True)))
98- else:
99- self.assertThat(lambda: findbar.visible, Eventually(Equals(True)))
100- search = self.app.select_single('GtkSearchEntry', visible=True)
101- self.assertTrue(search.has_focus)
102-
103- # something that will not be in /etc/issue
104- self.keyboard.type('Bogus12!')
105- self.app.wait_select_single('GtkLabel', label=u'No matches found')
106+ self.assertEqual(l.label, '=')
107+
108+ def test_calc(self):
109+ """Run a calculation"""
110+
111+ display = self.app.select_single(BuilderName='displayitem')
112+ self.mouse.click_object(display)
113+ self.assertThat(display.buffer, Equals(''))
114+
115+ self.keyboard.type('1+1')
116+ self.keyboard.press_and_release('Enter')
117+ self.assertThat(display.buffer, Eventually(Equals('2')))

Subscribers

People subscribed via source and target branches

to all changes: