Skip to content

Commit fdebd9b

Browse files
authored
chore: harden vscode_run_command for selenium CI (#2712)
## Summary Harden Selenium command-palette usage in `vscode_run_command` so Linux UI CI stops failing when the palette stays open or Enter races the filtered list. ## Changes - Escape before opening the palette (clear leftover overlay). - Short wait after typing before Enter. - Slightly longer wait for the quick-input field (`click_and_wait` 1s → 2s). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> Hardened the `vscode_run_command` helper function to prevent Linux UI CI failures when using VSCode's command palette. The changes improve resilience by clearing leftover overlay state before opening the palette, waiting before executing commands to reduce timing issues, and increasing the input field timeout. - Send ESCAPE keystroke via ActionChains before opening the palette to clear any leftover overlay state - Wait briefly after clicking/focusing the command input field before continuing - Increase `click_and_wait` timeout for the quick-input field from 1 to 2 seconds - Add 0.5 second sleep after typing the command and before pressing ENTER to reduce race conditions <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent f771b37 commit fdebd9b

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

test/ui/utils/ui_utils.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,12 @@ def vscode_run_command(
10201020
driver.switch_to.default_content()
10211021
if not command.startswith(">"):
10221022
command = ">" + command
1023+
1024+
# Dismiss any leftover palette/dialog from a previous call to avoid
1025+
# blocking the command-center click with an overlay.
1026+
ActionChains(driver).send_keys(Keys.ESCAPE).perform()
1027+
time.sleep(0.3)
1028+
10231029
# click the command box
10241030
max_attempts = 6 # we seen timeout issue on GHA with 4 seconds
10251031
command_input = None
@@ -1033,7 +1039,7 @@ def vscode_run_command(
10331039
driver,
10341040
command_box,
10351041
"//input[@aria-controls='quickInput_list']",
1036-
timeout=1,
1042+
timeout=2,
10371043
)
10381044
break
10391045
except (
@@ -1048,7 +1054,9 @@ def vscode_run_command(
10481054

10491055
if command_input:
10501056
command_input.send_keys(command)
1051-
# enter
1057+
# Let the palette finish filtering results before pressing Enter,
1058+
# otherwise the keystroke can arrive before a match is highlighted.
1059+
time.sleep(0.5)
10521060
actions = ActionChains(driver)
10531061
actions.send_keys(Keys.ENTER).perform()
10541062
if command_param:

0 commit comments

Comments
 (0)