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

Subscribers

People subscribed via source and target branches