Merge lp:~vrruiz/cordova-ubuntu-tests/ap-better-reporting into lp:cordova-ubuntu-tests

Proposed by Víctor R. Ruiz
Status: Merged
Approved by: Robert Bruce Park
Approved revision: 29
Merged at revision: 25
Proposed branch: lp:~vrruiz/cordova-ubuntu-tests/ap-better-reporting
Merge into: lp:cordova-ubuntu-tests
Diff against target: 806 lines (+159/-91)
26 files modified
tests/autopilot/cordova_ubuntu/tests/__init__.py (+30/-12)
tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py (+37/-26)
tests/autopilot/tools/qml/main-local.qml (+1/-1)
www/autotest/html/JUnitXmlReporter.js (+5/-5)
www/autotest/pages/accelerometer.html (+2/-2)
www/autotest/pages/all.html (+3/-3)
www/autotest/pages/battery.html (+2/-2)
www/autotest/pages/bridge.html (+2/-2)
www/autotest/pages/camera.html (+2/-2)
www/autotest/pages/capture.html (+2/-2)
www/autotest/pages/compass.html (+2/-2)
www/autotest/pages/contacts.html (+2/-2)
www/autotest/pages/datauri.html (+2/-2)
www/autotest/pages/device.html (+2/-2)
www/autotest/pages/file.html (+4/-4)
www/autotest/pages/filetransfer.html (+4/-4)
www/autotest/pages/geolocation.html (+2/-2)
www/autotest/pages/globalization.html (+2/-2)
www/autotest/pages/media.html (+2/-2)
www/autotest/pages/network.html (+2/-2)
www/autotest/pages/notification.html (+2/-2)
www/autotest/pages/platform.html (+2/-2)
www/autotest/pages/splashscreen.html (+2/-2)
www/autotest/pages/storage.html (+2/-2)
www/autotest/pages/whitelist.html (+2/-2)
www/autotest/test-runner.js (+39/-0)
To merge this branch: bzr merge lp:~vrruiz/cordova-ubuntu-tests/ap-better-reporting
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Robert Bruce Park (community) Approve
Review via email: mp+191177@code.launchpad.net

Commit message

Skip unsupported API tests.

Description of the change

Skip unsupported API tests.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Bruce Park (robru) wrote :

What is the purpose of get_www_dir_path? Unlike get_{cordova_container,persistent}_path, it returns the same value regardless of what happens in the if statement, making it useless. Do you intend to do something about the www dir not existing? It should be guaranteed to exist due to the dependencies of the deb package. Please drop that function and reference self.WWW_DIR_PATH wherever you would call self.get_www_dir_path() from.

review: Needs Fixing
Revision history for this message
Víctor R. Ruiz (vrruiz) wrote :

Robert: To be able to run the tests on the development branch, wherever the developer is working.

Revision history for this message
Víctor R. Ruiz (vrruiz) wrote :

Robert: Ok, checked carefully and that method is not used anymore. Removed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Robert Bruce Park (robru) wrote :

