diff options
Diffstat (limited to 'testautomation/graphics/optional/includes/global/g_find_replace.inc')
-rw-r--r-- | testautomation/graphics/optional/includes/global/g_find_replace.inc | 98 |
1 files changed, 56 insertions, 42 deletions
diff --git a/testautomation/graphics/optional/includes/global/g_find_replace.inc b/testautomation/graphics/optional/includes/global/g_find_replace.inc index b96099be71ab..3b9fc48ae10f 100644 --- a/testautomation/graphics/optional/includes/global/g_find_replace.inc +++ b/testautomation/graphics/optional/includes/global/g_find_replace.inc @@ -36,21 +36,21 @@ '* '\********************************************************************************** testcase tiEditSearchAndReplace + printlog "This test tests the 'Search and Replace' -dialogue." qaerrorlog "#i115121# Find and replace: wrong replacement" goto endsub - '/// This test tests the 'Search and Replace' -dialogue. ///' Dim sFile 'as string Dim sExpression(2) as string ' Expression to look for: ... Replace with dim sExt as string - Select Case Ucase(gApplication) - case "DRAW" : sExt = ".odg" - case "IMPRESS" : sExt = ".odp" - end select + Select Case Ucase(gApplication) + case "DRAW" : sExt = ".odg" + case "IMPRESS" : sExt = ".odp" + end select - 'First we need some errornes words to replace. (sExpression) - 'sExpression(1) has to be 3 times in the document - select case iSprache + printlog "First we need some errornes words to replace. (sExpression)" + printlog "sExpression(1) has to be 3 times in the document" + select case iSprache case 01 : sExpression(1) = "Alle" : sExpression(2) = "Allz" case 03 : sExpression(1) = "empreza" : sExpression(2) = "Emperor" ' Portuguese case 07 : qaerrorlog "No files for Russian yet, will use english instead." @@ -93,9 +93,9 @@ testcase tiEditSearchAndReplace else Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt) endif - ' check if the document is writable + printlog "check if the document is writable" if fIsDocumentWritable = false then - ' make the document writable and check if it's succesfull + printlog "make the document writable and check if it's succesfull" if fMakeDocumentWritable = false then warnlog "The document can't be make writeable. Test stopped." goto endsub @@ -110,24 +110,28 @@ testcase tiEditSearchAndReplace Messagebox.OK end if sleep 2 - hTypeKeys "<MOD1 HOME>" '/// Select the text ///' + printlog "Select the text" + hTypeKeys "<MOD1 HOME>" - '/// Edit-Find & Replace I///' + printlog "Edit-Find & Replace" EditSearchAndReplace sleep 1 Kontext "FindAndReplace" - '/// Clap the 'more options'-part open ///' + printlog "Clap the 'more options'-part open" More.Click - '/// verify, that search is done without 'similarity search' !!! ///' + printlog "verify, that search is done without 'similarity search' !!!" if SimilaritySearch.IsChecked = TRUE then SimilaritySearch.UnCheck warnlog "'Similar search' checkbox was enabled! It shouldn't be the default!" end if - SearchFor.SetText sExpression(1) '/// set Search text ///' - ReplaceWith.SetText sExpression(2) '/// set Replace text///' + printlog "set Search text" + SearchFor.SetText sExpression(1) + printlog "set Replace text" + ReplaceWith.SetText sExpression(2) - '/// Word has to be there ONLY three times ///' - SearchNow.Click '/// 1st search for text ///' + printlog "Word has to be there ONLY three times" + printlog "1st search for text" + SearchNow.Click Kontext "Messagebox" if Messagebox.Exists(2) then Printlog Messagebox.GetText @@ -136,7 +140,8 @@ testcase tiEditSearchAndReplace sleep 1 Kontext "FindAndReplace" - SearchNow.Click '/// 2nd search for text ///' + printlog "2nd search for text" + SearchNow.Click Kontext "Messagebox" if Messagebox.Exists(2) then Printlog Messagebox.GetText @@ -145,7 +150,8 @@ testcase tiEditSearchAndReplace sleep 1 Kontext "FindAndReplace" - SearchNow.Click '/// 3th search for text///' + printlog "3th search for text" + SearchNow.Click Kontext "Messagebox" if Messagebox.Exists(2) then Printlog Messagebox.GetText @@ -153,15 +159,16 @@ testcase tiEditSearchAndReplace end if sleep 1 Kontext "FindAndReplace" - - SearchNow.Click '/// 4th search for text; but it is no more available!///' + printlog "4th search for text; but it is no more available!" + SearchNow.Click sleep 2 kontext "Messagebox" if Messagebox.Exists Then Printlog "- The word was found 3 times: '" + messagebox.gettext + "'" Messagebox.OK else - SearchNow.Click '/// 5th search for word 1///' + printlog "5th search for word 1" + SearchNow.Click kontext if Messagebox.Exists (5) Then Printlog "?: "+Messagebox.gettext @@ -171,7 +178,7 @@ testcase tiEditSearchAndReplace Warnlog "- No MsgBox appeared: 'changed'" end if - '/// Replace all ///' + printlog "Replace all" Kontext "FindAndReplace" sleep 1 ReplaceAll.Click @@ -185,7 +192,8 @@ testcase tiEditSearchAndReplace end if Kontext "FindAndReplace" sleep 2 - SearchNow.Click '/// Search for word 1 to check if all words are replaced ///' + printlog "Search for word 1 to check if all words are replaced" + SearchNow.Click Kontext "Messagebox" if Not Messagebox.Exists then Warnlog " Not all words are replaced (Replace All)" @@ -197,17 +205,20 @@ testcase tiEditSearchAndReplace FindAndReplace.Close sleep 3 - '/// Edit-Find & Replace II ///' + printlog "Edit-Find & Replace II" gMouseClick 50,50 sleep 1 hTypeKeys "<MOD1 HOME>" EditSearchAndReplace sleep 1 Kontext "FindAndReplace" - SearchFor.SetText sExpression(2) '/// Search for word 2 ///' - ReplaceWith.SetText sExpression(1) '/// Replace with word 1 ///' + printlog "Search for word 2" + SearchFor.SetText sExpression(2) + printlog "Replace with word 1" + ReplaceWith.SetText sExpression(1) - ReplaceBtn.Click '/// Replace 1 ///' + printlog "Replace 1" + ReplaceBtn.Click Kontext "Messagebox" if Messagebox.Exists(4) Then Kontext "Messagebox" @@ -219,7 +230,8 @@ testcase tiEditSearchAndReplace Kontext "FindAndReplace" sleep 1 - SearchNow.Click '/// 2nd search for word 2 ///' + printlog "2nd search for word 2" + SearchNow.Click Kontext "Messagebox" if Messagebox.Exists(2) Then Warnlog " All words got replaced, but only the 1st should have been" @@ -230,7 +242,7 @@ testcase tiEditSearchAndReplace Printlog " Word replaced" end if - '/// Replace all ///' + printlog "Replace all" Kontext "FindAndReplace" ReplaceAll.Click kontext "Messagebox" @@ -240,7 +252,7 @@ testcase tiEditSearchAndReplace Printlog "- No messagebox after replace all" end if - '/// Search for word 2 to check if all are replaced ///' + printlog "Search for word 2 to check if all are replaced" Kontext "FindAndReplace" SearchNow.Click kontext "Messagebox" @@ -255,21 +267,23 @@ testcase tiEditSearchAndReplace More.Click FindAndReplace.Close sleep 2 - '/// Close document ///' + printlog "Close document" Call hCloseDocument endcase 'tiEditSearchAndReplace + '-------------------------------------------------------- + testcase tiEditSearchAndReplaceBUGS -'/// inspired by bugs: 101974, 101975, 101976 ///' +printlog "inspired by bugs: 101974, 101975, 101976" dim i as integer dim bTemp as boolean - '/// open application ///' + printlog "open application" Call hNewDocument sleep 3 - '/// Edit->Search and Replace ///' + printlog "Edit->Search and Replace" EditSearchAndReplace Kontext "FindAndReplace" if FindAndReplace.Exists (5) then @@ -278,7 +292,7 @@ testcase tiEditSearchAndReplaceBUGS Warnlog "Dialog for Search&Replace could NOT be opened :-(" endif - '/// for al 5 views in 'View->Workspace->...' do: ///' + printlog "for al 5 views in 'View->Workspace->...' do: " for i = 1 to 6 Printlog "- " + i + " View->Workspace->... ------------------------------------------------------" try @@ -317,7 +331,7 @@ testcase tiEditSearchAndReplaceBUGS endcatch sleep 5 Kontext "FindAndReplace" - '///+ if not already open, open. edit->search and replace ///' + printlog "if not already open, open. edit->search and replace" if (FindAndReplace.exists <> TRUE) then try EditSearchAndReplace @@ -332,13 +346,13 @@ testcase tiEditSearchAndReplaceBUGS endif else Kontext "FindAndReplace" - '///+ set text to look for to "a" ///' + printlog "set text to look for to a" SearchFor.SetText "a" - Printlog "'///+ click button 'find' ///'" + Printlog " click button 'find'" SearchNow.Click sleep 5 kontext - '///+ if active exists 'wrap/not found...' say OK ///' + printlog "if active exists 'wrap/not found...' say OK" if active.exists(5) then Printlog "Active: '" + active.GetText + "'" try @@ -359,7 +373,7 @@ testcase tiEditSearchAndReplaceBUGS next i Kontext "FindAndReplace" FindAndReplace.cancel - '/// close application ///' + printlog "close application" Call hCloseDocument endcase 'tiEditSearchAndReplaceBUGS |