Merge lp:~vrruiz/cordova-ubuntu-tests/enable-fix-persistent-path into lp:cordova-ubuntu-tests

Proposed by Víctor R. Ruiz
Status: Merged
Approved by: Víctor R. Ruiz
Approved revision: 33
Merged at revision: 34
Proposed branch: lp:~vrruiz/cordova-ubuntu-tests/enable-fix-persistent-path
Merge into: lp:cordova-ubuntu-tests
Diff against target: 129 lines (+15/-18)
2 files modified
tests/autopilot/cordova_ubuntu/tests/__init__.py (+13/-4)
tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py (+2/-14)
To merge this branch: bzr merge lp:~vrruiz/cordova-ubuntu-tests/enable-fix-persistent-path
Reviewer Review Type Date Requested Status
Robert Bruce Park (community) Approve
PS Jenkins bot continuous-integration Approve
Leo Arias Pending
Javier Collado Pending
Review via email: mp+203799@code.launchpad.net

Description of the change

This re-enables the skipped tests and fixes the problem with Cordova's local storage persistent path encoding.

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
Robert Bruce Park (robru) wrote :

Ran the tests, looks good.

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

Thanks, Robert.

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-11-13 20:02:53 +0000
+++ tests/autopilot/cordova_ubuntu/tests/__init__.py 2014-01-29 17:32:18 +0000
@@ -12,6 +12,7 @@
12import subprocess12import subprocess
1313
14from xml.dom import minidom14from xml.dom import minidom
15from base64 import b64encode
15from testtools.matchers import Contains, Equals16from testtools.matchers import Contains, Equals
1617
17from autopilot.input import Mouse, Touch, Pointer18from autopilot.input import Mouse, Touch, Pointer
@@ -24,7 +25,10 @@
24 pointer = Pointer(Touch.create())25 pointer = Pointer(Touch.create())
25 LOCAL_CORDOVA_CONTAINER_PATH = os.path.abspath("%s/%s" % (os.path.dirname(os.path.realpath(__file__)),26 LOCAL_CORDOVA_CONTAINER_PATH = os.path.abspath("%s/%s" % (os.path.dirname(os.path.realpath(__file__)),
26 '../../tools/qml/main-local.qml'))27 '../../tools/qml/main-local.qml'))
28 LOCAL_CORDOVA_APP_PATH = os.path.abspath("%s/%s" % (os.path.dirname(os.path.realpath(__file__)),
29 '../../../../www/'))
27 INSTALLED_CORDOVA_CONTAINER_PATH = '/usr/share/cordova-ubuntu-tests/autopilot-tests/qml/main.qml'30 INSTALLED_CORDOVA_CONTAINER_PATH = '/usr/share/cordova-ubuntu-tests/autopilot-tests/qml/main.qml'
31 INSTALLED_CORDOVA_APP_PATH = '/usr/share/cordova-ubuntu-tests/www/'
28 arch = subprocess.check_output(["dpkg-architecture",32 arch = subprocess.check_output(["dpkg-architecture",
29 "-qDEB_HOST_MULTIARCH"]).strip()33 "-qDEB_HOST_MULTIARCH"]).strip()
30 QML_LAUNCHER = "/usr/lib/" + arch + "/qt5/bin/qmlscene"34 QML_LAUNCHER = "/usr/lib/" + arch + "/qt5/bin/qmlscene"
@@ -38,9 +42,14 @@
38 return self.INSTALLED_CORDOVA_CONTAINER_PATH42 return self.INSTALLED_CORDOVA_CONTAINER_PATH
3943
40 def get_persistent_path(self):44 def get_persistent_path(self):
45 """ Cordova Ubuntu hashes the persistent path """
46 path = os.path.join(os.environ['HOME'], '.local/share/cordova-ubuntu/persistent', b64encode(self.get_cordova_app_path()))
47 return path
48
49 def get_cordova_app_path(self):
41 if (os.path.exists(self.LOCAL_CORDOVA_CONTAINER_PATH)):50 if (os.path.exists(self.LOCAL_CORDOVA_CONTAINER_PATH)):
42 return self.LOCAL_PERSISTENT_PATH51 return self.LOCAL_CORDOVA_APP_PATH
43 return self.PERSISTENT_PATH52 return self.INSTALLED_CORDOVA_APP_PATH
4453
45 def setUp(self):54 def setUp(self):
46 params = [self.QML_LAUNCHER, self.get_cordova_container_path()]55 params = [self.QML_LAUNCHER, self.get_cordova_container_path()]
@@ -49,7 +58,6 @@
49 self.app = self.launch_test_application(58 self.app = self.launch_test_application(
50 *params,59 *params,
51 app_type='qt')60 app_type='qt')
52 print(params)
53 super(CordovaUbuntuTestCase, self).setUp()61 super(CordovaUbuntuTestCase, self).setUp()
5462
55 def tearDown(self):63 def tearDown(self):
@@ -87,4 +95,5 @@
87 testsuites = xml.getElementsByTagName('testsuite')95 testsuites = xml.getElementsByTagName('testsuite')
88 for testsuite in testsuites:96 for testsuite in testsuites:
89 failures = testsuite.attributes['failures']97 failures = testsuite.attributes['failures']
90 self.assertThat(failures.value, Equals('0'))98 self.assertThat(failures.nodeValue, Equals('0'))
99
91100
=== modified file 'tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py'
--- tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py 2013-11-06 19:29:56 +0000
+++ tests/autopilot/cordova_ubuntu/tests/test_mobilespec.py 2014-01-29 17:32:18 +0000
@@ -53,34 +53,28 @@
53 # Process still running, sleep a bit53 # Process still running, sleep a bit
54 signal.alarm(0)54 signal.alarm(0)
55 finished = True55 finished = True
56 if (junitxml_file):56 if (junitxml_file):
57 self.assert_junitxml_failures(junitxml_file)57 self.assert_junitxml_failures(junitxml_file)
58 except Alarm:58 except Alarm:
59 # Timeout reached59 # Timeout reached
60 pass60 pass
61 self.assertThat(finished, Equals(True))61 self.assertThat(finished, Equals(True))
6262
63 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
64 def test_accelerometer(self):63 def test_accelerometer(self):
65 self.run_mobilespec('accelerometer', 'TEST-Accelerometernavigatoraccelerometer.xml')64 self.run_mobilespec('accelerometer', 'TEST-Accelerometernavigatoraccelerometer.xml')
6665
67 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
68 def test_battery(self):66 def test_battery(self):
69 self.run_mobilespec('battery', 'TEST-Batterynavigatorbattery.xml')67 self.run_mobilespec('battery', 'TEST-Batterynavigatorbattery.xml')
7068
71 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
72 def test_camera(self):69 def test_camera(self):
73 self.run_mobilespec('camera', 'TEST-CameraConstantswindowCameranavigatorcamera.xml')70 self.run_mobilespec('camera', 'TEST-CameraConstantswindowCameranavigatorcamera.xml')
7471
75 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
76 def test_capture(self):72 def test_capture(self):
77 self.run_mobilespec('capture', 'TEST-Capturenavigatordevicecapture.xml')73 self.run_mobilespec('capture', 'TEST-Capturenavigatordevicecapture.xml')
7874
79 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
80 def test_compass(self):75 def test_compass(self):
81 self.run_mobilespec('compass', 'TEST-Compassnavigatorcompass.xml')76 self.run_mobilespec('compass', 'TEST-Compassnavigatorcompass.xml')
8277
83 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
84 def test_contacts(self):78 def test_contacts(self):
85 self.run_mobilespec('contacts', 'TEST-Contactsnavigatorcontacts.xml')79 self.run_mobilespec('contacts', 'TEST-Contactsnavigatorcontacts.xml')
8680
@@ -93,19 +87,15 @@
93 def test_file(self):87 def test_file(self):
94 self.run_mobilespec('file', 'TEST-FileAPI.xml')88 self.run_mobilespec('file', 'TEST-FileAPI.xml')
9589
96 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
97 def test_filetransfer(self):90 def test_filetransfer(self):
98 self.run_mobilespec('filetransfer', 'TEST-FileTransfer.xml')91 self.run_mobilespec('filetransfer', 'TEST-FileTransfer.xml')
9992
100 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
101 def test_geolocation(self):93 def test_geolocation(self):
102 self.run_mobilespec('geolocation', 'TEST-Geolocationnavigatorgeolocation.xml')94 self.run_mobilespec('geolocation', 'TEST-Geolocationnavigatorgeolocation.xml')
10395
104 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
105 def test_globalization(self):96 def test_globalization(self):
106 self.run_mobilespec('globalization', 'TEST-Globalizationnavigatorglobalization.xml')97 self.run_mobilespec('globalization', 'TEST-Globalizationnavigatorglobalization.xml')
10798
108 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
109 def test_media(self):99 def test_media(self):
110 self.run_mobilespec('media', 'TEST-Media.xml')100 self.run_mobilespec('media', 'TEST-Media.xml')
111101
@@ -121,13 +111,11 @@
121 def test_storage(self):111 def test_storage(self):
122 self.run_mobilespec('storage', 'TEST-SessionStorage.xml')112 self.run_mobilespec('storage', 'TEST-SessionStorage.xml')
123113
124 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
125 def test_bridge(self):114 def test_bridge(self):
126 self.run_mobilespec('bridge', 'TEST-bridge.xml')115 self.run_mobilespec('bridge', 'TEST-bridge.xml')
127116
128 def test_splashscreen(self):117 def test_splashscreen(self):
129 self.run_mobilespec('splashscreen', 'TEST-Splashscreencordova.xml')118 self.run_mobilespec('splashscreen', 'TEST-Splashscreencordova.xml')
130119
131 @skipIf('arm' in ARCH, 'This feature not yet supported on ARM.')
132 def test_whitelist(self):120 def test_whitelist(self):
133 self.run_mobilespec('whitelist', 'TEST-whitelist.xml')121 self.run_mobilespec('whitelist', 'TEST-whitelist.xml')

Subscribers

People subscribed via source and target branches