[Notepad++]

- Another fix attempt: reformat test failures and summary to winetest standard;

svn path=/trunk/ahk_tests/; revision=1410
This commit is contained in:
Olaf Siejka 2012-06-05 09:36:07 +00:00
parent 7d81c01b4b
commit 84d11c7d4b
7 changed files with 52 additions and 49 deletions

View File

@ -17,8 +17,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
; Test Ctrl+F 'Find' dialog
; Test Ctrl-F 'Find' dialog
TestsTotal++
TestName = Ctrl-F.Find.Dialog
szDocument = C:\NotepadTestFile.ini ; Case sensitive!
FileDelete, %szDocument%
FileAppend, This text`nwill contain some`nlines. We will use`nit to test dialogs., %szDocument%
@ -38,7 +39,7 @@ if not ErrorLevel
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Window 'Find' failed to appear, so Ctrl+F doesn't work, bug #6734. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Window 'Find' failed to appear, so Ctrl+F doesn't work, bug #6734. Active window caption: '%title%'`n
; Check if can open 'Find' from main menu
SendInput, {ALTDOWN}s ; Hit 'Search'
@ -53,7 +54,7 @@ if not ErrorLevel
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Can't open 'Find' from main menu. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Can't open 'Find' from main menu. Active window caption: '%title%'`n
bContinue := false
}
}
@ -62,7 +63,7 @@ if not ErrorLevel
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Window '%szDocument% - Notepad++' is not active. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Window '%szDocument% - Notepad++' is not active. Active window caption: '%title%'`n
bContinue := false
}
}
@ -70,7 +71,7 @@ else
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Failed to create '%szDocument%'. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Failed to create '%szDocument%'. Active window caption: '%title%'`n
bContinue := false
}
@ -97,7 +98,7 @@ TestFindDialog()
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Can't find match. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Can't find match. Active window caption: '%title%'`n
bContinue := false
}
}

View File

@ -29,6 +29,6 @@ else
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Window '%szDocument% - Notepad++' is not active. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Window '%szDocument% - Notepad++' is not active. Active window caption: '%title%'`n
bContinue := false
}

View File

@ -17,6 +17,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
TestName = OpenDocument
; Test if can create document, open it with Notepad++, delete text, write new one, save and exit
TestsTotal++
szDocument = %A_Desktop%\Notepad++Test.txt ; Case sensitive!
@ -49,7 +51,7 @@ if not ErrorLevel
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: For some reason number of lines is wrong! Is %iLines% and should be 1. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: For some reason number of lines is wrong! Is %iLines% and should be 1. Active window caption: '%title%'`n
bContinue := false
}
}
@ -57,7 +59,7 @@ if not ErrorLevel
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Failed to close '%szDocument% - Notepad++' window. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Failed to close '%szDocument% - Notepad++' window. Active window caption: '%title%'`n
bContinue := false
}
}
@ -65,7 +67,7 @@ if not ErrorLevel
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Failed to save. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Failed to save. Active window caption: '%title%'`n
bContinue := false
}
}
@ -73,7 +75,7 @@ if not ErrorLevel
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Failed to change text. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Failed to change text. Active window caption: '%title%'`n
bContinue := false
}
}
@ -81,7 +83,7 @@ if not ErrorLevel
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Window '%szDocument% - Notepad++' is not active. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Window '%szDocument% - Notepad++' is not active. Active window caption: '%title%'`n
bContinue := false
}
}
@ -89,6 +91,6 @@ else
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Failed to create '%szDocument%'. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Failed to create '%szDocument%'. Active window caption: '%title%'`n
bContinue := false
}

View File

@ -17,6 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
TestName = SaveAsDesktop
; Type some text and test if 'Save As' dialog can appear
TestsTotal++
szDocument = ; Case sensitive! [No file to open]
@ -33,14 +34,14 @@ IfWinActive, new 1 - Notepad++
if not ErrorLevel
{
TestsOK++
OutputDebug, OK: %Module%:%A_LineNumber%: 'Save As' dialog appeared.`n
OutputDebug, OK: %TestName%:%A_LineNumber%: 'Save As' dialog appeared.`n
bContinue := true
}
else
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: 'Save As' dialog failed to appear. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: 'Save As' dialog failed to appear. Active window caption: '%title%'`n
bContinue := false
}
}
@ -48,7 +49,7 @@ IfWinActive, new 1 - Notepad++
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: For some reason '*new 1 - Notepad++' window is not active anymore. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: The '*new 1 - Notepad++' window is not active anymore. Active window caption: '%title%'`n
bContinue := false
}
}
@ -56,7 +57,7 @@ else
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Window 'new 1 - Notepad++' is not active. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Window 'new 1 - Notepad++' is not active. Active window caption: '%title%'`n
bContinue := false
}
@ -79,14 +80,14 @@ if bContinue
IfExist, %szDocumentPath%
{
TestsOK++
OutputDebug, OK: %Module%:%A_LineNumber%: '%szDocumentPath%' exist as it should.`n
OutputDebug, OK: %TestName%:%A_LineNumber%: '%szDocumentPath%' exist as it should.`n
bContinue := true
}
else
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: File '%szDocumentPath%' does not exist, but it should. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: File '%szDocumentPath%' does not exist, but it should. Active window caption: '%title%'`n
bContinue := false
}
}
@ -94,7 +95,7 @@ if bContinue
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: There was a problem selecting 'Desktop' from ComboBox1. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: There was a problem selecting 'Desktop' from ComboBox1. Active window caption: '%title%'`n
bContinue := false
}
}
@ -102,7 +103,7 @@ if bContinue
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: For some reason 'Save As' dialog is not active anymore. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: For some reason 'Save As' dialog is not active anymore. Active window caption: '%title%'`n
bContinue := false
}
}
@ -117,14 +118,14 @@ if bContinue
if not ErrorLevel
{
TestsOK++
OutputDebug, OK: %Module%:%A_LineNumber%: Window '%szDocumentPath% - Notepad++' was closed successfully.`n
OutputDebug, OK: %TestName%:%A_LineNumber%: Window '%szDocumentPath% - Notepad++' was closed successfully.`n
bContinue := true
}
else
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Failed to close '%szDocumentPath% - Notepad++' window. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Failed to close '%szDocumentPath% - Notepad++' window. Active window caption: '%title%'`n
bContinue := false
}
}

