From 84d11c7d4bdd8d618e3be55afec0cf85f9e78799 Mon Sep 17 00:00:00 2001 From: Olaf Siejka Date: Tue, 5 Jun 2012 09:36:07 +0000 Subject: [PATCH] [Notepad++] - Another fix attempt: reformat test failures and summary to winetest standard; svn path=/trunk/ahk_tests/; revision=1410 --- Notepad++/6.1.2/Ctrl+F_FindDialog.ahk | 13 +++---- Notepad++/6.1.2/DUMMY.ahk | 2 +- Notepad++/6.1.2/OpenDocument.ahk | 14 ++++---- Notepad++/6.1.2/SaveAsDesktop.ahk | 21 +++++------ Notepad++/6.1.2/install_test.ahk | 40 ++++++++++----------- Notepad++/6.1.2/prepare.ahk | 7 ++-- Notepad++/6.1.2/zz_notepad++_6.1.2_test.ahk | 4 +-- 7 files changed, 52 insertions(+), 49 deletions(-) diff --git a/Notepad++/6.1.2/Ctrl+F_FindDialog.ahk b/Notepad++/6.1.2/Ctrl+F_FindDialog.ahk index f57b8da..312fee5 100644 --- a/Notepad++/6.1.2/Ctrl+F_FindDialog.ahk +++ b/Notepad++/6.1.2/Ctrl+F_FindDialog.ahk @@ -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 } } diff --git a/Notepad++/6.1.2/DUMMY.ahk b/Notepad++/6.1.2/DUMMY.ahk index 5122bac..b12ed83 100644 --- a/Notepad++/6.1.2/DUMMY.ahk +++ b/Notepad++/6.1.2/DUMMY.ahk @@ -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 } diff --git a/Notepad++/6.1.2/OpenDocument.ahk b/Notepad++/6.1.2/OpenDocument.ahk index 850b841..117d3bd 100644 --- a/Notepad++/6.1.2/OpenDocument.ahk +++ b/Notepad++/6.1.2/OpenDocument.ahk @@ -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 } diff --git a/Notepad++/6.1.2/SaveAsDesktop.ahk b/Notepad++/6.1.2/SaveAsDesktop.ahk index a32b101..dc7f5c5 100644 --- a/Notepad++/6.1.2/SaveAsDesktop.ahk +++ b/Notepad++/6.1.2/SaveAsDesktop.ahk @@ -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 } } \ No newline at end of file diff --git a/Notepad++/6.1.2/install_test.ahk b/Notepad++/6.1.2/install_test.ahk index fe4a4bf..05558d6 100644 --- a/Notepad++/6.1.2/install_test.ahk +++ b/Notepad++/6.1.2/install_test.ahk @@ -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 } } diff --git a/Notepad++/6.1.2/prepare.ahk b/Notepad++/6.1.2/prepare.ahk index d3d7312..dca028e 100644 --- a/Notepad++/6.1.2/prepare.ahk +++ b/Notepad++/6.1.2/prepare.ahk @@ -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 } } diff --git a/Notepad++/6.1.2/zz_notepad++_6.1.2_test.ahk b/Notepad++/6.1.2/zz_notepad++_6.1.2_test.ahk index 72072af..59a735b 100644 --- a/Notepad++/6.1.2/zz_notepad++_6.1.2_test.ahk +++ b/Notepad++/6.1.2/zz_notepad++_6.1.2_test.ahk @@ -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 }