diff --git a/changes/2838.misc.rst b/changes/2838.misc.rst new file mode 100644 index 0000000000..c79fb95983 --- /dev/null +++ b/changes/2838.misc.rst @@ -0,0 +1 @@ +The ActivityIndicator tests now check for the correct visibility behavior when started and stopped. diff --git a/cocoa/tests_backend/widgets/activityindicator.py b/cocoa/tests_backend/widgets/activityindicator.py index 8389def931..a0d419a276 100644 --- a/cocoa/tests_backend/widgets/activityindicator.py +++ b/cocoa/tests_backend/widgets/activityindicator.py @@ -5,3 +5,7 @@ class ActivityIndicatorProbe(SimpleProbe): native_class = NSProgressIndicator + + @property + def is_hidden(self): + return self.native.isHidden() diff --git a/gtk/tests_backend/widgets/activityindicator.py b/gtk/tests_backend/widgets/activityindicator.py index 0a8ecfeac0..5bfa1c5d64 100644 --- a/gtk/tests_backend/widgets/activityindicator.py +++ b/gtk/tests_backend/widgets/activityindicator.py @@ -5,3 +5,7 @@ class ActivityIndicatorProbe(SimpleProbe): native_class = Gtk.Spinner + + @property + def is_hidden(self): + return not self.native.get_visible() diff --git a/iOS/tests_backend/widgets/activityindicator.py b/iOS/tests_backend/widgets/activityindicator.py index bc20c88bab..6fe2053771 100644 --- a/iOS/tests_backend/widgets/activityindicator.py +++ b/iOS/tests_backend/widgets/activityindicator.py @@ -5,3 +5,7 @@ class ActivityIndicatorProbe(SimpleProbe): native_class = UIActivityIndicatorView + + @property + def is_hidden(self): + return self.native.isHidden() diff --git a/testbed/tests/widgets/test_activityindicator.py b/testbed/tests/widgets/test_activityindicator.py index 15e97cc720..1de71464df 100644 --- a/testbed/tests/widgets/test_activityindicator.py +++ b/testbed/tests/widgets/test_activityindicator.py @@ -25,12 +25,14 @@ async def test_start_stop(widget, probe): # Widget should now be started assert widget.is_running + assert not probe.is_hidden widget.stop() await probe.redraw("Activity Indicator should be stopped") # Widget should now be stopped assert not widget.is_running + assert probe.is_hidden async def test_fixed_square_widget_size(widget, probe):