From 7b5b2bc2f85799561e7c5041dac8df25258b1f7f Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 21 Aug 2024 07:00:33 +0200 Subject: [PATCH] test: More precise click on CPU shares number input Enabling the disabled element only works when clicking on the [ - ] or [ + ] buttons, not the number itself. With Firefox the test will soon click into the center of the element, which is the number. Make the selector more specific to ensure it goes to the [ - ] button. Also circumvent the "element must be not enabled" restriction by directly using `Browser.mouse()`. This has always been a race condition, as we expect the number input to be disabled by default. --- test/check-application | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/check-application b/test/check-application index 9c9381b2..a8a1fcb2 100755 --- a/test/check-application +++ b/test/check-application @@ -1865,7 +1865,7 @@ class TestApplication(testlib.MachineCase): if auth: # Check that the checkbox is enabled when clicked on the field b.wait_visible("#run-image-dialog-cpu-priority-checkbox:not(:checked)") - b.click('#run-image-cpu-priority') + b.mouse('#run-image-cpu-priority button[aria-label="Decrease CPU shares"]', "click") b.wait_visible("#run-image-dialog-cpu-priority-checkbox:checked") b.set_checked("#run-image-dialog-cpu-priority-checkbox", False)