Use better method of waiting for window to close.
All tested.

svn path=/trunk/ahk_tests/; revision=1778
This commit is contained in:
Edijs Kolesnikovičs 2012-10-01 12:02:56 +00:00
parent 5bda5355bc
commit d52da46a0d
3 changed files with 50 additions and 10 deletions

View File

@ -184,11 +184,24 @@ if bContinue
else
{
TestsInfo("'7-Zip 4.65 Setup (Installing)' window appeared, waiting for it to close.")
WinWaitClose, 7-Zip 4.65 Setup, Installing, 20
iTimeOut := 20
while iTimeOut > 0
{
IfWinActive, 7-Zip 4.65 Setup, Installing
{
WinWaitClose, 7-Zip 4.65 Setup, Installing, 1
iTimeOut--
}
else
break ; exit the loop if something poped-up
}
WinWaitClose, 7-Zip 4.65 Setup, Installing, 1
if ErrorLevel
TestsFailed("'7-Zip 4.65 Setup (Installing)' window failed to close.")
TestsFailed("'7-Zip 4.65 Setup (Installing)' window failed to close (iTimeOut=" iTimeOut ").")
else
TestsOK("'7-Zip 4.65 Setup (Installing)' window closed.")
TestsOK("'7-Zip 4.65 Setup (Installing)' window closed (iTimeOut=" iTimeOut ").")
}
}

View File

@ -204,11 +204,24 @@ if bContinue
else
{
TestsInfo("'7-Zip 9.20 Setup (Installing)' window appeared, waiting for it to close.")
WinWaitClose, 7-Zip 9.20 Setup, Installing, 20
iTimeOut := 20
while iTimeOut > 0
{
IfWinActive, 7-Zip 9.20 Setup, Installing
{
WinWaitClose, 7-Zip 9.20 Setup, Installing, 1
iTimeOut--
}
else
break ; exit the loop if something poped-up
}
WinWaitClose, 7-Zip 9.20 Setup, Installing, 1
if ErrorLevel
TestsFailed("'7-Zip 9.20 Setup (Installing)' window failed to close.")
TestsFailed("'7-Zip 9.20 Setup (Installing)' window failed to close (iTimeOut=" iTimeOut ").")
else
TestsOK("'7-Zip 9.20 Setup (Installing)' window appeared and closed.")
TestsOK("'7-Zip 9.20 Setup (Installing)' window closed (iTimeOut=" iTimeOut ").")
}
}
}

View File

@ -232,14 +232,28 @@ if bContinue
else
{
TestsInfo("'Installing' window appeared, waiting for it to close.")
WinWaitClose, Setup - MPC-HC, Installing, 10
iTimeOut := 15
while iTimeOut > 0
{
IfWinActive, Setup - MPC-HC, Installing
{
WinWaitClose, Setup - MPC-HC, Installing, 1
iTimeOut--
}
else
break ; exit the loop if something poped-up
}
WinWaitClose, Setup - MPC-HC, Installing, 1
if ErrorLevel
TestsFailed("'Setup - MPC-HC (Installing)' window failed to dissapear.")
TestsFailed("'Setup - MPC-HC (Installing)' window failed to close (iTimeOut=" iTimeOut ").")
else
TestsOK("'Setup - MPC-HC (Installing)' window went away.")
TestsOK("'Setup - MPC-HC (Installing)' window closed (iTimeOut=" iTimeOut ").")
}
}
; Test if 'Completing' window appeared
TestsTotal++
if bContinue
@ -258,6 +272,7 @@ if bContinue
}
}
; Check if program exists
TestsTotal++
if bContinue
@ -275,4 +290,3 @@ if bContinue
TestsOK("The application has been installed, because '" InstalledDir "\" MainAppFile "' was found.")
}
}