Merge lp:~saviq/unity-2d/test_lens-bar-navigation into lp:unity-2d

Proposed by Michał Sawicz
Status: Merged
Approved by: Gerry Boland
Approved revision: 883
Merged at revision: 886
Proposed branch: lp:~saviq/unity-2d/test_lens-bar-navigation
Merge into: lp:unity-2d
Diff against target: 52 lines (+33/-0)
2 files modified
places/dash.qml (+1/-0)
tests/places/places-tests.rb (+32/-0)
To merge this branch: bzr merge lp:~saviq/unity-2d/test_lens-bar-navigation
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Albert Astals Cid (community) functional Approve
Review via email: mp+90691@code.launchpad.net

Description of the change

[tests] add lens bar left navigation test

To post a comment you must log in.
881. By Michał Sawicz

[test] make the test more generic

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

Could you please add a timeout > 0 for the verify & verify_equal statements. I'd be worried on first opening of the dash, that the lenses hadn't loaded by the time the verify check is called, so failing the test. Timeout adds a little forgiveness there, and causes no harm.

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

Done.

882. By Michał Sawicz

[tests] add timeouts in verify*

Revision history for this message
Albert Astals Cid (aacid) wrote :

I think the last verify_not (the one that holds the verify_equal) should not use TIMEOUT, we are already waiting inside for 2 seconds no need to wait for TIMEOUT more

Also was wondering if instead of "loader.call_method('forceActiveFocus()')" would be better to use keyboard interaction and simulate a down arrow keypress

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

> I think the last verify_not (the one that holds the verify_equal) should not
> use TIMEOUT, we are already waiting inside for 2 seconds no need to wait for
> TIMEOUT more
True that, I'm not yet 100% sure on the nested verify*s.

> Also was wondering if instead of "loader.call_method('forceActiveFocus()')"
> would be better to use keyboard interaction and simulate a down arrow keypress
That, too - it was needed in the previous version of this test but seems unnecessary now.

Fixed.

883. By Michał Sawicz

[tests] drop the timeout, use keyboard nav instead of forceActiveFocus()

Revision history for this message
Albert Astals Cid (aacid) wrote :

Like it, will let Gerry have the final say though :-)

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

Gerry happy, Gerry approved!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'places/dash.qml'
2--- places/dash.qml 2012-01-25 11:22:45 +0000
3+++ places/dash.qml 2012-01-31 09:11:23 +0000
4@@ -270,6 +270,7 @@
5
6 Loader {
7 id: pageLoader
8+ objectName: "pageLoader"
9
10 Accessible.name: "loader"
11 /* FIXME: check on visible necessary; fixed in Qt Quick 1.1
12
13=== modified file 'tests/places/places-tests.rb'
14--- tests/places/places-tests.rb 2012-01-27 14:35:35 +0000
15+++ tests/places/places-tests.rb 2012-01-31 09:11:23 +0000
16@@ -252,4 +252,36 @@
17 xid.close!
18 end
19
20+ # Test case objectives:
21+ # * Check navigation left from dash is disabled
22+ # Pre-conditions
23+ # * Desktop with no running applications
24+ # Test steps
25+ # * Invoke dash
26+ # * Focus dash contents, press left
27+ # * Check that focus is still on the first lens bar entry
28+ # Post-conditions
29+ # * None
30+ # References
31+ # * None
32+ test "Check navigation left from dash is disabled" do
33+ XDo::Keyboard.super
34+ verify(TIMEOUT, 'There should be a Dash declarative view after pressing Super') {
35+ @app_places.DashDeclarativeView()
36+ }
37+ loader = ""
38+ verify(TIMEOUT, 'Could not find the DashLoader') {
39+ loader = @app_places.QDeclarativeLoader( { :objectName => "pageLoader" } )
40+ }
41+ XDo::Keyboard.down
42+ verify_equal("true", TIMEOUT, 'Dash loader doesn\'t have focus') {
43+ loader['activeFocus']
44+ }
45+ XDo::Keyboard.left
46+ verify_not(0, 'Dash loader lost focus after pressing left') {
47+ verify_equal("false", 2) {
48+ loader['activeFocus']
49+ }
50+ }
51+ end
52 end

Subscribers

People subscribed via source and target branches