View File

@ -17,9 +17,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
Module = NotepadPP.6.1.2.%1%
SetupExe = %A_WorkingDir%\Apps\Notepad++_6.1.2_Setup.exe
bContinue := false
TestName = install
TestsFailed := 0
TestsOK := 0
@ -38,7 +38,7 @@ IfExist, %SetupExe%
Sleep, 1000
IfExist, %A_ProgramFiles%\Notepad++
{
OutputDebug, FAILED: %Module%:%A_LineNumber%: Failed to delete '%A_ProgramFiles%\Notepad++'.`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Failed to delete '%A_ProgramFiles%\Notepad++'.`n
bContinue := false
}
}
@ -48,7 +48,7 @@ IfExist, %SetupExe%
}
else
{
OutputDebug, FAILED: %Module%:%A_LineNumber%: '%SetupExe%' not found.`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: '%SetupExe%' not found.`n
bContinue := false
}
@ -68,7 +68,7 @@ if bContinue
; if not ErrorLevel
; {
; TestsOK++
; OutputDebug, OK: %Module%:%A_LineNumber%: 'Installer Language' window appeared and 'OK' button was focused.`n
; OutputDebug, OK: %TestName%:%A_LineNumber%: 'Installer Language' window appeared and 'OK' button was focused.`n
; SendInput, {ENTER} ; We know for sure where do we send Enter
; bContinue := true
; }
@ -76,7 +76,7 @@ if bContinue
; {
; TestsFailed++
; WinGetTitle, title, A
; OutputDebug, FAILED: %Module%:%A_LineNumber%: Failed to focus 'OK' button in 'Installer Language' window. Active window caption: '%title%'.`n
; OutputDebug, %TestName%:%A_LineNumber%: Test failed: Failed to focus 'OK' button in 'Installer Language' window. Active window caption: '%title%'.`n
; bContinue := false
; }
}
@ -84,7 +84,7 @@ if bContinue
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: 'Installer Language' window failed to appear. Active window caption: '%title%'.`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: 'Installer Language' window failed to appear. Active window caption: '%title%'.`n
bContinue := false
}
}
@ -101,7 +101,7 @@ if bContinue
Sleep, 250
TestsOK++
OutputDebug, OK: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Welcome to the Notepad++ v 6.1.2 Setup' appeared.`n
OutputDebug, OK: %TestName%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Welcome to the Notepad++ v 6.1.2 Setup' appeared.`n
SendInput, {ALTDOWN}n{ALTUP} ; Hit 'Next' button
bContinue := true
}
@ -109,7 +109,7 @@ if bContinue
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Welcome to the Notepad++ v 6.1.2 Setup' failed to appear. Active window caption: '%title%'.`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: 'Notepad++ v6.1.2 Setup' window with 'Welcome to the Notepad++ v 6.1.2 Setup' failed to appear. Active window caption: '%title%'.`n
bContinue := false
}
}
@ -126,7 +126,7 @@ if bContinue
Sleep, 250
TestsOK++
OutputDebug, OK: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'License Agreement' appeared.`n
OutputDebug, OK: %TestName%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'License Agreement' appeared.`n
SendInput, {ALTDOWN}a{ALTUP} ; Hit 'I Agree' button
bContinue := true
}
@ -134,7 +134,7 @@ if bContinue
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'License Agreement' failed to appear. Active window caption: '%title%'.`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: 'Notepad++ v6.1.2 Setup' window with 'License Agreement' failed to appear. Active window caption: '%title%'.`n
bContinue := false
}
}
@ -151,7 +151,7 @@ if bContinue
Sleep, 250
TestsOK++
OutputDebug, OK: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Choose Install Location' appeared.`n
OutputDebug, OK: %TestName%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Choose Install Location' appeared.`n
SendInput, {ALTDOWN}n{ALTUP} ; Hit 'Next' button
bContinue := true
}
@ -159,7 +159,7 @@ if bContinue
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Choose Install Location' failed to appear. Active window caption: '%title%'.`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: 'Notepad++ v6.1.2 Setup' window with 'Choose Install Location' failed to appear. Active window caption: '%title%'.`n
bContinue := false
}
}
@ -176,7 +176,7 @@ if bContinue
Sleep, 250
TestsOK++
OutputDebug, OK: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Check the components' appeared.`n
OutputDebug, OK: %TestName%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Check the components' appeared.`n
SendInput, {ALTDOWN}n{ALTUP} ; Hit 'Next' button
bContinue := true
}
@ -184,7 +184,7 @@ if bContinue
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Check the components' failed to appear. Active window caption: '%title%'.`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: 'Notepad++ v6.1.2 Setup' window with 'Check the components' failed to appear. Active window caption: '%title%'.`n
bContinue := false
}
}
@ -201,7 +201,7 @@ if bContinue
Sleep, 250
TestsOK++
OutputDebug, OK: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Create Shortcut on Desktop' appeared.`n
OutputDebug, OK: %TestName%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Create Shortcut on Desktop' appeared.`n
Control, Check, , Button5, Notepad ; Check 'Allow plugins'
Control, Check, , Button6, Notepad ; Check 'Create Shortcut'
@ -212,7 +212,7 @@ if bContinue
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Create Shortcut on Desktop' failed to appear. Active window caption: '%title%'.`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: 'Notepad++ v6.1.2 Setup' window with 'Create Shortcut on Desktop' failed to appear. Active window caption: '%title%'.`n
bContinue := false
}
}
@ -229,7 +229,7 @@ if bContinue
Sleep, 250
TestsOK++
OutputDebug, OK: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Completing' appeared.`n
OutputDebug, OK: %TestName%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Completing' appeared.`n
SendInput, {ALTDOWN}r{ALTUP} ; Uncheck 'Run Notepad'
SendInput, {ALTDOWN}f{ALTUP} ; Hit 'Finish' button
@ -239,7 +239,7 @@ if bContinue
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: 'Notepad++ v6.1.2 Setup' window with 'Completing' failed to appear. Active window caption: '%title%'.`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: 'Notepad++ v6.1.2 Setup' window with 'Completing' failed to appear. Active window caption: '%title%'.`n
bContinue := false
}
}
@ -253,13 +253,13 @@ if bContinue
IfExist, %AppExe%
{
TestsOK++
OutputDebug, OK: %Module%:%A_LineNumber%: Should be installed, because '%AppExe%' was found.`n
OutputDebug, OK: %TestName%:%A_LineNumber%: Should be installed, because '%AppExe%' was found.`n
bContinue := true
}
else
{
TestsFailed++
OutputDebug, FAILED: %Module%:%A_LineNumber%: Can NOT find '%AppExe%'.`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Can NOT find '%AppExe%'.`n
bContinue := false
}
}

