Skip to content

Commit

Permalink
test: More precise click on CPU shares number input
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jelly authored and martinpitt committed Aug 21, 2024
1 parent 2c78650 commit bb0a449
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,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)

Expand Down

0 comments on commit bb0a449

Please sign in to comment.