Merge lp:~saviq/unity-2d/shell-uitests into lp:~unity-2d-team/unity-2d/unity-2d-shell

Proposed by Michał Sawicz
Status: Merged
Approved by: Gerry Boland
Approved revision: 915
Merged at revision: 917
Proposed branch: lp:~saviq/unity-2d/shell-uitests
Merge into: lp:~unity-2d-team/unity-2d/unity-2d-shell
Diff against target: 284 lines (+36/-38)
3 files modified
tests/launcher/autohide_show_tests.rb (+28/-28)
tests/launcher/visual_verification.rb (+6/-6)
tests/run-tests.rb (+2/-4)
To merge this branch: bzr merge lp:~saviq/unity-2d/shell-uitests
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+88846@code.launchpad.net

Description of the change

Fix the testability tests so that they run in the shell

To post a comment you must log in.
lp:~saviq/unity-2d/shell-uitests updated
912. By Michał Sawicz

Merge from shell

913. By Michał Sawicz

Merge from shell

914. By Michał Sawicz

Merge from shell

915. By Michał Sawicz

Merge from shell

Revision history for this message
Gerry Boland (gerboland) wrote :

Fixes are good, but one test fails: Show Desktop - the launcher isn't revealing but the test expects it.

Question: I'm using Intelli-hide mode, that ok?

Revision history for this message
Michał Sawicz (saviq) wrote :

The fix for that just got merged, merge -shell to test.

Revision history for this message
Gerry Boland (gerboland) wrote :

