Merge lp:~elopio/unity-scope-click/autopilot-open_preview into lp:unity-scope-click

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 110
Merged at revision: 108
Proposed branch: lp:~elopio/unity-scope-click/autopilot-open_preview
Merge into: lp:unity-scope-click
Diff against target: 117 lines (+79/-2)
2 files modified
src/tests/autopilot/unityclickscope/fake_servers.py (+43/-1)
src/tests/autopilot/unityclickscope/test_click_scope.py (+36/-1)
To merge this branch: bzr merge lp:~elopio/unity-scope-click/autopilot-open_preview
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Alejandro J. Cura (community) Approve
Review via email: mp+201797@code.launchpad.net

Commit message

Added the autopilot test to open a preview.

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote :

Not yet ready. Marking as Needs review to see how jenkins tests fare.

Revision history for this message
Leo Arias (elopio) wrote :

sorry, wrong branch :)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:110
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://code.launchpad.net/~elopio/unity-scope-click/autopilot-open_preview/+merge/201797/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity-scope-click-ci/168/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-scope-click-trusty-amd64-ci/66
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-scope-click-trusty-armhf-ci/66

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity-scope-click-ci/168/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks good

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 'src/tests/autopilot/unityclickscope/fake_servers.py'
--- src/tests/autopilot/unityclickscope/fake_servers.py 2014-01-14 00:57:43 +0000
+++ src/tests/autopilot/unityclickscope/fake_servers.py 2014-01-15 15:15:46 +0000
@@ -40,13 +40,48 @@
40 'title': 'Shorts'40 'title': 'Shorts'
41 }41 }
42 ]42 ]
43 _FAKE_SHORTS_DETAILS_DICT = {
44 'website': 'https://launchpad.net/ubuntu-rssreader-app',
45 'description':
46 'Shorts is an rssreader application\n'
47 'Shorts is an rss reader application that allows you to easily '
48 'search for new feeds.',
49 'price': 0.0,
50 'framework': ["ubuntu-sdk-13.10"],
51 'terms_of_service': '',
52 'prices': {'USD': 0.0},
53 'screenshot_url': 'https://TODO/shorts0.png',
54 'date_published': '2013-10-16T15:58:52.469000',
55 'publisher': 'Ubuntu Click Loader',
56 'name': 'com.ubuntu.shorts',
57 'license': 'GNU GPL v3',
58 'changelog': 'Test fixes',
59 'support_url': 'mailto:ubuntu-touch-coreapps@lists.launchpad.net',
60 'icon_url': 'https://TODO/shorts.png',
61 'title': 'Shorts',
62 'binary_filesize': 164944,
63 'download_url': 'https://TODO/com.ubuntu.shorts_0.2.152_all.click',
64 'click_version': '0.1',
65 'developer_name': 'Ubuntu Click Loader',
66 'version': '0.2.152',
67 'company_name': '',
68 'keywords': ['shorts', 'rss', 'news'],
69 'screenshot_urls': [
70 'https://TODO/shorts0.png',
71 'https://TODO/shorts1.png'
72 ],
73 'architecture': ['all']
74 }
4375
44 def do_GET(self):76 def do_GET(self):
45 parsed_path = urlparse.urlparse(self.path)77 parsed_path = urlparse.urlparse(self.path)
46 if parsed_path.path.startswith(self._SEARCH_PATH):78 if parsed_path.path.startswith(self._SEARCH_PATH):
47 self.send_json_reply(200, self._get_fake_search_response())79 self.send_json_reply(200, self._get_fake_search_response())
48 elif parsed_path.path.startswith("/extra/"):80 elif parsed_path.path.startswith('/extra/'):
49 self.send_file(parsed_path.path[1:])81 self.send_file(parsed_path.path[1:])
82 elif parsed_path.path.startswith('/api/v1/package/'):
83 package = parsed_path.path[16:]
84 self.send_package_details(package)
50 else:85 else:
51 raise NotImplementedError(self.path)86 raise NotImplementedError(self.path)
5287
@@ -70,3 +105,10 @@
70 self.send_header('Content-Length', str(len(data)))105 self.send_header('Content-Length', str(len(data)))
71 self.end_headers()106 self.end_headers()
72 self.wfile.write(data)107 self.wfile.write(data)
108
109 def send_package_details(self, package):
110 if package == 'com.ubuntu.shorts':
111 self.send_json_reply(
112 200, json.dumps(self._FAKE_SHORTS_DETAILS_DICT))
113 else:
114 raise NotImplementedError(package)
73115
=== modified file 'src/tests/autopilot/unityclickscope/test_click_scope.py'
--- src/tests/autopilot/unityclickscope/test_click_scope.py 2014-01-14 00:57:43 +0000
+++ src/tests/autopilot/unityclickscope/test_click_scope.py 2014-01-15 15:15:46 +0000
@@ -20,8 +20,12 @@
20import fixtures20import fixtures
21from autopilot.matchers import Eventually21from autopilot.matchers import Eventually
22from testtools.matchers import Equals22from testtools.matchers import Equals
23from ubuntuuitoolkit import emulators as toolkit_emulators
23from unity8 import process_helpers24from unity8 import process_helpers
24from unity8.shell import tests as unity_tests25from unity8.shell import (
26 emulators as unity_emulators,
27 tests as unity_tests
28)
2529
26from unityclickscope import fixture_setup30from unityclickscope import fixture_setup
2731
@@ -100,3 +104,34 @@
100 search_box = self._proxy.select_single("SearchIndicator")104 search_box = self._proxy.select_single("SearchIndicator")
101 self.touch.tap_object(search_box)105 self.touch.tap_object(search_box)
102 self.keyboard.type(query)106 self.keyboard.type(query)
107
108 def test_open_app_preview(self):
109 expected_details = dict(
110 title='Shorts', publisher='Ubuntu Click Loader')
111 preview = self._open_app_preview('Shorts')
112 details = preview.get_details()
113 self.assertEqual(details, expected_details)
114
115 def _open_app_preview(self, name):
116 self._search(name)
117 icon = self.scope.wait_select_single('Tile', text=name)
118 pointing_device = toolkit_emulators.get_pointing_device()
119 pointing_device.click_object(icon)
120 return self.dash.wait_select_single(AppPreview)
121
122
123# TODO move this to unity. --elopio - 2014-1-14
124class AppPreview(unity_emulators.UnityEmulatorBase):
125 """Autopilot emulator for the application preview."""
126
127 def get_details(self):
128 """Return the details of the application whose preview is open."""
129 title = self.select_single('Label', objectName='titleLabel').text
130 publisher = self.select_single(
131 'Label', objectName='subtitleLabel').text
132 # The description label doesn't have an object name. Reported as bug
133 # http://pad.lv/1269114 -- elopio - 2014-1-14
134 # description = self.select_single(
135 # 'Label', objectName='descriptionLabel').text
136 # TODO check screenshots, icon, rating and reviews.
137 return dict(title=title, publisher=publisher)

Subscribers

People subscribed via source and target branches

to all changes: