summaryrefslogtreecommitdiffstats
path: root/QtMobility/sys_location/sys_location.qtt
blob: 1e09916ad998aafe44d6b4796aa8a499795bc16c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of QtUiTest.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights.  These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

//TESTED_COMPONENT=src/location

testcase = {

    current_position: function()
    {
        prompt(twiki('---+++ Position is detected
    | *Step* | *Verification* |
    | Run the weatherinfo_with_location example | Verify that weather information for your local area is displayed |'
        ));
    },

    location_is_updated: function()
    {
        prompt(twiki('---+++ Position changes are detected
    1. Run the fetchgooglemaps example (sources are in examples/fetchgooglemaps).
    1. Note the initial position displayed in the example.
    1. Move to a different location.
    1. Note the updated position displayed in the example.
    1. Verify that the new position in step 4 corresponds to the move in step 3 (i.e. if the device moved north, the new position should clearly indicate this).'
       ));
    },

    third_party_position_source: function()
    {
        //test case for QTMOBILITY-873: Allow 3rd party position sources
        prompt(twiki('---+++ Position is detected via cusom plugin
    Note that GPS and internet connection is required for this test case
    | *Step* | *Verification* |
    | Run the testQtLocation application (this is part of BlueWeel project, sources are in git@scm.dev.nokia.troll.no:qtmobility/qtmobility-tests.git | |
    | Select the Custom Service | Verify that no "Unable to register location service" and "Not valid interface." messages appear |
    | Press the Update Map button | Verify that map was loaded and correct current position is displayed |
        ));
    },

    shift_to_the_given_offset: function()
    {
        //test case for QTMOBILITY-658: Add a method to QGeoCoordinate which takes an offset and returns another QGeoCoordinate
        prompt(twiki('---+++ New coordinats are calculated
    Note that significand precision should be taken into account during comparing real numbers, that is why we consider 5.48417e-16 value equal to zero
    | *Step* | *Verification* |
    | Run the testQtLocation application | |
    | Select the MapNavigation | |
    | Fill in "0" in to Start Latitude field | |
    | Fill in "100" in to Start Longitude field | |
    | Select Distance/Bearing from *Pre-defined* dropdown list | |
    | Fill "1000000, 90" in to the given field | |
    | Press the Ok button | Verify that Destination fields are updated with 5.48417e-16 latitude and 108.9932 longitude | |
    | Fill in "60" in to Start Latitude field | |
    | Fill in "100" in to Start Longitude field | |
    | Select Distance/Bearing from *Pre-defined* dropdown list | |
    | Fill "1000000, 180" in to the given field | |
    | Press the Ok button | Verify that Destination fields are updated with 51.0068 latitude and 100 longitude | |
    | Fill in "60" in to Start Latitude field | |
    | Fill in "100" in to Start Longitude field | |
    | Select Distance/Bearing from *Pre-defined* dropdown list | |
    | Fill "1000000, 20" in to the given field | |
    | Press the Ok button | Verify that Destination fields are updated with 68.2523 latitude and 108.296 longitude | |
        ));
    },

    // Landmarks

    store_and_load_a_landmark_data: {
        // Valid landmarks are -90~90 latitude, and -180~180 longitude
        landmark : ["landmark", "20", "120"]
    },

    store_and_load_a_landmark: function(name, latitude, longitude)
    {
        startApplication("landmarkbrowser");
        select("Add Landmark");
        enter("Latitude", latitude);
        enter("Longitude", longitude);
        enter("Name", name);
        select("Ok");
        prompt("Verify that the landmark record is created");
    },

    negative_store_and_load_a_landmark_data: {
        // Landmarks outside the ranges -90~90 latitude, and -180~180 longitude
        bad_landmark_lat : ["bad_landmark", "100", "120"],
        bad_landmark_long : ["bad_landmark", "80", "300"]
    },

    negative_store_and_load_a_landmark: function(name, latitude, longitude)
    {
        startApplication("landmarkbrowser");
        select("Add Landmark");
        enter("Latitude", latitude);
        enter("Longitude", longitude);
        enter("Name", name);
        //expectMessageBox("Invalid");
        prompt("Verify a message box is shown indicating the values are ouside the valid range")
        select("Ok");
        select("Cancel");
    },

    // Maps and Navigation

    select_service_provider: function()
    {
        startApplication("geoservicedemo");
        select("Service Providers");
        select("nokia");
        select("Set Service Provider");
        prompt("Verify selected service provider is indicated as current service provider");
    },

    request_route_from_one_GPS_location_to_another_data: {
        route:["-27.575", "153.088", "-27.465", "153.023", "16050", "15989"]
    },

    request_route_from_one_GPS_location_to_another: function(lat1, long1, lat2, long2, distance1, distance2)
    {
        startApplication("geoservicedemo");
        select("Service Providers");
        select("nokia");
        select("Set Service Provider");
        select("Route");
        select("Request Route");
        enter(lat1);
        enter(long1);
        enter(lat2);
        enter(long2);
        select("Ok");
        prompt(twiki("Wait until the route is calculated (should be less than 10 seconds)"));
        prompt(twiki("Verify the instructions for segments 1 and 5 indicate to 'Head towards Logan rd' and 'Turn left on Logan rd'"));
        select("routes/route");
        compare(getText("distance"), distance1);
        select("Request Route");
        enter(lat2);
        enter(long2);
        enter(lat1);
        enter(long1);
        select("Ok");
        prompt(twiki('Wait until the route is calculated (should be less than 10 seconds)'));
        prompt(twiki('Verify the instructions for segments 1 and 2 indicate to Head towards Sedgebrook st and Turn right onto Sedgebrook st'));
        compare(getText("distance"), distance2);
    },

    pixmap_object_zooming: function()
    {
        //test case for QTMOBILITY-757: Be able to prevent a QGeoMapPixmapObject from being scaled when zooming occurs
        //test case for QTMOBILITY-701: Add a QGraphicsItem based map object.
        //Test application testqtLocation covers just one use case meanwhile we have 8 different situation
        //depending on what units and transforms are in use (we have 4 types of units (PixelUnit, MeterUnit, RelativeArcSecondUnit, AbsoluteArcSecondUnit)
        //and 2 types of transforms (BilinearTransform, ExactTransform)). New set of tests has to be created as soon as testqtLocation is improved.
        prompt(twiki('---+++ Pixmap object is not scaled during zooming
    Note that GPS and internet connection is required for this test case
    | *Step* | *Verification* |
    | Run the testQtLocation application | |
    | Select the MapNavigation | |
    | Go to Map tab | Verify that map is loaded for current position |
    | Swith to MapObject mode | |
    | Tap on the screen to create pixmap object | Verify that blue square appears on the screen in place of touch |
    | Switch to Pan/Zoom mode | |
    | Increase zoom level | Verify that the blue square is not scaled |
    | Decrease zoom level | Verify that the blue square is not scaled |
        ));
    },

    request_landmarks_for_given_coordinate_with_reverse_geocoding: function()
    {
        skip( "Nothing tested", SkipAll );
    },
	
    //TESTED_COMPONENT=plugins/declarative/location
	
    qml_display_map: function()
    {
        //test case for QTMOBILITY-796: QML for Maps & Navigation:mapping
        prompt(twiki('---+++ Map is displayed
    Note that GPS and internet connection is required for this test case
    | *Step* | *Verification* |
    | Run the testQtLocation application | |
    | Select the MapNavigation.qml | |
    | Tap on Mode button | Verify that map is loaded for current position |
        ));
    },
	
    qml_zoom_map: function()
    {
        //test case for QTMOBILITY-796: QML for Maps & Navigation:mapping
        prompt(twiki('---+++ Zoom in and out the map
    Note that GPS and internet connection is required for this test case
    | *Step* | *Verification* |
    | Run the testQtLocation application | |
    | Select the MapNavigation.qml | |
    | Tap on the Mode button | Verify that map is loaded |
    | Tap on Plus button | Verify that map is zoomed in |
    | Tap on Plus button | Verify that zoom level is decreased and map is displayed correctly with new zoom level |
        ));
    }

	
}  // end of testcase


/*
----Landmarks use cases

    landmarks_within_range_of_a_position: function() {    },

    create_edit_and_delete_a_landmark: function() {    },

    sorted_search_based_on_category: function() {    },

    sort_landmarks_in_alphabetical_and_nearest: function() {    },

    notification_on_landmark_changes: function() {    },

    enumerate_categories: function() {    },

    add_edit_and_delete_a_category: function() {    },

    notification_on_category_changes: function() {    },

----Maps And Navigation use cases

    list_of_way_points: function() {    },

    distinguish_pedestrian_and_car_navigation: function() {    },

    find_matching_landmarks_for_given_search_criteria_with_geocoding: function() {    },

    displaying_a_map: function() {    },

    provide_map_for_given_coordinate: function() {    },

    zooming_support: function() {    },

    online_and_offline: function() {    }

*/