[Notepad++_6.1.2]

Enter file name in 'Save As' AND check if entered the text correctly.
Works in clean snapshot of win2k3 SP1.

svn path=/trunk/ahk_tests/; revision=2059
This commit is contained in:
Edijs Kolesnikovičs 2013-09-08 07:56:57 +00:00
parent 19d5348a08
commit 2eda0ed53a

View File

@ -85,24 +85,36 @@ if bContinue
TestsFailed("Unable to enter '" A_Desktop "\new 1.txt' in 'File name' field in 'Save As' window.")
else
{
SendInput, !s ; Hit 'Save' in 'Save As' dialog
WinWaitClose, Save As,, 3
ControlGetText, szFileNameText, Edit1, Save As
if ErrorLevel
TestsFailed("'Save As' dialog failed to close.")
TestsFailed("There was problem with 'ControlGetText'.")
else
{
WinWaitActive, %A_Desktop%\new 1.txt - Notepad++,, 3
if ErrorLevel
TestsFailed("'" A_Desktop "\new 1.txt - Notepad++' window is not active window.")
szFileNameExpected = %A_Desktop%\new 1.txt
if (szFileNameText != szFileNameExpected)
TestsFailed("Unexpected text. Is '" szFileNameText "', should be '" szFileNameExpected "'.")
else
{
szDocumentPath = %A_Desktop%\new 1.txt
IfNotExist, %szDocumentPath%
TestsFailed("File '" szDocumentPath "' does not exist, but it should.")
SendInput, !s ; Hit 'Save' in 'Save As' dialog
WinWaitClose, Save As,, 3
if ErrorLevel
TestsFailed("'Save As' dialog failed to close.")
else
{
TestsInfo("'" szDocumentPath "' exist as it should.")
bContinue := true
WinWaitActive, %A_Desktop%\new 1.txt - Notepad++,, 3
if ErrorLevel
TestsFailed("'" A_Desktop "\new 1.txt - Notepad++' window is not active window.")
else
{
szDocumentPath = %A_Desktop%\new 1.txt
IfNotExist, %szDocumentPath%
TestsFailed("File '" szDocumentPath "' does not exist, but it should.")
else
{
TestsInfo("'" szDocumentPath "' exist as it should.")
bContinue := true
}
}
}
}
}