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
=== modified file 'tests/autopilot/cordova_ubuntu/tests/__init__.py'
--- tests/autopilot/cordova_ubuntu/tests/__init__.py 2013-10-08 22:08:37 +0000
+++ tests/autopilot/cordova_ubuntu/tests/__init__.py 2013-10-16 17:03:33 +0000
@@ -11,6 +11,7 @@
11import os.path11import os.path
12import subprocess12import subprocess
1313
14from xml.dom import minidom
14from testtools.matchers import Contains, Equals15from testtools.matchers import Contains, Equals
1516
16from autopilot.input import Mouse, Touch, Pointer17from autopilot.input import Mouse, Touch, Pointer
@@ -27,22 +28,19 @@
27 "-qDEB_HOST_MULTIARCH"]).strip()28 "-qDEB_HOST_MULTIARCH"]).strip()
28 QML_LAUNCHER = "/usr/lib/" + arch + "/qt5/bin/qmlscene"29 QML_LAUNCHER = "/usr/lib/" + arch + "/qt5/bin/qmlscene"
2930
30 # TODO: fix version31 PERSISTENT_PATH= os.path.join(os.environ['HOME'], '.local/share/cordova-ubuntu/persistent/L3Vzci9zaGFyZS9jb3Jkb3ZhLXVidW50dS10ZXN0cy9jb3Jkb3ZhbW9iaWxlc3BlYy93d3c=/')
31 # mobile_spec_path = '/usr/share/cordova-ubuntu-tests/www/'32 LOCAL_PERSISTENT_PATH= os.path.join(os.environ['HOME'], '.local/share/cordova-ubuntu/persistent/L2hvbWUvdnJydWl6L3dlYmFwcHMvbHAvY29yZG92YS11YnVudHUtdGVzdHMvd3d3')
32 LOCAL_WWW_DIR_PATH = os.path.abspath("%s/%s" % (os.path.dirname(os.path.realpath(__file__)),
33 '../../../www/'))
34 WWW_DIR_PATH = '/usr/share/cordova-ubuntu-tests/cordovamobilespec/www/'
35
36 def get_www_dir_path(self):
37 if os.path.exists(self.WWW_DIR_PATH):
38 return self.WWW_DIR_PATH
39 return self.WWW_DIR_PATH
4033
41 def get_cordova_container_path(self):34 def get_cordova_container_path(self):
42 if os.path.exists(self.LOCAL_CORDOVA_CONTAINER_PATH):35 if (os.path.exists(self.LOCAL_CORDOVA_CONTAINER_PATH)):
43 return self.LOCAL_CORDOVA_CONTAINER_PATH36 return self.LOCAL_CORDOVA_CONTAINER_PATH
44 return self.INSTALLED_CORDOVA_CONTAINER_PATH37 return self.INSTALLED_CORDOVA_CONTAINER_PATH
4538
39 def get_persistent_path(self):
40 if (os.path.exists(self.LOCAL_CORDOVA_CONTAINER_PATH)):
41 return self.LOCAL_PERSISTENT_PATH
42 return self.PERSISTENT_PATH
43
46 def setUp(self):44 def setUp(self):
47 params = [self.QML_LAUNCHER, self.get_cordova_container_path()]45 params = [self.QML_LAUNCHER, self.get_cordova_container_path()]
48 if (model() <> 'Desktop'):46 if (model() <> 'Desktop'):
@@ -50,13 +48,14 @@
50 self.app = self.launch_test_application(48 self.app = self.launch_test_application(
51 *params,49 *params,
52 app_type='qt')50 app_type='qt')
51 print params
53 super(CordovaUbuntuTestCase, self).setUp()52 super(CordovaUbuntuTestCase, self).setUp()
5453
55 def tearDown(self):54 def tearDown(self):
56 super(CordovaUbuntuTestCase, self).tearDown()55 super(CordovaUbuntuTestCase, self).tearDown()
5756
58 def pick_app_launcher(self, app_path):57 def pick_app_launcher(self, app_path):
59 # force Qt app introspection58 """ Force Qt app introspection """
60 from autopilot.introspection.qt import QtApplicationLauncher59 from autopilot.introspection.qt import QtApplicationLauncher
61 return QtApplicationLauncher()60 return QtApplicationLauncher()
6261
@@ -66,3 +65,22 @@
66 def get_webview(self):65 def get_webview(self):
67 return self.app.select_single(objectName="webView")66 return self.app.select_single(objectName="webView")
6867
68 def get_junitxml_path(self, junitxml_filename):
69 """ Return the absolute path of a JUnit XML file """
70 return os.path.join(self.get_persistent_path(), junitxml_filename)
71
72 def junitxml_remove(self, junitxml_filename):
73 """ Remove, if exists the JUnit XML file """
74 file_path = self.get_junitxml_path(junitxml_filename)
75 if (os.path.exists(file_path)):
76 os.unlink(file_path)
77
78 def assert_junitxml_failures(self, junitxml_filename):
79 """ Open a JUnit XML file and search errors """
80 file_path = self.get_junitxml_path(junitxml_filename)
81 self.assertThat(os.path.exists(file_path), Equals(True))
82 xml = minidom.parse(file_path)
83 testsuites = xml.getElementsByTagName('testsuite')
84 for testsuite in testsuites:
85 failures = testsuite.attributes['failures']
86 self.assertThat(failures.value, Equals('0'))
6987
=== modified file 'tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py'
--- tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py 2013-10-15 17:07:38 +0000
+++ tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py 2013-10-16 17:03:33 +0000
@@ -12,6 +12,7 @@
1212
13from testtools.matchers import Equals13from testtools.matchers import Equals
14from autopilot.matchers import Eventually14from autopilot.matchers import Eventually
15from unittest import skip
1516
16from cordova_ubuntu.tests import CordovaUbuntuTestCase17from cordova_ubuntu.tests import CordovaUbuntuTestCase
17from unittest import skipIf18from unittest import skipIf
@@ -27,20 +28,23 @@
27ARCH = subprocess.check_output('uname -p', shell=True).lower()28ARCH = subprocess.check_output('uname -p', shell=True).lower()
28TIMEOUT = 12029TIMEOUT = 120
2930
30
31class TestMobileSpec(CordovaUbuntuTestCase):31class TestMobileSpec(CordovaUbuntuTestCase):
3232
33 def run_mobilespec(self, test_page='all'):33 def run_mobilespec(self, test_page='all', junitxml_file=''):
34 """ Executes Cordova to run a Mobile Spec Suite's automated test """
35 sleep(1)
36 if (junitxml_file):
37 self.junitxml_remove(junitxml_file)
34 web_view = self.get_webview()38 web_view = self.get_webview()
35 self.assertThat(web_view.loadProgress, Eventually(Equals(100)))39 self.assertThat(web_view.loadProgress, Eventually(Equals(100)))
36 # Click on "Automated tests" (index.html)40 # Click on "Automated tests" (index.html)
37 web_view.slots.evalInPageUnsafe('document.getElementById("__automated").click();');41 web_view.slots.evalInPageUnsafe('document.getElementById("__automated").click();')
38 self.assertThat(web_view.loadProgress, Eventually(Equals(100)))42 self.assertThat(web_view.loadProgress, Eventually(Equals(100)))
39 # Click on test (autotest/index.html)43 # Click on test (autotest/index.html)
40 web_view.slots.evalInPageUnsafe('document.evaluate(\'//a[contains(@href, "%s.html")]\', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();' % test_page);44 web_view.slots.evalInPageUnsafe('document.evaluate(\'//a[contains(@href, "%s.html")]\', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click();' % test_page)
41 self.assertThat(web_view.loadProgress, Eventually(Equals(100)))45 self.assertThat(web_view.loadProgress, Eventually(Equals(100)))
42 # Wait until finished (autotest/pages/all.html)46 # Wait until finished (autotest/pages/all.html)
43 web_view.slots.evalInPageUnsafe("document.addEventListener('junitxml-finished', function (e) { setTimeout(navigator.app.closeApp, 1000); }, false);");47 web_view.slots.evalInPageUnsafe("document.addEventListener('junitxml-finished', function (e) { setTimeout(navigator.app.closeApp, 1000); }, false);")
44 # Detect window closed48 # Detect window closed
45 signal.signal(signal.SIGALRM, alarm_handler)49 signal.signal(signal.SIGALRM, alarm_handler)
46 signal.alarm(TIMEOUT) # Setup timeout50 signal.alarm(TIMEOUT) # Setup timeout
@@ -48,9 +52,10 @@
48 try:52 try:
49 while (self.app.process.poll() is None):53 while (self.app.process.poll() is None):
50 # Process still running, sleep a bit54 # Process still running, sleep a bit
51 sleep(1)
52 signal.alarm(0)55 signal.alarm(0)
53 finished = True56 finished = True
57 if (junitxml_file):
58 self.assert_junitxml_failures(junitxml_file)
54 except Alarm:59 except Alarm:
55 # Timeout reached60 # Timeout reached
56 pass61 pass
@@ -58,67 +63,73 @@
5863
59 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')64 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
60 def test_accelerometer(self):65 def test_accelerometer(self):
61 self.run_mobilespec('accelerometer');66 self.run_mobilespec('accelerometer', 'TEST-Accelerometernavigatoraccelerometer.xml')
6267
68 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
63 def test_battery(self):69 def test_battery(self):
64 self.run_mobilespec('battery');70 self.run_mobilespec('battery', 'TEST-Batterynavigatorbattery.xml')
6571
66 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')72 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
67 def test_camera(self):73 def test_camera(self):
68 self.run_mobilespec('camera');74 self.run_mobilespec('camera', 'TEST-CameraConstantswindowCameranavigatorcamera.xml')
6975
70 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')76 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
71 def test_capture(self):77 def test_capture(self):
72 self.run_mobilespec('capture');78 self.run_mobilespec('capture', 'TEST-Capturenavigatordevicecapture.xml')
7379
74 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')80 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
75 def test_compass(self):81 def test_compass(self):
76 self.run_mobilespec('compass');82 self.run_mobilespec('compass', 'TEST-Compassnavigatorcompass.xml')
7783
78 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')84 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
79 def test_contacts(self):85 def test_contacts(self):
80 self.run_mobilespec('contacts');86 self.run_mobilespec('contacts', 'TEST-Contactsnavigatorcontacts.xml')
8187
82 def test_datauri(self):88 def test_datauri(self):
83 self.run_mobilespec('datauri');89 self.run_mobilespec('datauri', 'TEST-datauris.xml')
8490
85 def test_device(self):91 def test_device(self):
86 self.run_mobilespec('device');92 self.run_mobilespec('device', 'TEST-DeviceInformationwindowdevice.xml')
8793
88 def test_file(self):94 def test_file(self):
89 self.run_mobilespec('file');95 self.run_mobilespec('file', 'TEST-FileAPI.xml')
9096
97 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
91 def test_filetransfer(self):98 def test_filetransfer(self):
92 self.run_mobilespec('filetransfer');99 self.run_mobilespec('filetransfer', 'TEST-FileTransfer.xml')
93100
94 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')101 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
95 def test_geolocation(self):102 def test_geolocation(self):
96 self.run_mobilespec('geolocation');103 self.run_mobilespec('geolocation', 'TEST-Geolocationnavigatorgeolocation.xml')
97104
105 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
98 def test_globalization(self):106 def test_globalization(self):
99 self.run_mobilespec('globalization');107 self.run_mobilespec('globalization', 'TEST-Globalizationnavigatorglobalization.xml')
100108
101 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')109 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
102 def test_media(self):110 def test_media(self):
103 self.run_mobilespec('media');111 self.run_mobilespec('media', 'TEST-Media.xml')
104112
105 def test_network(self):113 def test_network(self):
106 self.run_mobilespec('network');114 self.run_mobilespec('network', 'TEST-Networknavigatorconnection.xml')
107115
108 def test_notification(self):116 def test_notification(self):
109 self.run_mobilespec('notification');117 self.run_mobilespec('notification', 'TEST-Notificationnavigatornotification.xml')
110118
111 def test_platform(self):119 def test_platform(self):
112 self.run_mobilespec('platform');120 self.run_mobilespec('platform', 'TEST-Platformcordova.xml')
113121
114 def test_storage(self):122 def test_storage(self):
115 self.run_mobilespec('storage');123 self.run_mobilespec('storage', 'TEST-SessionStorage.xml')
116124
125 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
117 def test_bridge(self):126 def test_bridge(self):
118 self.run_mobilespec('bridge');127 self.run_mobilespec('bridge', 'TEST-bridge.xml')
119128
120 def test_splashscreen(self):129 def test_splashscreen(self):
121 self.run_mobilespec('splashscreen');130 self.run_mobilespec('splashscreen', 'TEST-Splashscreencordova.xml')
122131
132 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
123 def test_whitelist(self):133 def test_whitelist(self):
124 self.run_mobilespec('whitelist');134 self.run_mobilespec('whitelist', 'TEST-whitelist.xml')
135
125136
=== modified file 'tests/autopilot/tools/qml/main-local.qml'
--- tests/autopilot/tools/qml/main-local.qml 2013-08-28 15:28:22 +0000
+++ tests/autopilot/tools/qml/main-local.qml 2013-10-16 17:03:33 +0000
@@ -8,6 +8,6 @@
8 width: 6408 width: 640
9 height: 6409 height: 640
1010
11 wwwDir: '../www/'11 wwwDir: '../../www/'
1212
13}13}
1414
=== modified file 'www/autotest/html/JUnitXmlReporter.js'
--- www/autotest/html/JUnitXmlReporter.js 2013-08-23 18:00:28 +0000
+++ www/autotest/html/JUnitXmlReporter.js 2013-10-16 17:03:33 +0000
@@ -165,11 +165,11 @@
165 }165 }
166 // When all done, make it known on JUnitXmlReporter166 // When all done, make it known on JUnitXmlReporter
167 JUnitXmlReporter.finished_at = (new Date()).getTime();167 JUnitXmlReporter.finished_at = (new Date()).getTime();
168 // FIXME 1: closeApp should be elsewhere?168 // FIXME: Avoid using setTimeout. Waits until all files have been written
169 // FIXME 2: Avoid using setTimeout. Waits until all files have been written169 setTimeout(function() {
170 var event = new Event('junitxml-finished');170 var event = new Event('junitxml-finished');
171 document.dispatchEvent(event);171 document.dispatchEvent(event);
172 // setTimeout(navigator.app.closeApp, 1000); // Close app172 }, 1000);
173 },173 },
174174
175 getNestedOutput: function(suite) {175 getNestedOutput: function(suite) {
176176
=== modified file 'www/autotest/pages/accelerometer.html'
--- www/autotest/pages/accelerometer.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/accelerometer.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/accelerometer.tests.js"></script>48 <script type="text/javascript" src="../tests/accelerometer.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -65,7 +65,7 @@
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script>
68</head>68</head -->
6969
70<body>70<body>
71 <a href="javascript:" class="backBtn" onclick="backHome();">Back</a>71 <a href="javascript:" class="backBtn" onclick="backHome();">Back</a>
7272
=== modified file 'www/autotest/pages/all.html'
--- www/autotest/pages/all.html 2013-08-23 17:50:24 +0000
+++ www/autotest/pages/all.html 2013-10-16 17:03:33 +0000
@@ -56,7 +56,7 @@
56 <script type="text/javascript" src="../tests/file.tests.js"></script>56 <script type="text/javascript" src="../tests/file.tests.js"></script>
57 <script type="text/javascript" src="../tests/filetransfer.tests.js"></script>57 <script type="text/javascript" src="../tests/filetransfer.tests.js"></script>
58 <script type="text/javascript" src="../tests/geolocation.tests.js"></script>58 <script type="text/javascript" src="../tests/geolocation.tests.js"></script>
59 <!-- script type="text/javascript" src="../tests/globalization.tests.js"></script -->59 <script type="text/javascript" src="../tests/globalization.tests.js"></script>
60 <script type="text/javascript" src="../tests/media.tests.js"></script>60 <script type="text/javascript" src="../tests/media.tests.js"></script>
61 <script type="text/javascript" src="../tests/network.tests.js"></script>61 <script type="text/javascript" src="../tests/network.tests.js"></script>
62 <script type="text/javascript" src="../tests/notification.tests.js"></script>62 <script type="text/javascript" src="../tests/notification.tests.js"></script>
@@ -64,7 +64,7 @@
64 <script type="text/javascript" src="../tests/storage.tests.js"></script>64 <script type="text/javascript" src="../tests/storage.tests.js"></script>
65 <script type="text/javascript" src="../tests/splashscreen.tests.js"></script>65 <script type="text/javascript" src="../tests/splashscreen.tests.js"></script>
6666
67 <script type="text/javascript">67 <!-- script type="text/javascript">
68 var root, temp_root, persistent_root;68 var root, temp_root, persistent_root;
6969
70 document.addEventListener('deviceready', function () {70 document.addEventListener('deviceready', function () {
@@ -102,7 +102,7 @@
102 temp_root = fileSystem.root; // set in file.tests.js102 temp_root = fileSystem.root; // set in file.tests.js
103 }, onError);103 }, onError);
104 }, false);104 }, false);
105 </script>105 </script -->
106</head>106</head>
107107
108<body>108<body>
109109
=== modified file 'www/autotest/pages/battery.html'
--- www/autotest/pages/battery.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/battery.html 2013-10-16 17:03:33 +0000
@@ -43,7 +43,7 @@
4343
44 <!-- Tests -->44 <!-- Tests -->
45 <script type="text/javascript" src="../tests/battery.tests.js"></script>45 <script type="text/javascript" src="../tests/battery.tests.js"></script>
46 <script type="text/javascript">46 <!-- script type="text/javascript">
47 document.addEventListener('deviceready', function () {47 document.addEventListener('deviceready', function () {
48 var jasmineEnv = jasmine.getEnv();48 var jasmineEnv = jasmine.getEnv();
49 jasmineEnv.updateInterval = 1000;49 jasmineEnv.updateInterval = 1000;
@@ -60,7 +60,7 @@
6060
61 jasmineEnv.execute();61 jasmineEnv.execute();
62 }, false);62 }, false);
63 </script>63 </script -->
64</head>64</head>
6565
66<body>66<body>
6767
=== modified file 'www/autotest/pages/bridge.html'
--- www/autotest/pages/bridge.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/bridge.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/bridge.tests.js"></script>48 <script type="text/javascript" src="../tests/bridge.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/camera.html'
--- www/autotest/pages/camera.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/camera.html 2013-10-16 17:03:33 +0000
@@ -48,7 +48,7 @@
48 <!-- Tests -->48 <!-- Tests -->
49 <script type="text/javascript" src="../tests/camera.tests.js"></script>49 <script type="text/javascript" src="../tests/camera.tests.js"></script>
5050
51 <script type="text/javascript">51 <!-- script type="text/javascript">
52 document.addEventListener('deviceready', function () {52 document.addEventListener('deviceready', function () {
53 var jasmineEnv = jasmine.getEnv();53 var jasmineEnv = jasmine.getEnv();
54 jasmineEnv.updateInterval = 1000;54 jasmineEnv.updateInterval = 1000;
@@ -65,7 +65,7 @@
6565
66 jasmineEnv.execute();66 jasmineEnv.execute();
67 }, false);67 }, false);
68 </script>68 </script -->
69</head>69</head>
7070
71<body>71<body>
7272
=== modified file 'www/autotest/pages/capture.html'
--- www/autotest/pages/capture.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/capture.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/capture.tests.js"></script>48 <script type="text/javascript" src="../tests/capture.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/compass.html'
--- www/autotest/pages/compass.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/compass.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/compass.tests.js"></script>48 <script type="text/javascript" src="../tests/compass.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/contacts.html'
--- www/autotest/pages/contacts.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/contacts.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/contacts.tests.js"></script>48 <script type="text/javascript" src="../tests/contacts.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/datauri.html'
--- www/autotest/pages/datauri.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/datauri.html 2013-10-16 17:03:33 +0000
@@ -45,7 +45,7 @@
45 <!-- Tests -->45 <!-- Tests -->
46 <script type="text/javascript" src="../tests/datauri.tests.js"></script>46 <script type="text/javascript" src="../tests/datauri.tests.js"></script>
4747
48 <script type="text/javascript">48 <!-- script type="text/javascript">
49 document.addEventListener('deviceready', function () {49 document.addEventListener('deviceready', function () {
50 var jasmineEnv = jasmine.getEnv();50 var jasmineEnv = jasmine.getEnv();
51 jasmineEnv.updateInterval = 1000;51 jasmineEnv.updateInterval = 1000;
@@ -62,7 +62,7 @@
6262
63 jasmineEnv.execute();63 jasmineEnv.execute();
64 }, false);64 }, false);
65 </script>65 </script -->
66</head>66</head>
6767
68<body>68<body>
6969
=== modified file 'www/autotest/pages/device.html'
--- www/autotest/pages/device.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/device.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/device.tests.js"></script>48 <script type="text/javascript" src="../tests/device.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/file.html'
--- www/autotest/pages/file.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/file.html 2013-10-16 17:03:33 +0000
@@ -46,7 +46,7 @@
46 <!-- Tests -->46 <!-- Tests -->
47 <script type="text/javascript" src="../tests/file.tests.js"></script>47 <script type="text/javascript" src="../tests/file.tests.js"></script>
4848
49 <script type="text/javascript">49 <!-- script type="text/javascript">
50 var root, temp_root, persistent_root;50 var root, temp_root, persistent_root;
5151
52 document.addEventListener('deviceready', function () {52 document.addEventListener('deviceready', function () {
@@ -67,10 +67,10 @@
67 jasmineEnv.updateInterval = 1000;67 jasmineEnv.updateInterval = 1000;
6868
69 var htmlReporter = new jasmine.HtmlReporter();69 var htmlReporter = new jasmine.HtmlReporter();
70 var jUnitXmlReporter = new jasmine.JUnitXmlReporter();70 var jUnitXmlReporter = new jasmine.JUnitXmlReporter();
7171
72 jasmineEnv.addReporter(htmlReporter);72 jasmineEnv.addReporter(htmlReporter);
73 jasmineEnv.addReporter(jUnitXmlReporter);73 jasmineEnv.addReporter(jUnitXmlReporter);
7474
75 jasmineEnv.specFilter = function(spec) {75 jasmineEnv.specFilter = function(spec) {
76 return htmlReporter.specFilter(spec);76 return htmlReporter.specFilter(spec);
@@ -84,7 +84,7 @@
84 temp_root = fileSystem.root; // set in file.tests.js84 temp_root = fileSystem.root; // set in file.tests.js
85 }, onError);85 }, onError);
86 }, false);86 }, false);
87 </script>87 </script -->
88</head>88</head>
8989
90<body>90<body>
9191
=== modified file 'www/autotest/pages/filetransfer.html'
--- www/autotest/pages/filetransfer.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/filetransfer.html 2013-10-16 17:03:33 +0000
@@ -46,7 +46,7 @@
46 <!-- Tests -->46 <!-- Tests -->
47 <script type="text/javascript" src="../tests/filetransfer.tests.js"></script>47 <script type="text/javascript" src="../tests/filetransfer.tests.js"></script>
4848
49 <script type="text/javascript">49 <!-- script type="text/javascript">
50 var root, temp_root, persistent_root;50 var root, temp_root, persistent_root;
5151
52 document.addEventListener('deviceready', function () {52 document.addEventListener('deviceready', function () {
@@ -67,10 +67,10 @@
67 jasmineEnv.updateInterval = 1000;67 jasmineEnv.updateInterval = 1000;
6868
69 var htmlReporter = new jasmine.HtmlReporter();69 var htmlReporter = new jasmine.HtmlReporter();
70 var jUnitXmlReporter = new jasmine.JUnitXmlReporter();70 var jUnitXmlReporter = new jasmine.JUnitXmlReporter();
7171
72 jasmineEnv.addReporter(htmlReporter);72 jasmineEnv.addReporter(htmlReporter);
73 jasmineEnv.addReporter(jUnitXmlReporter);73 jasmineEnv.addReporter(jUnitXmlReporter);
7474
75 jasmineEnv.specFilter = function(spec) {75 jasmineEnv.specFilter = function(spec) {
76 return htmlReporter.specFilter(spec);76 return htmlReporter.specFilter(spec);
@@ -84,7 +84,7 @@
84 temp_root = fileSystem.root; // set in file.tests.js84 temp_root = fileSystem.root; // set in file.tests.js
85 }, onError);85 }, onError);
86 }, false);86 }, false);
87 </script>87 </script -->
88</head>88</head>
8989
90<body>90<body>
9191
=== modified file 'www/autotest/pages/geolocation.html'
--- www/autotest/pages/geolocation.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/geolocation.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/geolocation.tests.js"></script>48 <script type="text/javascript" src="../tests/geolocation.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/globalization.html'
--- www/autotest/pages/globalization.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/globalization.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/globalization.tests.js"></script>48 <script type="text/javascript" src="../tests/globalization.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/media.html'
--- www/autotest/pages/media.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/media.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/media.tests.js"></script>48 <script type="text/javascript" src="../tests/media.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/network.html'
--- www/autotest/pages/network.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/network.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/network.tests.js"></script>48 <script type="text/javascript" src="../tests/network.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/notification.html'
--- www/autotest/pages/notification.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/notification.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/notification.tests.js"></script>48 <script type="text/javascript" src="../tests/notification.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/platform.html'
--- www/autotest/pages/platform.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/platform.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/platform.tests.js"></script>48 <script type="text/javascript" src="../tests/platform.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/splashscreen.html'
--- www/autotest/pages/splashscreen.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/splashscreen.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/splashscreen.tests.js"></script>48 <script type="text/javascript" src="../tests/splashscreen.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/storage.html'
--- www/autotest/pages/storage.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/storage.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/storage.tests.js"></script>48 <script type="text/javascript" src="../tests/storage.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/pages/whitelist.html'
--- www/autotest/pages/whitelist.html 2013-10-10 20:38:16 +0000
+++ www/autotest/pages/whitelist.html 2013-10-16 17:03:33 +0000
@@ -47,7 +47,7 @@
47 <!-- Tests -->47 <!-- Tests -->
48 <script type="text/javascript" src="../tests/whitelist.tests.js"></script>48 <script type="text/javascript" src="../tests/whitelist.tests.js"></script>
4949
50 <script type="text/javascript">50 <!-- script type="text/javascript">
51 document.addEventListener('deviceready', function () {51 document.addEventListener('deviceready', function () {
52 var jasmineEnv = jasmine.getEnv();52 var jasmineEnv = jasmine.getEnv();
53 jasmineEnv.updateInterval = 1000;53 jasmineEnv.updateInterval = 1000;
@@ -64,7 +64,7 @@
6464
65 jasmineEnv.execute();65 jasmineEnv.execute();
66 }, false);66 }, false);
67 </script>67 </script -->
68</head>68</head>
6969
70<body>70<body>
7171
=== modified file 'www/autotest/test-runner.js'
--- www/autotest/test-runner.js 2013-07-25 13:09:34 +0000
+++ www/autotest/test-runner.js 2013-10-16 17:03:33 +0000
@@ -60,3 +60,42 @@
60 return false;60 return false;
61 }, "Expecting callbacks to be called.", timeout);61 }, "Expecting callbacks to be called.", timeout);
62}62}
63
64// Expects session storage to be available and executes the tests
65var root, temp_root, persistent_root;
66
67document.addEventListener('deviceready', function () {
68 // one-time retrieval of the root file system entry
69 var onError = function(e) {
70 console.log('[ERROR] Problem setting up root filesystem for test running! Error to follow.');
71 console.log(JSON.stringify(e));
72 };
73
74 window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
75 function(fileSystem) {
76 console.log('File API test Init: Setting PERSISTENT FS.');
77 root = fileSystem.root; // set in file.tests.js
78 persistent_root = root;
79
80 // Once root is set up, fire off tests
81 var jasmineEnv = jasmine.getEnv();
82 jasmineEnv.updateInterval = 1000;
83
84 var htmlReporter = new jasmine.HtmlReporter();
85 var jUnitXmlReporter = new jasmine.JUnitXmlReporter();
86
87 jasmineEnv.addReporter(htmlReporter);
88 jasmineEnv.addReporter(jUnitXmlReporter);
89
90 jasmineEnv.specFilter = function(spec) {
91 return htmlReporter.specFilter(spec);
92 };
93
94 jasmineEnv.execute();
95 }, onError);
96 window.requestFileSystem(LocalFileSystem.TEMPORARY, 0,
97 function(fileSystem) {
98 console.log('File API test Init: Setting TEMPORARY FS.');
99 temp_root = fileSystem.root; // set in file.tests.js
100 }, onError);
101}, false);
63\ No newline at end of file102\ No newline at end of file

Subscribers

People subscribed via source and target branches