diff options
Diffstat (limited to 'testautomation/graphics/optional/includes/global/g_tools.inc')
-rw-r--r-- | testautomation/graphics/optional/includes/global/g_tools.inc | 310 |
1 files changed, 161 insertions, 149 deletions
diff --git a/testautomation/graphics/optional/includes/global/g_tools.inc b/testautomation/graphics/optional/includes/global/g_tools.inc index fa3f429bbb3b..e8e918b95cbb 100644 --- a/testautomation/graphics/optional/includes/global/g_tools.inc +++ b/testautomation/graphics/optional/includes/global/g_tools.inc @@ -29,11 +29,6 @@ '* '* short description : will be moved to autocorrection.bas/inc '* -'************************************************************************************** -' #1 tiToolsThesaurus -' #1 tiToolsHyphenation1 -' #1 tiToolsHyphenation2 -' #1 tToolsMacro '\************************************************************************************* ' sFile = gTesttoolpath + "graphics\required\input\silben_"+iSprache+sExt @@ -46,6 +41,7 @@ testcase tiToolsThesaurus Dim sAlternativeText as string Dim sExt as string Dim ZaehlerBedeutung + dim sWorkFile as string 'for normal text, the thesaurus is enabled, 'if the format->character->language of the word has a thesaurus @@ -54,7 +50,7 @@ testcase tiToolsThesaurus 'so especially for asian languages you have to set a default language in the options, 'to be able to use the thesaurus there - fallback to englisch, 'because there is no thesaurus for cjk languages - + 'As long as OOo has no modules for that, disabled if gOOO = True then printlog "No spellchecking in OOo" @@ -63,64 +59,65 @@ testcase tiToolsThesaurus 'First we make sure we test a language where Thesaurus select case iSprache - case 01 : sWord = "Hello" - case 03 : sWord = "Alo" - case 07 : printlog "- No Thesaur for Russian available" - goto endsub - case 30 : Printlog "- No Thesaurus available !" - goto endsub - case 31 : sWord = "Guiten" - case 33 : sWord = "Bonjour" - case 34 : sWord = "Hola" - case 35 : Printlog "- No Thesaurus available !" - goto endsub - case 36 : Printlog "- No Thesaurus available !" - goto endsub - case 37 : Printlog "- No Thesaurus available !" - goto endsub - case 39 : sWord = "Ciao" - case 42 : Printlog "- No Thesaurus available !" - goto endsub - case 45 : sWord = "Hej" - case 46 : sWord = "Välkommen" - case 47 : Printlog "- No Thesaurus available !" - goto endsub - case 48 : Printlog "- No Thesaurus in Polish!" - goto endsub - case 49 : sWord = "Hallo" - case 50 : sWord = "Prosojnica" - case 51 : Printlog "- No Thesaurus available !" - goto endsub - case 55 : Printlog "- No Thesaurus in Brazilian!" - goto endsub - case 90 : Printlog "- No Thesaurus available !" - goto endsub + case 01 : sWord = "Hello" + case 03 : sWord = "Alo" + case 07 : printlog "- No Thesaur for Russian available" + goto endsub + case 30 : Printlog "- No Thesaurus available !" + goto endsub + case 31 : sWord = "Guiten" + case 33 : sWord = "Bonjour" + case 34 : sWord = "Hola" + case 35 : Printlog "- No Thesaurus available !" + goto endsub + case 36 : Printlog "- No Thesaurus available !" + goto endsub + case 37 : Printlog "- No Thesaurus available !" + goto endsub + case 39 : sWord = "Ciao" + case 42 : Printlog "- No Thesaurus available !" + goto endsub + case 45 : sWord = "Hej" + case 46 : sWord = "Välkommen" + case 47 : Printlog "- No Thesaurus available !" + goto endsub + case 48 : Printlog "- No Thesaurus in Polish!" + goto endsub + case 49 : sWord = "Hallo" + case 50 : sWord = "Prosojnica" + case 51 : Printlog "- No Thesaurus available !" + goto endsub + case 55 : Printlog "- No Thesaurus in Brazilian!" + goto endsub + case 90 : Printlog "- No Thesaurus available !" + goto endsub - case else : if bAsianLan then - hSetSpellHypLanguage - sWord = "Hello" - else - Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" - sWord = "Hello" - endif + case else : if bAsianLan then + hSetSpellHypLanguage + sWord = "Hello" + else + Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" + sWord = "Hello" + endif end select - + PrintLog "Thesaurus with 1 word: " + sWord - if( Ucase(gApplication) = "DRAW" ) then + if( gApplication = "DRAW" ) then sExt = ".odg" - elseif( Ucase(gApplication) = "IMPRESS" ) then + elseif( gApplication = "IMPRESS" ) then sExt = ".odp" endif - Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_" + iSprache + sExt) - Call sMakeReadOnlyDocumentEditable() + sWorkFile = gTesttoolPath & "graphics\required\input\recht_" & iSprache & sExt + + Call hFileOpenLocally( sWorkFile ) Call hTextrahmenErstellen (sWord,20,20,50,30) sleep 1 printlog "select the word" hTypeKeys "<Home><SHIFT END>" - + try ExtrasThesaurusDraw catch @@ -154,8 +151,7 @@ testcase tiToolsThesaurus endif if ( ReplaceWith.getText() <> sAlternativeText ) then - warnlog "the text is no transfered to the ReplaceWith field. " +_ - "ReplaceWith = " + ReplaceWith.getText() + ", Alternative = " + sAlternativeText + warnlog "the text is no transfered to the ReplaceWith field. " + "ReplaceWith = " + ReplaceWith.getText() + ", Alternative = " + sAlternativeText else printlog "the text is transfered to the ReplaceWith field." endif @@ -165,9 +161,9 @@ testcase tiToolsThesaurus endif Thesaurus.OK - if(Ucase(gApplication) = "DRAW") then + if(gApplication = "DRAW") then Kontext "Draw" - elseif(Ucase(gApplication) = "IMPRESS") then + elseif(gApplication = "IMPRESS") then Kontext "Impress" else ' fallback warnlog "gApplication is wrong" @@ -186,10 +182,10 @@ testcase tiToolsThesaurus else warnlog "thesaurus didn't come up." end if - + Call hCloseDocument -endcase +endcase 'tiToolsThesaurus '------------------------------------------------------------------------------- testcase tiToolsThesaurusWithoutText @@ -210,9 +206,9 @@ testcase tiToolsThesaurusWithoutText endif Call hCloseDocument - -endcase + +endcase 'tiToolsThesaurusWithoutText '------------------------------------------------------------------------------- testcase tiToolsThesaurusContextMenu @@ -236,46 +232,46 @@ testcase tiToolsThesaurusContextMenu 'First we make sure we test a language where Thesaurus select case iSprache - case 01 : sWord = "Hello" - case 03 : sWord = "Alo" - case 07 : printlog "- No Thesaur for Russian available" - goto endsub - case 30 : Printlog "- No Thesaurus available !" - goto endsub - case 31 : sWord = "Guiten" - case 33 : sWord = "Bonjour" - case 34 : sWord = "Hola" - case 35 : Printlog "- No Thesaurus available !" - goto endsub - case 36 : Printlog "- No Thesaurus available !" - goto endsub - case 37 : Printlog "- No Thesaurus available !" - goto endsub - case 39 : sWord = "Ciao" - case 42 : Printlog "- No Thesaurus available !" - goto endsub - case 45 : sWord = "Hej" - case 46 : sWord = "Välkommen" - case 47 : Printlog "- No Thesaurus available !" - goto endsub - case 48 : Printlog "- No Thesaurus in Polish!" - goto endsub - case 49 : sWord = "Hallo" - case 50 : sWord = "Prosojnica" - case 51 : Printlog "- No Thesaurus available !" - goto endsub - case 55 : Printlog "- No Thesaurus in Brazilian!" - goto endsub - case 90 : Printlog "- No Thesaurus available !" - goto endsub + case 01 : sWord = "Hello" + case 03 : sWord = "Alo" + case 07 : printlog "- No Thesaur for Russian available" + goto endsub + case 30 : Printlog "- No Thesaurus available !" + goto endsub + case 31 : sWord = "Guiten" + case 33 : sWord = "Bonjour" + case 34 : sWord = "Hola" + case 35 : Printlog "- No Thesaurus available !" + goto endsub + case 36 : Printlog "- No Thesaurus available !" + goto endsub + case 37 : Printlog "- No Thesaurus available !" + goto endsub + case 39 : sWord = "Ciao" + case 42 : Printlog "- No Thesaurus available !" + goto endsub + case 45 : sWord = "Hej" + case 46 : sWord = "Välkommen" + case 47 : Printlog "- No Thesaurus available !" + goto endsub + case 48 : Printlog "- No Thesaurus in Polish!" + goto endsub + case 49 : sWord = "Hallo" + case 50 : sWord = "Prosojnica" + case 51 : Printlog "- No Thesaurus available !" + goto endsub + case 55 : Printlog "- No Thesaurus in Brazilian!" + goto endsub + case 90 : Printlog "- No Thesaurus available !" + goto endsub - case else : if bAsianLan then - hSetSpellHypLanguage - sWord = "Hello" - else - Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" - sWord = "Hello" - endif + case else : if bAsianLan then + hSetSpellHypLanguage + sWord = "Hello" + else + Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" + sWord = "Hello" + endif end select PrintLog "Thesaurus with 1 word: " + sWord @@ -286,7 +282,7 @@ testcase tiToolsThesaurusContextMenu printlog "select the word" hTypeKeys "<Home><SHIFT END>" - + hOpenContextMenu hMenuSelectNr(14) ' the synonyms @@ -308,28 +304,31 @@ testcase tiToolsThesaurusContextMenu call hCloseDocument -endcase +endcase 'tiToolsThesaurusContextMenu '------------------------------------------------------------------------------- testcase tiToolsHyphenation1 printlog " - Hyphenation without any text" - Call hNewDocument '/// New impress document ///' + printlog "New impress document " + Call hNewDocument sleep 3 - ToolsLanguageHyphenationDraw '/// Try with empty document ///' + ToolsLanguageHyphenationDraw Kontext "Hyphenation" + printlog "Try with empty document" if Hyphenation.Exists(1) = True Then - Warnlog " - Dialog ist da" - Hyphenation.Cancel + Warnlog " - Dialog ist da" + Hyphenation.Cancel else - Printlog " - Hyphenation activated" + Printlog " - Hyphenation activated" end if ' Kontext "DocumentImpress" printlog " - Hyphenation with text, but without any possibility to break words" select case iSprache - case 01 : hTextrahmenErstellen ("This ist a text with no split words",10,10,40,40) '/// Create text without a pssibility to split words///' + case 01 : hTextrahmenErstellen ("This ist a text with no split words",10,10,40,40) case 03 : hTextrahmenErstellen ("Compare a tradu" + Chr(231) + Chr(227) + "o com o original",10,10,40,40) case 07 : qaerrorlog "- No Hypenation for Russian available" - Call hCloseDocument '/// Close document ///' + printlog "Close document" + Call hCloseDocument goto endsub case 31 : hTextrahmenErstellen ("Het is mijn bedoeling om voor en hulpmiddel.",10,10,40,40) case 33 : hTextrahmenErstellen ("Merci beaucoup pout votre candidature du 13/11/97.",10,10,40,40) @@ -340,7 +339,7 @@ testcase tiToolsHyphenation1 case 46 : hTextrahmenErstellen ("Detta är en text utan delade ord",10,10,40,40) case 48 : hTextrahmenErstellen (" Jeoli jednak zechcesz",10,10,40,40) case 49 : hTextrahmenErstellen ("Dies ist ein Text ohne eine Moeglichkeit Woerter zu trennen",10,10,40,40) - case 50 : hTextrahmenErstellen ("Zato ves čas iščemo nove člane: sodelujte",10,10,40,40) + case 50 : hTextrahmenErstellen ("Zato ves �?as iš�?emo nove �?lane: sodelujte",10,10,40,40) case 55 : hTextrahmenErstellen ("a Sun tentou adquirir a Apple",10,10,40,40) case else : if bAsianLan then printlog "For the language " + iSprache +" nothing is prepared yet, but is AsianLan, so OK :-)" @@ -351,7 +350,7 @@ testcase tiToolsHyphenation1 endif end select hTypeKeys "<Home>" - ToolsLanguageHyphenationDraw '/// Try ///' + ToolsLanguageHyphenationDraw Kontext "Hyphenation" if Hyphenation.Exists =True Then Warnlog "Dialog exists" @@ -360,32 +359,32 @@ testcase tiToolsHyphenation1 Kontext "Active" if Active.Exists then Active.OK end if - - Call hCloseDocument '/// Close document ///' + printlog "Close document " + Call hCloseDocument endcase 'tiToolsHyphenation1 '------------------------------------------------------------------------------- testcase tiToolsHyphenation2 - dim iWaitIndex as integer - dim sExt as string - Dim i : Dim DasWort2 : Dim DasWort3 : Dim DasWort4 : Dim DasWort5 : Dim DasWort6 : Dim DasWort7 - Dim DasWort as string - dim sDraw as string - dim sFile as string - PrintLog "- Tools/Hyphenation2" - Select Case Ucase(gApplication) - case "DRAW" : sExt = ".odg" - case "IMPRESS" : sExt = ".odp" - end select + dim iWaitIndex as integer + dim sExt as string + Dim i : Dim DasWort2 : Dim DasWort3 : Dim DasWort4 : Dim DasWort5 : Dim DasWort6 : Dim DasWort7 + Dim DasWort as string + dim sDraw as string + dim sFile as string + PrintLog "- Tools/Hyphenation2" + Select Case gApplication + case "DRAW" : sExt = ".odg" + case "IMPRESS" : sExt = ".odp" + end select - if ((not bAsianLan) AND (iSprache <> 07)) then - sFile = gTesttoolpath + "graphics\required\input\silben_"+iSprache+sExt - Call hFileOpen (sFile) - endif + if ((not bAsianLan) AND (iSprache <> 07)) then + sFile = gTesttoolpath + "graphics\required\input\silben_"+iSprache+sExt + Call hFileOpenLocally( sFile ) + endif - select case iSprache '/// Open prepared document ///' + select case iSprache case 01 :DasWort = "ation" : DasWort2 = "tion" : DasWort3 = "ion" : DasWort4 = "on" '+Chr(34) case 07 : qaerrorlog "- No Hypenation for Russian available" goto endsub @@ -402,6 +401,7 @@ testcase tiToolsHyphenation2 case else : if bAsianLan then printlog "For the language " + iSprache +" nothing is prepared yet, but is AsianLan, so OK :-)" printlog " :-) will use English instead" + printlog "Open prepared document" Call hFileOpen (gTesttoolpath + "graphics\required\input\silben_"+"1"+sExt) DasWort = "ation" : DasWort2 = "tion" : DasWort3 = "ion" : DasWort4 = "on" '+Chr(34) else @@ -410,66 +410,78 @@ testcase tiToolsHyphenation2 endif end select - Call sMakeReadOnlyDocumentEditable - - printlog " - Test hyphenation" - EditSelectAll '/// Press CTRL + A to select all ///' - '/// press return to go into the edit mode ///' + printlog "Test hyphenation" +printlog "Press CTRL + A to select all" + EditSelectAll + printlog "press return to go into the edit mode" hTypeKeys "<Return>" sleep 1 ' WA for draw, or smth else: get text part before hyphenation: if iSprache = "1" OR bAsianLan = TRUE then - hTypeKeys "<MOD1 END><HOME><MOD1 SHIFT RIGHT RIGHT>" '/// Select part of text and compare it with original text at this place ///' + printlog "Select part of text and compare it with original text at this place" + hTypeKeys "<MOD1 END><HOME><MOD1 SHIFT RIGHT RIGHT>" else hTypeKeys "<MOD1 END><HOME><MOD1 SHIFT RIGHT>" endif EditCopy sDraw = GetClipboardText() - EditSelectAll '/// Select whole text ///' - ToolsLanguageHyphenationDraw '/// Run Hyphenation ///' + printlog "Select whole text" + EditSelectAll + printlog "Run Hyphenation" + ToolsLanguageHyphenationDraw gMouseClick 50,50 - hTypeKeys "<MOD1 END><HOME><MOD1 SHIFT RIGHT>" '/// Select part of text and compare it with original text at this place ///' + printlog "Select part of text and compare it with original text at this place" + hTypeKeys "<MOD1 END><HOME><MOD1 SHIFT RIGHT>" sleep 3 EditCopy -printlog GetClipboardText + + printlog GetClipboardText select case GetClipboardText - case DasWort : printlog " - Hyphenation worked" - case DasWort2 : printlog " - Hyphenation worked" - case DasWort3 : printlog " - Hyphenation worked" - case DasWort4 : printlog " - Hyphenation worked" - case else : warnlog " - Hyphenation didnt work" + case DasWort : printlog " - Hyphenation worked" + case DasWort2 : printlog " - Hyphenation worked" + case DasWort3 : printlog " - Hyphenation worked" + case DasWort4 : printlog " - Hyphenation worked" + case else : warnlog " - Hyphenation didnt work" end select if GetClipboardText <> sDraw then - Printlog " - WA draw hyphenation did work :-)" + Printlog " - WA draw hyphenation did work :-)" else - Warnlog " - Hyphenation did not work" - Printlog "Expected: '"+DasWort+"'; or something different than: '"+sDraw+"'; But what we got was: '"+GetClipboardText+"'" + Warnlog " - Hyphenation did not work" + Printlog "Expected: '"+DasWort+"'; or something different than: '"+sDraw+"'; But what we got was: '"+GetClipboardText+"'" end if sleep 1 - Call hCloseDocument '/// Close document ///' + printlog "Close document" + Call hCloseDocument endcase 'tiToolsHyphenation2 '------------------------------------------------------------------------------- testcase tToolsMacro +qaerrorlog( "#i116017# - [Automation]: TypeKeys executes wrong commands" ) + goto endsub + + Dim i as integer Dim j as integer Dim Zaehler as integer Dim ZaehlerListe as integer + printlog "New document" Call hNewDocument ToolsMacro Kontext "Makro" - '/// to get the count of all macros, the list needs to get elapsed-all ///' + printlog "to get the count of all macros, the list needs to get elapsed-all" for j = 1 to 2 Zaehler=MakroAus.GetItemCount MakroAus.typeKeys "<end>" for i = 1 to Zaehler - MakroAus.typeKeys "<+><up>" + MakroAus.typeKeys "<+>" + sleep 1 + MakroAus.typeKeys "<up>" next i next j Zaehler=MakroAus.GetItemCount @@ -578,5 +590,5 @@ testcase tToolsMacro 'TODO: organizer testing! Call hCloseDocument Call hCloseDocument - + endcase 'tToolsMacro |