Merge lp:~canonical-platform-qa/ubuntu-clock-app/xvfb_and_qml_tests into lp:ubuntu-clock-app
- xvfb_and_qml_tests
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~canonical-platform-qa/ubuntu-clock-app/xvfb_and_qml_tests |
Merge into: | lp:ubuntu-clock-app |
Prerequisite: | lp:~canonical-platform-qa/ubuntu-clock-app/whitespaces |
Diff against target: |
287 lines (+85/-29) 11 files modified
CMakeLists.txt (+4/-9) app/alarm/AlarmLabel.qml (+4/-0) app/worldclock/WorldCityList.qml (+2/-1) backend/CMakeLists.txt (+2/-0) debian/changelog (+1/-0) debian/control (+4/-0) debian/rules (+1/-1) tests/CMakeLists.txt (+6/-1) tests/unit/CMakeLists.txt (+38/-0) tests/unit/tst_alarmLabel.qml (+12/-7) tests/unit/tst_alarmRepeat.qml (+11/-10) |
To merge this branch: | bzr merge lp:~canonical-platform-qa/ubuntu-clock-app/xvfb_and_qml_tests |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Needs Fixing | |
Nekhelesh Ramananthan | Pending | ||
Review via email:
|
This proposal supersedes a proposal from 2014-09-12.
This proposal has been superseded by a proposal from 2014-09-23.
Commit message
There is one test that fails, I want to see if Jenkins runs it.
Description of the change
There is one test that fails, I want to see if Jenkins runs it.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal | # |
PASSED: Continuous integration, rev:96
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal | # |
The test fails on my system as well. It is a known failure. I will fix asap. However jenkins at the moment is only configured to run AP tests. You will need to talk to fginther about enabling jenkins to run the qml tests as well.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal | # |
67 -if(NOT CLICK_MODE)
68 - add_subdirector
69 -endif(NOT CLICK_MODE)
I believe this was added in the first place to ensure that the tests folder does not make its way into the clock app click package since the click package doesn't need to also include tests. I see that you added,
102 +add_subdirecto
103 +
104 +if(NOT CLICK_MODE)
105 + add_subdirector
106 +endif(NOT CLICK_MODE)
But doesn't that mean that the units directory is still included in the click package?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Leo Arias (elopio) wrote : Posted in a previous version of this proposal | # |
I built the package with click-buddy, and then:
click contents com.ubuntu.
There doesn't seem to be tst files added to the package. Do you know who added that if originally, to ask him?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:98
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:100
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:100
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:101
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:103
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2014-09-18 15:20:25 +0000 |
3 | +++ CMakeLists.txt 2014-09-23 17:46:57 +0000 |
4 | @@ -17,6 +17,9 @@ |
5 | |
6 | option(INSTALL_TESTS "Install the tests on make install" on) |
7 | option(CLICK_MODE "Build as a click package" on) |
8 | +option(USE_XVFB "Use XVFB to run qml tests" on) |
9 | + |
10 | +enable_testing() |
11 | |
12 | # Standard install paths |
13 | include(GNUInstallDirs) |
14 | @@ -96,21 +99,13 @@ |
15 | add_subdirectory(app) |
16 | add_subdirectory(backend) |
17 | add_subdirectory(po) |
18 | -if(NOT CLICK_MODE) |
19 | - add_subdirectory(tests) |
20 | -endif(NOT CLICK_MODE) |
21 | +add_subdirectory(tests) |
22 | |
23 | add_custom_target("autopilot" chmod +x ${CMAKE_SOURCE_DIR}/tests/autopilot/run |
24 | COMMAND ${CMAKE_SOURCE_DIR}/tests/autopilot/run |
25 | DEPENDS timezone timezone-qmldir alarmsettings alarmsettings-qmldir datetime datetime-qmldir |
26 | WORKING_DIRECTORY ./app) |
27 | |
28 | -enable_testing() |
29 | -add_test(NAME basic |
30 | - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/app |
31 | - COMMAND /usr/bin/qmltestrunner -input ${CMAKE_SOURCE_DIR}/tests/unit -import ${CMAKE_BINARY_DIR}/backend |
32 | -) |
33 | - |
34 | add_custom_target("run" /usr/bin/qmlscene -I ${CMAKE_BINARY_DIR}/backend ${CMAKE_SOURCE_DIR}/app/ubuntu-clock-app.qml |
35 | DEPENDS timezone timezone-qmldir alarmsettings alarmsettings-qmldir datetime datetime-qmldir |
36 | WORKING_DIRECTORY ./app) |
37 | |
38 | === modified file 'app/alarm/AlarmLabel.qml' |
39 | --- app/alarm/AlarmLabel.qml 2014-08-24 12:47:50 +0000 |
40 | +++ app/alarm/AlarmLabel.qml 2014-09-23 17:46:57 +0000 |
41 | @@ -38,6 +38,10 @@ |
42 | } |
43 | } |
44 | |
45 | + Component.onCompleted: { |
46 | + _labelEntry.forceActiveFocus() |
47 | + } |
48 | + |
49 | Column { |
50 | id: _labelColumn |
51 | |
52 | |
53 | === modified file 'app/worldclock/WorldCityList.qml' |
54 | --- app/worldclock/WorldCityList.qml 2014-08-24 12:47:50 +0000 |
55 | +++ app/worldclock/WorldCityList.qml 2014-09-23 17:46:57 +0000 |
56 | @@ -65,6 +65,7 @@ |
57 | iconName: "back" |
58 | text: i18n.tr("Back") |
59 | onTriggered: { |
60 | + cityList.forceActiveFocus() |
61 | searchField.text = "" |
62 | worldCityList.state = "default" |
63 | isOnlineMode = false |
64 | @@ -224,7 +225,7 @@ |
65 | } |
66 | |
67 | onFlickStarted: { |
68 | - Qt.inputMethod.hide() |
69 | + forceActiveFocus() |
70 | } |
71 | |
72 | anchors.fill: parent |
73 | |
74 | === modified file 'backend/CMakeLists.txt' |
75 | --- backend/CMakeLists.txt 2014-08-13 14:38:12 +0000 |
76 | +++ backend/CMakeLists.txt 2014-09-23 17:46:57 +0000 |
77 | @@ -1,3 +1,5 @@ |
78 | +project(backend) |
79 | + |
80 | include_directories( |
81 | ${CMAKE_CURRENT_SOURCE_DIR} |
82 | ) |
83 | |
84 | === modified file 'debian/changelog' |
85 | --- debian/changelog 2014-09-19 21:03:09 +0000 |
86 | +++ debian/changelog 2014-09-23 17:46:57 +0000 |
87 | @@ -33,6 +33,7 @@ |
88 | * Added alarm snooze settings (LP: #1354400) |
89 | * Fixed default alarm label not being translatable (LP: #1365012) |
90 | * Improved multiselect mode behavior and appearance (LP: #1370146) |
91 | + * Automatically focus textfield (LP: #1372089) |
92 | |
93 | [Zsombor Egri] |
94 | * Fixed alarm status toggle being reverted immediately (LP: #1272337) |
95 | |
96 | === modified file 'debian/control' |
97 | --- debian/control 2014-08-19 19:11:35 +0000 |
98 | +++ debian/control 2014-09-23 17:46:57 +0000 |
99 | @@ -7,9 +7,13 @@ |
100 | intltool, |
101 | python3 | python3-all | python3-dev | python3-all-dev, |
102 | python3-minimal, |
103 | + qml-module-qttest, |
104 | qt5-default, |
105 | qtbase5-dev, |
106 | qtdeclarative5-dev, |
107 | + qtdeclarative5-dev-tools, |
108 | + qtdeclarative5-ubuntu-ui-toolkit-plugin, |
109 | + xvfb, |
110 | Standards-Version: 3.9.5 |
111 | Section: misc |
112 | Homepage: https://launchpad.net/ubuntu-clock-app |
113 | |
114 | === modified file 'debian/rules' |
115 | --- debian/rules 2014-08-08 15:57:16 +0000 |
116 | +++ debian/rules 2014-09-23 17:46:57 +0000 |
117 | @@ -11,7 +11,7 @@ |
118 | dh_auto_configure -- -DCLICK_MODE=OFF |
119 | |
120 | override_dh_auto_test: |
121 | - echo |
122 | + CTEST_OUTPUT_ON_FAILURE=1 make -C obj-$(DEB_HOST_GNU_TYPE) test |
123 | |
124 | override_dh_install: |
125 | dh_install --fail-missing |
126 | |
127 | === modified file 'tests/CMakeLists.txt' |
128 | --- tests/CMakeLists.txt 2014-08-08 15:57:16 +0000 |
129 | +++ tests/CMakeLists.txt 2014-09-23 17:46:57 +0000 |
130 | @@ -1,1 +1,6 @@ |
131 | -add_subdirectory(autopilot) |
132 | +add_subdirectory(unit) |
133 | + |
134 | +if(NOT CLICK_MODE) |
135 | + add_subdirectory(autopilot) |
136 | +endif(NOT CLICK_MODE) |
137 | + |
138 | |
139 | === added file 'tests/unit/CMakeLists.txt' |
140 | --- tests/unit/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
141 | +++ tests/unit/CMakeLists.txt 2014-09-23 17:46:57 +0000 |
142 | @@ -0,0 +1,38 @@ |
143 | +find_program(QMLTESTRUNNER_BIN |
144 | + NAMES qmltestrunner |
145 | + PATHS /usr/lib/*/qt5/bin |
146 | + NO_DEFAULT_PATH |
147 | +) |
148 | + |
149 | +find_program(XVFB_RUN_BIN |
150 | + NAMES xvfb-run |
151 | +) |
152 | + |
153 | +macro(DECLARE_QML_TEST TST_NAME TST_QML_FILE) |
154 | + if(USE_XVFB) |
155 | + set(COMMAND_PREFIX ${XVFB_RUN_BIN} -a -s "-screen 0 1024x768x24") |
156 | + else() |
157 | + set(COMMAND_PREFIX "") |
158 | + endif() |
159 | + add_test(NAME ${TST_NAME} |
160 | + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} |
161 | + COMMAND ${COMMAND_PREFIX} ${QMLTESTRUNNER_BIN} -import ${backend_BINARY_DIR} -input ${CMAKE_CURRENT_SOURCE_DIR}/${TST_QML_FILE} |
162 | + ) |
163 | +endmacro() |
164 | + |
165 | +if(QMLTESTRUNNER_BIN AND XVFB_RUN_BIN) |
166 | + declare_qml_test("AlarmLabel" tst_alarmLabel.qml) |
167 | + declare_qml_test("AlarmRepeat" tst_alarmRepeat.qml) |
168 | +else() |
169 | + if (NOT QMLTESTRUNNER_BIN) |
170 | + message(WARNING "Qml tests disabled: qmltestrunner not found") |
171 | + else() |
172 | + message(WARNING "Qml tests disabled: xvfb-run not found") |
173 | + endif() |
174 | +endif() |
175 | + |
176 | +set(QML_TST_FILES |
177 | + tst_alarmLabel.qml |
178 | + tst_alarmRepeat.qml |
179 | +) |
180 | +add_custom_target(tst_QmlFiles ALL SOURCES ${QML_TST_FILES}) |
181 | |
182 | === modified file 'tests/unit/tst_alarmLabel.qml' |
183 | --- tests/unit/tst_alarmLabel.qml 2014-08-13 22:18:55 +0000 |
184 | +++ tests/unit/tst_alarmLabel.qml 2014-09-23 17:46:57 +0000 |
185 | @@ -37,12 +37,6 @@ |
186 | backButton = findChild(header, "customBackButton") |
187 | } |
188 | |
189 | - function cleanup() { |
190 | - clearTextField(alarmLabel) |
191 | - typeString("Alarm") |
192 | - alarmLabelPage.alarm.message = "Alarm" |
193 | - } |
194 | - |
195 | function clearTextField(textfield) { |
196 | // Get textfield focus by clicking once |
197 | mouseClick(textfield, textfield.width - units.gu(2), textfield.height/2) |
198 | @@ -51,6 +45,14 @@ |
199 | mouseClick(textfield, textfield.width - units.gu(2), textfield.height/2) |
200 | } |
201 | |
202 | + /* |
203 | + Test to check if the alarm label has focus true by default to ensure |
204 | + that the OSK is shown when the opens the alarm label page. |
205 | + */ |
206 | + function test_01_alarmLabelHasFocus() { |
207 | + compare(alarmLabel.focus, true, "Alarm Label does not have focus by default") |
208 | + } |
209 | + |
210 | function test_backButtonEnabled_data() { |
211 | return [ |
212 | {tag: "EmptyAlarmLabel", string: "", enableStatus: false}, |
213 | @@ -72,6 +74,8 @@ |
214 | |
215 | compare(alarmLabel.text, data.string, "Alarm label is not what was type in the textfield") |
216 | compare(backButton.enabled, data.enableStatus, "Back Button enable status is not as expected") |
217 | + |
218 | + alarmLabel.text = _alarm.message |
219 | } |
220 | |
221 | /* |
222 | @@ -79,8 +83,9 @@ |
223 | when the page is loaded. |
224 | */ |
225 | function test_alarmLabelIsSameAsAlarmMessage() { |
226 | - alarmLabelPage.alarm.message = "Random Alarm Label" |
227 | + _alarm.message = "Random Alarm Label" |
228 | compare(alarmLabel.text, "Random Alarm Label", "Alarm label set is not the same as alarm message") |
229 | + _alarm.reset() |
230 | } |
231 | } |
232 | } |
233 | |
234 | === modified file 'tests/unit/tst_alarmRepeat.qml' |
235 | --- tests/unit/tst_alarmRepeat.qml 2014-09-02 20:56:44 +0000 |
236 | +++ tests/unit/tst_alarmRepeat.qml 2014-09-23 17:46:57 +0000 |
237 | @@ -44,6 +44,7 @@ |
238 | function init() { |
239 | alarmRepeatPageLoader.sourceComponent = alarmRepeatPage |
240 | alarmRepeatPageLoader.item.visible = true |
241 | + spy.target = alarmRepeatPageLoader.item.Component |
242 | header = findChild(mainView, "MainView_Header") |
243 | backButton = findChild(header, "customBackButton") |
244 | repeater = findChild(alarmRepeatPageLoader.item, "alarmDays") |
245 | @@ -51,8 +52,17 @@ |
246 | |
247 | function cleanup() { |
248 | alarmRepeatPageLoader.sourceComponent = undefined |
249 | + spy.wait() |
250 | + tryCompare(spy, "count", 1) |
251 | _alarm.reset() |
252 | tryCompare(_alarm, "status", Alarm.Ready) |
253 | + spy.clear() |
254 | + spy.target = undefined |
255 | + } |
256 | + |
257 | + SignalSpy { |
258 | + id: spy |
259 | + signalName: "destruction" |
260 | } |
261 | |
262 | /* |
263 | @@ -60,7 +70,7 @@ |
264 | default an alarm is an one-time alarm and in the repeat page none of |
265 | the days must be checked |
266 | */ |
267 | - function test_allSwitchesAreUncheckedByDefault() { |
268 | + function test_01_allSwitchesAreUncheckedByDefault() { |
269 | waitForRendering(alarmRepeatPageLoader.item); |
270 | |
271 | tryCompare(_alarm, "daysOfWeek", 0, 3000, "Alarm days of weeks is not 0 by default") |
272 | @@ -82,15 +92,6 @@ |
273 | function test_alarmTypeSwitch() { |
274 | waitForRendering(alarmRepeatPageLoader.item); |
275 | |
276 | - // TEST FAILS HERE // |
277 | - // Alarm should be one-time by default. By the test before this |
278 | - // changed the value and the alarm.reset() in the cleanup doesn't |
279 | - // seem to do its job. |
280 | - |
281 | - // test_alarmObjectSetsSwitchStatus() is run before this test. And in |
282 | - // that test I set the alarm type to repeating. However the cleanup |
283 | - // should reset back to one-time when calling the alarm.reset() function. |
284 | - |
285 | tryCompare(_alarm, "type", Alarm.OneTime, 3000, "Alarm type is not OneTime by default") |
286 | |
287 | var dayListItem = findChild(alarmRepeatPageLoader.item, "alarmDay"+3) |
FAILED: Continuous integration, rev:96 /code.launchpad .net/~canonical -platform- qa/ubuntu- clock-app/ xvfb_and_ qml_tests/ +merge/ 234421/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http:// 91.189. 93.70:8080/ job/ubuntu- clock-app- ci/457/ 91.189. 93.70:8080/ job/generic- mediumtests- utopic- python3/ 303 91.189. 93.70:8080/ job/generic- mediumtests- utopic- python3/ 303/artifact/ work/output/ *zip*/output. zip 91.189. 93.70:8080/ job/ubuntu- clock-app- utopic- amd64-ci/ 104
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- clock-app- ci/457/ rebuild
http://