From 2990c6acc05322b370a4261c7a48183cae5bdd7b Mon Sep 17 00:00:00 2001 From: Moises Date: Fri, 13 Sep 2024 22:57:09 +0200 Subject: [PATCH 1/3] Updated the ActivityIndicator tests to also check for visibility when started and stopped Signed-off-by: Moises --- cocoa/tests_backend/widgets/activityindicator.py | 4 ++++ gtk/tests_backend/widgets/activityindicator.py | 4 ++++ iOS/tests_backend/widgets/activityindicator.py | 4 ++++ testbed/tests/widgets/test_activityindicator.py | 3 +++ 4 files changed, 15 insertions(+) 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..1df31040ec 100644 --- a/testbed/tests/widgets/test_activityindicator.py +++ b/testbed/tests/widgets/test_activityindicator.py @@ -19,18 +19,21 @@ async def test_start_stop(widget, probe): "The activity indicator can be started and stopped" # Widget should be initially stopped assert not widget.is_running + assert probe.is_hidden widget.start() await probe.redraw("Activity Indicator should be started") # 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): From 0abadb2c2dfdb1e085de3b94311e69aa79c3c4fc Mon Sep 17 00:00:00 2001 From: Moises Date: Fri, 13 Sep 2024 23:03:42 +0200 Subject: [PATCH 2/3] Added changes rst file for test updates Signed-off-by: Moises --- changes/2838.misc.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/2838.misc.rst 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. From f2798ea838dd85209d7966e321476acaceab1776 Mon Sep 17 00:00:00 2001 From: Moises Date: Fri, 13 Sep 2024 23:17:06 +0200 Subject: [PATCH 3/3] Removed duplicate assert Signed-off-by: Moises --- testbed/tests/widgets/test_activityindicator.py | 1 - 1 file changed, 1 deletion(-) diff --git a/testbed/tests/widgets/test_activityindicator.py b/testbed/tests/widgets/test_activityindicator.py index 1df31040ec..1de71464df 100644 --- a/testbed/tests/widgets/test_activityindicator.py +++ b/testbed/tests/widgets/test_activityindicator.py @@ -19,7 +19,6 @@ async def test_start_stop(widget, probe): "The activity indicator can be started and stopped" # Widget should be initially stopped assert not widget.is_running - assert probe.is_hidden widget.start() await probe.redraw("Activity Indicator should be started")