Merge lp:~boiko/messaging-app/fix_autopilot into lp:messaging-app

Proposed by Gustavo Pichorim Boiko
Status: Merged
Approved by: Bill Filler
Approved revision: no longer in the source branch.
Merged at revision: 81
Proposed branch: lp:~boiko/messaging-app/fix_autopilot
Merge into: lp:messaging-app
Diff against target: 48 lines (+3/-6)
3 files modified
src/qml/MessageDelegate.qml (+1/-0)
src/qml/Messages.qml (+1/-0)
tests/autopilot/messaging_app/emulators.py (+1/-6)
To merge this branch: bzr merge lp:~boiko/messaging-app/fix_autopilot
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Leo Arias (community) code review, ran the test Approve
Bill Filler (community) Approve
Review via email: mp+211651@code.launchpad.net

Commit message

Wait for the messages to be marked as read before getting them in autopilot tests.

Description of the change

Wait for the messages to be marked as read before getting them in autopilot tests.

== Checklist ==
Are there any related MPs required for this MP to build/function as expected? Please list.
No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)
Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/messaging-app) on device or emulator?
Yes

If you changed the UI, was the change specified/approved by design?
N/A

If you changed the packaging (debian), did you subscribe a core-dev to this MP?
N/A

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
Leo Arias (elopio) wrote :

I've finally flashed my device with Ubuntu. When I run this branch commenting the

29 time.sleep(2)

I still get the same error as before when trying to move the pointer to the message bubble:
StateNotFoundError: Object not found with name 'MessageDelegate' and properties {'id': 17}.

So loaded.wait_for(True) doesn't seem to be waiting enough for me.

review: Needs Fixing
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

> I've finally flashed my device with Ubuntu. When I run this branch commenting
> the
>
> 29 time.sleep(2)
>
> I still get the same error as before when trying to move the pointer to the
> message bubble:
> StateNotFoundError: Object not found with name 'MessageDelegate' and
> properties {'id': 17}.
>
> So loaded.wait_for(True) doesn't seem to be waiting enough for me.

After some more investigation, I found the real root cause of the problem. It happens because the messages on the thread used by the test are still unread, and then when you enter the view, the app requests history-service to mark them as read, which in turns triggers an update on the items, which makes the list view discard the previous delegates and create new ones.

I have changed the MR using the correct fix now, which is to only get the delegates after the items are already marked as read.

Revision history for this message
Bill Filler (bfiller) wrote :

approved
Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/<package-name>) on device or emulator?
yes

Did CI run pass? If not, please explain why.
Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
yes

Revision history for this message
Bill Filler (bfiller) :
review: Approve
Revision history for this message
Leo Arias (elopio) wrote :

Thank you very much!

review: Approve (code review, ran the test)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
81. By Gustavo Pichorim Boiko

Wait for the messages to be marked as read before getting them in autopilot tests. Fixes: 1293610

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/MessageDelegate.qml'
2--- src/qml/MessageDelegate.qml 2014-03-14 10:27:45 +0000
3+++ src/qml/MessageDelegate.qml 2014-03-19 14:27:28 +0000
4@@ -30,6 +30,7 @@
5 property bool incoming: false
6 property string textColor: incoming ? "#333333" : "#ffffff"
7 property bool selectionMode: false
8+ property bool unread: false
9
10 anchors.left: parent ? parent.left : undefined
11 anchors.right: parent ? parent.right: undefined
12
13=== modified file 'src/qml/Messages.qml'
14--- src/qml/Messages.qml 2014-03-14 10:27:45 +0000
15+++ src/qml/Messages.qml 2014-03-19 14:27:28 +0000
16@@ -400,6 +400,7 @@
17 objectName: "message%1".arg(index)
18 incoming: senderId != "self"
19 selected: messageList.isSelected(messageDelegate)
20+ unread: newEvent
21 removable: !messages.selectionMode
22 selectionMode: messages.selectionMode
23 confirmRemoval: true
24
25=== modified file 'tests/autopilot/messaging_app/emulators.py'
26--- tests/autopilot/messaging_app/emulators.py 2014-03-14 10:38:24 +0000
27+++ tests/autopilot/messaging_app/emulators.py 2014-03-19 14:27:28 +0000
28@@ -413,11 +413,6 @@
29 thread = self.select_single(
30 'ThreadDelegate', objectName='thread{}'.format(participants))
31 self.pointing_device.click_object(thread)
32- # XXX workaround an autopilot error we are getting with the qt5.2
33- # landing PPA. If we try to select messages without the sleep,
34- # it seems that the QML changes between autopilot selecting the
35- # object and clicking it. --elopio - 2014-03-14
36- time.sleep(2)
37 return self.get_root_instance().wait_select_single(Messages)
38
39
40@@ -446,7 +441,7 @@
41
42 def _get_message_delegate(self, index):
43 return self.wait_select_single(
44- 'MessageDelegate', objectName='message{}'.format(index))
45+ 'MessageDelegate', objectName='message{}'.format(index), unread=False)
46
47 def _long_press(self, object_):
48 if model() == 'Desktop':

Subscribers

People subscribed via source and target branches