From 2eda0ed53a55229c5676c3beb2e6ae56c3455569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edijs=20Kolesnikovi=C4=8Ds?= Date: Sun, 8 Sep 2013 07:56:57 +0000 Subject: [PATCH] [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 --- Notepad++/6.1.2/SaveAsDesktop.ahk | 34 +++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/Notepad++/6.1.2/SaveAsDesktop.ahk b/Notepad++/6.1.2/SaveAsDesktop.ahk index 92d95ec..af7795b 100644 --- a/Notepad++/6.1.2/SaveAsDesktop.ahk +++ b/Notepad++/6.1.2/SaveAsDesktop.ahk @@ -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 + } + } } } }