mirror of
https://github.com/reactos/ahk_tests.git
synced 2024-11-23 03:29:39 +00:00
[AHK]
Do not use hardcoded value to print window title match mode in log, use built in function. svn path=/trunk/ahk_tests/; revision=1858
This commit is contained in:
parent
a325cbd422
commit
c0ac9ac1b1
@ -100,7 +100,7 @@ if bContinue
|
||||
{
|
||||
; Sometimes files are extracted so fast that AHK doesn't detect the window
|
||||
IfNotExist, %InstallLocation%\aida32.exe
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=2) and '" InstallLocation "\aida32.exe' doesnt exist.")
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=" A_TitleMatchMode ") and '" InstallLocation "\aida32.exe' doesnt exist.")
|
||||
else
|
||||
TestsOK("AHK unabled to detect 'Extracting' window, but '" InstallLocation "\aida32.exe' exist.")
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ else
|
||||
{
|
||||
SetTitleMatchMode, 1 ; A window's title must start with the specified WinTitle to be a match
|
||||
IfWinNotActive, DOSBox 0.72
|
||||
TestsFailed("Window 'DOSBox 0.72' is not active (SetTitleMatchMode=1).")
|
||||
TestsFailed("Window 'DOSBox 0.72' is not active (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
SendInput, intro
|
||||
@ -36,7 +36,7 @@ else
|
||||
SetTitleMatchMode, 2 ; A window's title can contain WinTitle anywhere inside it to be a match
|
||||
WinWaitActive, Program: INTRO,,5
|
||||
if ErrorLevel
|
||||
TestsFailed("Window 'Program: INTRO' is not active (SetTitleMatchMode=2).")
|
||||
TestsFailed("Window 'Program: INTRO' is not active (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
SendInput, {ENTER}{ENTER}{ENTER} ; Read the intro
|
||||
@ -44,7 +44,7 @@ else
|
||||
SendInput, {ENTER}
|
||||
WinWaitClose, Program: INTRO,,5
|
||||
if ErrorLevel
|
||||
TestsFailed("Window 'Program: INTRO' failed to close (SetTitleMatchMode=2).")
|
||||
TestsFailed("Window 'Program: INTRO' failed to close (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
Process, WaitClose, dosbox.exe, 4
|
||||
|
@ -48,9 +48,9 @@ RunApplication()
|
||||
Process, Exist, dosbox.exe
|
||||
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
|
||||
if NewPID = 0
|
||||
TestsFailed("Window 'DOSBox 0.72' failed to appear (SetTitleMatchMode=1). No 'dosbox.exe' process detected.")
|
||||
TestsFailed("Window 'DOSBox 0.72' failed to appear (SetTitleMatchMode=" A_TitleMatchMode "). No 'dosbox.exe' process detected.")
|
||||
else
|
||||
TestsFailed("Window 'DOSBox 0.72' failed to appear (SetTitleMatchMode=1). 'dosbox.exe' process detected.")
|
||||
TestsFailed("Window 'DOSBox 0.72' failed to appear (SetTitleMatchMode=" A_TitleMatchMode "). 'dosbox.exe' process detected.")
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ else
|
||||
{
|
||||
SetTitleMatchMode, 1 ; A window's title must start with the specified WinTitle to be a match
|
||||
IfWinNotActive, DOSBox 0.74
|
||||
TestsFailed("Window 'DOSBox 0.74' is not active (SetTitleMatchMode=1).")
|
||||
TestsFailed("Window 'DOSBox 0.74' is not active (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
SendInput, intro
|
||||
@ -36,7 +36,7 @@ else
|
||||
SetTitleMatchMode, 2 ; A window's title can contain WinTitle anywhere inside it to be a match
|
||||
WinWaitActive, Program: INTRO,,5
|
||||
if ErrorLevel
|
||||
TestsFailed("Window 'Program: INTRO' is not active (SetTitleMatchMode=2).")
|
||||
TestsFailed("Window 'Program: INTRO' is not active (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
SendInput, {ENTER}{ENTER}{ENTER} ; Read the intro
|
||||
@ -44,7 +44,7 @@ else
|
||||
SendInput, {ENTER}
|
||||
WinWaitClose, Program: INTRO,,5
|
||||
if ErrorLevel
|
||||
TestsFailed("Window 'Program: INTRO' failed to close (SetTitleMatchMode=2).")
|
||||
TestsFailed("Window 'Program: INTRO' failed to close (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
Process, WaitClose, dosbox.exe, 4
|
||||
|
@ -48,9 +48,9 @@ RunApplication()
|
||||
Process, Exist, dosbox.exe
|
||||
NewPID = %ErrorLevel% ; Save the value immediately since ErrorLevel is often changed.
|
||||
if NewPID = 0
|
||||
TestsFailed("Window 'DOSBox 0.74' failed to appear (SetTitleMatchMode=1). No 'dosbox.exe' process detected.")
|
||||
TestsFailed("Window 'DOSBox 0.74' failed to appear (SetTitleMatchMode=" A_TitleMatchMode "). No 'dosbox.exe' process detected.")
|
||||
else
|
||||
TestsFailed("Window 'DOSBox 0.74' failed to appear (SetTitleMatchMode=1). 'dosbox.exe' process detected.")
|
||||
TestsFailed("Window 'DOSBox 0.74' failed to appear (SetTitleMatchMode=" A_TitleMatchMode "). 'dosbox.exe' process detected.")
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ else
|
||||
SetTitleMatchMode, 2 ; A window's title can contain WinTitle anywhere inside it to be a match.
|
||||
WinWaitActive, of 1 file - Downloads,,10
|
||||
if ErrorLevel
|
||||
TestsFailed("Window 'of 1 file - Downloads' failed to appear (SetTitleMatchMode=2).")
|
||||
TestsFailed("Window 'of 1 file - Downloads' failed to appear (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
SetTitleMatchMode, 3 ; A window's title must exactly match WinTitle to be a match.
|
||||
|
@ -55,7 +55,7 @@ else
|
||||
SetTitleMatchMode, 2 ; A window's title can contain WinTitle anywhere inside it to be a match.
|
||||
WinWaitActive, of 1 file - Downloads,,10
|
||||
if ErrorLevel
|
||||
TestsFailed("Window 'of 1 file - Downloads' failed to appear (SetTitleMatchMode=2).")
|
||||
TestsFailed("Window 'of 1 file - Downloads' failed to appear (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
SetTitleMatchMode, 3 ; A window's title must exactly match WinTitle to be a match.
|
||||
|
@ -55,7 +55,7 @@ else
|
||||
SetTitleMatchMode, 2 ; A window's title can contain WinTitle anywhere inside it to be a match.
|
||||
WinWaitActive, of 1 file - Downloads,,10
|
||||
if ErrorLevel
|
||||
TestsFailed("Window 'of 1 file - Downloads' failed to appear (SetTitleMatchMode=2).")
|
||||
TestsFailed("Window 'of 1 file - Downloads' failed to appear (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
SetTitleMatchMode, 3 ; A window's title must exactly match WinTitle to be a match.
|
||||
|
@ -94,7 +94,7 @@ if bContinue
|
||||
{
|
||||
; Sometimes files are extracted so fast that AHK doesn't detect the window
|
||||
IfNotExist, %InstallLocation%\fap-0.9.1-win32-bin\%MainAppFile%
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=2) and '" InstallLocation "\fap-0.9.1-win32-bin\" MainAppFile "' doesnt exist.")
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=" A_TitleMatchMode ") and '" InstallLocation "\fap-0.9.1-win32-bin\" MainAppFile "' doesnt exist.")
|
||||
else
|
||||
TestsOK("AHK unabled to detect 'Extracting' window, but '" InstallLocation "\fap-0.9.1-win32-bin\" MainAppFile "' exist.")
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ if bContinue
|
||||
{
|
||||
; Sometimes files are extracted so fast that AHK doesn't detect the window
|
||||
IfNotExist, %InstallLocation%\%MainAppFile%
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=2) and '" InstallLocation "\" MainAppFile "' doesnt exist.")
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=" A_TitleMatchMode ") and '" InstallLocation "\" MainAppFile "' doesnt exist.")
|
||||
else
|
||||
TestsOK("AHK unabled to detect 'Extracting' window, but '" InstallLocation "\" MainAppFile "' exist.")
|
||||
}
|
||||
|
@ -255,13 +255,13 @@ if bContinue
|
||||
; Installer will open explorer window, close it
|
||||
WinWait, Home Page Software ahk_class CabinetWClass,, 22
|
||||
if ErrorLevel
|
||||
TestsFailed("Explorer window 'Home Page Software' (SetTitleMatchMode=2) failed to appear.")
|
||||
TestsFailed("Explorer window 'Home Page Software' (SetTitleMatchMode=" A_TitleMatchMode ") failed to appear.")
|
||||
else
|
||||
{
|
||||
WinClose, Home Page Software ahk_class CabinetWClass
|
||||
WinWaitClose, Home Page Software ahk_class CabinetWClass,, 5
|
||||
if ErrorLevel
|
||||
TestsFailed("Unable to close explorer window 'Home Page Software' (SetTitleMatchMode=2).")
|
||||
TestsFailed("Unable to close explorer window 'Home Page Software' (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
TestsOK("'Installing' window closed (iTimeOut=" iTimeOut "), 'Home Page Software' window appeared and we closed it.")
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ if bContinue
|
||||
{
|
||||
; Sometimes files are extracted so fast that AHK doesn't detect the window
|
||||
IfNotExist, %InstallLocation%\%MainAppFile%
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=2) and '" InstallLocation "\" MainAppFile "' doesnt exist.")
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=" A_TitleMatchMode ") and '" InstallLocation "\" MainAppFile "' doesnt exist.")
|
||||
else
|
||||
TestsOK("AHK unabled to detect 'Extracting' window, but '" InstallLocation "\" MainAppFile "' exist.")
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ else
|
||||
SetTitleMatchMode, 1 ; A window's title must start with the specified WinTitle to be a match.
|
||||
WinWaitActive, Save,, 7
|
||||
if ErrorLevel
|
||||
TestsFailed("'Save as' dialog failed to appear (SetTitleMatchMode=1).")
|
||||
TestsFailed("'Save as' dialog failed to appear (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
SendInput, {ALTDOWN}s{ALTUP} ; Hit 'Save' in 'Save as'
|
||||
@ -80,7 +80,7 @@ else
|
||||
WinClose, Blank page - Opera,,5
|
||||
WinWaitActive, Active,,7 ; ROS 'Active transfers', WinXP 'Active Transfers'
|
||||
if ErrorLevel
|
||||
TestsFailed("'Active' dialog failed to appear(SetTitleMatchMode=1).")
|
||||
TestsFailed("'Active' dialog failed to appear(SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
SendInput, {ENTER} ; Hit 'OK'
|
||||
|
@ -90,7 +90,7 @@ else
|
||||
SetTitleMatchMode, 1 ; A window's title must start with the specified WinTitle to be a match.
|
||||
WinWaitActive, Transfers 0,, 5 ; Expected window title is something like 'Transfers 03:12 - Opera'
|
||||
if ErrorLevel
|
||||
TestsFailed("Window 'Transfers 0' failed to appear ( SetTitleMatchMode=1).")
|
||||
TestsFailed("Window 'Transfers 0' failed to appear ( SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
iTimeOut := 120
|
||||
|
@ -93,7 +93,7 @@ if bContinue
|
||||
{
|
||||
; Sometimes files are extracted so fast that AHK doesn't detect the window
|
||||
IfNotExist, %InstallLocation%\%MainAppFile%
|
||||
TestsFailed("'WinRAR self-extracting archive (Extracting)' window failed to appear (SetTitleMatchMode=2) and '" InstallLocation "\" MainAppFile "' doesnt exist.")
|
||||
TestsFailed("'WinRAR self-extracting archive (Extracting)' window failed to appear (SetTitleMatchMode=" A_TitleMatchMode ") and '" InstallLocation "\" MainAppFile "' doesnt exist.")
|
||||
else
|
||||
TestsOK("AHK unabled to detect 'WinRAR self-extracting archive (Extracting)' window, but '" InstallLocation "\" MainAppFile "' exist.")
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ if bContinue
|
||||
{
|
||||
; Sometimes files are extracted so fast that AHK doesn't detect the window
|
||||
IfNotExist, %InstallLocation%\%MainAppFile%
|
||||
TestsFailed("'WinRAR self-extracting archive (Extracting)' window failed to appear (SetTitleMatchMode=2) and '" InstallLocation "\" MainAppFile "' doesnt exist.")
|
||||
TestsFailed("'WinRAR self-extracting archive (Extracting)' window failed to appear (SetTitleMatchMode=" A_TitleMatchMode ") and '" InstallLocation "\" MainAppFile "' doesnt exist.")
|
||||
else
|
||||
TestsOK("AHK unabled to detect 'WinRAR self-extracting archive (Extracting)' window, but '" InstallLocation "\" MainAppFile "' exist.")
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ if bContinue
|
||||
{
|
||||
; Sometimes files are extracted so fast that AHK doesn't detect the window
|
||||
IfNotExist, C:\ReactOS\Samba-TNG
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=2) and 'C:\ReactOS\Samba-TNG' doesnt exist.")
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=" A_TitleMatchMode ") and 'C:\ReactOS\Samba-TNG' doesnt exist.")
|
||||
else
|
||||
TestsOK("AHK unabled to detect 'Extracting' window, but 'C:\ReactOS\Samba-TNG' exist.")
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ if bContinue
|
||||
{
|
||||
; Sometimes files are extracted so fast that AHK doesn't detect the window
|
||||
IfNotExist, %InstallLocation%\%MainAppFile%
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=2) and '" InstallLocation "\" MainAppFile "' doesnt exist.")
|
||||
TestsFailed("'Extracting' window failed to appear (SetTitleMatchMode=" A_TitleMatchMode ") and '" InstallLocation "\" MainAppFile "' doesnt exist.")
|
||||
else
|
||||
TestsOK("AHK unabled to detect 'Extracting' window, but '" InstallLocation "\" MainAppFile "' exist.")
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ else
|
||||
SetTitleMatchMode, 2 ; A window's title can contain WinTitle anywhere inside it to be a match.
|
||||
WinWaitActive, of %NameExt% Saved,,5
|
||||
if ErrorLevel
|
||||
TestsFailed("Window 'of " NameExt " Saved' failed to appear (SetTitleMatchMode=2).")
|
||||
TestsFailed("Window 'of " NameExt " Saved' failed to appear (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
{
|
||||
iTimeOut := 240
|
||||
|
@ -223,13 +223,13 @@ if bContinue
|
||||
; WinRAR will open explorer window, close it
|
||||
WinWait, WinRAR ahk_class CabinetWClass,, 22
|
||||
if ErrorLevel
|
||||
TestsFailed("Explorer window 'WinRAR' (SetTitleMatchMode=2) failed to appear.")
|
||||
TestsFailed("Explorer window 'WinRAR' (SetTitleMatchMode=" A_TitleMatchMode ") failed to appear.")
|
||||
else
|
||||
{
|
||||
WinClose, WinRAR ahk_class CabinetWClass
|
||||
WinWaitClose, WinRAR ahk_class CabinetWClass,, 5
|
||||
if ErrorLevel
|
||||
TestsFailed("Unable to close explorer window 'WinRAR' (SetTitleMatchMode=2).")
|
||||
TestsFailed("Unable to close explorer window 'WinRAR' (SetTitleMatchMode=" A_TitleMatchMode ").")
|
||||
else
|
||||
TestsOK("'WinRAR Setup (WinRAR has been successfully)' window appeared, 'Done' button clicked and window closed.")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user