View File

@ -17,7 +17,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
Module = NotepadPP.6.1.2.%1%
ModuleExe = %A_ProgramFiles%\Notepad++\notepad++.exe
bContinue := false
TestsTotal := 0
@ -52,7 +51,7 @@ RunNotepad(PathToFile)
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Window 'new 1 - Notepad++' failed to appear. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Window 'new 1 - Notepad++' failed to appear. Active window caption: '%title%'`n
bContinue := false
}
}
@ -70,7 +69,7 @@ RunNotepad(PathToFile)
{
TestsFailed++
WinGetTitle, title, A
OutputDebug, FAILED: %Module%:%A_LineNumber%: Window '%PathToFile% - Notepad++' failed to appear. Active window caption: '%title%'`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Window '%PathToFile% - Notepad++' failed to appear. Active window caption: '%title%'`n
bContinue := false
}
}
@ -78,7 +77,7 @@ RunNotepad(PathToFile)
else
{
TestsFailed++
OutputDebug, FAILED: %Module%:%A_LineNumber%: Can NOT find '%ModuleExe%'.`n
OutputDebug, %TestName%:%A_LineNumber%: Test failed: Can NOT find '%ModuleExe%'.`n
bContinue := false
}
}

View File

@ -71,6 +71,6 @@ if 1 != --list
TestsSkipped := TestsTotal - TestsOK - TestsFailed
TestsExecuted := TestsOK + TestsFailed
if (TestsSkipped < 0 or TestsExecuted < 0)
OutputDebug, %Module%: Check TestsTotal, TestsOK and TestsFailed, because results returns less than 0.
OutputDebug, %Module%: %TestsExecuted% tests executed (0 marked as todo, %TestsFailed% failures), %TestsSkipped% skipped.`n
OutputDebug, %TestName%: Check TestsTotal, TestsOK and TestsFailed, because results returns less than 0.
OutputDebug, %TestName%: %TestsExecuted% tests executed (0 marked as todo, %TestsFailed% failures), %TestsSkipped% skipped.`n
}