Merge lp:~rpadovani/ubuntu-calculator-app/fixed-test into lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk

Proposed by Riccardo Padovani
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 109
Merged at revision: 108
Proposed branch: lp:~rpadovani/ubuntu-calculator-app/fixed-test
Merge into: lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk
Diff against target: 75 lines (+11/-12)
3 files modified
Simple/Screen.qml (+1/-1)
tests/autopilot/ubuntu_calculator_app/emulators/simple_page.py (+2/-2)
tests/autopilot/ubuntu_calculator_app/tests/test_simple_page.py (+8/-9)
To merge this branch: bzr merge lp:~rpadovani/ubuntu-calculator-app/fixed-test
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Gustavo Pichorim Boiko (community) Approve
Review via email: mp+174873@code.launchpad.net

Commit message

Update delete test to new UX (you have to click delete button)
Fixed tear off test (before was alway true for a wrong implementation, now it's a real test)

Description of the change

Update delete test to new UX (you have to click delete button)
Fixed tear off test (before was alway true for a wrong implementation, now it's a real test)

To post a comment you must log in.
109. By Riccardo Padovani

Little improvment to tear off test

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

The code looks good. I am just wondering if the numbers might be different in another language and thus the representation won't be "14" anymore, but still, it is better than the previous code, approving.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Simple/Screen.qml'
2--- Simple/Screen.qml 2013-07-15 15:09:20 +0000
3+++ Simple/Screen.qml 2013-07-15 21:52:26 +0000
4@@ -120,7 +120,7 @@
5 }
6
7 Button {
8- text: i18n.tr("Delete")
9+ text: i18n.tr("Delete")
10 width: parent.width
11 onClicked: root.removeItem()
12 }
13
14=== modified file 'tests/autopilot/ubuntu_calculator_app/emulators/simple_page.py'
15--- tests/autopilot/ubuntu_calculator_app/emulators/simple_page.py 2013-07-14 21:18:06 +0000
16+++ tests/autopilot/ubuntu_calculator_app/emulators/simple_page.py 2013-07-15 21:52:26 +0000
17@@ -17,8 +17,8 @@
18 def get_formula_label(self):
19 return self.app.select_single('CalcLabel', isLast=True)
20
21- def get_calc_label(self, label_id):
22- return self.app.select_single('CalcLabel', id=label_id)
23+ def get_calc_label(self, numbers):
24+ return self.app.select_single('CalcLabel', numbers=numbers)
25
26 def get_screen(self):
27 return self.app.select_many("Screen")[0]
28
29=== modified file 'tests/autopilot/ubuntu_calculator_app/tests/test_simple_page.py'
30--- tests/autopilot/ubuntu_calculator_app/tests/test_simple_page.py 2013-07-14 22:05:48 +0000
31+++ tests/autopilot/ubuntu_calculator_app/tests/test_simple_page.py 2013-07-15 21:52:26 +0000
32@@ -80,6 +80,11 @@
33 ty = y + (w / 2)
34
35 self.pointing_device.drag(tx + h / 3 , ty + w / 3, tx - h / 3, ty + w / 3)
36+ self.pointing_device.drag(tx, ty, tx, ty + w / 3)
37+ self.pointing_device.move(tx, ty + 1.3 * (w / 10))
38+
39+ self.pointing_device.click()
40+ self.pointing_device.click() # Second one is necessary to have the time to drag
41
42 def _click_buttons(self, input_):
43 for char in input_:
44@@ -195,21 +200,15 @@
45
46 def test_tear_off(self):
47 """Test tear off adds calculation to history"""
48- # Take the label id
49- label_id = self.simple_page.get_formula_label().id
50-
51 # Do the calc
52 self._tear_off("9+5")
53
54 # Check if has been saved
55- label = lambda: self.simple_page.get_calc_label(label_id)
56- self.assertThat(label, Eventually(NotEquals(label_id)))
57+ label = lambda: self.simple_page.get_calc_label("14")
58+ self.assertThat(label, Eventually(NotEquals(None)))
59
60 def test_swipe_delete_calculation_right_left(self):
61 """Try to delete a calculation swiping it from right to left"""
62- # Take the label id
63- label_id = self.simple_page.get_formula_label().id
64-
65 # Do the calc
66 self._tear_off("9+5")
67
68@@ -217,5 +216,5 @@
69 self._delete_last_calculation()
70
71 # Check if has been deleted
72- label = lambda: self.simple_page.get_calc_label(label_id)
73+ label = lambda: self.simple_page.get_calc_label("14")
74 self.assertThat(label, Eventually(Equals(None)))
75\ No newline at end of file

Subscribers

People subscribed via source and target branches