Merge lp:~aacid/unity-2d/unity-2d_test_toggling_bfb_does_not_close_launcher into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 861
Merged at revision: 859
Proposed branch: lp:~aacid/unity-2d/unity-2d_test_toggling_bfb_does_not_close_launcher
Merge into: lp:unity-2d
Diff against target: 46 lines (+38/-0)
1 file modified
tests/launcher/autohide_show_tests.rb (+38/-0)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d_test_toggling_bfb_does_not_close_launcher
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Michał Sawicz functional Approve
Review via email: mp+89271@code.launchpad.net

Description of the change

[test] Launcher does not hide after toggling the dash

To post a comment you must log in.
858. By Albert Astals Cid

merge

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

Hey
XDo::Mouse.move(bfb['x_absolute'].to_i + 1, bfb['y_absolute'].to_i + 1, 0, true)
Curious if you considered "hover" [1], so this would just be "bfb.hover"

+ (1..15).each do |i|
+ verify_equal( 0, 0, 'Launcher hiding after clicking twice in the bfb' ) {
+ @app.Launcher()['x_absolute'].to_i
+ }
+ sleep 0.1
+ end

I know you can nest verify_* statements. Would something like this be nicer?:

verify_not(3, 'Launcher hiding after hovering mouse over bfb' and clicking twice) {
  verify_equal( 2, 0 ) {
     @app.Launcher()['x_absolute'].to_i
  }
}

[1] https://projects.developer.nokia.com/dav/Testabilitydriver/doc/api/qt_linux/#QtAction:hover

859. By Albert Astals Cid

Improvements based on Gerry's comments, do use Qt to move the mouse and a nice nested verify instead of a loop

860. By Albert Astals Cid

merge trunk

861. By Albert Astals Cid

replaced tabs by mistake

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

Seems to have worked fine.

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

Yep looks great, thanks Albert!

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-19 12:28:36 +0000
3+++ tests/launcher/autohide_show_tests.rb 2012-01-19 17:32:30 +0000
4@@ -432,4 +432,42 @@
5 end
6 end
7
8+ # Test case objectives:
9+ # * Launcher does not hide after toggling the dash
10+ # Pre-conditions
11+ # * Desktop with no running applications
12+ # Test steps
13+ # * Open application in position overlapping Launcher
14+ # * Verify Launcher hiding
15+ # * Move mouse to the left
16+ # * Verify Launcher showing
17+ # * Click twice in the bfb
18+ # * Verify Launcher showing during 1.5 seconds
19+ # Post-conditions
20+ # * None
21+ # References
22+ # * None
23+ test "Launcher visible after toggling dash" do
24+ xid = TmpWindow.open_window_at(10,100)
25+ verify_equal( -WIDTH, TIMEOUT, 'Launcher visible with window in the way, should be hidden' ) {
26+ @app.Unity2dPanel()['x_absolute'].to_i
27+ }
28+
29+ bfb = @app.LauncherList( :name => 'main' ).LauncherList( :isBfb => true );
30+ XDo::Mouse.move(0, 200, 0, true)
31+ verify_equal( 0, TIMEOUT, 'Launcher hiding when mouse at left edge of screen' ) {
32+ @app.Unity2dPanel()['x_absolute'].to_i
33+ }
34+ bfb.move_mouse()
35+ bfb.tap()
36+ bfb.tap()
37+ verify_not(0, 'Launcher hiding after hovering mouse over bfb and clicking twice') {
38+ verify_equal( -WIDTH, 2 ) {
39+ @app.Unity2dPanel()['x_absolute'].to_i
40+ }
41+ }
42+
43+ xid.close!
44+ end
45+
46 end

Subscribers

People subscribed via source and target branches