Merge lp:~mago-contributors/mago/mago-usc3-31 into lp:~mago-contributors/mago/mago-testsuite

Proposed by Patrick Wright
Status: Merged
Merged at revision: 22
Proposed branch: lp:~mago-contributors/mago/mago-usc3-31
Merge into: lp:~mago-contributors/mago/mago-testsuite
Diff against target: 200 lines (+144/-22)
1 file modified
software-center/test_softwarecenter.py (+144/-22)
To merge this branch: bzr merge lp:~mago-contributors/mago/mago-usc3-31
Reviewer Review Type Date Requested Status
Mago Contributors Pending
Review via email: mp+56012@code.launchpad.net

Description of the change

Added some USC tests

These are yet to be cleaned up and refactored but they are runnable

Some tests are incomplete as well and are currently in progress

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'software-center/data'
=== added file 'software-center/data/hello_2.5-1_amd64.deb'
0Binary files software-center/data/hello_2.5-1_amd64.deb 1970-01-01 00:00:00 +0000 and software-center/data/hello_2.5-1_amd64.deb 2011-04-01 22:04:29 +0000 differ0Binary files software-center/data/hello_2.5-1_amd64.deb 1970-01-01 00:00:00 +0000 and software-center/data/hello_2.5-1_amd64.deb 2011-04-01 22:04:29 +0000 differ
=== added file 'software-center/data/hello_2.5-1_i386.deb'
1Binary files software-center/data/hello_2.5-1_i386.deb 1970-01-01 00:00:00 +0000 and software-center/data/hello_2.5-1_i386.deb 2011-04-01 22:04:29 +0000 differ1Binary files software-center/data/hello_2.5-1_i386.deb 1970-01-01 00:00:00 +0000 and software-center/data/hello_2.5-1_i386.deb 2011-04-01 22:04:29 +0000 differ
=== modified file 'software-center/test_softwarecenter.py'
--- software-center/test_softwarecenter.py 2011-03-23 11:16:51 +0000
+++ software-center/test_softwarecenter.py 2011-04-01 22:04:29 +0000
@@ -23,6 +23,8 @@
23import commands23import commands
24import ldtp24import ldtp
25import ooldtp25import ooldtp
26import commands
27import os
2628
27class TestSoftwareCenter(TestCase):29class TestSoftwareCenter(TestCase):
28 launcher = 'software-center'30 launcher = 'software-center'
@@ -40,15 +42,18 @@
40 ldtp.wait(2)42 ldtp.wait(2)
41 ldtp.click(self.window_name, 'btnInstall') 43 ldtp.click(self.window_name, 'btnInstall')
42 self.application.authenticate(self.testConfig.get('auth', 'password'))44 self.application.authenticate(self.testConfig.get('auth', 'password'))
43 # TODO bug with doesrowexist() partial match implementation45 ldtp.wait(5)
46
47 # TODO It would be nice to add a check that the in progress menu appears and disappears.
44 #ldtp.wait(3)48 #ldtp.wait(3)
45 #self.assertTrue(ldtp.doesrowexist(self.window_name, 'ttblSoftwaresources', 'In Progress...'))49 #self.assertTrue(ldtp.doesrowexist(self.window_name, 'ttblSoftwaresources', 'In Progress', True))
46 #ldtp.wait(10)50 #ldtp.wait(10)
47 #self.assertFalse(ldtp.doesrowexist(self.window_name, 'ttblSoftwaresources', 'In Progress...'))51 #self.assertFalse(ldtp.doesrowexist(self.window_name, 'ttblSoftwaresources', 'In Progress', True))
52
48 ldtp.singleclickrow(self.window_name, 'ttblSoftwaresources', 'Installed Software')53 ldtp.singleclickrow(self.window_name, 'ttblSoftwaresources', 'Installed Software')
49 ldtp.wait(5)54 ldtp.wait(5)
50 #self.assertTrue(ldtp.doesrowexist(self.window_name, 'tblInstalledPaneappview', 'Test Drive an Ubuntu ISO'))55 self.assertTrue(ldtp.doesrowexist(self.window_name, 'tblInstalledPaneappview', 'Test Drive an Ubuntu ISO', True))
51 #ldtp.wait(5)56 ldtp.wait(5)
52 ldtp.settextvalue(self.window_name, 'txtInstalledPanesearchentry', 'Test Drive')57 ldtp.settextvalue(self.window_name, 'txtInstalledPanesearchentry', 'Test Drive')
53 # assumes Test Drive is the first in the list58 # assumes Test Drive is the first in the list
54 ldtp.wait(3)59 ldtp.wait(3)
@@ -56,24 +61,141 @@
56 ldtp.wait(2)61 ldtp.wait(2)
57 ldtp.generatekeyevent('<space>')62 ldtp.generatekeyevent('<space>')
58 ldtp.wait(5)63 ldtp.wait(5)
59 # TODO bug 739908 - seems to be blocking ldtp from clicking the Remove button64 # TODO
60 #ldtp.click(self.window_name, 'btnRemove')65 #ldtp.click(self.window_name, 'btnRemove')
6166
62 @unittest.skip("Bug 709125 User agent doesn't include Ubuntu in it so apt.ubuntu.com doesn't work")67 def test_custom_package_list(self):
63 def test_url_launcher_not_installed(self):68 """
64 """69 """
65 """70 # search for gobby,gnome-orca
66 # Execute command: wget -U "Ubuntu" http://apt.ubuntu.com/p/python71 ldtp.enterstring(self.window_name, 'txtAvailablePanesearchentry', 'gobby,gnome-orca')
67 wget_rc = 'wget -U "Ubuntu" http://apt.ubuntu.com/p/python'72 ldtp.wait(3)
68 status, output = commands.getstatusoutput(wget_rc)73 # assert install button and items displayed
69 self.failUnlessEqual(status, 0)74 self.assertTrue(ldtp.doesrowexist(self.window_name, 'tblAvailablePaneappview', 'Gobby Collaborative Editor', True))
70 self.assertIn("The package you requested will install shortly.", output)75 self.assertTrue(ldtp.doesrowexist(self.window_name, 'tblAvailablePaneappview', 'Orca Screen Reader and Magnifier', True))
71 76 # append ,9base
72 # File will contain message:77 ldtp.enterstring(self.window_name, 'txtAvailablePanesearchentry', 'gobby,gnome-orca,9base')
73 #Please Wait78 ldtp.wait(3)
74 #The package you requested will install shortly.79 # assert
75 80 self.assertTrue(ldtp.doesrowexist(self.window_name, 'tblAvailablePaneappview', 'Gobby Collaborative Editor', True))
76 # USC will open and automatically display the python package81 self.assertTrue(ldtp.doesrowexist(self.window_name, 'tblAvailablePaneappview', 'Orca Screen Reader and Magnifier', True))
77 82 # TODO bug 746964 self.assertTrue(ldtp.doesrowexist(self.window_name, 'tblAvailablePaneappview', 'Plan 9 userland tools', True))
83 # append, abcd
84 ldtp.enterstring(self.window_name, 'txtAvailablePanesearchentry', 'gobby,gnome-orca,9base,abcd')
85 # assert not found item
86 # TODO bug 712903 need to verify if this still according to spec
87 #self.assertTrue(ldtp.doesrowexist(self.window_name, 'tblAvailablePaneappview', 'Not Found', True))
88
89 # append e
90 ldtp.enterstring(self.window_name, 'txtAvailablePanesearchentry', 'gobby,gnome-orca,9base,abcde')
91 # assert no not found
92 self.assertFalse(ldtp.doesrowexist(self.window_name, 'tblAvailablePaneappview', 'Not Found', True))
93 # assert
94 # TODO bug 746964
95 #self.assertTrue(ldtp.doesrowexist(self.window_name, 'tblAvailablePaneappview', 'A Better CD Encoder', True))
96
97 def test_launch_with_package_name(self):
98 """
99 """
100 # execute command software-center gobby
101 self.application.close()
102 self.application.launch(launcher_args=['gobby'])
103
104 # assert Get Software > Internet > Gobby Col.....
105 ldtp.waittillguiexist(self.window_name, 'btnGobbyCollaborativeEditor*')
106 # assert pane view
107 self.assertTrue(ldtp.guiexist(self.window_name, 'lblGobbyCollaborativeEditor*'))
108
109 def test_launch_with_debian_file(self):
110 """
111 """
112 self.application.close()
113 filepath = os.path.join(os.path.dirname(__file__), 'data', 'hello_2.5-1_i386.deb')
114 self.application.launch(launcher_args=[filepath])
115
116 # assert Get Software > Internet > Gobby Col.....
117 ldtp.waittillguiexist(self.window_name, 'btnTheclassicgreeting*')
118 # assert pane view
119 self.assertTrue(ldtp.guiexist(self.window_name, 'lblTheclassicgreeting*'))
120
121
122 def test_launch_with_apturl(self):
123 """
124 """
125 self.application.close()
126 self.application.launch(launcher_args=['apt://gobby'])
127
128 # assert Get Software > Internet > Gobby Col.....
129 ldtp.waittillguiexist(self.window_name, 'btnGobbyCollaborativeEditor*')
130 # assert pane view
131 self.assertTrue(ldtp.guiexist(self.window_name, 'lblGobbyCollaborativeEditor*'))
132
133 def test_reset_corrupt_cache(self):
134 """
135 These test steps outlined in the spec do not work. contact Gary about how this should work.
136 """
137 pass
138 # execute command apt-get install 4g8 && dpkg --force-depends -r libnet1
139
140 # click installed software
141
142 # assert icon
143
144 # press tab, space
145
146 # assert custom policy kit opens
147
148 # click cancel
149
150 # start installing any app
151
152 # asssert icon disappears
153
154 # click In Progress
155
156 # assert "Rebuilding software catalog" task
157
158 # clean up step (apt-get remove 4g8 libnet1 ???
159
160 def test_add_remove_repositories(self):
161 """
162 LDTP becomes completely inert when the software sources app is opened within usc
163 """
164 pass
165 # edit - software sources
166 #ldtp.click(self.window_name, 'mnuSoftwareSources*')
167
168 # password
169 #self.application.authenticate(self.testConfig.get('auth', 'password'))
170
171 # other software tab click add
172 #ldtp.click(self.window_name, '')
173
174 # enter url
175
176 # click Add Source
177
178 # click close
179
180 # click in progress (cache update) "Updating cache"
181
182 # when complete should go to main get software pane
183
184 # search for 2mandvd and assert exists
185
186 # remove sources
187
188 # click close
189
190 # click in progress (cache update) "Updating cache"
191
192 # when complete should go to main get software pane
193
194 # click search clear button
195
196 # search for 2mandvd and assert does NOT exist
197
198
199
78if __name__ == "__main__":200if __name__ == "__main__":
79 nose.main()201 nose.main()

Subscribers

People subscribed via source and target branches