Merge lp:~jonas-drange/ubuntu-system-settings/fix-background-test into lp:ubuntu-system-settings

Proposed by Jonas G. Drange on 2015-01-29
Status: Work in progress
Proposed branch: lp:~jonas-drange/ubuntu-system-settings/fix-background-test
Merge into: lp:ubuntu-system-settings
Diff against target: 41 lines (+13/-11)
1 file modified
tests/autopilot/ubuntu_system_settings/tests/test_background.py (+13/-11)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-system-settings/fix-background-test
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration 2015-01-29 Needs Fixing on 2015-01-30
Sebastien Bacher (community) 2015-01-29 Needs Fixing on 2015-01-29
Review via email: mp+247955@code.launchpad.net

Commit Message

[background] fix test by being less specific about what image to choose as new background

Description of the Change

[background] fix test by being less specific about what image to choose as new background

To post a comment you must log in.
Sebastien Bacher (seb128) wrote :

looks fine, thanks

review: Approve
Sebastien Bacher (seb128) wrote :

in fact from CI result, that needs work :-/

review: Needs Fixing
Jonas G. Drange (jonas-drange) wrote :

Can't reproduce that failure on mako, desktop or krillin. The good news is that the assertEqual failure is not the issue here.

Unmerged revisions

1281. By Jonas G. Drange on 2015-01-29

fix test by not being specific which background we click, since that is broken

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/ubuntu_system_settings/tests/test_background.py'
2--- tests/autopilot/ubuntu_system_settings/tests/test_background.py 2014-12-02 06:40:54 +0000
3+++ tests/autopilot/ubuntu_system_settings/tests/test_background.py 2015-01-29 10:27:22 +0000
4@@ -29,7 +29,8 @@
5 def get_wallpapergrid(self, name):
6 """Return a WallpaperGrid with given name, or
7 all of them"""
8- return self.select_single('WallpaperGrid', objectName=name)
9+ return self.main_view.wait_select_single(
10+ 'WallpaperGrid', objectName=name)
11
12 def get_wallpapers(self, name=None):
13 """Return individual wallpapers (QQuickImage) in given grid,
14@@ -77,16 +78,17 @@
15
16 # wallpaper source that is selected now
17 old = self.selected_wallpaper.source
18-
19- # click a wallpaper that is not selected
20- self.main_view.scroll_to_and_click(
21- self.all_wallpapers[3])
22-
23- # click set/save
24- self.save_wallpaper()
25-
26- # the newly selected wallpaper source
27- new = self.selected_wallpaper.source
28+ new = None
29+
30+ # Grid elements are produced by a repeater, and AP cannot
31+ # AFAIK select specific children. We therefor click backgrounds
32+ # until the selected wallpaper changes
33+ for wp in self.get_wallpapers(name='UbuntuArtGrid'):
34+ self.main_view.pointing_device.click_object(wp)
35+ self.save_wallpaper()
36+ new = self.selected_wallpaper.source
37+ if old != new:
38+ break
39
40 # assert that UI is updated
41 self.assertNotEqual(new, old)

Subscribers

People subscribed via source and target branches