Merge lp:~canonical-platform-qa/ubuntu-ui-toolkit/fix1365674-optional_containers into lp:ubuntu-ui-toolkit/staging

Proposed by Leo Arias
Status: Merged
Approved by: Cris Dywan
Approved revision: 1274
Merged at revision: 1302
Proposed branch: lp:~canonical-platform-qa/ubuntu-ui-toolkit/fix1365674-optional_containers
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 76 lines (+39/-3)
2 files modified
tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_flickable.py (+5/-3)
tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py (+34/-0)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-ui-toolkit/fix1365674-optional_containers
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Cris Dywan Approve
Zoltan Balogh Approve
Brendan Donegan (community) Approve
Review via email: mp+236745@code.launchpad.net

Commit message

The autopilot helpers to swipe to show more now get the flickable containers by default.

To post a comment you must log in.
1272. By Leo Arias

Added explicit tests for swipe to show more receiving argument, as suggested by robotfuel.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

LGTM

review: Approve
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

OK

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

Autopilot crashed. running tests again.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1273. By Leo Arias

Merged with staging.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1274. By Leo Arias

Merged with trunk.

Revision history for this message
Cris Dywan (kalikiana) wrote :

Nice tweak! I actually was hitting this in a branch before and didn't find a solution without using internal API.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_flickable.py'
2--- tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_flickable.py 2014-08-03 03:06:54 +0000
3+++ tests/autopilot/ubuntuuitoolkit/_custom_proxy_objects/_flickable.py 2014-10-21 17:44:24 +0000
4@@ -119,7 +119,7 @@
5 "Couldn't swipe in the flickable.")
6
7 @autopilot_logging.log_action(logger.info)
8- def swipe_to_show_more_above(self, containers):
9+ def swipe_to_show_more_above(self, containers=None):
10 if self.atYBeginning:
11 raise _common.ToolkitException(
12 "Can't swipe more, we are already at the top of the "
13@@ -128,7 +128,7 @@
14 self._swipe_to_show_more('above', containers)
15
16 @autopilot_logging.log_action(logger.info)
17- def swipe_to_show_more_below(self, containers):
18+ def swipe_to_show_more_below(self, containers=None):
19 if self.atYEnd:
20 raise _common.ToolkitException(
21 "Can't swipe more, we are already at the bottom of the "
22@@ -136,7 +136,9 @@
23 else:
24 self._swipe_to_show_more('below', containers)
25
26- def _swipe_to_show_more(self, direction, containers):
27+ def _swipe_to_show_more(self, direction, containers=None):
28+ if containers is None:
29+ containers = self._get_containers()
30 start_x = stop_x = self.globalRect.x + (self.globalRect.width // 2)
31 # Start and stop just a little under the top and a little over the
32 # bottom.
33
34=== modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py'
35--- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2014-09-04 09:16:49 +0000
36+++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2014-10-21 17:44:24 +0000
37@@ -179,6 +179,40 @@
38 self.flickable.swipe_to_bottom()
39 self.assertTrue(self.flickable.atYEnd)
40
41+ def test_swipe_to_show_more_above_with_containers(self):
42+ """Swipe to show more above must receive containers as parameter."""
43+ self.flickable.swipe_to_bottom()
44+ self.assertTrue(self.flickable.atYEnd)
45+
46+ containers = self.flickable._get_containers()
47+ self.flickable.swipe_to_show_more_above(containers)
48+ self.assertFalse(self.flickable.atYEnd)
49+
50+ def test_swipe_to_show_more_above_without_arguments(self):
51+ """Calling swipe to show more above must get containers by default."""
52+ self.flickable.swipe_to_bottom()
53+ self.assertTrue(self.flickable.atYEnd)
54+
55+ self.flickable.swipe_to_show_more_above()
56+ self.assertFalse(self.flickable.atYEnd)
57+
58+ def test_swipe_to_show_more_below_with_containers(self):
59+ """Swipe to show more below must receive containers as parameter."""
60+ self.flickable.swipe_to_top()
61+ self.assertTrue(self.flickable.atYBeginning)
62+
63+ containers = self.flickable._get_containers()
64+ self.flickable.swipe_to_show_more_below(containers)
65+ self.assertFalse(self.flickable.atYBeginning)
66+
67+ def test_swipe_to_show_more_below_without_arguments(self):
68+ """Calling swipe to show more below must get containers by default."""
69+ self.flickable.swipe_to_top()
70+ self.assertTrue(self.flickable.atYBeginning)
71+
72+ self.flickable.swipe_to_show_more_below()
73+ self.assertFalse(self.flickable.atYBeginning)
74+
75
76 class UnityFlickableTestCase(tests.QMLStringAppTestCase):
77

Subscribers

People subscribed via source and target branches