Merge lp:~canonical-platform-qa/ubuntu-system-tests/pull_to_refresh_video_scope into lp:ubuntu-system-tests

Proposed by Omer Akram
Status: Work in progress
Proposed branch: lp:~canonical-platform-qa/ubuntu-system-tests/pull_to_refresh_video_scope
Merge into: lp:ubuntu-system-tests
Diff against target: 71 lines (+14/-10)
3 files modified
ubuntu_system_tests/helpers/scopes/base.py (+8/-1)
ubuntu_system_tests/helpers/scopes/video/_cpo.py (+5/-8)
ubuntu_system_tests/tests/scopes/test_video_scope.py (+1/-1)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-system-tests/pull_to_refresh_video_scope
Reviewer Review Type Date Requested Status
platform-qa-bot continuous-integration Needs Fixing
Richard Huddie (community) Needs Fixing
Santiago Baldassin (community) Approve
prod-platform-qa continuous-integration Pending
Review via email: mp+305824@code.launchpad.net

Commit message

Stabilize local videos display test

Description of the change

manually refresh the video scope before trying to assess its elements.

@run_tests: ubuntu_system_tests.tests.scopes.test_video_scope.VideoScopeTest.test_display_local_video_content

To post a comment you must log in.
Revision history for this message
Omer Akram (om26er) wrote :

My hunch is that it could be a timing issue between the files are copied vs the scope is opened. So I implemented a mechanism that refreshes the video scope when its opened. If we still see the test failure after this update, we can declare that to be a real bug.

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Comments inline

review: Needs Fixing
463. By Omer Akram

minor changes per review

Revision history for this message
Omer Akram (om26er) wrote :

Thanks for the review, updated the code.

Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Code looks good to me. Let's wait until Jenkins vote before emerge

review: Approve
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Omer Akram (om26er) wrote :

Interestingly the test is still failing and I don't seem to be able to reproduce it here. Will probably need to replicate a test run exactly like the lab.

Revision history for this message
Richard Huddie (rhuddie) wrote :

> Interestingly the test is still failing and I don't seem to be able to
> reproduce it here. Will probably need to replicate a test run exactly like the
> lab.

I would recommend not using a pull action to refresh. - We've had many problems with this in the past as it is not reliable. There is already a refresh() method in the base class which uses url dispatcher to navigate back to the current scope and it causes a refresh without any UI interaction. So I would try using that first.

Revision history for this message
Richard Huddie (rhuddie) wrote :

Setting as needs fixing for above.

review: Needs Fixing
Revision history for this message
Omer Akram (om26er) wrote :

It seems we don't really need a fix on this one. Its something to do with the lab as the scope is completely blank there.

I'll probably need remote access to the device in the lab.

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

> > Interestingly the test is still failing and I don't seem to be able to
> > reproduce it here. Will probably need to replicate a test run exactly like
> the
> > lab.
>
> I would recommend not using a pull action to refresh. - We've had many
> problems with this in the past as it is not reliable. There is already a
> refresh() method in the base class which uses url dispatcher to navigate back
> to the current scope and it causes a refresh without any UI interaction. So I
> would try using that first.

I'm sorry but I disagree with Richard on this one. I think that the use of the pull_to_refresh method is actually a good solution. That's what the end user would do if the local videos/photos are not displayed. Using the url dispatcher is not really a navigation option for the end users so I would avoid it. If the pull to refresh method is not reliable, me can work and making it more robust

464. By Omer Akram

dummy commit for CI

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Richard Huddie (rhuddie) wrote :

We had a similar problem on this mp: https://code.launchpad.net/~canonical-platform-qa/ubuntu-system-tests/fix_sd_card/+merge/305711

The solution there was to use the mediascanner observer to wait for the new media files to be scanned before navigating to the scope. I think similar fix would likely work here also.

review: Needs Fixing
Revision history for this message
Omer Akram (om26er) wrote :

This is more of an issue with the Device setup than the test code. The scope being completely blank, all the times indicates of a situation with network.

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Allan LeSage (allanlesage) wrote :

Rebuilding this a few times just for kicks.

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

464. By Omer Akram

dummy commit for CI

463. By Omer Akram

minor changes per review

462. By Omer Akram

Implement a pull_to_refresh for scopes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu_system_tests/helpers/scopes/base.py'
2--- ubuntu_system_tests/helpers/scopes/base.py 2016-09-15 14:00:15 +0000
3+++ ubuntu_system_tests/helpers/scopes/base.py 2016-09-20 16:11:55 +0000
4@@ -55,6 +55,13 @@
5 objectName='categoryListView')
6 list_view.swipe_to_top()
7
8+ def pull_to_refresh(self):
9+ """Refresh the scope by a pull down."""
10+ width, height = self.globalRect.w, self.globalRect.h
11+ self.pointing_device.drag(width / 2, height / 2, width / 2, height)
12+ self.wait_for_processing_to_start(silent_fail=True)
13+ self.wait_for_processing_to_complete()
14+
15 def _get_icon(self, category, title, subtitle=None):
16 """Return an icon that has specified title and subtitle.
17 :param category: The category to search.
18@@ -315,7 +322,7 @@
19 self.processing.wait_for(True, timeout=timeout)
20 except AssertionError as e:
21 if not silent_fail:
22- raise(e)
23+ raise e
24
25 def wait_for_processing_to_complete(self):
26 """Wait for the processing indicator to disappear."""
27
28=== modified file 'ubuntu_system_tests/helpers/scopes/video/_cpo.py'
29--- ubuntu_system_tests/helpers/scopes/video/_cpo.py 2016-08-31 11:40:49 +0000
30+++ ubuntu_system_tests/helpers/scopes/video/_cpo.py 2016-09-20 16:11:55 +0000
31@@ -51,10 +51,9 @@
32 return False
33
34 def _get_my_videos_section(self):
35- self.wait_select_many(
36- ap_query_timeout=30, objectName='dashCategorylocal')
37- return self.select_single(
38- objectName='dashCategorylocal').select_single('QQuickGridView')
39+ local_videos_category = self.wait_select_single(
40+ ap_query_timeout=30, objectName='dashCategorylocal', visible=True)
41+ return local_videos_category.select_single('QQuickGridView')
42
43 def get_my_videos_thumbnails(self):
44 """
45@@ -71,10 +70,8 @@
46 return labels, sources
47
48 def get_my_videos(self):
49- """ Retrieve all the youtube videos """
50- self.wait_for_processing_to_complete()
51- buttons = self._get_videos(self._get_my_videos_section())
52- return buttons
53+ """ Retrieve all the local videos """
54+ return self._get_videos(self._get_my_videos_section())
55
56 def is_my_videos_displayed(self):
57 """ Indicate if the my videos section is being displayed """
58
59=== modified file 'ubuntu_system_tests/tests/scopes/test_video_scope.py'
60--- ubuntu_system_tests/tests/scopes/test_video_scope.py 2016-09-16 14:12:34 +0000
61+++ ubuntu_system_tests/tests/scopes/test_video_scope.py 2016-09-20 16:11:55 +0000
62@@ -79,8 +79,8 @@
63 shutil.copy2(test_data.SRC_VIDEO_FILE_1, video2)
64
65 scope = scopes.go_to_video_scope()
66-
67 self.dash.wait_for_dash_loaded()
68+ scope.pull_to_refresh()
69 video_content = scope.get_my_videos_thumbnails()
70 video_names = [video1_name, video2_name]
71 video_files = [THUMBNAILER_PREFIX + video1,

Subscribers

People subscribed via source and target branches

to all changes: