From d09d2e0ae98ab30dba0beedb321d667d60f2aed6 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 10 Oct 2025 12:50:07 +0200 Subject: [PATCH] ui-tests: minimize Log window On hosted GitHub Actions runners, there is always this Log window visible on the Desktop, and due to some magic logic, this window is sometimes in the foreground on the `windows-2025` runners. Let's minimize it so that it is out of the way and does not interfere with the AutoHotKey-based UI tests. Signed-off-by: Johannes Schindelin --- .github/workflows/ui-tests.yml | 8 ++++++++ ui-tests/minimize-log-window.ahk | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 ui-tests/minimize-log-window.ahk diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 919738a268..37a298028a 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -103,6 +103,14 @@ jobs: with: sparse-checkout: | ui-tests + - name: Minimize existing Log window + working-directory: ui-tests + run: | + $exitCode = 0 + type minimize-log-window.ahk + & "${env:RUNNER_TEMP}\ahk\AutoHotKey64.exe" /ErrorStdOut /force minimize-log-window.ahk "$PWD\minimize-log-window" 2>&1 | Out-Default + if (!$?) { $exitCode = 1; echo "::error::Failed to minimize Log window!" } else { echo "::notice::Minimized Log window" } + exit $exitCode - name: Run UI tests id: ui-tests timeout-minutes: 10 diff --git a/ui-tests/minimize-log-window.ahk b/ui-tests/minimize-log-window.ahk new file mode 100644 index 0000000000..d7b116bc69 --- /dev/null +++ b/ui-tests/minimize-log-window.ahk @@ -0,0 +1,21 @@ +#Requires AutoHotkey v2.0 +#Include ui-test-library.ahk + +for hwnd in WinGetList() +{ + title := WinGetTitle(hwnd) + if title != "" + { + FileAppend 'Got window ' . hwnd . '`n', '*' + try { + exe := WinGetProcessName(hwnd) + } catch as e { + FileAppend 'Could not get executable for hwnd ' . hwnd . ': ' . e.Message . '`n', '*' + exe := "" + } + title := WinGetTitle(hwnd) + FileAppend 'Got window ' . hwnd . ' ah_exe ' . exe . ' title ' . title . '`n', '*' + + WinMinimize(hwnd) + } +}