Yep works great. Thanks for the clarification.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/launcher/autohide_show_tests.rb'
2--- tests/launcher/autohide_show_tests.rb 2012-01-18 11:01:20 +0000
3+++ tests/launcher/autohide_show_tests.rb 2012-01-18 14:55:37 +0000
4@@ -34,8 +34,8 @@
5
6 # Run once at the beginning of this test suite
7 startup do
8- system 'killall unity-2d-launcher > /dev/null 2>&1'
9- system 'killall unity-2d-launcher > /dev/null 2>&1'
10+ system 'killall unity-2d-shell > /dev/null 2>&1'
11+ system 'killall unity-2d-shell > /dev/null 2>&1'
12
13 # Minimize all windows
14 XDo::XWindow.toggle_minimize_all
15@@ -52,11 +52,11 @@
16
17 # Execute the application
18 @sut = TDriver.sut(:Id => "sut_qt")
19- @app = @sut.run( :name => UNITY_2D_LAUNCHER,
20+ @app = @sut.run( :name => UNITY_2D_SHELL,
21 :arguments => "-testability",
22 :sleeptime => 2 )
23 # Make certain application is ready for testing
24- verify{ @app.Unity2dPanel() }
25+ verify{ @app.Launcher() }
26 end
27
28 # Run after each test case completes
29@@ -64,7 +64,7 @@
30 TmpWindow.close_all_windows
31 #@app.close
32 #Need to kill Launcher as it does not shutdown when politely asked
33- system "pkill -nf unity-2d-launcher"
34+ system "pkill -nf unity-2d-shell"
35 end
36
37 #####################################################################################
38@@ -85,11 +85,11 @@
39 test "Position with Empty Desktop" do
40 # check width before proceeding
41 verify_equal( WIDTH, TIMEOUT, "Launcher is not #{WIDTH} pixels wide on screen!" ) {
42- @app.Unity2dPanel()['width'].to_i
43+ @app.Launcher()['width'].to_i
44 }
45
46 verify_equal( 0, TIMEOUT, 'Launcher hiding on empty desktop, should be visible' ) {
47- @app.Unity2dPanel()['x_absolute'].to_i
48+ @app.Launcher()['x_absolute'].to_i
49 }
50 end
51
52@@ -109,7 +109,7 @@
53 # Open Terminal with position 100x100
54 xid = TmpWindow.open_window_at(100,100)
55 verify_equal( 0, TIMEOUT, 'Launcher hiding when window not in the way, should be visible' ) {
56- @app.Unity2dPanel()['x_absolute'].to_i
57+ @app.Launcher()['x_absolute'].to_i
58 }
59 xid.close!
60 end
61@@ -130,7 +130,7 @@
62 # Open Terminal with position 40x100
63 xid = TmpWindow.open_window_at(40,100)
64 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible when window in the way, should be hidden' ) {
65- @app.Unity2dPanel()['x_absolute'].to_i
66+ @app.Launcher()['x_absolute'].to_i
67 }
68 xid.close!
69 end
70@@ -155,17 +155,17 @@
71 # Open Terminal with position 100x100
72 xid = TmpWindow.open_window_at(100,100)
73 verify_equal( 0, TIMEOUT, 'Launcher hiding when window not in the way, should be visible' ) {
74- @app.Unity2dPanel()['x_absolute'].to_i
75+ @app.Launcher()['x_absolute'].to_i
76 }
77
78 xid.move(WIDTH-1,100)
79 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible when window in the way, should be hidden' ) {
80- @app.Unity2dPanel()['x_absolute'].to_i
81+ @app.Launcher()['x_absolute'].to_i
82 }
83
84 xid.move(WIDTH,100)
85 verify_equal( 0, TIMEOUT, 'Launcher hiding when window not in the way, should be visible' ) {
86- @app.Unity2dPanel()['x_absolute'].to_i
87+ @app.Launcher()['x_absolute'].to_i
88 }
89 xid.close!
90 end
91@@ -191,22 +191,22 @@
92 test "Reveal hidden Launcher with mouse" do
93 xid = TmpWindow.open_window_at(10,100)
94 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way, should be hidden' ) {
95- @app.Unity2dPanel()['x_absolute'].to_i
96+ @app.Launcher()['x_absolute'].to_i
97 }
98
99 XDo::Mouse.move(0,200)
100 verify_equal( 0, TIMEOUT, 'Launcher hiding when mouse at left edge of screen' ) {
101- @app.Unity2dPanel()['x_absolute'].to_i
102+ @app.Launcher()['x_absolute'].to_i
103 }
104
105 XDo::Mouse.move(WIDTH-1,200)
106 verify_equal( 0, TIMEOUT, 'Launcher should still be visible as mouse over it' ) {
107- @app.Unity2dPanel()['x_absolute'].to_i
108+ @app.Launcher()['x_absolute'].to_i
109 }
110
111 XDo::Mouse.move(WIDTH,200)
112 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way and mouse moved out, should be hidden' ) {
113- @app.Unity2dPanel()['x_absolute'].to_i
114+ @app.Launcher()['x_absolute'].to_i
115 }
116 xid.close!
117 end
118@@ -231,12 +231,12 @@
119 test "Hold Super key down to reveal launcher and shortcut keys" do
120 xid = TmpWindow.open_window_at(10,100)
121 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way, should be hidden' ) {
122- @app.Unity2dPanel()['x_absolute'].to_i
123+ @app.Launcher()['x_absolute'].to_i
124 }
125
126 XDo::Keyboard.key_down('SUPER')
127 verify_equal( 0, TIMEOUT, 'Launcher hiding when Super Key held, should be visible' ) {
128- @app.Unity2dPanel()['x_absolute'].to_i
129+ @app.Launcher()['x_absolute'].to_i
130 }
131 verify_equal( 'true', TIMEOUT, 'Shortcut on Home Folder icon not displaying with Super key held' ) {
132 @app.LauncherList( :name => 'main' ) \
133@@ -247,7 +247,7 @@
134
135 XDo::Keyboard.key_up('SUPER')
136 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way and mouse moved out, should be hidden' ) {
137- @app.Unity2dPanel()['x_absolute'].to_i
138+ @app.Launcher()['x_absolute'].to_i
139 }
140 xid.close!
141 end
142@@ -272,12 +272,12 @@
143 test "Press Alt+F1 to focus Launcher" do
144 xid = TmpWindow.open_window_at(10,100)
145 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way, should be hidden' ) {
146- @app.Unity2dPanel()['x_absolute'].to_i
147+ @app.Launcher()['x_absolute'].to_i
148 }
149
150 XDo::Keyboard.alt_F1 #Must use uppercase F to indicate function keys
151 verify_equal( 0, TIMEOUT, 'Launcher hiding after Alt+F1 pressed, should be visible' ) {
152- @app.Unity2dPanel()['x_absolute'].to_i
153+ @app.Launcher()['x_absolute'].to_i
154 }
155 verify_equal( 'true', TIMEOUT, 'Dash icon not highlighted after Alt+F1 pressed' ){
156 @app.LauncherList( :name => 'main' ) \
157@@ -287,7 +287,7 @@
158
159 XDo::Keyboard.escape
160 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way and mouse moved out, should be hidden' ) {
161- @app.Unity2dPanel()['x_absolute'].to_i
162+ @app.Launcher()['x_absolute'].to_i
163 }
164 xid.close!
165 end
166@@ -315,14 +315,14 @@
167 test "Press Alt+F1 to focus/unfocus Launcher" do
168 xid = TmpWindow.open_window_at(10,100)
169 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way, should be hidden' ) {
170- @app.Unity2dPanel()['x_absolute'].to_i
171+ @app.Launcher()['x_absolute'].to_i
172 }
173 assert_equal( xid.id, XDo::XWindow.active_window, \
174 'terminal should have focus after starting it' )
175
176 XDo::Keyboard.alt_F1 #Must use uppercase F to indicate function keys
177 verify_equal( 0, TIMEOUT, 'Launcher hiding after Alt+F1 pressed, should be visible' ) {
178- @app.Unity2dPanel()['x_absolute'].to_i
179+ @app.Launcher()['x_absolute'].to_i
180 }
181 verify_equal( 'true', TIMEOUT, 'Dash icon not highlighted after Alt+F1 pressed' ) {
182 @app.LauncherList( :name => 'main' ) \
183@@ -334,7 +334,7 @@
184
185 XDo::Keyboard.alt_F1
186 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way and mouse moved out, should be hidden' ){
187- @app.Unity2dPanel()['x_absolute'].to_i
188+ @app.Launcher()['x_absolute'].to_i
189 }
190 assert_equal( xid.id, XDo::XWindow.active_window, \
191 'terminal does not have focus when it should' )
192@@ -360,17 +360,17 @@
193 test "Launcher visible on show-desktop" do
194 xid = TmpWindow.open_window_at(10,100)
195 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way, should be hidden' ) {
196- @app.Unity2dPanel()['x_absolute'].to_i
197+ @app.Launcher()['x_absolute'].to_i
198 }
199
200 XDo::XWindow.toggle_minimize_all # This is effectively the show-desktop shortcut
201 verify_equal( 0, TIMEOUT, 'Launcher hiding after triggering show-desktop, should be visible' ) {
202- @app.Unity2dPanel()['x_absolute'].to_i
203+ @app.Launcher()['x_absolute'].to_i
204 }
205
206 XDo::XWindow.toggle_minimize_all
207 verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way, should be hidden' ) {
208- @app.Unity2dPanel()['x_absolute'].to_i
209+ @app.Launcher()['x_absolute'].to_i
210 }
211 xid.close!
212 end
213
214=== modified file 'tests/launcher/visual_verification.rb'
215--- tests/launcher/visual_verification.rb 2011-12-12 22:57:15 +0000
216+++ tests/launcher/visual_verification.rb 2012-01-18 14:55:37 +0000
217@@ -30,8 +30,8 @@
218
219 # Run once at the beginning of this test suite
220 startup do
221- system 'killall unity-2d-launcher > /dev/null 2>&1'
222- system 'killall unity-2d-launcher > /dev/null 2>&1'
223+ system 'killall unity-2d-shell > /dev/null 2>&1'
224+ system 'killall unity-2d-shell > /dev/null 2>&1'
225 end
226
227 # Run once at the end of this test suite
228@@ -42,7 +42,7 @@
229 setup do
230 # Execute the application
231 @sut = TDriver.sut(:Id => "sut_qt")
232- @app = @sut.run( :name => UNITY_2D_LAUNCHER,
233+ @app = @sut.run( :name => UNITY_2D_SHELL,
234 :arguments => "-testability",
235 :sleeptime => 2 )
236 end
237@@ -51,7 +51,7 @@
238 teardown do
239 #@app.close
240 #Need to kill Launcher as it does not shutdown when politely asked
241- system "pkill -nf unity-2d-launcher"
242+ system "pkill -nf unity-2d-shell"
243 end
244
245 #####################################################################################
246@@ -60,7 +60,7 @@
247 test "Visually compare Dash tile with reference" do
248 expected_image = pwd + 'verification/dash-tile.png'
249
250- dash_tile = @app.Unity2dPanel() \
251+ dash_tile = @app.Launcher() \
252 .LauncherList( :name => 'main' ) \
253 .QDeclarativeItem( :name => 'Dash home' ) \
254 .QDeclarativeItem()
255@@ -73,7 +73,7 @@
256 test "Check Dash Tile location in Launcher" do
257 expected_image = pwd + 'verification/dash-tile.png'
258
259- tile_list = @app.Unity2dPanel().LauncherList( :name => 'main' )
260+ tile_list = @app.Launcher().LauncherList( :name => 'main' )
261
262 # Given the reference image, locate the matching visual in the LauncherList
263 coordinates = tile_list.find_on_screen(expected_image, 4)
264
265=== modified file 'tests/run-tests.rb'
266--- tests/run-tests.rb 2012-01-18 11:01:20 +0000
267+++ tests/run-tests.rb 2012-01-18 14:55:37 +0000
268@@ -44,15 +44,13 @@
269 if File.exists?(binary_dir_file)
270 binary_dir = File.open(binary_dir_file).first.strip
271 puts 'Running tests on applications contained within ' + binary_dir
272- UNITY_2D_LAUNCHER = binary_dir + '/launcher/app/unity-2d-launcher'
273+ UNITY_2D_SHELL = binary_dir + '/shell/app/unity-2d-shell'
274 UNITY_2D_PANEL = binary_dir + '/panel/app/unity-2d-panel'
275- UNITY_2D_PLACES = binary_dir + '/places/app/unity-2d-places'
276 UNITY_2D_SPREAD = binary_dir + '/spread/app/unity-2d-spread'
277 else
278 puts 'NOTICE: source not configured, tests will be carried out on *installed* applications!'
279- UNITY_2D_LAUNCHER = 'unity-2d-launcher'
280+ UNITY_2D_SHELL = 'unity-2d-shell'
281 UNITY_2D_PANEL = 'unity-2d-panel'
282- UNITY_2D_PLACES = 'unity-2d-places'
283 UNITY_2D_SPREAD = 'unity-2d-spread'
284 end
285

Subscribers

People subscribed via source and target branches

to all changes: