Merge lp:~kissiel/checkbox/checkbox-touch-cleanup into lp:checkbox
- checkbox-touch-cleanup
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Sylvain Pineau |
Approved revision: | 3826 |
Merged at revision: | 3856 |
Proposed branch: | lp:~kissiel/checkbox/checkbox-touch-cleanup |
Merge into: | lp:checkbox |
Diff against target: |
507 lines (+0/-477) 5 files modified
checkbox-touch/components/HelloComponent.qml (+0/-15) checkbox-touch/components/ScreensPreviewPage.qml (+0/-237) checkbox-touch/preview.qml (+0/-65) checkbox-touch/py/checkbox_touch.py (+0/-110) checkbox-touch/tests/unit/tst_hellocomponent.qml (+0/-50) |
To merge this branch: | bzr merge lp:~kissiel/checkbox/checkbox-touch-cleanup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sylvain Pineau (community) | Approve | ||
Zygmunt Krynicki (community) | Approve | ||
Review via email: mp+260582@code.launchpad.net |
Commit message
Description of the change
This MR removes some unused bits from the Checkbox-Touch.
6827eae checkbox-touch: remove FakeCheckboxTou
2d4d959 checkbox-touch: remove HelloComponent
8504c0f checkbox-touch: remove screens preview page
Daniel Manrique (roadmr) wrote : | # |
Attempt to merge into lp:checkbox failed due to conflicts:
text conflict in checkbox-
Maciej Kisielewski (kissiel) wrote : | # |
Self-approving, as the only change after Zygmunt's review was a simple rebase.
Daniel Manrique (roadmr) wrote : | # |
The attempt to merge lp:~kissiel/checkbox/checkbox-touch-cleanup into lp:checkbox failed. Below is the output from the failed tests.
[precise] starting container
[precise] (timing) 0.06user 0.01system 0:05.22elapsed 1%CPU (0avgtext+0avgdata 7848maxresident)k
[precise] (timing) 0inputs+32outputs (0major+
[precise] provisioning container
[precise] (timing) 46.65user 14.74system 1:39.52elapsed 61%CPU (0avgtext+0avgdata 52404maxresident)k
[precise] (timing) 0inputs+
[precise-testing] Starting tests...
Found a test script: ./checkbox-
[precise-testing] container-
[precise-testing] (timing) 28.25user 2.14system 0:30.71elapsed 98%CPU (0avgtext+0avgdata 116644maxresident)k
[precise-testing] (timing) 0inputs+4264outputs (0major+
Found a test script: ./checkbox-
[precise-testing] container-
[precise-testing] (timing) 0.64user 0.14system 0:00.83elapsed 94%CPU (0avgtext+0avgdata 42864maxresident)k
[precise-testing] (timing) 0inputs+1528outputs (0major+
Found a test script: ./checkbox-
[precise-testing] container-
[precise-testing] (timing) 16.97user 0.16system 0:17.61elapsed 97%CPU (0avgtext+0avgdata 84236maxresident)k
[precise-testing] (timing) 0inputs+1312outputs (0major+
Found a test script: ./checkbox-
[precise-testing] container-
[precise-testing] (timing) 0.00user 0.00system 0:00.03elapsed 53%CPU (0avgtext+0avgdata 2044maxresident)k
[precise-testing] (timing) 0inputs+8outputs (0major+
Found a test script: ./plainbox/
[precise-testing] container-
[precise-testing] (timing) 1.34user 0.09system 0:01.47elapsed 97%CPU (0avgtext+0avgdata 49672maxresident)k
[precise-testing] (timing) 0inputs+40outputs (0major+
Found a test script: ./plainbox/
[precise-testing] 001-container-
[precise-testing] (timing) 0.15user 0.03system 0:00.20elapsed 92%CPU (0avgtext+0avgdata 10588maxresident)k
[precise-testing] (timing) 0inputs+88outputs (0major+
Found a test script: ./plainbox/
[precise-testing] container-
[precise-testing] (timing) 32.86user 1.26system 0:34.46elapsed 99%CPU (0avgtext+0avgdata 134856maxresident)k
[precise-testing] (timing) 0inputs+3016outputs (0major+
Found a test script: ./plainbox/
[precise-testing] container-
[precise-testing] (t...
- 3825. By Maciej Kisielewski
-
checkbox-touch: remove HelloComponent
This patch removes boilerplate component that was generated by SDK's wizard.
It's about time :)Signed-off-by: Maciej Kisielewski <email address hidden>
- 3826. By Maciej Kisielewski
-
checkbox-touch: remove screens preview page
This patch removes 'alternative' way of lunching the app, where user could see
individual components. This component - ScreensPreviewPage got stale and no one
used it, so this commit ends its existance.Signed-off-by: Maciej Kisielewski <email address hidden>
Preview Diff
1 | === removed file 'checkbox-touch/components/HelloComponent.qml' | |||
2 | --- checkbox-touch/components/HelloComponent.qml 2014-08-11 12:29:41 +0000 | |||
3 | +++ checkbox-touch/components/HelloComponent.qml 1970-01-01 00:00:00 +0000 | |||
4 | @@ -1,15 +0,0 @@ | |||
5 | 1 | import QtQuick 2.0 | ||
6 | 2 | import Ubuntu.Components 0.1 | ||
7 | 3 | |||
8 | 4 | UbuntuShape { | ||
9 | 5 | width: 200 | ||
10 | 6 | height: width | ||
11 | 7 | |||
12 | 8 | property alias text : myText.text | ||
13 | 9 | |||
14 | 10 | Label { | ||
15 | 11 | id: myText | ||
16 | 12 | anchors.centerIn: parent | ||
17 | 13 | } | ||
18 | 14 | } | ||
19 | 15 | |||
20 | 16 | 0 | ||
21 | === removed file 'checkbox-touch/components/ScreensPreviewPage.qml' | |||
22 | --- checkbox-touch/components/ScreensPreviewPage.qml 2014-09-29 19:18:47 +0000 | |||
23 | +++ checkbox-touch/components/ScreensPreviewPage.qml 1970-01-01 00:00:00 +0000 | |||
24 | @@ -1,237 +0,0 @@ | |||
25 | 1 | /* | ||
26 | 2 | * This file is part of Checkbox | ||
27 | 3 | * | ||
28 | 4 | * Copyright 2014 Canonical Ltd. | ||
29 | 5 | * | ||
30 | 6 | * Authors: | ||
31 | 7 | * - Maciej Kisielewski <maciej.kisielewski@canonical.com> | ||
32 | 8 | * | ||
33 | 9 | * This program is free software; you can redistribute it and/or modify | ||
34 | 10 | * it under the terms of the GNU General Public License as published by | ||
35 | 11 | * the Free Software Foundation; version 3. | ||
36 | 12 | * | ||
37 | 13 | * This program is distributed in the hope that it will be useful, | ||
38 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
39 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
40 | 16 | * GNU General Public License for more details. | ||
41 | 17 | * | ||
42 | 18 | * You should have received a copy of the GNU General Public License | ||
43 | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
44 | 20 | */ | ||
45 | 21 | |||
46 | 22 | import QtQuick 2.0 | ||
47 | 23 | import Ubuntu.Components 1.1 | ||
48 | 24 | import QtQuick.Layouts 1.1 | ||
49 | 25 | |||
50 | 26 | Page { | ||
51 | 27 | id: screensPreviewPage | ||
52 | 28 | title: i18n.tr("Screens preview") | ||
53 | 29 | visible: false | ||
54 | 30 | |||
55 | 31 | Flickable { | ||
56 | 32 | anchors.fill: parent | ||
57 | 33 | contentHeight: column.height | ||
58 | 34 | contentWidth: column.width | ||
59 | 35 | anchors.margins: units.gu(1) | ||
60 | 36 | ColumnLayout { | ||
61 | 37 | id: column | ||
62 | 38 | spacing: units.gu(3) | ||
63 | 39 | Label { | ||
64 | 40 | fontSize: "x-large" | ||
65 | 41 | Layout.alignment: Qt.AlignHCenter | ||
66 | 42 | Layout.fillWidth: true | ||
67 | 43 | wrapMode: Text.WrapAtWordBoundaryOrAnywhere | ||
68 | 44 | text: i18n.tr("This is a developer screen that allows you to preview particular part of the app.\nSelect which screen to preview") | ||
69 | 45 | } | ||
70 | 46 | Button { | ||
71 | 47 | text: i18n.tr("Welcome page") | ||
72 | 48 | onClicked: { | ||
73 | 49 | var newPage = Qt.createComponent(Qt.resolvedUrl("WelcomePage.qml")).createObject(); | ||
74 | 50 | newPage.welcomeText = i18n.tr("This application is under development.\nThere is nothing beyond this screen yet"); | ||
75 | 51 | newPage.startTestingTriggered.connect(function() { pageStack.pop() }) | ||
76 | 52 | pageStack.push(newPage); | ||
77 | 53 | } | ||
78 | 54 | } | ||
79 | 55 | Button { | ||
80 | 56 | text: i18n.tr("Automated test page") | ||
81 | 57 | onClicked: { | ||
82 | 58 | var test = { | ||
83 | 59 | "name": "memory/info", | ||
84 | 60 | "description": "This test checks the amount of memory which is reporting \ | ||
85 | 61 | in meminfo against the size of the memory modules detected by DMI." | ||
86 | 62 | }; | ||
87 | 63 | var newPage = Qt.createComponent(Qt.resolvedUrl("AutomatedTestPage.qml")).createObject(); | ||
88 | 64 | newPage.test = test; | ||
89 | 65 | pageStack.push(newPage); | ||
90 | 66 | } | ||
91 | 67 | } | ||
92 | 68 | Button { | ||
93 | 69 | text: i18n.tr("User-Interact-Verify test page") | ||
94 | 70 | onClicked: { | ||
95 | 71 | var test = { | ||
96 | 72 | "name": "Headphones playback", | ||
97 | 73 | "description": "This test will check that headphones connector works correctly.\n\ | ||
98 | 74 | STEPS:\n\ | ||
99 | 75 | 1. Connect a pair of headphones to your audio device\n\ | ||
100 | 76 | 2. Click the Test button to play a sound to your audio device" | ||
101 | 77 | }; | ||
102 | 78 | var newPage = Qt.createComponent(Qt.resolvedUrl("InteractIntroPage.qml")).createObject(); | ||
103 | 79 | newPage.test = test; | ||
104 | 80 | newPage.testStarted.connect(userInteractVerifyTestStarted); | ||
105 | 81 | newPage.testDone.connect(testDone); | ||
106 | 82 | //Triggering of timer should change the state on intro page | ||
107 | 83 | interactIntroTimer.triggered.connect(newPage.stopActivity) | ||
108 | 84 | pageStack.push(newPage); | ||
109 | 85 | } | ||
110 | 86 | } | ||
111 | 87 | Button { | ||
112 | 88 | objectName: "resumeSessionPageButton" | ||
113 | 89 | text: i18n.tr("Resume session page") | ||
114 | 90 | onClicked: { | ||
115 | 91 | var newPage = Qt.createComponent(Qt.resolvedUrl("ResumeSessionPage.qml")).createObject(); | ||
116 | 92 | newPage.resumeText = "Checkbox did not finish completely.\n\n\ | ||
117 | 93 | Do you want to rerun the last test, continue to the next test, or restart from the beginning?"; | ||
118 | 94 | newPage.rerunLast.connect(function() { | ||
119 | 95 | console.log("Rerun last test selected"); | ||
120 | 96 | replaceOnPageStack(screensPreviewPage); | ||
121 | 97 | }); | ||
122 | 98 | newPage.continueSession.connect(function() { | ||
123 | 99 | console.log("Continue session selected"); | ||
124 | 100 | replaceOnPageStack(screensPreviewPage); | ||
125 | 101 | }); | ||
126 | 102 | newPage.restartSession.connect(function() { | ||
127 | 103 | console.log("Restart session selected"); | ||
128 | 104 | replaceOnPageStack(screensPreviewPage); | ||
129 | 105 | }); | ||
130 | 106 | replaceOnPageStack(newPage); | ||
131 | 107 | } | ||
132 | 108 | } | ||
133 | 109 | Button { | ||
134 | 110 | objectName: "manualIntroPageButton" | ||
135 | 111 | text: i18n.tr("Manual test page") | ||
136 | 112 | onClicked: { | ||
137 | 113 | var test = { | ||
138 | 114 | "name": "Volume Down Key", | ||
139 | 115 | "description": "PURPOSE:\n This test will test the volume down key\n\ | ||
140 | 116 | STEPS:\n 1. Click the volume down key of your phone", | ||
141 | 117 | "verificationDescription": "Did the volume go down when you pressed the volume down key?" | ||
142 | 118 | }; | ||
143 | 119 | |||
144 | 120 | var newPage = Qt.createComponent(Qt.resolvedUrl("ManualIntroPage.qml")).createObject(); | ||
145 | 121 | newPage.testDone.connect(testDone); | ||
146 | 122 | newPage.test = test; | ||
147 | 123 | newPage.continueClicked.connect(function() { | ||
148 | 124 | var verificationPage = Qt.createComponent(Qt.resolvedUrl("TestVerificationPage.qml")).createObject(); | ||
149 | 125 | verificationPage.test = test; | ||
150 | 126 | verificationPage.testDone.connect(testDone); | ||
151 | 127 | pageStack.push(verificationPage); | ||
152 | 128 | }); | ||
153 | 129 | pageStack.push(newPage); | ||
154 | 130 | } | ||
155 | 131 | } | ||
156 | 132 | Row { | ||
157 | 133 | spacing: units.gu(3) | ||
158 | 134 | Button { | ||
159 | 135 | text: i18n.tr("User-Interact test page") | ||
160 | 136 | onClicked: { | ||
161 | 137 | var test = { | ||
162 | 138 | "name": "Finger Expand", | ||
163 | 139 | "description": "PURPOSE:\n Check touchscreen expand gesture for zoom\n\ | ||
164 | 140 | STEPS:\n\ | ||
165 | 141 | 1. Press the Test button\n\ | ||
166 | 142 | 2. Using 2 fingers, resize the blue square until it turns green, then release it." | ||
167 | 143 | }; | ||
168 | 144 | |||
169 | 145 | var newPage = Qt.createComponent(Qt.resolvedUrl("InteractIntroPage.qml")).createObject(); | ||
170 | 146 | newPage.test = test; | ||
171 | 147 | newPage.testDone.connect(testDone); | ||
172 | 148 | newPage.testStarted.connect(userInteractTestStarted); | ||
173 | 149 | interactIntroTimer.triggered.connect(newPage.stopActivity) | ||
174 | 150 | pageStack.push(newPage); | ||
175 | 151 | } | ||
176 | 152 | } | ||
177 | 153 | Label { | ||
178 | 154 | text: "Should pass?" | ||
179 | 155 | } | ||
180 | 156 | |||
181 | 157 | Switch { | ||
182 | 158 | id: userInteractShouldFail | ||
183 | 159 | } | ||
184 | 160 | } | ||
185 | 161 | Button { | ||
186 | 162 | id: verificationPageButton | ||
187 | 163 | text: i18n.tr("Test verification page") | ||
188 | 164 | onClicked: { | ||
189 | 165 | var test = { | ||
190 | 166 | "name": "Headphones playback", | ||
191 | 167 | "verificationDescription": "Did you hear a sound through the headphones and did the sound \ | ||
192 | 168 | play without any distortion, clicks or other strange noises from your headphones?" | ||
193 | 169 | }; | ||
194 | 170 | |||
195 | 171 | interactIntroTimer.triggered.disconnect(verificationPageButton.clicked); | ||
196 | 172 | var newPage = Qt.createComponent(Qt.resolvedUrl("TestVerificationPage.qml")).createObject(); | ||
197 | 173 | newPage.test = test; | ||
198 | 174 | newPage.testDone.connect(testDone); | ||
199 | 175 | pageStack.push(newPage); | ||
200 | 176 | } | ||
201 | 177 | } | ||
202 | 178 | Button { | ||
203 | 179 | text: i18n.tr("Results page") | ||
204 | 180 | onClicked: { | ||
205 | 181 | var newPage = Qt.createComponent(Qt.resolvedUrl("ResultsPage.qml")).createObject(); | ||
206 | 182 | newPage.results = {"totalPassed": 15, "totalFailed": 3, "totalSkipped": 5}; | ||
207 | 183 | pageStack.push(newPage); | ||
208 | 184 | } | ||
209 | 185 | } | ||
210 | 186 | LatchButton { | ||
211 | 187 | objectName: "latchButton" | ||
212 | 188 | text: "Latch button" | ||
213 | 189 | } | ||
214 | 190 | } | ||
215 | 191 | } | ||
216 | 192 | /* | ||
217 | 193 | This timer emulates running test. | ||
218 | 194 | */ | ||
219 | 195 | Timer { | ||
220 | 196 | id: interactIntroTimer | ||
221 | 197 | interval: 2000; running: false; repeat: false | ||
222 | 198 | } | ||
223 | 199 | |||
224 | 200 | function testDone(test) { | ||
225 | 201 | console.log("Test finished with result: " + test["outcome"]); | ||
226 | 202 | unwindStack(); | ||
227 | 203 | } | ||
228 | 204 | |||
229 | 205 | function replaceOnPageStack(newPage) { | ||
230 | 206 | pageStack.pop(); | ||
231 | 207 | pageStack.push(newPage); | ||
232 | 208 | } | ||
233 | 209 | function userInteractVerifyTestStarted() { | ||
234 | 210 | interactIntroTimer.triggered.connect(verificationPageButton.clicked); | ||
235 | 211 | interactIntroTimer.start(); | ||
236 | 212 | } | ||
237 | 213 | function showUserInteractSummaryPage() { | ||
238 | 214 | interactIntroTimer.triggered.disconnect(showUserInteractSummaryPage) | ||
239 | 215 | var newPage = Qt.createComponent(Qt.resolvedUrl("UserInteractSummaryPage.qml")).createObject(); | ||
240 | 216 | var test = { | ||
241 | 217 | "name": "Finger Expand", | ||
242 | 218 | "outcome": (userInteractShouldFail.checked == true) ? "pass" : "fail" | ||
243 | 219 | } | ||
244 | 220 | newPage.test = test | ||
245 | 221 | newPage.testDone.connect(testDone); | ||
246 | 222 | pageStack.push(newPage); | ||
247 | 223 | } | ||
248 | 224 | function userInteractTestStarted() { | ||
249 | 225 | interactIntroTimer.triggered.connect(showUserInteractSummaryPage); | ||
250 | 226 | interactIntroTimer.start(); | ||
251 | 227 | } | ||
252 | 228 | function unwindStack() { | ||
253 | 229 | /* | ||
254 | 230 | This function pops pages of from the stack until we're on screensPreviewPage | ||
255 | 231 | Ordinary pageStack.pop() would'n work as there might be 1 or 2 pages on stack | ||
256 | 232 | */ | ||
257 | 233 | while(pageStack.currentPage!=screensPreviewPage) { | ||
258 | 234 | pageStack.pop(); | ||
259 | 235 | } | ||
260 | 236 | } | ||
261 | 237 | } | ||
262 | 238 | 0 | ||
263 | === removed file 'checkbox-touch/preview.qml' | |||
264 | --- checkbox-touch/preview.qml 2014-12-03 15:05:34 +0000 | |||
265 | +++ checkbox-touch/preview.qml 1970-01-01 00:00:00 +0000 | |||
266 | @@ -1,65 +0,0 @@ | |||
267 | 1 | /* | ||
268 | 2 | * This file is part of Checkbox | ||
269 | 3 | * | ||
270 | 4 | * Copyright 2014 Canonical Ltd. | ||
271 | 5 | * | ||
272 | 6 | * Authors: | ||
273 | 7 | * - Maciej Kisielewski <maciej.kisielewski@canonical.com> | ||
274 | 8 | * | ||
275 | 9 | * This program is free software; you can redistribute it and/or modify | ||
276 | 10 | * it under the terms of the GNU General Public License as published by | ||
277 | 11 | * the Free Software Foundation; version 3. | ||
278 | 12 | * | ||
279 | 13 | * This program is distributed in the hope that it will be useful, | ||
280 | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
281 | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
282 | 16 | * GNU General Public License for more details. | ||
283 | 17 | * | ||
284 | 18 | * You should have received a copy of the GNU General Public License | ||
285 | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
286 | 20 | */ | ||
287 | 21 | import QtQuick 2.0 | ||
288 | 22 | import Ubuntu.Components 1.1 | ||
289 | 23 | import "components" | ||
290 | 24 | |||
291 | 25 | /*! | ||
292 | 26 | \brief MainView with a Label and Button elements. | ||
293 | 27 | */ | ||
294 | 28 | |||
295 | 29 | MainView { | ||
296 | 30 | // objectName for functional testing purposes (autopilot-qt5) | ||
297 | 31 | objectName: "mainView" | ||
298 | 32 | |||
299 | 33 | // Note! applicationName needs to match the "name" field of the click manifest | ||
300 | 34 | applicationName: "com.ubuntu.checkbox" | ||
301 | 35 | |||
302 | 36 | /* | ||
303 | 37 | This property enables the application to change orientation | ||
304 | 38 | when the device is rotated. The default is false. | ||
305 | 39 | */ | ||
306 | 40 | //automaticOrientation: true | ||
307 | 41 | |||
308 | 42 | width: units.gu(100) | ||
309 | 43 | height: units.gu(75) | ||
310 | 44 | |||
311 | 45 | useDeprecatedToolbar: false | ||
312 | 46 | |||
313 | 47 | // High-level object representing the full checkbox testing stack | ||
314 | 48 | CheckboxStack { | ||
315 | 49 | onStackReady: { | ||
316 | 50 | console.log("Pyotherside version " + pyothersideVersion); | ||
317 | 51 | console.log("Python version " + pythonVersion); | ||
318 | 52 | console.log("Plainbox version " + plainboxVersion); | ||
319 | 53 | console.log("Checkbox version " + applicationVersion); | ||
320 | 54 | } | ||
321 | 55 | } | ||
322 | 56 | |||
323 | 57 | PageStack { | ||
324 | 58 | id: pageStack | ||
325 | 59 | objectName: "pageStack" | ||
326 | 60 | Component.onCompleted: { | ||
327 | 61 | var newPage = Qt.createComponent(Qt.resolvedUrl("components/ScreensPreviewPage.qml")).createObject(); | ||
328 | 62 | push(newPage); | ||
329 | 63 | } | ||
330 | 64 | } | ||
331 | 65 | } | ||
332 | 66 | 0 | ||
333 | === modified file 'checkbox-touch/py/checkbox_touch.py' | |||
334 | --- checkbox-touch/py/checkbox_touch.py 2015-05-29 14:45:19 +0000 | |||
335 | +++ checkbox-touch/py/checkbox_touch.py 2015-06-08 08:21:58 +0000 | |||
336 | @@ -136,116 +136,6 @@ | |||
337 | 136 | return b not in a | 136 | return b not in a |
338 | 137 | 137 | ||
339 | 138 | 138 | ||
340 | 139 | class FakeCheckboxTouchApplication(PlainboxApplication): | ||
341 | 140 | |||
342 | 141 | __version__ = (1, 1, 3, 'final', 0) | ||
343 | 142 | |||
344 | 143 | def __init__(self): | ||
345 | 144 | if plainbox.__version__ < (0, 21): | ||
346 | 145 | raise SystemExit("plainbox 0.21 required, you have {}".format( | ||
347 | 146 | ToolBase.format_version_tuple(plainbox.__version__))) | ||
348 | 147 | # adjust_logging(logging.INFO, ['checkbox.touch'], True) | ||
349 | 148 | self.index = 0 | ||
350 | 149 | self.max_tests = 50 | ||
351 | 150 | self.max_categories = 30 | ||
352 | 151 | |||
353 | 152 | def __repr__(self): | ||
354 | 153 | return "fake-app" | ||
355 | 154 | |||
356 | 155 | @view | ||
357 | 156 | def get_version_pair(self): | ||
358 | 157 | return { | ||
359 | 158 | 'plainbox_version': ToolBase.format_version_tuple( | ||
360 | 159 | plainbox.__version__), | ||
361 | 160 | 'application_version': ToolBase.format_version_tuple( | ||
362 | 161 | self.__version__) | ||
363 | 162 | } | ||
364 | 163 | |||
365 | 164 | @view | ||
366 | 165 | def start_session(self): | ||
367 | 166 | return { | ||
368 | 167 | 'session_id': 'fake' | ||
369 | 168 | } | ||
370 | 169 | |||
371 | 170 | @view | ||
372 | 171 | def get_testplans(self): | ||
373 | 172 | return { | ||
374 | 173 | 'testplan_info_list': [{ | ||
375 | 174 | "mod_id": "id-{}".format(i), | ||
376 | 175 | "mod_name": "name-{}".format(i), | ||
377 | 176 | "mod_selected": True, | ||
378 | 177 | } for i in range(self.max_categories)] | ||
379 | 178 | } | ||
380 | 179 | |||
381 | 180 | @view | ||
382 | 181 | def remember_testplan(self): | ||
383 | 182 | pass | ||
384 | 183 | |||
385 | 184 | @view | ||
386 | 185 | def get_categories(self): | ||
387 | 186 | return { | ||
388 | 187 | 'category_info_list': [{ | ||
389 | 188 | "mod_id": "id-{}".format(i), | ||
390 | 189 | "mod_name": "name-{}".format(i), | ||
391 | 190 | "mod_selected": True, | ||
392 | 191 | } for i in range(self.max_categories)] | ||
393 | 192 | } | ||
394 | 193 | |||
395 | 194 | @view | ||
396 | 195 | def remember_categories(self, selected_id_list): | ||
397 | 196 | pass | ||
398 | 197 | |||
399 | 198 | @view | ||
400 | 199 | def get_available_tests(self): | ||
401 | 200 | return { | ||
402 | 201 | 'test_info_list': sorted([ | ||
403 | 202 | { | ||
404 | 203 | "mod_id": "id-{}".format(i), | ||
405 | 204 | "mod_name": "name-{}".format(i), | ||
406 | 205 | "mod_group": "group-{}".format(i % 3), | ||
407 | 206 | "mod_selected": True, | ||
408 | 207 | } for i in range(self.max_tests)], | ||
409 | 208 | key=lambda item: item['mod_group']) | ||
410 | 209 | } | ||
411 | 210 | |||
412 | 211 | @view | ||
413 | 212 | def remember_tests(self, selected_id_list): | ||
414 | 213 | pass | ||
415 | 214 | |||
416 | 215 | @view | ||
417 | 216 | def get_next_test(self): | ||
418 | 217 | if self.index < self.max_tests: | ||
419 | 218 | result = { | ||
420 | 219 | "id": "id-{}".format(self.index), | ||
421 | 220 | "name": 'name-{}'.format(self.index), | ||
422 | 221 | "description": 'description-{}'.format(self.index), | ||
423 | 222 | "verificationDescription": "Verification", | ||
424 | 223 | "plugin": "manual", | ||
425 | 224 | "command": "command" | ||
426 | 225 | } | ||
427 | 226 | self.index += 1 | ||
428 | 227 | return result | ||
429 | 228 | else: | ||
430 | 229 | return {} | ||
431 | 230 | |||
432 | 231 | @view | ||
433 | 232 | def register_test_result(self, test): | ||
434 | 233 | pass | ||
435 | 234 | |||
436 | 235 | @view | ||
437 | 236 | def run_test_activity(self, test): | ||
438 | 237 | test['outcome'] = 'pass' | ||
439 | 238 | return test | ||
440 | 239 | |||
441 | 240 | @view | ||
442 | 241 | def get_results(self): | ||
443 | 242 | return { | ||
444 | 243 | 'totalPassed': 31, | ||
445 | 244 | 'totalFailed': 9, | ||
446 | 245 | 'totalSkipped': 10 | ||
447 | 246 | } | ||
448 | 247 | |||
449 | 248 | |||
450 | 249 | class CheckboxTouchApplication(PlainboxApplication): | 139 | class CheckboxTouchApplication(PlainboxApplication): |
451 | 250 | """ | 140 | """ |
452 | 251 | Class implementing the whole checkbox-touch application logic. | 141 | Class implementing the whole checkbox-touch application logic. |
453 | 252 | 142 | ||
454 | === removed file 'checkbox-touch/tests/unit/tst_hellocomponent.qml' | |||
455 | --- checkbox-touch/tests/unit/tst_hellocomponent.qml 2014-08-11 12:29:41 +0000 | |||
456 | +++ checkbox-touch/tests/unit/tst_hellocomponent.qml 1970-01-01 00:00:00 +0000 | |||
457 | @@ -1,50 +0,0 @@ | |||
458 | 1 | import QtQuick 2.0 | ||
459 | 2 | import QtTest 1.0 | ||
460 | 3 | import Ubuntu.Components 0.1 | ||
461 | 4 | import "../../components" | ||
462 | 5 | |||
463 | 6 | // See more details @ http://qt-project.org/doc/qt-5.0/qtquick/qml-testcase.html | ||
464 | 7 | |||
465 | 8 | // Execute tests with: | ||
466 | 9 | // qmltestrunner | ||
467 | 10 | |||
468 | 11 | Item { | ||
469 | 12 | // The objects | ||
470 | 13 | HelloComponent { | ||
471 | 14 | id: objectUnderTest | ||
472 | 15 | } | ||
473 | 16 | |||
474 | 17 | TestCase { | ||
475 | 18 | name: "HelloComponent" | ||
476 | 19 | |||
477 | 20 | function init() { | ||
478 | 21 | console.debug(">> init"); | ||
479 | 22 | compare("",objectUnderTest.text,"text was not empty on init"); | ||
480 | 23 | console.debug("<< init"); | ||
481 | 24 | } | ||
482 | 25 | |||
483 | 26 | function cleanup() { | ||
484 | 27 | console.debug(">> cleanup"); | ||
485 | 28 | console.debug("<< cleanup"); | ||
486 | 29 | } | ||
487 | 30 | |||
488 | 31 | function initTestCase() { | ||
489 | 32 | console.debug(">> initTestCase"); | ||
490 | 33 | console.debug("<< initTestCase"); | ||
491 | 34 | } | ||
492 | 35 | |||
493 | 36 | function cleanupTestCase() { | ||
494 | 37 | console.debug(">> cleanupTestCase"); | ||
495 | 38 | console.debug("<< cleanupTestCase"); | ||
496 | 39 | } | ||
497 | 40 | |||
498 | 41 | function test_canReadAndWriteText() { | ||
499 | 42 | var expected = "Hello World"; | ||
500 | 43 | |||
501 | 44 | objectUnderTest.text = expected; | ||
502 | 45 | |||
503 | 46 | compare(expected,objectUnderTest.text,"expected did not equal result"); | ||
504 | 47 | } | ||
505 | 48 | } | ||
506 | 49 | } | ||
507 | 50 |
+1, thanks