Thanks Victor! Looks good now ;-)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/cordova_ubuntu/tests/__init__.py'
2--- tests/autopilot/cordova_ubuntu/tests/__init__.py 2013-10-08 22:08:37 +0000
3+++ tests/autopilot/cordova_ubuntu/tests/__init__.py 2013-10-16 17:03:33 +0000
4@@ -11,6 +11,7 @@
5 import os.path
6 import subprocess
7
8+from xml.dom import minidom
9 from testtools.matchers import Contains, Equals
10
11 from autopilot.input import Mouse, Touch, Pointer
12@@ -27,22 +28,19 @@
13 "-qDEB_HOST_MULTIARCH"]).strip()
14 QML_LAUNCHER = "/usr/lib/" + arch + "/qt5/bin/qmlscene"
15
16- # TODO: fix version
17- # mobile_spec_path = '/usr/share/cordova-ubuntu-tests/www/'
18- LOCAL_WWW_DIR_PATH = os.path.abspath("%s/%s" % (os.path.dirname(os.path.realpath(__file__)),
19- '../../../www/'))
20- WWW_DIR_PATH = '/usr/share/cordova-ubuntu-tests/cordovamobilespec/www/'
21-
22- def get_www_dir_path(self):
23- if os.path.exists(self.WWW_DIR_PATH):
24- return self.WWW_DIR_PATH
25- return self.WWW_DIR_PATH
26+ PERSISTENT_PATH= os.path.join(os.environ['HOME'], '.local/share/cordova-ubuntu/persistent/L3Vzci9zaGFyZS9jb3Jkb3ZhLXVidW50dS10ZXN0cy9jb3Jkb3ZhbW9iaWxlc3BlYy93d3c=/')
27+ LOCAL_PERSISTENT_PATH= os.path.join(os.environ['HOME'], '.local/share/cordova-ubuntu/persistent/L2hvbWUvdnJydWl6L3dlYmFwcHMvbHAvY29yZG92YS11YnVudHUtdGVzdHMvd3d3')
28
29 def get_cordova_container_path(self):
30- if os.path.exists(self.LOCAL_CORDOVA_CONTAINER_PATH):
31+ if (os.path.exists(self.LOCAL_CORDOVA_CONTAINER_PATH)):
32 return self.LOCAL_CORDOVA_CONTAINER_PATH
33 return self.INSTALLED_CORDOVA_CONTAINER_PATH
34
35+ def get_persistent_path(self):
36+ if (os.path.exists(self.LOCAL_CORDOVA_CONTAINER_PATH)):
37+ return self.LOCAL_PERSISTENT_PATH
38+ return self.PERSISTENT_PATH
39+
40 def setUp(self):
41 params = [self.QML_LAUNCHER, self.get_cordova_container_path()]
42 if (model() <> 'Desktop'):
43@@ -50,13 +48,14 @@
44 self.app = self.launch_test_application(
45 *params,
46 app_type='qt')
47+ print params
48 super(CordovaUbuntuTestCase, self).setUp()
49
50 def tearDown(self):
51 super(CordovaUbuntuTestCase, self).tearDown()
52
53 def pick_app_launcher(self, app_path):
54- # force Qt app introspection
55+ """ Force Qt app introspection """
56 from autopilot.introspection.qt import QtApplicationLauncher
57 return QtApplicationLauncher()
58
59@@ -66,3 +65,22 @@
60 def get_webview(self):
61 return self.app.select_single(objectName="webView")
62
63+ def get_junitxml_path(self, junitxml_filename):
64+ """ Return the absolute path of a JUnit XML file """
65+ return os.path.join(self.get_persistent_path(), junitxml_filename)
66+
67+ def junitxml_remove(self, junitxml_filename):
68+ """ Remove, if exists the JUnit XML file """
69+ file_path = self.get_junitxml_path(junitxml_filename)
70+ if (os.path.exists(file_path)):
71+ os.unlink(file_path)
72+
73+ def assert_junitxml_failures(self, junitxml_filename):
74+ """ Open a JUnit XML file and search errors """
75+ file_path = self.get_junitxml_path(junitxml_filename)
76+ self.assertThat(os.path.exists(file_path), Equals(True))
77+ xml = minidom.parse(file_path)
78+ testsuites = xml.getElementsByTagName('testsuite')
79+ for testsuite in testsuites:
80+ failures = testsuite.attributes['failures']
81+ self.assertThat(failures.value, Equals('0'))
82
83=== modified file 'tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py'
84--- tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py 2013-10-15 17:07:38 +0000
85+++ tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py 2013-10-16 17:03:33 +0000
86@@ -12,6 +12,7 @@
87
88 from testtools.matchers import Equals
89 from autopilot.matchers import Eventually
90+from unittest import skip
91
92 from cordova_ubuntu.tests import CordovaUbuntuTestCase
93 from unittest import skipIf
94@@ -27,20 +28,23 @@
95 ARCH = subprocess.check_output('uname -p', shell=True).lower()
96 TIMEOUT = 120
97
98-
99 class TestMobileSpec(CordovaUbuntuTestCase):
100
101- def run_mobilespec(self, test_page='all'):
102+ def run_mobilespec(self, test_page='all', junitxml_file=''):
103+ """ Executes Cordova to run a Mobile Spec Suite's automated test """
104+ sleep(1)
105+ if (junitxml_file):
106+ self.junitxml_remove(junitxml_file)
107 web_view = self.get_webview()
108 self.assertThat(web_view.loadProgress, Eventually(Equals(100)))
109 # Click on "Automated tests" (index.html)
110- web_view.slots.evalInPageUnsafe('document.getElementById("__automated").click();');
111+ web_view.slots.evalInPageUnsafe('document.getElementById("__automated").click();')
112 self.assertThat(web_view.loadProgress, Eventually(Equals(100)))
113 # Click on test (autotest/index.html)
114- web_view.slots.evalInPageUnsafe('document.evaluate(\'//a[contains(@href, "%s.html")]\', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();' % test_page);
115+ web_view.slots.evalInPageUnsafe('document.evaluate(\'//a[contains(@href, "%s.html")]\', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();' % test_page)
116 self.assertThat(web_view.loadProgress, Eventually(Equals(100)))
117 # Wait until finished (autotest/pages/all.html)
118- web_view.slots.evalInPageUnsafe("document.addEventListener('junitxml-finished', function (e) { setTimeout(navigator.app.closeApp, 1000); }, false);");
119+ web_view.slots.evalInPageUnsafe("document.addEventListener('junitxml-finished', function (e) { setTimeout(navigator.app.closeApp, 1000); }, false);")
120 # Detect window closed
121 signal.signal(signal.SIGALRM, alarm_handler)
122 signal.alarm(TIMEOUT) # Setup timeout
123@@ -48,9 +52,10 @@
124 try:
125 while (self.app.process.poll() is None):
126 # Process still running, sleep a bit
127- sleep(1)
128 signal.alarm(0)
129 finished = True
130+ if (junitxml_file):
131+ self.assert_junitxml_failures(junitxml_file)
132 except Alarm:
133 # Timeout reached
134 pass
135@@ -58,67 +63,73 @@
136
137 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
138 def test_accelerometer(self):
139- self.run_mobilespec('accelerometer');
140+ self.run_mobilespec('accelerometer', 'TEST-Accelerometernavigatoraccelerometer.xml')
141
142+ @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
143 def test_battery(self):
144- self.run_mobilespec('battery');
145+ self.run_mobilespec('battery', 'TEST-Batterynavigatorbattery.xml')
146
147 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
148 def test_camera(self):
149- self.run_mobilespec('camera');
150+ self.run_mobilespec('camera', 'TEST-CameraConstantswindowCameranavigatorcamera.xml')
151
152 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
153 def test_capture(self):
154- self.run_mobilespec('capture');
155+ self.run_mobilespec('capture', 'TEST-Capturenavigatordevicecapture.xml')
156
157 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
158 def test_compass(self):
159- self.run_mobilespec('compass');
160+ self.run_mobilespec('compass', 'TEST-Compassnavigatorcompass.xml')
161
162 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
163 def test_contacts(self):
164- self.run_mobilespec('contacts');
165+ self.run_mobilespec('contacts', 'TEST-Contactsnavigatorcontacts.xml')
166
167 def test_datauri(self):
168- self.run_mobilespec('datauri');
169+ self.run_mobilespec('datauri', 'TEST-datauris.xml')
170
171 def test_device(self):
172- self.run_mobilespec('device');
173+ self.run_mobilespec('device', 'TEST-DeviceInformationwindowdevice.xml')
174
175 def test_file(self):
176- self.run_mobilespec('file');
177+ self.run_mobilespec('file', 'TEST-FileAPI.xml')
178
179+ @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
180 def test_filetransfer(self):
181- self.run_mobilespec('filetransfer');
182+ self.run_mobilespec('filetransfer', 'TEST-FileTransfer.xml')
183
184 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
185 def test_geolocation(self):
186- self.run_mobilespec('geolocation');
187+ self.run_mobilespec('geolocation', 'TEST-Geolocationnavigatorgeolocation.xml')
188
189+ @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
190 def test_globalization(self):
191- self.run_mobilespec('globalization');
192+ self.run_mobilespec('globalization', 'TEST-Globalizationnavigatorglobalization.xml')
193
194 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
195 def test_media(self):
196- self.run_mobilespec('media');
197+ self.run_mobilespec('media', 'TEST-Media.xml')
198
199 def test_network(self):
200- self.run_mobilespec('network');
201+ self.run_mobilespec('network', 'TEST-Networknavigatorconnection.xml')
202
203 def test_notification(self):
204- self.run_mobilespec('notification');
205+ self.run_mobilespec('notification', 'TEST-Notificationnavigatornotification.xml')
206
207 def test_platform(self):
208- self.run_mobilespec('platform');
209+ self.run_mobilespec('platform', 'TEST-Platformcordova.xml')
210
211 def test_storage(self):
212- self.run_mobilespec('storage');
213+ self.run_mobilespec('storage', 'TEST-SessionStorage.xml')
214
215+ @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
216 def test_bridge(self):
217- self.run_mobilespec('bridge');
218+ self.run_mobilespec('bridge', 'TEST-bridge.xml')
219
220 def test_splashscreen(self):
221- self.run_mobilespec('splashscreen');
222+ self.run_mobilespec('splashscreen', 'TEST-Splashscreencordova.xml')
223
224+ @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
225 def test_whitelist(self):
226- self.run_mobilespec('whitelist');
227+ self.run_mobilespec('whitelist', 'TEST-whitelist.xml')
228+
229
230=== modified file 'tests/autopilot/tools/qml/main-local.qml'
231--- tests/autopilot/tools/qml/main-local.qml 2013-08-28 15:28:22 +0000
232+++ tests/autopilot/tools/qml/main-local.qml 2013-10-16 17:03:33 +0000
233@@ -8,6 +8,6 @@
234 width: 640
235 height: 640
236
237- wwwDir: '../www/'
238+ wwwDir: '../../www/'
239
240 }
241
242=== modified file 'www/autotest/html/JUnitXmlReporter.js'
243--- www/autotest/html/JUnitXmlReporter.js 2013-08-23 18:00:28 +0000
244+++ www/autotest/html/JUnitXmlReporter.js 2013-10-16 17:03:33 +0000
245@@ -165,11 +165,11 @@
246 }
247 // When all done, make it known on JUnitXmlReporter
248 JUnitXmlReporter.finished_at = (new Date()).getTime();
249- // FIXME 1: closeApp should be elsewhere?
250- // FIXME 2: Avoid using setTimeout. Waits until all files have been written
251- var event = new Event('junitxml-finished');
252- document.dispatchEvent(event);
253- // setTimeout(navigator.app.closeApp, 1000); // Close app
254+ // FIXME: Avoid using setTimeout. Waits until all files have been written
255+ setTimeout(function() {
256+ var event = new Event('junitxml-finished');
257+ document.dispatchEvent(event);
258+ }, 1000);
259 },
260
261 getNestedOutput: function(suite) {
262
263=== modified file 'www/autotest/pages/accelerometer.html'
264--- www/autotest/pages/accelerometer.html 2013-10-10 20:38:16 +0000
265+++ www/autotest/pages/accelerometer.html 2013-10-16 17:03:33 +0000
266@@ -47,7 +47,7 @@
267 <!-- Tests -->
268 <script type="text/javascript" src="../tests/accelerometer.tests.js"></script>
269
270- <script type="text/javascript">
271+ <!-- script type="text/javascript">
272 document.addEventListener('deviceready', function () {
273 var jasmineEnv = jasmine.getEnv();
274 jasmineEnv.updateInterval = 1000;
275@@ -65,7 +65,7 @@
276 jasmineEnv.execute();
277 }, false);
278 </script>
279-</head>
280+</head -->
281
282 <body>
283 <a href="javascript:" class="backBtn" onclick="backHome();">Back</a>
284
285=== modified file 'www/autotest/pages/all.html'
286--- www/autotest/pages/all.html 2013-08-23 17:50:24 +0000
287+++ www/autotest/pages/all.html 2013-10-16 17:03:33 +0000
288@@ -56,7 +56,7 @@
289 <script type="text/javascript" src="../tests/file.tests.js"></script>
290 <script type="text/javascript" src="../tests/filetransfer.tests.js"></script>
291 <script type="text/javascript" src="../tests/geolocation.tests.js"></script>
292- <!-- script type="text/javascript" src="../tests/globalization.tests.js"></script -->
293+ <script type="text/javascript" src="../tests/globalization.tests.js"></script>
294 <script type="text/javascript" src="../tests/media.tests.js"></script>
295 <script type="text/javascript" src="../tests/network.tests.js"></script>
296 <script type="text/javascript" src="../tests/notification.tests.js"></script>
297@@ -64,7 +64,7 @@
298 <script type="text/javascript" src="../tests/storage.tests.js"></script>
299 <script type="text/javascript" src="../tests/splashscreen.tests.js"></script>
300
301- <script type="text/javascript">
302+ <!-- script type="text/javascript">
303 var root, temp_root, persistent_root;
304
305 document.addEventListener('deviceready', function () {
306@@ -102,7 +102,7 @@
307 temp_root = fileSystem.root; // set in file.tests.js
308 }, onError);
309 }, false);
310- </script>
311+ </script -->
312 </head>
313
314 <body>
315
316=== modified file 'www/autotest/pages/battery.html'
317--- www/autotest/pages/battery.html 2013-10-10 20:38:16 +0000
318+++ www/autotest/pages/battery.html 2013-10-16 17:03:33 +0000
319@@ -43,7 +43,7 @@
320
321 <!-- Tests -->
322 <script type="text/javascript" src="../tests/battery.tests.js"></script>
323- <script type="text/javascript">
324+ <!-- script type="text/javascript">
325 document.addEventListener('deviceready', function () {
326 var jasmineEnv = jasmine.getEnv();
327 jasmineEnv.updateInterval = 1000;
328@@ -60,7 +60,7 @@
329
330 jasmineEnv.execute();
331 }, false);
332- </script>
333+ </script -->
334 </head>
335
336 <body>
337
338=== modified file 'www/autotest/pages/bridge.html'
339--- www/autotest/pages/bridge.html 2013-10-10 20:38:16 +0000
340+++ www/autotest/pages/bridge.html 2013-10-16 17:03:33 +0000
341@@ -47,7 +47,7 @@
342 <!-- Tests -->
343 <script type="text/javascript" src="../tests/bridge.tests.js"></script>
344
345- <script type="text/javascript">
346+ <!-- script type="text/javascript">
347 document.addEventListener('deviceready', function () {
348 var jasmineEnv = jasmine.getEnv();
349 jasmineEnv.updateInterval = 1000;
350@@ -64,7 +64,7 @@
351
352 jasmineEnv.execute();
353 }, false);
354- </script>
355+ </script -->
356 </head>
357
358 <body>
359
360=== modified file 'www/autotest/pages/camera.html'
361--- www/autotest/pages/camera.html 2013-10-10 20:38:16 +0000
362+++ www/autotest/pages/camera.html 2013-10-16 17:03:33 +0000
363@@ -48,7 +48,7 @@
364 <!-- Tests -->
365 <script type="text/javascript" src="../tests/camera.tests.js"></script>
366
367- <script type="text/javascript">
368+ <!-- script type="text/javascript">
369 document.addEventListener('deviceready', function () {
370 var jasmineEnv = jasmine.getEnv();
371 jasmineEnv.updateInterval = 1000;
372@@ -65,7 +65,7 @@
373
374 jasmineEnv.execute();
375 }, false);
376- </script>
377+ </script -->
378 </head>
379
380 <body>
381
382=== modified file 'www/autotest/pages/capture.html'
383--- www/autotest/pages/capture.html 2013-10-10 20:38:16 +0000
384+++ www/autotest/pages/capture.html 2013-10-16 17:03:33 +0000
385@@ -47,7 +47,7 @@
386 <!-- Tests -->
387 <script type="text/javascript" src="../tests/capture.tests.js"></script>
388
389- <script type="text/javascript">
390+ <!-- script type="text/javascript">
391 document.addEventListener('deviceready', function () {
392 var jasmineEnv = jasmine.getEnv();
393 jasmineEnv.updateInterval = 1000;
394@@ -64,7 +64,7 @@
395
396 jasmineEnv.execute();
397 }, false);
398- </script>
399+ </script -->
400 </head>
401
402 <body>
403
404=== modified file 'www/autotest/pages/compass.html'
405--- www/autotest/pages/compass.html 2013-10-10 20:38:16 +0000
406+++ www/autotest/pages/compass.html 2013-10-16 17:03:33 +0000
407@@ -47,7 +47,7 @@
408 <!-- Tests -->
409 <script type="text/javascript" src="../tests/compass.tests.js"></script>
410
411- <script type="text/javascript">
412+ <!-- script type="text/javascript">
413 document.addEventListener('deviceready', function () {
414 var jasmineEnv = jasmine.getEnv();
415 jasmineEnv.updateInterval = 1000;
416@@ -64,7 +64,7 @@
417
418 jasmineEnv.execute();
419 }, false);
420- </script>
421+ </script -->
422 </head>
423
424 <body>
425
426=== modified file 'www/autotest/pages/contacts.html'
427--- www/autotest/pages/contacts.html 2013-10-10 20:38:16 +0000
428+++ www/autotest/pages/contacts.html 2013-10-16 17:03:33 +0000
429@@ -47,7 +47,7 @@
430 <!-- Tests -->
431 <script type="text/javascript" src="../tests/contacts.tests.js"></script>
432
433- <script type="text/javascript">
434+ <!-- script type="text/javascript">
435 document.addEventListener('deviceready', function () {
436 var jasmineEnv = jasmine.getEnv();
437 jasmineEnv.updateInterval = 1000;
438@@ -64,7 +64,7 @@
439
440 jasmineEnv.execute();
441 }, false);
442- </script>
443+ </script -->
444 </head>
445
446 <body>
447
448=== modified file 'www/autotest/pages/datauri.html'
449--- www/autotest/pages/datauri.html 2013-10-10 20:38:16 +0000
450+++ www/autotest/pages/datauri.html 2013-10-16 17:03:33 +0000
451@@ -45,7 +45,7 @@
452 <!-- Tests -->
453 <script type="text/javascript" src="../tests/datauri.tests.js"></script>
454
455- <script type="text/javascript">
456+ <!-- script type="text/javascript">
457 document.addEventListener('deviceready', function () {
458 var jasmineEnv = jasmine.getEnv();
459 jasmineEnv.updateInterval = 1000;
460@@ -62,7 +62,7 @@
461
462 jasmineEnv.execute();
463 }, false);
464- </script>
465+ </script -->
466 </head>
467
468 <body>
469
470=== modified file 'www/autotest/pages/device.html'
471--- www/autotest/pages/device.html 2013-10-10 20:38:16 +0000
472+++ www/autotest/pages/device.html 2013-10-16 17:03:33 +0000
473@@ -47,7 +47,7 @@
474 <!-- Tests -->
475 <script type="text/javascript" src="../tests/device.tests.js"></script>
476
477- <script type="text/javascript">
478+ <!-- script type="text/javascript">
479 document.addEventListener('deviceready', function () {
480 var jasmineEnv = jasmine.getEnv();
481 jasmineEnv.updateInterval = 1000;
482@@ -64,7 +64,7 @@
483
484 jasmineEnv.execute();
485 }, false);
486- </script>
487+ </script -->
488 </head>
489
490 <body>
491
492=== modified file 'www/autotest/pages/file.html'
493--- www/autotest/pages/file.html 2013-10-10 20:38:16 +0000
494+++ www/autotest/pages/file.html 2013-10-16 17:03:33 +0000
495@@ -46,7 +46,7 @@
496 <!-- Tests -->
497 <script type="text/javascript" src="../tests/file.tests.js"></script>
498
499- <script type="text/javascript">
500+ <!-- script type="text/javascript">
501 var root, temp_root, persistent_root;
502
503 document.addEventListener('deviceready', function () {
504@@ -67,10 +67,10 @@
505 jasmineEnv.updateInterval = 1000;
506
507 var htmlReporter = new jasmine.HtmlReporter();
508- var jUnitXmlReporter = new jasmine.JUnitXmlReporter();
509+ var jUnitXmlReporter = new jasmine.JUnitXmlReporter();
510
511 jasmineEnv.addReporter(htmlReporter);
512- jasmineEnv.addReporter(jUnitXmlReporter);
513+ jasmineEnv.addReporter(jUnitXmlReporter);
514
515 jasmineEnv.specFilter = function(spec) {
516 return htmlReporter.specFilter(spec);
517@@ -84,7 +84,7 @@
518 temp_root = fileSystem.root; // set in file.tests.js
519 }, onError);
520 }, false);
521- </script>
522+ </script -->
523 </head>
524
525 <body>
526
527=== modified file 'www/autotest/pages/filetransfer.html'
528--- www/autotest/pages/filetransfer.html 2013-10-10 20:38:16 +0000
529+++ www/autotest/pages/filetransfer.html 2013-10-16 17:03:33 +0000
530@@ -46,7 +46,7 @@
531 <!-- Tests -->
532 <script type="text/javascript" src="../tests/filetransfer.tests.js"></script>
533
534- <script type="text/javascript">
535+ <!-- script type="text/javascript">
536 var root, temp_root, persistent_root;
537
538 document.addEventListener('deviceready', function () {
539@@ -67,10 +67,10 @@
540 jasmineEnv.updateInterval = 1000;
541
542 var htmlReporter = new jasmine.HtmlReporter();
543- var jUnitXmlReporter = new jasmine.JUnitXmlReporter();
544+ var jUnitXmlReporter = new jasmine.JUnitXmlReporter();
545
546 jasmineEnv.addReporter(htmlReporter);
547- jasmineEnv.addReporter(jUnitXmlReporter);
548+ jasmineEnv.addReporter(jUnitXmlReporter);
549
550 jasmineEnv.specFilter = function(spec) {
551 return htmlReporter.specFilter(spec);
552@@ -84,7 +84,7 @@
553 temp_root = fileSystem.root; // set in file.tests.js
554 }, onError);
555 }, false);
556- </script>
557+ </script -->
558 </head>
559
560 <body>
561
562=== modified file 'www/autotest/pages/geolocation.html'
563--- www/autotest/pages/geolocation.html 2013-10-10 20:38:16 +0000
564+++ www/autotest/pages/geolocation.html 2013-10-16 17:03:33 +0000
565@@ -47,7 +47,7 @@
566 <!-- Tests -->
567 <script type="text/javascript" src="../tests/geolocation.tests.js"></script>
568
569- <script type="text/javascript">
570+ <!-- script type="text/javascript">
571 document.addEventListener('deviceready', function () {
572 var jasmineEnv = jasmine.getEnv();
573 jasmineEnv.updateInterval = 1000;
574@@ -64,7 +64,7 @@
575
576 jasmineEnv.execute();
577 }, false);
578- </script>
579+ </script -->
580 </head>
581
582 <body>
583
584=== modified file 'www/autotest/pages/globalization.html'
585--- www/autotest/pages/globalization.html 2013-10-10 20:38:16 +0000
586+++ www/autotest/pages/globalization.html 2013-10-16 17:03:33 +0000
587@@ -47,7 +47,7 @@
588 <!-- Tests -->
589 <script type="text/javascript" src="../tests/globalization.tests.js"></script>
590
591- <script type="text/javascript">
592+ <!-- script type="text/javascript">
593 document.addEventListener('deviceready', function () {
594 var jasmineEnv = jasmine.getEnv();
595 jasmineEnv.updateInterval = 1000;
596@@ -64,7 +64,7 @@
597
598 jasmineEnv.execute();
599 }, false);
600- </script>
601+ </script -->
602 </head>
603
604 <body>
605
606=== modified file 'www/autotest/pages/media.html'
607--- www/autotest/pages/media.html 2013-10-10 20:38:16 +0000
608+++ www/autotest/pages/media.html 2013-10-16 17:03:33 +0000
609@@ -47,7 +47,7 @@
610 <!-- Tests -->
611 <script type="text/javascript" src="../tests/media.tests.js"></script>
612
613- <script type="text/javascript">
614+ <!-- script type="text/javascript">
615 document.addEventListener('deviceready', function () {
616 var jasmineEnv = jasmine.getEnv();
617 jasmineEnv.updateInterval = 1000;
618@@ -64,7 +64,7 @@
619
620 jasmineEnv.execute();
621 }, false);
622- </script>
623+ </script -->
624 </head>
625
626 <body>
627
628=== modified file 'www/autotest/pages/network.html'
629--- www/autotest/pages/network.html 2013-10-10 20:38:16 +0000
630+++ www/autotest/pages/network.html 2013-10-16 17:03:33 +0000
631@@ -47,7 +47,7 @@
632 <!-- Tests -->
633 <script type="text/javascript" src="../tests/network.tests.js"></script>
634
635- <script type="text/javascript">
636+ <!-- script type="text/javascript">
637 document.addEventListener('deviceready', function () {
638 var jasmineEnv = jasmine.getEnv();
639 jasmineEnv.updateInterval = 1000;
640@@ -64,7 +64,7 @@
641
642 jasmineEnv.execute();
643 }, false);
644- </script>
645+ </script -->
646 </head>
647
648 <body>
649
650=== modified file 'www/autotest/pages/notification.html'
651--- www/autotest/pages/notification.html 2013-10-10 20:38:16 +0000
652+++ www/autotest/pages/notification.html 2013-10-16 17:03:33 +0000
653@@ -47,7 +47,7 @@
654 <!-- Tests -->
655 <script type="text/javascript" src="../tests/notification.tests.js"></script>
656
657- <script type="text/javascript">
658+ <!-- script type="text/javascript">
659 document.addEventListener('deviceready', function () {
660 var jasmineEnv = jasmine.getEnv();
661 jasmineEnv.updateInterval = 1000;
662@@ -64,7 +64,7 @@
663
664 jasmineEnv.execute();
665 }, false);
666- </script>
667+ </script -->
668 </head>
669
670 <body>
671
672=== modified file 'www/autotest/pages/platform.html'
673--- www/autotest/pages/platform.html 2013-10-10 20:38:16 +0000
674+++ www/autotest/pages/platform.html 2013-10-16 17:03:33 +0000
675@@ -47,7 +47,7 @@
676 <!-- Tests -->
677 <script type="text/javascript" src="../tests/platform.tests.js"></script>
678
679- <script type="text/javascript">
680+ <!-- script type="text/javascript">
681 document.addEventListener('deviceready', function () {
682 var jasmineEnv = jasmine.getEnv();
683 jasmineEnv.updateInterval = 1000;
684@@ -64,7 +64,7 @@
685
686 jasmineEnv.execute();
687 }, false);
688- </script>
689+ </script -->
690 </head>
691
692 <body>
693
694=== modified file 'www/autotest/pages/splashscreen.html'
695--- www/autotest/pages/splashscreen.html 2013-10-10 20:38:16 +0000
696+++ www/autotest/pages/splashscreen.html 2013-10-16 17:03:33 +0000
697@@ -47,7 +47,7 @@
698 <!-- Tests -->
699 <script type="text/javascript" src="../tests/splashscreen.tests.js"></script>
700
701- <script type="text/javascript">
702+ <!-- script type="text/javascript">
703 document.addEventListener('deviceready', function () {
704 var jasmineEnv = jasmine.getEnv();
705 jasmineEnv.updateInterval = 1000;
706@@ -64,7 +64,7 @@
707
708 jasmineEnv.execute();
709 }, false);
710- </script>
711+ </script -->
712 </head>
713
714 <body>
715
716=== modified file 'www/autotest/pages/storage.html'
717--- www/autotest/pages/storage.html 2013-10-10 20:38:16 +0000
718+++ www/autotest/pages/storage.html 2013-10-16 17:03:33 +0000
719@@ -47,7 +47,7 @@
720 <!-- Tests -->
721 <script type="text/javascript" src="../tests/storage.tests.js"></script>
722
723- <script type="text/javascript">
724+ <!-- script type="text/javascript">
725 document.addEventListener('deviceready', function () {
726 var jasmineEnv = jasmine.getEnv();
727 jasmineEnv.updateInterval = 1000;
728@@ -64,7 +64,7 @@
729
730 jasmineEnv.execute();
731 }, false);
732- </script>
733+ </script -->
734 </head>
735
736 <body>
737
738=== modified file 'www/autotest/pages/whitelist.html'
739--- www/autotest/pages/whitelist.html 2013-10-10 20:38:16 +0000
740+++ www/autotest/pages/whitelist.html 2013-10-16 17:03:33 +0000
741@@ -47,7 +47,7 @@
742 <!-- Tests -->
743 <script type="text/javascript" src="../tests/whitelist.tests.js"></script>
744
745- <script type="text/javascript">
746+ <!-- script type="text/javascript">
747 document.addEventListener('deviceready', function () {
748 var jasmineEnv = jasmine.getEnv();
749 jasmineEnv.updateInterval = 1000;
750@@ -64,7 +64,7 @@
751
752 jasmineEnv.execute();
753 }, false);
754- </script>
755+ </script -->
756 </head>
757
758 <body>
759
760=== modified file 'www/autotest/test-runner.js'
761--- www/autotest/test-runner.js 2013-07-25 13:09:34 +0000
762+++ www/autotest/test-runner.js 2013-10-16 17:03:33 +0000
763@@ -60,3 +60,42 @@
764 return false;
765 }, "Expecting callbacks to be called.", timeout);
766 }
767+
768+// Expects session storage to be available and executes the tests
769+var root, temp_root, persistent_root;
770+
771+document.addEventListener('deviceready', function () {
772+ // one-time retrieval of the root file system entry
773+ var onError = function(e) {
774+ console.log('[ERROR] Problem setting up root filesystem for test running! Error to follow.');
775+ console.log(JSON.stringify(e));
776+ };
777+
778+ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
779+ function(fileSystem) {
780+ console.log('File API test Init: Setting PERSISTENT FS.');
781+ root = fileSystem.root; // set in file.tests.js
782+ persistent_root = root;
783+
784+ // Once root is set up, fire off tests
785+ var jasmineEnv = jasmine.getEnv();
786+ jasmineEnv.updateInterval = 1000;
787+
788+ var htmlReporter = new jasmine.HtmlReporter();
789+ var jUnitXmlReporter = new jasmine.JUnitXmlReporter();
790+
791+ jasmineEnv.addReporter(htmlReporter);
792+ jasmineEnv.addReporter(jUnitXmlReporter);
793+
794+ jasmineEnv.specFilter = function(spec) {
795+ return htmlReporter.specFilter(spec);
796+ };
797+
798+ jasmineEnv.execute();
799+ }, onError);
800+ window.requestFileSystem(LocalFileSystem.TEMPORARY, 0,
801+ function(fileSystem) {
802+ console.log('File API test Init: Setting TEMPORARY FS.');
803+ temp_root = fileSystem.root; // set in file.tests.js
804+ }, onError);
805+}, false);
806\ No newline at end of file

Subscribers

People subscribed via source and target branches