56
52
playback_button = self.main_window.get_playback_button()
57
53
player = self.main_window.get_player()
59
""" Default state after load the video is playing and with pause
55
# Default state after load the video is playing and with pause icon.
62
56
self.assertProperty(player, playing=True, paused=False)
63
57
self.assertProperty(playback_button, icon="pause")
65
59
self.pointing_device.click_object(playback_button)
67
""" First click must pause the video, change playing state and show
61
# First click must pause the video, change playing state and show play
69
63
self.assertProperty(player, playing=False, paused=True)
70
64
self.assertProperty(playback_button, icon="play")
72
66
self.pointing_device.click()
74
""" Second click should change the state to playing again """
68
# Second click should change the state to playing again
75
69
self.assertProperty(player, playing=True, paused=False)
76
70
self.assertProperty(playback_button, icon="pause")
78
@skip("New backend work needed. bug 1231147")
79
def test_scene_selector_visibility(self):
83
scene_selector = self.main_window.get_scene_selector()
84
slider = self.main_window.get_slider()
86
""" Default state is hide """
87
self.assertProperty(scene_selector, visible=False)
89
""" Scene selector must apper when clicking int the slider handler """
90
self.pointing_device.click_object(slider)
91
self.assertProperty(scene_selector, visible=True)
93
""" click again must dismiss the scene selector """
94
self.pointing_device.click()
95
self.assertProperty(scene_selector, visible=False)
97
@skip("fails on touch and is not reliable on different screen resolutions. bug 1183245")
98
def test_scene_selector_operation(self):
102
slider = self.main_window.get_slider()
103
time_line = self.main_window.get_timeline()
104
selector = self.main_window.get_scene_selector()
105
self.assertThat(selector.count, Eventually(GreaterThan(3)))
107
""" Show scene selector """
108
self.pointing_device.click_object(slider)
110
""" Make sure that the scenes are in correct place """
111
scene_0 = self.main_window.get_scene_0()
112
selectorRect = selector.globalRect
113
self.pointing_device.drag(
114
selectorRect[0], selectorRect[1] + selectorRect[3] / 2,
115
selectorRect[0] + selectorRect[2], selectorRect[1] + selectorRect[3] / 2)
116
self.assertThat(selector.moving, Eventually(Equals(False)))
117
self.assertThat(scene_0.x, Eventually(Equals(0)))
119
""" Click in the second scene """
120
scene_2 = self.main_window.get_scene_2()
121
self.assertThat(scene_2.ready, Eventually(Equals(True)))
122
self.pointing_device.click_object(scene_2)
123
self.assertThat(selector.currentIndex, Eventually(Equals(2)))
124
self.assertProperty(time_line, value=1.107)
126
@skipIf(model() == 'Nexus 4' or model() == 'Galaxy Nexus', 'Screen width not enough for seekbar')
72
@skipIf(model() in ('Nexus 4', 'Galaxy Nexus'),
73
'Screen width not enough for seekbar')
127
74
def test_time_display_behavior(self):
128
75
self.show_controls()
129
76
self.pause_video()
131
78
time_line = self.main_window.get_slider()
132
79
time_label = self.main_window.get_time_label()
134
""" Seek to the midle of the movie """
81
# Seek to the midle of the movie
135
82
self.pointing_device.click_object(time_line)
137
""" Time label must show the current video time (diff from zero or empty) """
84
# Time label must show the current video time (diff from zero or empty)
138
85
self.assertNotEqual(time_label.text, "00:00:00")
139
86
self.assertNotEqual(time_label.text, "")
141
""" Click in the label to change the state """
88
# Click in the label to change the state
142
89
self.pointing_device.click_object(time_label)
144
""" After the click the label must show the remaning time (with '-' signal) """
91
# After the click the label must show the remaning time (with '-'
145
93
self.assertEqual(time_label.text[0:1], "-")
147
@skipIf(model() == 'Nexus 4' or model() == 'Galaxy Nexus', 'Screen width not enough for seekbar')
95
@skipIf(model() in ('Nexus 4', 'Galaxy Nexus'),
96
'Screen width not enough for seekbar')
148
97
def test_show_controls_at_end(self):
149
98
controls = self.main_window.get_controls()
150
""" The controls are invisible by default """
99
# The controls are invisible by default
151
100
self.assertThat(controls.visible, Eventually(Equals(False)))
153
""" wait for video ends and control appears """
102
# wait for video ends and control appears
154
103
self.assertThat(controls.visible, Eventually(Equals(True), timeout=35))