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) + } +}