24
24
""" This is needed to wait for the application to start.
25
25
In the testfarm, the application may take some time to show up."""
27
# Remove configuration file where knowledge of the photo roll hint's necessity is stored
28
config_file = os.path.expanduser("~/.config/com.ubuntu.camera/com.ubuntu.camera.conf")
29
os.remove(config_file)
27
31
super(TestCapture, self).setUp()
29
34
self.main_window.get_qml_view().visible, Eventually(Equals(True)))
49
54
# Wait for the camera to have finished focusing
50
55
# (the exposure button gets enabled when ready)
51
56
self.assertThat(exposure_button.enabled, Eventually(Equals(True)))
57
self.assertThat(exposure_button.width, Eventually(NotEquals(0)))
58
self.assertThat(exposure_button.height, Eventually(NotEquals(0)))
53
60
# Now take the picture! (Give it a little time to animate)
54
61
self.pointing_device.move_to_object(exposure_button)
91
98
# Click the exposure button to start recording
92
99
self.pointing_device.move_to_object(exposure_button)
93
100
self.assertThat(exposure_button.enabled, Eventually(Equals(True)))
101
self.assertThat(exposure_button.width, Eventually(NotEquals(0)))
102
self.assertThat(exposure_button.height, Eventually(NotEquals(0)))
94
103
self.pointing_device.click()
96
105
# Record video for 2 seconds and check if the stop watch actually
126
135
self.assertThat(stop_watch.opacity, Eventually(Equals(0.0)))
137
def test_hint_after_first_picture(self):
138
hint = self.main_window.get_photo_roll_hint()
139
photo_button = self.main_window.get_exposure_button()
141
# Wait for the camera to be ready to take a picture
142
self.assertThat(photo_button.enabled, Eventually(Equals(True)))
143
self.assertThat(photo_button.width, Eventually(NotEquals(0)))
144
self.assertThat(photo_button.height, Eventually(NotEquals(0)))
146
# Check that the photo roll hint is hidden
147
self.assertEquals(hint.visible, False)
150
self.pointing_device.move_to_object(photo_button)
151
self.pointing_device.click()
153
# Check that the photo roll hint is displayed
154
#self.assertEquals(hint.visible, True)
155
self.assertThat(hint.visible, Eventually(Equals(True)))
157
# Swipe to photo roll
158
self.main_window.swipe_to_gallery(self)
159
self.main_window.swipe_to_viewfinder(self)
161
# Check that the photo roll hint is hidden
162
self.assertEquals(hint.visible, False)
128
164
"""Test that the shoot button gets disabled for a while then re-enabled
129
165
after shooting"""
130
166
@unittest.skip("Disabled this test due race condition see bug 1227373")