Merge lp:~rpadovani/ubuntu-calculator-app/1188716bis into lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk

Proposed by Riccardo Padovani
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 117
Merged at revision: 117
Proposed branch: lp:~rpadovani/ubuntu-calculator-app/1188716bis
Merge into: lp:~ubuntu-calculator-dev/ubuntu-calculator-app/old_trunk
Diff against target: 68 lines (+44/-1)
1 file modified
tests/autopilot/ubuntu_calculator_app/tests/test_simple_page.py (+44/-1)
To merge this branch: bzr merge lp:~rpadovani/ubuntu-calculator-app/1188716bis
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+177771@code.launchpad.net

Commit message

Added test to check if a calc is saved when you close and reopen the app

Description of the change

Added test to check if a calc is saved when you close and reopen the app

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Excellent. This fills in the final needed testcase. We'll have to see what happens with the issue of sending the kill signal. For now, let's add it :-)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/ubuntu_calculator_app/tests/test_simple_page.py'
--- tests/autopilot/ubuntu_calculator_app/tests/test_simple_page.py 2013-07-17 13:53:51 +0000
+++ tests/autopilot/ubuntu_calculator_app/tests/test_simple_page.py 2013-07-31 09:23:42 +0000
@@ -16,6 +16,8 @@
16from ubuntu_calculator_app.tests import CalculatorTestCase16from ubuntu_calculator_app.tests import CalculatorTestCase
17from ubuntu_calculator_app.emulators.simple_page import SimplePage17from ubuntu_calculator_app.emulators.simple_page import SimplePage
1818
19import os.path
20
1921
20class TestSimplePage(CalculatorTestCase):22class TestSimplePage(CalculatorTestCase):
2123
@@ -95,6 +97,38 @@
95 self.assertThat(97 self.assertThat(
96 get_result, Eventually(Equals(expected_result)))98 get_result, Eventually(Equals(expected_result)))
9799
100 def _close_and_reopen(self):
101 # See #1188292, there is a bug in SDK that prevents to use terminate
102 #self.simple_page.app.process.terminate()
103 #self.simple_page.app.process.wait()
104
105 screen = self.simple_page.get_screen()
106 x, y, h, w = screen.globalRect
107
108 self.pointing_device.move(x + (h / 25), y + w / 2.7)
109 self.pointing_device.click()
110
111 self.simple_page.app.process.wait()
112
113 local_location = "../../ubuntu-calculator-app.qml"
114
115 # Yes, I know, it's a duplication of CalculatorTestCase().setUp(), but I didn't find a better way to implement it
116 if os.path.exists(self.local_location):
117 self.app = self.launch_test_application(
118 "qmlscene",
119 self.local_location,
120 app_type='qt')
121 else:
122 self.app = self.launch_test_application(
123 "qmlscene",
124 "/usr/share/ubuntu-calculator-app/ubuntu-calculator-app.qml",
125 "--desktop_file_hint="
126 "/usr/share/applications/ubuntu-calculator-app.desktop",
127 app_type='qt')
128
129 # Check if windows has been launch
130 self.assertThat(self.simple_page.app.select_single("QQuickView").visible, Eventually(Equals(True)))
131
98 def test_equals_dont_change_numbers(self):132 def test_equals_dont_change_numbers(self):
99 """ Test that typing a number and pressing "=" won't change the number133 """ Test that typing a number and pressing "=" won't change the number
100 (bug #1165894).134 (bug #1165894).
@@ -229,4 +263,13 @@
229 self.pointing_device.click_object(calc)263 self.pointing_device.click_object(calc)
230264
231 self._calculate("+5")265 self._calculate("+5")
232 self._assert_result("25")
233\ No newline at end of file266\ No newline at end of file
267 self._assert_result("25")
268
269 def test_save_calculation_between_reload(self):
270 # Do the calc
271 self._tear_off("44-2")
272
273 self._close_and_reopen()
274
275 label = lambda: self.simple_page.get_calc_label("42")
276 self.assertThat(label, Eventually(NotEquals(None)))
234\ No newline at end of file277\ No newline at end of file

Subscribers

People subscribed via source and target branches