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

Proposed by Albert Astals Cid on 2012-01-25
Status: Merged
Approved by: Gerry Boland on 2012-01-26
Approved revision: 873
Merged at revision: 870
Proposed branch: lp:~aacid/unity-2d/unity-2d_test_super_s_does_not_type_s
Merge into: lp:unity-2d
Diff against target: 103 lines (+64/-1)
2 files modified
tests/manual-tests/places.txt (+20/-0)
tests/places/places-tests.rb (+44/-1)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d_test_super_s_does_not_type_s
Reviewer Review Type Date Requested Status
Michał Sawicz Needs Fixing on 2012-01-25
Gerry Boland 2012-01-25 Pending
Review via email: mp+90068@code.launchpad.net

Description of the Change

[test] Check that doing Super+s with the dash open does not type s in the search entry

To post a comment you must log in.
Michał Sawicz (saviq) wrote :

You should kill / launch the spread yourself here to make sure it runs from your build dir and not the system one.

review: Needs Fixing
Gerry Boland (gerboland) wrote :

Yep, please do as Michał suggested.

My only concern is with the "sleep 1" at the end. It *should* be enough, when you've manually loaded the spread in the script, but on a slow machine...

I think you'd better kill the spread in the test teardown, just in case a verify statment fails.

Albert Astals Cid (aacid) wrote :

Pushed the fixes regarding starting/killing the spread

871. By Albert Astals Cid on 2012-01-25

Create and kill the spread ourselves, this way there's no need to wait that second and press esc and you make sure it's this build spread you are testing

872. By Albert Astals Cid on 2012-01-25

merge

873. By Albert Astals Cid on 2012-01-25

Convert it to a manual test :-/

874. By Albert Astals Cid on 2012-01-26

merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/manual-tests/places.txt'
2--- tests/manual-tests/places.txt 2011-12-21 15:22:56 +0000
3+++ tests/manual-tests/places.txt 2012-01-25 17:09:40 +0000
4@@ -17,3 +17,23 @@
5 --> The text "Filter results" gets highlighted and no underline is shown. (lp:893061)
6
7 ----
8+
9+ # Test case objectives:
10+ # * Check that Super+s does not type s in the search line
11+ # Pre-conditions
12+ # * Desktop with no running applications
13+ # Test steps
14+ # * Verify dash is not showing
15+ # * Press Alt+F2
16+ # * Verify dash is showing
17+ # * Verify there is no text in the search line
18+ # * Press Super+s
19+ # * Verify there is no text in the search line
20+ # Post-conditions
21+ # * None
22+ # References
23+ # * There is a test case for this called "Super+s does not type s"
24+ # but it does not work realiably because of the reasons explained
25+ # in the places-tests.rb file
26+
27+----
28\ No newline at end of file
29
30=== modified file 'tests/places/places-tests.rb'
31--- tests/places/places-tests.rb 2012-01-25 08:51:36 +0000
32+++ tests/places/places-tests.rb 2012-01-25 17:09:40 +0000
33@@ -38,6 +38,9 @@
34 $SUT.execute_shell_command 'killall unity-2d-launcher'
35 $SUT.execute_shell_command 'killall unity-2d-launcher'
36
37+ $SUT.execute_shell_command 'killall unity-2d-spread'
38+ $SUT.execute_shell_command 'killall unity-2d-spread'
39+
40 # Minimize all windows
41 XDo::XWindow.toggle_minimize_all
42 end
43@@ -57,14 +60,18 @@
44 :arguments => "-testability",
45 :sleeptime => 2 )
46
47+ @app_spread = $SUT.run( :name => UNITY_2D_SPREAD,
48+ :arguments => "-testability",
49+ :sleeptime => 2 )
50 end
51
52 # Run after each test case completes
53 teardown do
54 TmpWindow.close_all_windows
55 #Need to kill Launcher as it does not shutdown when politely asked
56+ $SUT.execute_shell_command 'pkill -nf unity-2d-spread'
57+ $SUT.execute_shell_command 'pkill -nf unity-2d-places'
58 $SUT.execute_shell_command 'pkill -nf unity-2d-launcher'
59- $SUT.execute_shell_command 'pkill -nf unity-2d-places'
60 end
61
62 #####################################################################################
63@@ -119,4 +126,40 @@
64 @app_places.DashDeclarativeView()
65 }
66 end
67+
68+ # Test case objectives:
69+ # * Check that Super+s does not type s
70+ # Pre-conditions
71+ # * Desktop with no running applications
72+ # Test steps
73+ # * Verify dash is not showing
74+ # * Press Alt+F2
75+ # * Verify dash is showing
76+ # * Verify there is no text in the search entry
77+ # * Press Super+s
78+ # * Verify there is no text in the search entry
79+ # Post-conditions
80+ # * None
81+ # References
82+ # * None
83+ # FIXME This does not work reliably because the spread clears the search entry
84+ # and thus sometimes we ask for the contents too late
85+ xtest "Super+s does not type s" do
86+ verify_not(0, 'There should not be a Dash declarative view on startup') {
87+ @app_places.DashDeclarativeView()
88+ }
89+ XDo::Keyboard.alt_F2 #Must use uppercase F to indicate function keys
90+ verify(TIMEOUT, 'There should be a Dash declarative view after pressing Alt+F2') {
91+ @app_places.DashDeclarativeView()
92+ }
93+ verify_equal("", TIMEOUT, 'There should be no text in the Search Entry') {
94+ @app_places.DashDeclarativeView().SearchEntry().QDeclarativeTextInput()['text']
95+ }
96+ XDo::Keyboard.super_s
97+ verify_not(0, "Text of the Search Entry should not be an 's'") {
98+ verify_equal( "s", 1 ) {
99+ @app_places.DashDeclarativeView().SearchEntry().QDeclarativeTextInput()['text']
100+ }
101+ }
102+ end
103 end

Subscribers

People subscribed via source and target branches