diff options
author | Marc Neumann [msc] <Marc.Neumann@sun.com> | 2010-03-18 13:09:36 +0100 |
---|---|---|
committer | Marc Neumann [msc] <Marc.Neumann@sun.com> | 2010-03-18 13:09:36 +0100 |
commit | 517fb6fdb13d6e008f2141193a9296cba626a0d8 (patch) | |
tree | f51ba455a66b48d7d980a35e1dee13ee0bf51f86 /testautomation | |
parent | f119d919823f94c1c73e4d77f485c91a077b1035 (diff) |
tl74: #108360# fixed for new thesaurus and refactoring
Diffstat (limited to 'testautomation')
-rwxr-xr-x | testautomation/graphics/optional/g_tools.bas | 2 | ||||
-rw-r--r-- | testautomation/graphics/optional/includes/global/g_tools.inc | 212 | ||||
-rwxr-xr-x | testautomation/graphics/required/d_updt.bas | 2 | ||||
-rwxr-xr-x | testautomation/graphics/required/i_updt_1.bas | 2 | ||||
-rw-r--r-- | testautomation/graphics/required/includes/global/id_006.inc | 206 | ||||
-rw-r--r-- | testautomation/graphics/tools/id_tools_2.inc | 18 |
6 files changed, 246 insertions, 196 deletions
diff --git a/testautomation/graphics/optional/g_tools.bas b/testautomation/graphics/optional/g_tools.bas index bb890f970722..bb65e6b27d43 100755 --- a/testautomation/graphics/optional/g_tools.bas +++ b/testautomation/graphics/optional/g_tools.bas @@ -43,6 +43,7 @@ sub main PrintLog "-------------------------" + gApplication + "-------------------" Call tiToolsThesaurus + Call tiToolsThesaurusWithoutText Call tiToolsHyphenation1 Call tiToolsHyphenation2 Call tToolsMacro @@ -50,6 +51,7 @@ sub main gApplication = "DRAW" PrintLog "-------------------------" + gApplication + "-------------------" Call tiToolsThesaurus + Call tiToolsThesaurusWithoutText Call tiToolsHyphenation1 Call tiToolsHyphenation2 Call tToolsMacro diff --git a/testautomation/graphics/optional/includes/global/g_tools.inc b/testautomation/graphics/optional/includes/global/g_tools.inc index 3de5d8b39a98..dcfe8707d6d6 100644 --- a/testautomation/graphics/optional/includes/global/g_tools.inc +++ b/testautomation/graphics/optional/includes/global/g_tools.inc @@ -40,49 +40,54 @@ '------------------------------------------------------------------------------- testcase tiToolsThesaurus - Dim DasWort as string - Dim ZaehlerBedeutung - -'/// for normal text, the thesaurus is enabled, if the format->character->language of the word has a thesaurus///' -'///+ unfortunately in textboxes this doesn't work, you can give the word a langauge, but this is been ignored by///' -'///+ our thesaurus :-(((///' -'/// 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 ??///' - - '/// First we make sure we test a language where Thesa - ' As long as OOo has no modules for that, disabled - if gOOO = True then - printlog "No spellchecking in OOo" - goto endsub - endif + Dim sWord as string + Dim sChangedWord as string + Dim sReplaceWord as string + Dim sExt as string + Dim ZaehlerBedeutung + 'for normal text, the thesaurus is enabled, + 'if the format->character->language of the word has a thesaurus + 'unfortunately in textboxes this doesn't work, you can give the word a langauge, + 'but this is been ignored by our thesaurus + '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" + goto endsub + endif + + 'First we make sure we test a language where Thesaurus select case iSprache - case 01 : DasWort = "Hello" - case 03 : DasWort = "Alo" + 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 : DasWort = "Guiten" - case 33 : DasWort = "Bonjour" - case 34 : DasWort = "Hola" + 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 : DasWort = "Ciao" + case 39 : sWord = "Ciao" case 42 : Printlog "- No Thesaurus available !" goto endsub - case 45 : DasWort = "Hej" - case 46 : DasWort = "Välkommen" + 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 : DasWort = "Hallo" - case 50 : DasWort = "Prosojnica" + case 49 : sWord = "Hallo" + case 50 : sWord = "Prosojnica" case 51 : Printlog "- No Thesaurus available !" goto endsub case 55 : Printlog "- No Thesaurus in Brazilian!" @@ -92,72 +97,113 @@ testcase tiToolsThesaurus case else : if bAsianLan then hSetSpellHypLanguage - DasWort = "Hello" + sWord = "Hello" else Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" - DasWort = "Hello" + sWord = "Hello" endif end select + + PrintLog "Thesaurus with 1 word: " + sWord + + if( Ucase(gApplication) = "DRAW" ) then + sExt = ".odg" + elseif( Ucase(gApplication) = "IMPRESS" ) then + sExt = ".odp" + endif + + Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_" + iSprache + sExt) + + Call hTextrahmenErstellen (sWord,20,20,50,30) + sleep 1 + + printlog "select the word" + hTypeKeys "<Home><SHIFT END>" + + try + ExtrasThesaurusDraw + catch + warnlog "No Thesaurus available." + hCloseDocument() + goto endsub + endcatch + + Kontext "Thesaurus" + if Thesaurus.Exists(3) then + + if CurrentWord.GetSelText <> sWord Then + WarnLog "marked word should be:" + sWord + " but it is:" + CurrentWord.GetSelText + else + PrintLog "Marked word is correctly changed" + endif - printlog " Thesaurus without any word in the document" - Call hNewDocument '/// New document ///' - try - ExtrasThesaurusDraw '/// try thesaurus in empty document ///' - Kontext "Thesaurus" - Thesaurus.Cancel - WarnLog " If no word is in the document, Thesaurus shouldn't be available" - catch - PrintLog " No Thesaurus available" - endcatch - - PrintLog " Thesaurus with 1 word: " + DasWort - - Call hTextrahmenErstellen (DasWort,20,20,50,30) - sleep 1 - - hTypeKeys "<Home><SHIFT END>" - '------------------------ -ToolsOptions -Kontext "ExtrasOptionenDlg" -hToolsOptions("LANGUAGESETTINGS","Languages") -Westlich.Select 34 -Kontext "ExtrasOptionenDlg" -ExtrasOptionenDlg.OK -sleep 1 - '------------------------ - try - ExtrasThesaurusDraw '/// Thesaurus with only 1 word ///' - Kontext "Thesaurus" - if Thesaurus.Exists(3) then - if CurrentWord.GetSelText <> DasWort Then WarnLog "marked word should be:" + DasWort + " but it is:" + CurrentWord.GetSelText - if CurrentWord.GetSelText = DasWort Then PrintLog " Marked word is correctly changed" '/// Control if word has changed ///' - ZaehlerBedeutung=Alternatives.GetItemCount if Alternatives.GetItemCount = 0 Then - PrintLog " There are no suggestions for this word" - sleep 1 + warnlog "There are no alternative for this word" + sleep 1 else - if ZaehlerBedeutung=1 Then - Alternatives.Select ZaehlerBedeutung - else - Alternatives.Select (ZaehlerBedeutung - 1) - end if - sleep 1 - Synonym.Select 1 '/// Select synonym 1///' - sleep 1 - if Ersetzen.GetText=Synonym.GetSelText Then PrintLog " Meaning transfered into Replace edit field" - if Ersetzen.GetText<>Synonym.GetSelText Then WarnLog " Replacement should have been: '" + Alternatives.GetSelText + "' but it is '" + Ersetzen.GetText+"'" - endif - Thesaurus.Cancel - else - warnlog " thesaurus didn't come up, that's bad :-(" - end if - catch - warnLog " No Thesaurus available ??! check if options western has smth selected !! !TL!" - endcatch - Call hCloseDocument '/// Close document ///' - -endcase 'tiToolsThesaurus + printlog "select the first alternative" + Alternatives.Select 1 + + printlog "check if the selected alternative apprear in the ReplaceWith field." + if ( ReplaceWith.getText() <> Alternatives.getSeltext(1,3) ) then + warnlog "the text is no transfered to the ReplaceWith field." + else + printlog "the text is transfered to the ReplaceWith field." + endif + + sReplaceWord = ReplaceWith.getText() + sleep 1 + endif + Thesaurus.OK + + if(Ucase(gApplication) = "DRAW") then + Kontext "Draw" + elseif(Ucase(gApplication) = "IMPRESS") then + Kontext "Impress" + else ' fallback + warnlog "gApplication is wrong" + goto endsub + endif + + hTypeKeys "<Home><SHIFT END>" + EditCopy + sChangedWord = getClipboard() + printlog "sChangedWord = " + sChangedWord + if(sChangedWord <> sReplaceWord) then + warnlog "the text was not replaced" + else + printlog "the text was successfull replaced" + endif + else + warnlog "thesaurus didn't come up." + end if + + Call hCloseDocument + +endcase +'------------------------------------------------------------------------------- +testcase tiToolsThesaurusWithoutText + + printlog "Thesaurus without any word in the document" + Call hNewDocument + try + ExtrasThesaurusDraw + catch + PrintLog "the Thesaurus is correctly not available" + call hCloseDocument + goto endsub + endcatch + + WarnLog "If no word is in the document, Thesaurus shouldn't be available" + Kontext "Thesaurus" + if Thesaurus.Exists then + Thesaurus.Cancel + endif + + Call hCloseDocument + +endcase '------------------------------------------------------------------------------- testcase tiToolsHyphenation1 diff --git a/testautomation/graphics/required/d_updt.bas b/testautomation/graphics/required/d_updt.bas index 9d56a2c87fed..d191f2adea1c 100755 --- a/testautomation/graphics/required/d_updt.bas +++ b/testautomation/graphics/required/d_updt.bas @@ -63,7 +63,7 @@ sub main call id_004 Call D_005_ call id_005 - call id_006 + call id_Tools call d_007 call id_007 call id_008 diff --git a/testautomation/graphics/required/i_updt_1.bas b/testautomation/graphics/required/i_updt_1.bas index 1d9b28f2aea9..141b261e3ee9 100755 --- a/testautomation/graphics/required/i_updt_1.bas +++ b/testautomation/graphics/required/i_updt_1.bas @@ -58,7 +58,7 @@ sub main Call im_004_ call id_004 call id_005 - call id_006 + call id_Tools Call hStatusOut end sub diff --git a/testautomation/graphics/required/includes/global/id_006.inc b/testautomation/graphics/required/includes/global/id_006.inc index 948cab1c4a04..a2a435735268 100644 --- a/testautomation/graphics/required/includes/global/id_006.inc +++ b/testautomation/graphics/required/includes/global/id_006.inc @@ -42,7 +42,21 @@ ' #1 tiToolsOptions '\********************************************************************************** - +'------------------------------------------------------------------------------ +sub id_Tools + printLog "--------- id_006 ----------" + call tiToolsSpellchecking + call tiToolsSpellcheckingAutomatic + call tiToolsThesaurus + call tiToolsHyphenation + call tiToolsAutoCorrect + call tChineseTranslation + call tiToolsMacro + call tiToolsGallery + call tiToolsEyedropper + call tToolsOptionsTest ' global one +end sub +'------------------------------------------------------------------------------- testcase tiToolsSpellchecking if not gOOO then ' Spellcheck doesn't work in OOo builds. @@ -86,9 +100,7 @@ testcase tiToolsSpellchecking else goto endsub endif endcase - -'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - +'------------------------------------------------------------------------------- testcase tiToolsSpellcheckingAutomatic '/// open application ///' Call hNewDocument @@ -102,72 +114,104 @@ testcase tiToolsSpellcheckingAutomatic '/// close application ///' Call hCloseDocument endcase +'------------------------------------------------------------------------------- +testcase tiToolsThesaurus -'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Dim sWord as string + Dim sExt as string -testcase tiToolsThesaurus - qaerrorlog "#i93133#: Thesaurus not active in loaded bugdoc" - goto endsub - if not gOOO then ' Thesaurus doesn't work in OOo builds. + 'for normal text, the thesaurus is enabled, + 'if the format->character->language of the word has a thesaurus + 'unfortunately in textboxes this doesn't work, you can give the word a langauge, + 'but this is been ignored by our thesaurus + '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 - dim sFileName as String - - '/// call subroutine 'hSetSpellHypLanguage' for setting the default language in the options, to enable it for languages, which don't provide a dictionary (usually asian ones) ///' - call hSetSpellHypLanguage - '/// open application-specific document which contains an American-formatted textframe with text. And select the text ///' - if (gApplication = "IMPRESS") then - sFileName = (ConvertPath (gTesttoolPath + "graphics\required\input\engtext.odp")) - else - sFileName = (ConvertPath (gTesttoolPath + "graphics\required\input\engtext.odg")) - end if - if hFileExists ( sFileName ) = FALSE then - warnlog "The language-file was not found or accessible! The test ends." + 'As long as OOo has no modules for that, disabled + if gOOO = True then + printlog "No spellchecking in OOo" goto endsub - end if - Call hFileOpen (sFileName) - - sleep (2) - - hTypeKeys "<TAB><RETURN>" - hTypeKeys "<END><SHIFT HOME>" - - ' Call hTextrahmenErstellen ("SimpleTest" + "<Mod1 Shift left>", 10, 10, 30, 40) - try - '/// Tools->Thesaurus ///' - ExtrasThesaurusDraw - Kontext "Thesaurus" - Call DialogTest ( Thesaurus ) - '/// click button 'language' ///' - Sprache.Click - Kontext "SpracheAuswaehlen" - Call DialogTest ( SpracheAuswaehlen ) - '/// cancel dialog 'select language' ///' - SpracheAuswaehlen.cancel - Kontext "Thesaurus" - '/// click button 'search' ///' - Nachschlagen.Click - kontext - '/// if messagebox exist, say OK; (word not found) ///' - if Messagebox.exists (5) then - printlog "Messagebox: word not in thesaurus: '"+Messagebox.gettext+"'" - Messagebox.ok - end if - sleep 1 - Kontext "Thesaurus" - '/// cancel dialog 'Thesaurus' ///' - Thesaurus.Cancel - catch - warnlog "Thesaurus didn't work :-(" - endcatch - sleep 1 - '/// close application ///' - Call hCloseDocument - else goto endsub endif -endcase -'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + '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 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 + sExt = ".odg" + elseif( Ucase(gApplication) = "IMPRESS" ) then + sExt = ".odp" + endif + + Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_" + iSprache + sExt) + Call hTextrahmenErstellen (sWord,20,20,50,30) + sleep 1 + + printlog "select the word" + hTypeKeys "<Home><SHIFT END>" + + try + ExtrasThesaurusDraw + catch + warnlog "No Thesaurus available." + hCloseDocument() + goto endsub + endcatch + + Kontext "Thesaurus" + if Thesaurus.Exists(3) then + Thesaurus.Cancel + else + warnlog "the thesaurus does not appear" + endif + Call hCloseDocument + +endcase +'------------------------------------------------------------------------------- testcase tiToolsHyphenation '/// open application ///' Call hNewDocument @@ -179,7 +223,7 @@ testcase tiToolsHyphenation '/// close application ///' Call hCloseDocument endcase - +'------------------------------------------------------------------------------- testcase tiToolsAutoCorrect dim iLanguage as integer ' for resetting the language '/// open application ///' @@ -291,9 +335,7 @@ testcase tiToolsAutoCorrect '/// close application ///' Call hCloseDocument endcase - -'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - +'------------------------------------------------------------------------------- testcase tChineseTranslation qaerrorlog( "#i89634# - Chinese Translation dialog does not close" ) @@ -365,9 +407,7 @@ testcase tChineseTranslation '/// Close application ///' Call hCloseDocument endcase - -'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - +'------------------------------------------------------------------------------- testcase tiToolsMacro '/// open application ///' Call hNewDocument @@ -419,9 +459,7 @@ testcase tiToolsMacro '/// close application ///' Call hCloseDocument endcase - -'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - +'------------------------------------------------------------------------------- testcase tiToolsGallery '/// open application ///' Call hNewDocument @@ -433,9 +471,7 @@ testcase tiToolsGallery '/// close application ///' Call hCloseDocument endcase - -'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - +'------------------------------------------------------------------------------- testcase tiToolsEyedropper '/// open application ///' Call hNewDocument @@ -449,20 +485,4 @@ testcase tiToolsEyedropper '/// close application ///' Call hCloseDocument endcase - -'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -testcase tiToolsOptions - '/// open application ///' - Call hNewDocument - '/// Tools->Options ///' - ToolsOptions - WaitSlot (2000) 'sleep 1 - kontext "OptionenDlg" - '/// close dialog 'Options' ///' - OptionenDlg.Close - '/// close application ///' - Call hCloseDocument -endcase - -'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +'-------------------------------------------------------------------------------
\ No newline at end of file diff --git a/testautomation/graphics/tools/id_tools_2.inc b/testautomation/graphics/tools/id_tools_2.inc index 6cf18494915d..501965a591d0 100644 --- a/testautomation/graphics/tools/id_tools_2.inc +++ b/testautomation/graphics/tools/id_tools_2.inc @@ -835,24 +835,6 @@ sub id_005 ' tiFormatLayer ' not in impress end sub -'------------------------------------------------------------------------------ -sub id_006 - - printLog Chr(13) + "--------- id_006 ----------" - - call tiToolsSpellchecking - call tiToolsSpellcheckingAutomatic - call tiToolsThesaurus - call tiToolsHyphenation - call tiToolsAutoCorrect - call tChineseTranslation - call tiToolsMacro - call tiToolsGallery - call tiToolsEyedropper - call tiToolsOptions ' get just called one time here... - Call tToolsOptionsTest ' global one -end sub - '------------------------------------------------------------------------------- sub id_007 |