Merge lp:~carla-sella/ubuntu-autopilot-tests/evince-mod into lp:ubuntu-autopilot-tests

Proposed by Carla Sella
Status: Merged
Merged at revision: 19
Proposed branch: lp:~carla-sella/ubuntu-autopilot-tests/evince-mod
Merge into: lp:ubuntu-autopilot-tests
Diff against target: 363 lines (+99/-89)
4 files modified
evince/test_evince.py (+23/-13)
gedit/test_gedit.py (+6/-6)
screenshot/test_screenshot.py (+4/-4)
terminal/test_terminal.py (+66/-66)
To merge this branch: bzr merge lp:~carla-sella/ubuntu-autopilot-tests/evince-mod
Reviewer Review Type Date Requested Status
Ubuntu Testcase Admins Pending
Review via email: mp+142037@code.launchpad.net

Description of the change

For Nicholas:
- I cancelled TABS
- In the Evince test I put back the home global variable otherwise test does not work (do not know if this is ok for you) - fixed the assertions in the "enter_fullscreen_mode" and "exit_fullscreen_mode", I think thats ok for those two tests.

I proposed for merging so you can see if the changes are ok for you.

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=== modified file 'evince/test_evince.py'
2--- evince/test_evince.py 2013-01-03 23:38:02 +0000
3+++ evince/test_evince.py 2013-01-06 15:13:23 +0000
4@@ -11,6 +11,10 @@
5
6 #http://packages.qa.ubuntu.com/qatracker/testcases/1417/info
7 class EvinceTests(AutopilotTestCase):
8+
9+ global home
10+ home = os.getenv('HOME')
11+
12 def setUp(self):
13 super(EvinceTests, self).setUp()
14 self.app = self.start_app_window("Document Viewer")
15@@ -44,38 +48,40 @@
16 sleep(2)
17
18 #Does Evince enter fullscreen mode?
19- if self.app.is_maximized:
20- print "maxed"
21- print str(self.app.geometry())
22+ windowState = self.app._get_window_states()
23+ self.assertThat(windowState, Contains("_NET_WM_STATE_FULLSCREEN"))
24+
25
26 def test_exit_fullscreen_mode(self):
27 #Test-case name: evince/evn-003
28 #This test will check that Evince can enter exit fullscreen mode via F11
29- #Create pdf
30- createFile(self)
31
32- #Open pdf
33- openFile(self)
34+ #Press F11
35+ self.keyboard.press_and_release("F11")
36+ sleep(2)
37
38 #Make sure that Evince is in fullscreen mode
39+ windowState = self.app._get_window_states()
40+ self.assertThat(windowState, Contains("_NET_WM_STATE_FULLSCREEN"))
41
42 #Exit fullscreen mode
43 self.keyboard.press_and_release("F11")
44 sleep(2)
45
46 #Does Evince exit fullscreen mode and restore the window size and position correctly?
47- #Delete pdf
48- deleteFile(self)
49+ windowState = self.app._get_window_states()
50+ self.assertNotIn(windowState, Contains("_NET_WM_STATE_FULLSCREEN"))
51+
52
53 def test_hide_side_bar(self):
54 #Test-case name: evince/evn-004
55 #This test will check that Evince can hide sidebar
56 #Create pdf
57 createFile(self)
58-
59 #Open pdf
60 openFile(self)
61-
62+ sleep(5)
63+
64 #Make sure sidebar is displayed
65
66 #Press F9
67@@ -94,12 +100,15 @@
68 createFile(self)
69 #Open pdf
70 openFile(self)
71+ sleep(5)
72 #Make sure sidebar is hidden
73
74 #Press F9
75 self.keyboard.press_and_release("F9")
76 sleep(2)
77+
78 #Does Evince display a sidebar with page thumbnails or the document index?
79+
80
81 #Delete pdf
82 deleteFile(self)
83@@ -111,6 +120,7 @@
84 createFile(self)
85 #Open pdf
86 openFile(self)
87+ sleep(5)
88 #Press ctrl+left
89 self.keyboard.press_and_release("Ctrl+Left")
90 sleep(2)
91@@ -139,9 +149,9 @@
92 def openFile(self):
93 #Open a pdf by selecting file
94 self.keyboard.press_and_release("Ctrl+o")
95- self.keyboard.type("~/Documents/output.pdf")
96+ self.keyboard.type(home + "/Documents/output.pdf")
97 self.keyboard.type("\n")
98
99 def deleteFile(self):
100 #Delete pdf file created for test purposes
101- self.addCleanup("~/Documents/output.pdf")
102+ self.addCleanup(remove, home + "/Documents/output.pdf")
103
104=== modified file 'gedit/test_gedit.py'
105--- gedit/test_gedit.py 2012-12-28 15:41:41 +0000
106+++ gedit/test_gedit.py 2013-01-06 15:13:23 +0000
107@@ -94,15 +94,15 @@
108 self.keyboard.type("firefox /tmp/gedit.html\n")
109
110 #Close firefox window
111- sleep(1)
112- self.keyboard.press_and_release("Ctrl+q")
113+ sleep(1)
114+ self.keyboard.press_and_release("Ctrl+q")
115
116 #Close terminal window
117 #self.keyboard.press_and_release("Alt+Tab")
118 self.keyboard.type("exit\n")
119
120 #Remove "/tmp/gedit.html" file
121- sleep(3)
122+ sleep(3)
123 self.addCleanup(remove, "/tmp/gedit.html")
124
125
126@@ -165,7 +165,7 @@
127
128 #Type in "T"
129 self.keyboard.type("T")
130- sleep(5)
131+ sleep(5)
132
133 #Verify all the "T" letters in the document are highlited
134
135@@ -197,8 +197,8 @@
136 #Delete the file we made
137 sleep(3)
138 self.addCleanup(remove, tempFile.name)
139-
140-
141+
142+
143 def test_display_file_browser_panel(self):
144 #Test-case name: gedit/ged-005
145 #This test will check that GEdit can display File Browser panel
146
147=== modified file 'screenshot/test_screenshot.py'
148--- screenshot/test_screenshot.py 2013-01-03 23:38:02 +0000
149+++ screenshot/test_screenshot.py 2013-01-06 15:13:23 +0000
150@@ -36,7 +36,7 @@
151 sleep(3)
152
153 #Make sure screenshot window you launched is focused and ready to accept your keyboard input
154- self.app.set_focus()
155+ self.app.set_focus()
156 self.assertTrue(self.app.is_focused)
157
158 #Press Alt+n to focus on Name field
159@@ -62,7 +62,7 @@
160 self.keyboard.press_and_release("Alt+w")
161
162 #Make sure screenshot window you launched is focused and ready to accept your keyboard input
163- self.app.set_focus()
164+ self.app.set_focus()
165 self.assertTrue(self.app.is_focused)
166
167 #Press Alt+n to focus on Name field
168@@ -97,7 +97,7 @@
169 self.keyboard.press_and_release("Alt+s")
170
171 #Make sure screenshot window you launched is focused and ready to accept your keyboard input
172- self.app.set_focus()
173+ self.app.set_focus()
174 self.assertTrue(self.app.is_focused)
175
176 #Press Alt+n to focus on Name field
177@@ -108,5 +108,5 @@
178
179 #Is the screenshot image saved to your home directory? Is it a valid image file containing your selected window, with the drop shadow effect?
180
181- #Remove created file
182+ #Remove created file
183 self.addCleanup(remove, "/tmp/shot2.png")
184
185=== modified file 'terminal/test_terminal.py'
186--- terminal/test_terminal.py 2012-12-28 14:02:50 +0000
187+++ terminal/test_terminal.py 2013-01-06 15:13:23 +0000
188@@ -99,23 +99,23 @@
189 self.keyboard.press_and_release("Down")
190 self.keyboard.press_and_release("Down")
191 self.keyboard.press_and_release("Down")
192- self.keyboard.type("\n")
193+ self.keyboard.type("\n")
194 self.keyboard.press_and_release("Alt+s")
195- self.keyboard.press_and_release("Shift+Tab")
196- self.keyboard.press_and_release("Shift+Tab")
197- self.keyboard.type("\n")
198+ self.keyboard.press_and_release("Shift+Tab")
199+ self.keyboard.press_and_release("Shift+Tab")
200+ self.keyboard.type("\n")
201
202 #Set a Background Image
203- self.keyboard.press_and_release("Shift+Tab")
204- self.keyboard.press_and_release("Right")
205- self.keyboard.press_and_release("Alt+b")
206- self.keyboard.press_and_release("Alt+f")
207- self.keyboard.press_and_release("Space")
208- self.keyboard.type("/usr/share/backgrounds/Gran_Canaria_by_ALF.jpg")
209- self.keyboard.press_and_release("Alt+o")
210- self.keyboard.press_and_release("Tab")
211- self.keyboard.press_and_release("Tab")
212- self.keyboard.press_and_release("Space")
213+ self.keyboard.press_and_release("Shift+Tab")
214+ self.keyboard.press_and_release("Right")
215+ self.keyboard.press_and_release("Alt+b")
216+ self.keyboard.press_and_release("Alt+f")
217+ self.keyboard.press_and_release("Space")
218+ self.keyboard.type("/usr/share/backgrounds/Gran_Canaria_by_ALF.jpg")
219+ self.keyboard.press_and_release("Alt+o")
220+ self.keyboard.press_and_release("Tab")
221+ self.keyboard.press_and_release("Tab")
222+ self.keyboard.press_and_release("Space")
223
224 #Verify Terminal background changes
225
226@@ -125,21 +125,21 @@
227 self.keyboard.press_and_release("Space", delay=0.2)
228
229 #Close Profile preferences window
230- self.keyboard.press_and_release("Alt+c")
231-
232- #Change the Zoom Level
233- self.keyboard.press_and_release("Ctrl+plus")
234- self.keyboard.press_and_release("Ctrl+plus")
235- self.keyboard.press_and_release("Ctrl+plus")
236- self.keyboard.press_and_release("Ctrl+plus")
237- self.keyboard.press_and_release("Ctrl+-")
238- self.keyboard.press_and_release("Ctrl+-")
239-
240- #Verify zoom level has changed
241-
242-
243- #Put Zoom level back as it was
244- self.keyboard.press_and_release("Ctrl+0")
245+ self.keyboard.press_and_release("Alt+c")
246+
247+ #Change the Zoom Level
248+ self.keyboard.press_and_release("Ctrl+plus")
249+ self.keyboard.press_and_release("Ctrl+plus")
250+ self.keyboard.press_and_release("Ctrl+plus")
251+ self.keyboard.press_and_release("Ctrl+plus")
252+ self.keyboard.press_and_release("Ctrl+-")
253+ self.keyboard.press_and_release("Ctrl+-")
254+
255+ #Verify zoom level has changed
256+
257+
258+ #Put Zoom level back as it was
259+ self.keyboard.press_and_release("Ctrl+0")
260
261
262 def test_terminal_coloring(self):
263@@ -156,17 +156,17 @@
264 #Type in ls
265 self.keyboard.type("ls /tmp\n")
266
267- #Verify txt is in black
268-
269-
270- #Type in chmod 777 text1.txt
271- self.keyboard.type("chmod 777 /tmp/text1.txt\n")
272-
273- #Type in ls
274+ #Verify txt is in black
275+
276+
277+ #Type in chmod 777 text1.txt
278+ self.keyboard.type("chmod 777 /tmp/text1.txt\n")
279+
280+ #Type in ls
281 self.keyboard.type("ls /tmp\n")
282
283
284- #Verify txt should now be green
285+ #Verify txt should now be green
286
287 #Delete the file we created
288 self.addCleanup(remove, "/tmp/text1.txt")
289@@ -177,25 +177,25 @@
290 #This test will check that the terminal tab launches succesfully
291
292
293- #Open Terminal using the dash, and typing 'terminal'
294- self.keyboard.press_and_release("Super")
295- self.keyboard.type("terminal\n")
296-
297- #Is an instance of gnome-terminal with the title '@: ~' opened, with the current directory set to the users home directory?
298-
299-
300- #Close opened terminal
301- self.keyboard.press_and_release("Ctrl+d", delay=0.2)
302-
303- #Press Ctrl+Alt+T
304- self.keyboard.press_and_release("Ctrl+Alt+t")
305-
306- #Is an instance of gnome-terminal with the title '@: ~' opened, with the current directory set to the users home directory?
307-
308-
309- #Close opened terminal
310- self.keyboard.press_and_release("Ctrl+d")
311- self.keyboard.press_and_release("Ctrl+d")
312+ #Open Terminal using the dash, and typing 'terminal'
313+ self.keyboard.press_and_release("Super")
314+ self.keyboard.type("terminal\n")
315+
316+ #Is an instance of gnome-terminal with the title '@: ~' opened, with the current directory set to the users home directory?
317+
318+
319+ #Close opened terminal
320+ self.keyboard.press_and_release("Ctrl+d", delay=0.2)
321+
322+ #Press Ctrl+Alt+T
323+ self.keyboard.press_and_release("Ctrl+Alt+t")
324+
325+ #Is an instance of gnome-terminal with the title '@: ~' opened, with the current directory set to the users home directory?
326+
327+
328+ #Close opened terminal
329+ self.keyboard.press_and_release("Ctrl+d")
330+ self.keyboard.press_and_release("Ctrl+d")
331 #Had to put two Ctrl+d's as the first one closes the terminal that opens with the launch of this test
332
333
334@@ -207,20 +207,20 @@
335 self.app.set_focus()
336 self.assertTrue(self.app.is_focused)
337
338- #From the main menu select 'Terminal > Set Title...'
339+ #From the main menu select 'Terminal > Set Title...'
340 self.keyboard.press_and_release("Alt+t", delay=0.5)
341- self.keyboard.press_and_release("s", delay=0.5)
342-
343- #Verify the Set Title dialog appears
344+ self.keyboard.press_and_release("s", delay=0.5)
345+
346+ #Verify the Set Title dialog appears
347 #Check to see that the title of the window is "Set Title"
348 #self.assertThat(lambda: self.app.name, Eventually(Contains("Set Title")))
349 #Commented it as it does not work
350-
351- #Enter 'Test Title' and click OK
352- self.keyboard.type("Test Title")
353- self.keyboard.press_and_release("Alt+o")
354-
355- #Is the title of the window now 'Test Title'?
356+
357+ #Enter 'Test Title' and click OK
358+ self.keyboard.type("Test Title")
359+ self.keyboard.press_and_release("Alt+o")
360+
361+ #Is the title of the window now 'Test Title'?
362 #Check to see that the title reflects our 'Test Title'
363 self.assertThat(lambda: self.app.name, Eventually(Contains("Test Title")))
364

Subscribers

People subscribed via source and target branches