Merge lp:~veebers/stock-ticker-mobile-app/porting-autopilot-1.4 into lp:stock-ticker-mobile-app
- porting-autopilot-1.4
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 68 |
Proposed branch: | lp:~veebers/stock-ticker-mobile-app/porting-autopilot-1.4 |
Merge into: | lp:stock-ticker-mobile-app |
Prerequisite: | lp:~veebers/stock-ticker-mobile-app/update-tests |
Diff against target: |
210 lines (+59/-40) 4 files modified
Current_charts_page.qml (+1/-0) tests/autopilot/stock_ticker/tests/__init__.py (+1/-1) tests/autopilot/stock_ticker/tests/test_Management_page.py (+17/-12) tests/autopilot/stock_ticker/tests/test_Subtabs.py (+40/-27) |
To merge this branch: | bzr merge lp:~veebers/stock-ticker-mobile-app/porting-autopilot-1.4 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Needs Fixing | |
Robert Steckroth | Approve | ||
Review via email: mp+193718@code.launchpad.net |
This proposal supersedes a proposal from 2013-11-01.
Commit message
Description of the change
Updating tests so that they pass using autopilot 1.4.
Robert Steckroth (robertsteckroth) wrote : | # |
Robert Steckroth (robertsteckroth) wrote : | # |
A god start to next verison
Robert Steckroth (robertsteckroth) wrote : | # |
A good start to next verison
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Autolanding.
No commit message was specified in the merge proposal. Hit 'Add commit message' on the merge proposal web page or follow the link below. You can approve the merge proposal yourself to rerun.
https:/
Chris Gagnon (chris.gagnon) wrote : | # |
I can't get the tests or the application to work at all, I see this in the logs when I try to open the app with qmlscene
[com.ubuntu.
[com.ubuntu.
Chris Gagnon (chris.gagnon) wrote : | # |
The network calls should be mocked so the test can be run without the internet if possible.
Chris Gagnon (chris.gagnon) wrote : | # |
What happens if the target_row doesn't find an object? we should have an error message here so it's easy to diagnose the target_row is not found, and not the remove_button is not found.
43 + try:
44 + o.select_single(
45 + 'QQuickText',
46 + objectName=
47 + text="Google Inc."
48 + )
49 + target_row = o
50 + break
51 + except StateNotFoundError:
52 + pass
53 +
54 + remove_button = target_
Robert Steckroth (robertsteckroth) wrote : | # |
Well, google should be in the top ten of the auto-complete list when a g is
typed into the search box. Occasionally this will not happen correctly.
Adding a o to the string will help --> press "go" to find google.
Maybe a 15 second timeout would help thisl, or perhaps a sleep statement
can knock this out. I thought that the sleep command was a little sloppy,
but...
On Mon, Nov 4, 2013 at 10:22 AM, Chris Gagnon <email address hidden>wrote:
> What happens if the target_row doesn't find an object? we should have an
> error message here so it's easy to diagnose the target_row is not found,
> and not the remove_button is not found.
>
>
> 43 + try:
> 44 + o.select_single(
> 45 + 'QQuickText',
> 46 + objectName=
> 47 + text="Google Inc."
> 48 + )
> 49 + target_row = o
> 50 + break
> 51 + except StateNotFoundError:
> 52 + pass
> 53 +
> 54 + remove_button = target_
> --
>
> https:/
> You are reviewing the proposed merge of
> lp:~veebers/stock-ticker-mobile-app/porting-autopilot-1.4 into
> lp:stock-ticker-mobile-app.
>
--
<surgemcgee> Systems/Software Engineer
Robert Steckroth (robertsteckroth) wrote : | # |
Also, I plan on jumping back into this project sooner than later, but I
have a proprietary project which is in it's prime right now.
On Mon, Nov 4, 2013 at 12:55 PM, Robert Steckroth <<email address hidden>
> wrote:
> Well, google should be in the top ten of the auto-complete list when a g
> is typed into the search box. Occasionally this will not happen correctly.
> Adding a o to the string will help --> press "go" to find google.
> Maybe a 15 second timeout would help thisl, or perhaps a sleep statement
> can knock this out. I thought that the sleep command was a little sloppy,
> but...
>
>
> On Mon, Nov 4, 2013 at 10:22 AM, Chris Gagnon <email address hidden>wrote:
>
>> What happens if the target_row doesn't find an object? we should have an
>> error message here so it's easy to diagnose the target_row is not found,
>> and not the remove_button is not found.
>>
>>
>> 43 + try:
>> 44 + o.select_single(
>> 45 + 'QQuickText',
>> 46 + objectName=
>> 47 + text="Google Inc."
>> 48 + )
>> 49 + target_row = o
>> 50 + break
>> 51 + except StateNotFoundError:
>> 52 + pass
>> 53 +
>> 54 + remove_button = target_
>> --
>>
>> https:/
>> You are reviewing the proposed merge of
>> lp:~veebers/stock-ticker-mobile-app/porting-autopilot-1.4 into
>> lp:stock-ticker-mobile-app.
>>
>
>
>
> --
> <surgemcgee> Systems/Software Engineer
>
>
>
>
--
<surgemcgee> Systems/Software Engineer
- 73. By Christopher Lee
-
Fix typo
Christopher Lee (veebers) wrote : | # |
Hi Robert, I getting a test failure (stock_
The error message:
tests/autopilot
self.
File "/usr/lib/
raise MismatchError(
MismatchError: 300.0 == 300.0
I'm not certain what it (or the chart) is supposed to do in this situation so I can't offer a fix in the test or in the application itself either.
Also note that I've started a WIP MR for mocking-out the server: https:/
Robert Steckroth (robertsteckroth) wrote : | # |
Ya sure, I am looking into it now.
On Tue, Nov 12, 2013 at 9:27 PM, Christopher Lee <email address hidden>wrote:
> Hi Robert, I getting a test failure
> (stock_
> not sure how to solve. I'm wondering if you could lend me your knowledge
> and help me out?
>
> The error message:
> tests/autopilot
> test_chart_subtab
> self.assertThat
> File "/usr/lib/
> in assertThat
> raise MismatchError(
> MismatchError: 300.0 == 300.0
>
> I'm not certain what it (or the chart) is supposed to do in this situation
> so I can't offer a fix in the test or in the application itself either.
>
>
> Also note that I've started a WIP MR for mocking-out the server:
> https:/
> --
>
> https:/
> You are reviewing the proposed merge of
> lp:~veebers/stock-ticker-mobile-app/porting-autopilot-1.4 into
> lp:stock-ticker-mobile-app.
>
--
<surgemcgee> Systems/Software Engineer
Robert Steckroth (robertsteckroth) wrote : | # |
Ok, I have looked into it but so not have the time to make the changes. Here is what you need to do.
* Remove all of the domain re-naming code from the application. This can be altered in the autopilot tests instead.
* Create a yahoo data stream for the front page. The application defaults to yahoo which is needed to run the tests.
* The chart.dot need to have an active stock to work. This will be fixed when yahoo is added as above^
* line: 52 in the Current_charts_page needs to be altered to this --> "onValueChanged: chart_day_range = value". I recommend puling from the stable branch until I find the time to fully integrate Indurate into the app.
Good python work by the way :)
Christopher Lee (veebers) wrote : | # |
Hi Robert, thanks :-) Thanks for taking the time to look at that issue.
I'm not the most intimate with this applications codebase so will need to look into what your comments entail.
In the meantime could you take a look at the mock server MR and make any suggestions you have on that? I get the feeling that some of your above comments can be introduced into that MR or perhaps after that code has landed?
Robert Steckroth (robertsteckroth) wrote : | # |
Ya, I did, the code looks good. I like the use of @property as a getter looping mechanism for the port (very clever).
I should be able to get a few extra days off work here shortly and polish up some things.
Christopher Lee (veebers) wrote : | # |
Hi Robert,
I've let these MR's get stale (this one and
https:/
At this stage I feel that _this_ branch is suitable to merge as it fixes all but
one test failure. I'll need your assistance, or ask you to take it on, to fix
the remaining as I don't have the familiarity of the application and
requirements to do so in any timely fashion.
WRT the second MR, the mock server, as mentioned previously I have this working
for me but a colleague is seeing failures. Again, I'm not familiar enough with
this application and it's data consumption use to efficiently solve this problem
so I'll ask that you can take this on and I can assist you in getting it
completed.
I'm hoping that we can get some movement on this in the near future.
Chris.
Preview Diff
1 | === modified file 'Current_charts_page.qml' | |||
2 | --- Current_charts_page.qml 2013-09-04 01:51:45 +0000 | |||
3 | +++ Current_charts_page.qml 2013-11-08 03:33:30 +0000 | |||
4 | @@ -20,6 +20,7 @@ | |||
5 | 20 | import "javascript/graph.js" as Graph | 20 | import "javascript/graph.js" as Graph |
6 | 21 | 21 | ||
7 | 22 | Rectangle { | 22 | Rectangle { |
8 | 23 | objectName: "chartDetails" | ||
9 | 23 | property var canvas_object | 24 | property var canvas_object |
10 | 24 | onVisibleChanged: visible && displayDayInfo() | 25 | onVisibleChanged: visible && displayDayInfo() |
11 | 25 | // color: "#FCFCFC" | 26 | // color: "#FCFCFC" |
12 | 26 | 27 | ||
13 | === modified file 'tests/autopilot/stock_ticker/tests/__init__.py' | |||
14 | --- tests/autopilot/stock_ticker/tests/__init__.py 2013-11-08 03:33:30 +0000 | |||
15 | +++ tests/autopilot/stock_ticker/tests/__init__.py 2013-11-08 03:33:30 +0000 | |||
16 | @@ -41,7 +41,7 @@ | |||
17 | 41 | scenarios = [('with touch', dict(input_device_class=Touch))] | 41 | scenarios = [('with touch', dict(input_device_class=Touch))] |
18 | 42 | 42 | ||
19 | 43 | local_location = "../../Stock_Ticker.qml" | 43 | local_location = "../../Stock_Ticker.qml" |
21 | 44 | installed_location = "/usr/share/stock-ticker-mobile-app/Stock_Tickers.qml" | 44 | installed_location = "/usr/share/stock-ticker-mobile-app/Stock_Ticker.qml" |
22 | 45 | sqlite_dir = os.path.expanduser( | 45 | sqlite_dir = os.path.expanduser( |
23 | 46 | "~/.local/share/com.ubuntu.stock-ticker-mobile/Databases") | 46 | "~/.local/share/com.ubuntu.stock-ticker-mobile/Databases") |
24 | 47 | backup_dir = sqlite_dir + ".backup" | 47 | backup_dir = sqlite_dir + ".backup" |
25 | 48 | 48 | ||
26 | === modified file 'tests/autopilot/stock_ticker/tests/test_Management_page.py' | |||
27 | --- tests/autopilot/stock_ticker/tests/test_Management_page.py 2013-10-10 18:51:45 +0000 | |||
28 | +++ tests/autopilot/stock_ticker/tests/test_Management_page.py 2013-11-08 03:33:30 +0000 | |||
29 | @@ -23,6 +23,7 @@ | |||
30 | 23 | from __future__ import absolute_import | 23 | from __future__ import absolute_import |
31 | 24 | 24 | ||
32 | 25 | from testtools.matchers import Equals | 25 | from testtools.matchers import Equals |
33 | 26 | from autopilot.introspection.dbus import StateNotFoundError | ||
34 | 26 | from autopilot.matchers import Eventually | 27 | from autopilot.matchers import Eventually |
35 | 27 | from stock_ticker.tests import StockTickerTestCase | 28 | from stock_ticker.tests import StockTickerTestCase |
36 | 28 | 29 | ||
37 | @@ -95,19 +96,23 @@ | |||
38 | 95 | management_delegate = \ | 96 | management_delegate = \ |
39 | 96 | management_listview.get_children()[0].get_children() | 97 | management_listview.get_children()[0].get_children() |
40 | 97 | 98 | ||
42 | 98 | cmpy_index = -1 | 99 | # Find the newly added row and list item. |
43 | 100 | target_row = None | ||
44 | 99 | for o in management_delegate: | 101 | for o in management_delegate: |
56 | 100 | add_list_item = o.select_single( | 102 | try: |
57 | 101 | 'QQuickText', objectName='companyNameText') | 103 | o.select_single( |
58 | 102 | cmpy_index += 1 | 104 | 'QQuickText', |
59 | 103 | if add_list_item and hasattr(add_list_item, 'text'): | 105 | objectName='companyNameText', |
60 | 104 | if add_list_item.text == 'Google Inc.': | 106 | text="Google Inc." |
61 | 105 | break | 107 | ) |
62 | 106 | 108 | target_row = o | |
63 | 107 | self.assertThat(add_list_item.text, Eventually(Equals('Google Inc.'))) | 109 | break |
64 | 108 | 110 | except StateNotFoundError: | |
65 | 109 | remove_button = management_delegate[cmpy_index].select_single( | 111 | pass |
66 | 110 | 'QQuickItem', objectName='removeButton') | 112 | |
67 | 113 | remove_button = target_row.select_single( | ||
68 | 114 | 'QQuickItem', | ||
69 | 115 | objectName='removeButton') | ||
70 | 111 | self.pointing_device.click_object(remove_button) | 116 | self.pointing_device.click_object(remove_button) |
71 | 112 | 117 | ||
72 | 113 | self.assertThat(management_listview.count, | 118 | self.assertThat(management_listview.count, |
73 | 114 | 119 | ||
74 | === modified file 'tests/autopilot/stock_ticker/tests/test_Subtabs.py' | |||
75 | --- tests/autopilot/stock_ticker/tests/test_Subtabs.py 2013-11-08 03:33:30 +0000 | |||
76 | +++ tests/autopilot/stock_ticker/tests/test_Subtabs.py 2013-11-08 03:33:30 +0000 | |||
77 | @@ -54,32 +54,38 @@ | |||
78 | 54 | details_button = sub_bar.select_single( | 54 | details_button = sub_bar.select_single( |
79 | 55 | 'UbuntuShape', objectName='detailsTab') | 55 | 'UbuntuShape', objectName='detailsTab') |
80 | 56 | 56 | ||
83 | 57 | subtab_pages = self.app.select_single( | 57 | tabs_container = self.app.select_single( |
84 | 58 | 'QQuickItem', objectName='currentRectSizer').get_children() | 58 | 'QQuickItem', objectName='currentRectSizer') |
85 | 59 | chart_details = tabs_container.select_single( | ||
86 | 60 | "Current", | ||
87 | 61 | objectName="chartDetails") | ||
88 | 62 | details_listview = tabs_container.select_single( | ||
89 | 63 | "QQuickListView", | ||
90 | 64 | objectName="detailsListView") | ||
91 | 59 | 65 | ||
92 | 60 | # Ensure toolbar is hidden so we can interact with buttons | 66 | # Ensure toolbar is hidden so we can interact with buttons |
93 | 61 | self.main_view.close_toolbar() | 67 | self.main_view.close_toolbar() |
94 | 62 | 68 | ||
95 | 63 | self.pointing_device.click_object(details_button) | 69 | self.pointing_device.click_object(details_button) |
97 | 64 | self.assertThat(subtab_pages[2].visible, Eventually(Equals(True))) | 70 | self.assertThat(details_listview.visible, Eventually(Equals(True))) |
98 | 65 | 71 | ||
99 | 66 | self.pointing_device.click_object(charts_button) | 72 | self.pointing_device.click_object(charts_button) |
100 | 67 | 73 | ||
103 | 68 | self.assertThat(subtab_pages[2].visible, Eventually(Equals(False))) | 74 | self.assertThat(details_listview.visible, Eventually(Equals(False))) |
104 | 69 | self.assertThat(subtab_pages[1].visible, Eventually(Equals(True))) | 75 | self.assertThat(chart_details.visible, Eventually(Equals(True))) |
105 | 70 | 76 | ||
106 | 71 | chart_dot = self.app.select_single( | 77 | chart_dot = self.app.select_single( |
107 | 72 | 'QQuickImage', objectName='chartDot') | 78 | 'QQuickImage', objectName='chartDot') |
108 | 73 | chart_info = self.app.select_single( | 79 | chart_info = self.app.select_single( |
109 | 74 | 'QQuickText', objectName='dayInfoText') | 80 | 'QQuickText', objectName='dayInfoText') |
110 | 75 | 81 | ||
112 | 76 | self.pointing_device.click_object(subtab_pages[1]) | 82 | self.pointing_device.click_object(chart_details) |
113 | 77 | 83 | ||
114 | 78 | dot_x = chart_dot.x | 84 | dot_x = chart_dot.x |
115 | 79 | info_text = chart_info.text | 85 | info_text = chart_info.text |
116 | 80 | 86 | ||
117 | 81 | self.main_view.move_subtabs_bar_up() | 87 | self.main_view.move_subtabs_bar_up() |
119 | 82 | self.main_view.flick_page_right(subtab_pages[1]) | 88 | self.main_view.flick_page_right(chart_details) |
120 | 83 | 89 | ||
121 | 84 | self.assertThat(chart_dot.x, NotEquals(dot_x)) | 90 | self.assertThat(chart_dot.x, NotEquals(dot_x)) |
122 | 85 | self.assertThat(chart_info.text, NotEquals(info_text)) | 91 | self.assertThat(chart_info.text, NotEquals(info_text)) |
123 | @@ -106,22 +112,25 @@ | |||
124 | 106 | details_button = sub_bar.select_single( | 112 | details_button = sub_bar.select_single( |
125 | 107 | 'UbuntuShape', objectName='detailsTab') | 113 | 'UbuntuShape', objectName='detailsTab') |
126 | 108 | 114 | ||
129 | 109 | subtab_pages = self.app.select_single( | 115 | tabs_container = self.app.select_single( |
130 | 110 | 'QQuickItem', objectName='currentRectSizer').get_children() | 116 | 'QQuickItem', objectName='currentRectSizer') |
131 | 117 | news_listview = tabs_container.select_single( | ||
132 | 118 | "QQuickListView", | ||
133 | 119 | objectName="newsListView") | ||
134 | 120 | details_listview = tabs_container.select_single( | ||
135 | 121 | "QQuickListView", | ||
136 | 122 | objectName="detailsListView") | ||
137 | 111 | 123 | ||
138 | 112 | # Ensure toolbar is hidden so we can interact with buttons | 124 | # Ensure toolbar is hidden so we can interact with buttons |
139 | 113 | self.main_view.close_toolbar() | 125 | self.main_view.close_toolbar() |
140 | 114 | 126 | ||
141 | 115 | self.pointing_device.click_object(news_button) | 127 | self.pointing_device.click_object(news_button) |
143 | 116 | self.assertThat(subtab_pages[3].visible, Eventually(Equals(True))) | 128 | self.assertThat(news_listview.visible, Eventually(Equals(True))) |
144 | 117 | 129 | ||
145 | 118 | self.pointing_device.click_object(details_button) | 130 | self.pointing_device.click_object(details_button) |
146 | 119 | 131 | ||
152 | 120 | self.assertThat(subtab_pages[3].visible, Eventually(Equals(False))) | 132 | self.assertThat(news_listview.visible, Eventually(Equals(False))) |
153 | 121 | self.assertThat(subtab_pages[2].visible, Eventually(Equals(True))) | 133 | self.assertThat(details_button.visible, Eventually(Equals(True))) |
149 | 122 | |||
150 | 123 | details_listview = self.app.select_single( | ||
151 | 124 | 'QQuickListView', objectName='detailsListView') | ||
154 | 125 | 134 | ||
155 | 126 | contentY = details_listview.contentY | 135 | contentY = details_listview.contentY |
156 | 127 | 136 | ||
157 | @@ -129,7 +138,7 @@ | |||
158 | 129 | Eventually(Equals(details_listview.contentY))) | 138 | Eventually(Equals(details_listview.contentY))) |
159 | 130 | 139 | ||
160 | 131 | self.main_view.move_subtabs_bar_up() | 140 | self.main_view.move_subtabs_bar_up() |
162 | 132 | self.main_view.hold_page_down(subtab_pages[2]) | 141 | self.main_view.hold_page_down(details_listview) |
163 | 133 | 142 | ||
164 | 134 | self.assertThat(details_listview.contentY, | 143 | self.assertThat(details_listview.contentY, |
165 | 135 | Eventually(NotEquals(contentY))) | 144 | Eventually(NotEquals(contentY))) |
166 | @@ -157,29 +166,33 @@ | |||
167 | 157 | details_button = sub_bar.select_single( | 166 | details_button = sub_bar.select_single( |
168 | 158 | 'UbuntuShape', objectName='detailsTab') | 167 | 'UbuntuShape', objectName='detailsTab') |
169 | 159 | 168 | ||
174 | 160 | subtab_pages = self.app.select_single( | 169 | tabs_container = self.app.select_single( |
175 | 161 | 'QQuickItem', objectName='currentRectSizer').get_children() | 170 | 'QQuickItem', |
176 | 162 | 171 | objectName='currentRectSizer') | |
177 | 163 | # Ensure toolbar is hidden so we can interact with buttons | 172 | |
178 | 173 | news_listview = tabs_container.select_single( | ||
179 | 174 | "QQuickListView", | ||
180 | 175 | objectName="newsListView") | ||
181 | 176 | details_listview = tabs_container.select_single( | ||
182 | 177 | "QQuickListView", | ||
183 | 178 | objectName="detailsListView") | ||
184 | 179 | |||
185 | 164 | self.main_view.close_toolbar() | 180 | self.main_view.close_toolbar() |
186 | 165 | 181 | ||
187 | 166 | self.pointing_device.click_object(details_button) | 182 | self.pointing_device.click_object(details_button) |
189 | 167 | self.assertThat(subtab_pages[2].visible, Eventually(Equals(True))) | 183 | self.assertThat(details_listview.visible, Eventually(Equals(True))) |
190 | 168 | 184 | ||
191 | 169 | self.pointing_device.click_object(news_button) | 185 | self.pointing_device.click_object(news_button) |
192 | 170 | 186 | ||
198 | 171 | self.assertThat(subtab_pages[2].visible, Eventually(Equals(False))) | 187 | self.assertThat(details_listview.visible, Eventually(Equals(False))) |
199 | 172 | self.assertThat(subtab_pages[3].visible, Eventually(Equals(True))) | 188 | self.assertThat(news_listview.visible, Eventually(Equals(True))) |
195 | 173 | |||
196 | 174 | news_listview = self.app.select_single( | ||
197 | 175 | 'QQuickListView', objectName='newsListView') | ||
200 | 176 | 189 | ||
201 | 177 | contentY = news_listview.contentY | 190 | contentY = news_listview.contentY |
202 | 178 | 191 | ||
203 | 179 | self.assertThat(news_listview.contentY, Eventually(Equals(contentY))) | 192 | self.assertThat(news_listview.contentY, Eventually(Equals(contentY))) |
204 | 180 | 193 | ||
205 | 181 | self.main_view.move_subtabs_bar_up() | 194 | self.main_view.move_subtabs_bar_up() |
207 | 182 | self.main_view.hold_page_down(subtab_pages[3]) | 195 | self.main_view.hold_page_down(news_listview) |
208 | 183 | 196 | ||
209 | 184 | self.assertThat(news_listview.contentY, | 197 | self.assertThat(news_listview.contentY, |
210 | 185 | Eventually(NotEquals(contentY))) | 198 | Eventually(NotEquals(contentY))) |
It works good. Two tests failed but..