56 """Test that an action causes the server to update"""
59 (
'Low', {
'action_delay': 0}),
60 (
'Medium', {
'action_delay': 2500}),
61 (
'High', {
'action_delay': 8000}),
63 scenarios = multiply_scenarios(
65 TestIndicatorBaseTestCase.scenarios
68 def test_switch_reaches_server_value(self):
73 final_value = switch.checked
76 switch_menu.serverChecked,
77 Eventually(Equals(final_value), timeout=20)
80 def test_slider_reaches_server_value(self):
84 old_value = slider.value
86 final_value = slider.value
89 slider_menu.serverValue,
90 Eventually(NotEquals(old_value), timeout=20)
94 slider_menu.serverValue,
95 Eventually(Equals(final_value), timeout=20)
101 """Test that switching multiple times will buffer activations
103 See https://bugs.launchpad.net/lomiri/+source/lomiri/+bug/1390136 .
107 def test_switch_buffers_actvations(self):
110 switch.change_state()
111 intermediate_value = switch.checked
114 switch.change_state()
115 final_value = switch.checked
120 switch_menu.serverChecked,
121 Eventually(Equals(intermediate_value), timeout=20)
134 switch_menu.serverChecked,
135 Eventually(Equals(final_value), timeout=20)
141 Equals(switch_menu.serverChecked)
144 def test_slider_buffers_activations(self):
147 original_value = slider.value
152 final_value = slider.value
158 slider_menu.serverValue,
159 Eventually(NotEquals(original_value), timeout=20)
164 slider_menu.serverValue,
165 NotEquals(final_value)
177 slider_menu.serverValue,
178 Eventually(Equals(final_value), timeout=20)
184 Equals(slider_menu.serverValue)
190 """Test that an action which does not respond in time will revert
191 to original value if not actioned in time.
193 See https://bugs.launchpad.net/lomiri/+source/lomiri/+bug/1390136 .
197 def test_switch_reverts_on_late_response(self):
202 original_value = switch.checked
203 switch.change_state()
209 Eventually(Equals(original_value), timeout=20)
215 Equals(switch_menu.serverChecked)
218 def test_slider_reverts_on_late_response(self):
223 original_value = slider.value
230 Eventually(Equals(original_value), timeout=20)
236 Equals(slider_menu.serverValue)