diff options
Diffstat (limited to 'testautomation/graphics/optional')
10 files changed, 442 insertions, 979 deletions
diff --git a/testautomation/graphics/optional/g_spellcheck.bas b/testautomation/graphics/optional/g_spellcheck.bas index 7dad1b0d9e40..f8a8eb6c0668 100644..100755 --- a/testautomation/graphics/optional/g_spellcheck.bas +++ b/testautomation/graphics/optional/g_spellcheck.bas @@ -42,19 +42,16 @@ sub main use "graphics\optional\includes\global\g_spellcheck.inc" hSetLocaleStrings ( gTesttoolPath + "graphics\tools\locale_1.txt" , glLocale () ) - - PrintLog "-------------------------" + gApplication + "-------------------" - Call tiToolsSpellcheckCorrect - Call tiToolsSpellcheckError - Call tiToolsSpellcheckCheck - Call tToolsSpellcheckAutoSpellcheck + PrintLog "-------------------------" + gApplication + "-------------------" + call tiToolsSpellcheckCheck_AlwaysIgnore + call tiToolsSpellcheckCheck_Change + call tiToolsSpellcheckCheck_ChangeAll gApplication = "DRAW" PrintLog "-------------------------" + gApplication + "-------------------" - Call tiToolsSpellcheckCorrect - Call tiToolsSpellcheckError - Call tiToolsSpellcheckCheck - Call tToolsSpellcheckAutoSpellcheck + call tiToolsSpellcheckCheck_AlwaysIgnore + call tiToolsSpellcheckCheck_Change + call tiToolsSpellcheckCheck_ChangeAll Call hStatusOut end sub diff --git a/testautomation/graphics/optional/i_only_updt_1.bas b/testautomation/graphics/optional/i_only_updt_1.bas index fd1e4ae68215..98d226424f00 100644..100755 --- a/testautomation/graphics/optional/i_only_updt_1.bas +++ b/testautomation/graphics/optional/i_only_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/optional/includes/global/g_clipexport.inc b/testautomation/graphics/optional/includes/global/g_clipexport.inc index 64385ffd78c3..c9569cbf8741 100644 --- a/testautomation/graphics/optional/includes/global/g_clipexport.inc +++ b/testautomation/graphics/optional/includes/global/g_clipexport.inc @@ -165,87 +165,138 @@ global Text5 as string global Text6 as string global Text7 as string +'--------------------------- Tests for Writer ---------------------------------- +sub writertest + + try + call Make_And_Check_Formatted_Text_Line_From_Application + catch + warnlog "Something went wrong with testing writertest" + endcatch + + try + call Make_Rectangle_From_Application + call Full_test_Draw + call Full_test_Impress + call Full_test_Writer + call Full_test_Calc + catch + warnlog "something wrong with testing writertest" + endcatch +end sub ' big one + +'---------------------------- Tests for Calc ----------------------------------- +sub calctest + + try + call Make_Rectangle_From_Application + call Full_test_Draw + call Full_test_Impress + call Full_test_Writer + call Full_test_Calc + catch + warnlog "something wrong with calctest" + endcatch + printlog "currently no specific tests from Calc" +end sub + +'------------------------------------------------------------------------------- +sub tClipboardFromDrawTest + + EnableQAErrors = false + FromApp2 = gApplication + printlog "gApplication = " + gApplication + + select case( gApplication ) + case "WRITER" : call writertest() + case "CALC" : call calctest() + case else : warnlog( "Unsupported gApplication provided: " & gApplication ) + end select + +end sub + '------------------------------- "object"-dependant tests ---------------------- -try - call Make_Rectangle_From_Application - call Full_test_Draw - call Full_test_Impress - call Full_test_Writer - call Full_test_Calc -catch - warnlog "something wrong with testing Rectangle" -endcatch - -try - call Make_Make3dObject_From_Application - call Full_test_Draw - call Small_test_Impress - call Small_test_Calc - call Small_test_Writer -catch - warnlog "something wrong with testing 3dObject" -endcatch - -'qaerrorlog "Make_CurveObject_From_Application needs an overview - FHA" -try - call Make_CurveObject_From_Application - call Small_test_Draw - call Small_test_Impress - call Small_test_Calc - call Small_test_Writer -catch - warnlog "something wrong with testing CurveObj" -endcatch - -try - call Make_ConnectorObject_From_Application - call Small_test_Draw - call Small_test_Impress - call Small_test_Calc - call Small_test_Writer -catch - warnlog "something wrong with testing ConnectorObject" -endcatch - -try - call Make_LineObject_From_Application - call Small_test_Draw - call Small_test_Impress - ' call Small_test_Calc - ' call Small_test_Writer -catch - warnlog "something wrong with testing LineObject" -endcatch - -try -catch - warnlog "something wrong with testing ConnectorObject" -endcatch - -try - call Make_Circle_From_Application - call Small_test_Draw - call Small_test_Impress - call Small_test_Calc - call Small_test_Writer -catch - warnlog "something wrong with testing Circle" -endcatch - -try - call Make_TextSquare_From_Application - call Small_test_Draw - call Small_test_Impress - call Small_test_Calc - call Small_test_Writer - -catch - warnlog "something wrong with testing TextSquare" -endcatch - -call clear_all_and_close -Printlog "tClipboardFromDrawTest finished" +sub g_clipexport + try + call Make_Rectangle_From_Application + call Full_test_Draw + call Full_test_Impress + call Full_test_Writer + call Full_test_Calc + catch + warnlog "something wrong with testing Rectangle" + endcatch + + try + call Make_Make3dObject_From_Application + call Full_test_Draw + call Small_test_Impress + call Small_test_Calc + call Small_test_Writer + catch + warnlog "something wrong with testing 3dObject" + endcatch + + 'qaerrorlog "Make_CurveObject_From_Application needs an overview - FHA" + try + call Make_CurveObject_From_Application + call Small_test_Draw + call Small_test_Impress + call Small_test_Calc + call Small_test_Writer + catch + warnlog "something wrong with testing CurveObj" + endcatch + + try + call Make_ConnectorObject_From_Application + call Small_test_Draw + call Small_test_Impress + call Small_test_Calc + call Small_test_Writer + catch + warnlog "something wrong with testing ConnectorObject" + endcatch + + try + call Make_LineObject_From_Application + call Small_test_Draw + call Small_test_Impress + ' call Small_test_Calc + ' call Small_test_Writer + catch + warnlog "something wrong with testing LineObject" + endcatch + + try + catch + warnlog "something wrong with testing ConnectorObject" + endcatch + + try + call Make_Circle_From_Application + call Small_test_Draw + call Small_test_Impress + call Small_test_Calc + call Small_test_Writer + catch + warnlog "something wrong with testing Circle" + endcatch + + try + call Make_TextSquare_From_Application + call Small_test_Draw + call Small_test_Impress + call Small_test_Calc + call Small_test_Writer + + catch + warnlog "something wrong with testing TextSquare" + endcatch + + call clear_all_and_close + Printlog "tClipboardFromDrawTest finished" end sub diff --git a/testautomation/graphics/optional/includes/global/g_clipexport2.inc b/testautomation/graphics/optional/includes/global/g_clipexport2.inc index fae2cdcc7820..44fb7bbd5070 100644 --- a/testautomation/graphics/optional/includes/global/g_clipexport2.inc +++ b/testautomation/graphics/optional/includes/global/g_clipexport2.inc @@ -61,7 +61,7 @@ sub MakeRectangle end sub '------------------------------------------------------------------------------- -sub MakeCircle +testcase MakeCircle printlog "Create Circle" if gApplication = "WRITER" then @@ -81,10 +81,10 @@ sub MakeCircle gMouseUp (30,30) sleep 1 -end sub +endcase '------------------------------------------------------------------------------- -sub Make3dObject +testcase Make3dObject printlog "Create 3dObject" if (Ucase(gApplication) = "CALC") then @@ -158,10 +158,10 @@ sub Make3dObject endif end if -end sub +endcase '------------------------------------------------------------------------------- -sub MakeCurveObject +testcase MakeCurveObject if (Ucase(gApplication) = "WRITER") then warnlog "Cant make circle in this application" @@ -195,10 +195,10 @@ sub MakeCurveObject hMenuItemUnCheck (7) sleep 1 -end sub +endcase '------------------------------------------------------------------------------- -sub MakeLineObject +testcase MakeLineObject if gApplication = "WRITER" then warnlog "Currently no support for line-object in this application" @@ -224,10 +224,10 @@ sub MakeLineObject Kontext "Arrowshapes" Arrowshapes.Close -end sub +endcase '------------------------------------------------------------------------------- -sub MakeConnectorObject +testcase MakeConnectorObject if gApplication = "WRITER" then warnlog "Cant make connector in this application" @@ -268,7 +268,7 @@ sub MakeConnectorObject gMouseUp (30,37) end if -end sub +endcase '------------------------------------------------------------------------------- sub MakeFormattedTextLine diff --git a/testautomation/graphics/optional/includes/global/g_clipexport3.inc b/testautomation/graphics/optional/includes/global/g_clipexport3.inc index 5a6e86ac2a9c..63eb77cd6134 100644 --- a/testautomation/graphics/optional/includes/global/g_clipexport3.inc +++ b/testautomation/graphics/optional/includes/global/g_clipexport3.inc @@ -412,7 +412,7 @@ sub Check_Text_Formatting SetKontextApplication printlog " Check_Text_Formatting Ends" - +end suB '---------------------------------------------------------------------------------------------------- sub Check_Colors_Borders_Attributes @@ -558,26 +558,10 @@ sub Check_Colors_Borders_Attributes ColorModel = Farbmodell.GetSelText printlog " " + ColorModel - select case iSprache ' Prepared for future language-problematics. - if ColorR <> R.GetText then Warnlog "Wrong R-Color. Should be: " + ColorR + " but was: " + R.GetText - if ColorG <> G.GetText then Warnlog "Wrong V-Color. Should be: " + ColorG + " but was: " + G.GetText - if ColorB <> B.GetText then Warnlog "Wrong B-Color. Should be: " + ColorB + " but was: " + B.GetText - Else if ColorC <> C.GetText then Warnlog "Wrong C-Color. Should be: " + ColorC + " but was: " + C.GetText if ColorM <> M.GetText then Warnlog "Wrong M-Color. Should be: " + ColorM + " but was: " + M.GetText if ColorY <> Y.GetText then Warnlog "Wrong J-Color. Should be: " + ColorY + " but was: " + Y.GetText if ColorK <> K.GetText then Warnlog "Wrong N-Color. Should be: " + ColorK + " but was: " + K.GetText - End if - if ColorR <> R.GetText then Warnlog "Wrong R-Color. Should be: " + ColorR + " but was: " + R.GetText - if ColorG <> G.GetText then Warnlog "Wrong G-Color. Should be: " + ColorG + " but was: " + G.GetText - if ColorB <> B.GetText then Warnlog "Wrong B-Color. Should be: " + ColorB + " but was: " + B.GetText - Else - if ColorC <> C.GetText then Warnlog "Wrong C-Color. Should be: " + ColorC + " but was: " + C.GetText - if ColorM <> M.GetText then Warnlog "Wrong M-Color. Should be: " + ColorM + " but was: " + M.GetText - if ColorY <> Y.GetText then Warnlog "Wrong Y-Color. Should be: " + ColorY + " but was: " + Y.GetText - if ColorK <> K.GetText then Warnlog "Wrong K-Color. Should be: " + ColorK + " but was: " + K.GetText - End if - end select Kontext Active.setpage TabFarbverlaeufe @@ -624,7 +608,8 @@ sub Check_Colors_Borders_Attributes Printlog "End of one application" - '---------------------------------- Set the Kontext to the current Application ----------------------------------' +end sub + '---------------------------------- Set the Kontext to the current Application ----------------------------------' sub SetKontextApplication sleep 1 @@ -698,7 +683,7 @@ sub New_Writer end sub '------------------------------------------------------------------------------- -sub Choose_Toapplication +testcase Choose_Toapplication For ToAppCounter = 1 to 4 @@ -724,6 +709,6 @@ sub Choose_Toapplication Call hNewDocument SetKontextApplication -end sub +endcase '-------------------------------------------------------------------------------------------------------- diff --git a/testautomation/graphics/optional/includes/global/g_edit.inc b/testautomation/graphics/optional/includes/global/g_edit.inc index 869e6730cf0d..fdff948d0bfb 100644 --- a/testautomation/graphics/optional/includes/global/g_edit.inc +++ b/testautomation/graphics/optional/includes/global/g_edit.inc @@ -258,6 +258,7 @@ testcase tEditObjectEdit else Call hNewDocument + call sSelectEmptyLayout sleep 1 '/// new document ///' InsertObjectOLEObject '/// insert writer ole object ///' Kontext "OLEObjektEinfuegen" diff --git a/testautomation/graphics/optional/includes/global/g_spellcheck.inc b/testautomation/graphics/optional/includes/global/g_spellcheck.inc index 74f6177287ef..7f0993d09df5 100644 --- a/testautomation/graphics/optional/includes/global/g_spellcheck.inc +++ b/testautomation/graphics/optional/includes/global/g_spellcheck.inc @@ -29,398 +29,210 @@ '* '* short description : '* -'******************************************************************* -'* -' #1 tiToolsSpellcheckCorrect -' #1 tiToolsSpellcheckError -' #1 tiToolsSpellcheckCheck -' #1 tToolsSpellcheckAutoSpellcheck -'* '\******************************************************************* -testcase tiToolsSpellcheckCorrect - if iSprache = 48 then - qaerrorlog "This test is not adapted for polish, 48." - got endsub +testcase tiToolsSpellcheckCheck_AlwaysIgnore + + Dim sExt as string + + Dim sWrongWord as String + Dim sRightWord as string + + dim aWords(2) as string + aWords() = getWordsForLanguage() + + sWrongWord = aWords(0) + sRightWord = aWords(1) + + if(sWrongWord = "" OR sRightWord = "") then ' if any word is empty then the test should stop + qaerrorlog "no spellcheck test for the langauges " + iSprache + " available." + goto endsub endif - Dim DieDatei as String - dim lFiles(100) as string - dim i as integer - dim iFiles as integer - - lFiles(0)=0 - Printlog "- Checking Dictionary-Files" ' borrowed from w_106.inc - select case iSprache - case 01 : DieDatei = "01-44-hyph.dat" - case else : DieDatei = "" & iSprache & "-hyph.dat" - end select - DieDatei = Convertpath(gNetzOfficePath + "share\dict\" + DieDatei) - if gPlatGroup <> "unx" then - if (Dir(DieDatei) = "") then - if bAsianLan then - printlog "Dictionary not found : " + DieDatei + ", but is AsianLan, so OK :-)" - else - if gNetzInst then - printlog "Dictionary not found : " + DieDatei - else - warnlog "Dictionary not found : " + DieDatei - end if - end if - else - Printlog " Dictionary has been installed : " + DieDatei - end if - end if - iFiles = GetFileList (Convertpath (gNetzOfficePath + "share\dict\"), "*.dat" ,lFiles()) - for i = 1 to iFiles - printlog " " + i + ": " + DateiExtract(lFiles(i)) - next i + delete_word_from_dictionary(sWrongWord,"IgnoreAllList") - Call hNewDocument - ' sleep 2 - ToolsSpellcheck - Kontext "Active" - if Active.Exists(5) then - try - printlog "Message: Finished: Want to continue at the beginning? '" + active.gettext + "'" - Active.No - catch - Warnlog "The Active-dialoge didn't have a No-button, tries with OK instead." - Active.Ok - endcatch + if Ucase(gApplication) = "DRAW" then + sExt = ".odg" else - Warnlog "No 'Spellcheck finished, do you wish to continue?' message appeared" - end if - sleep 2 + sExt = ".odp" + endif - PrintLog "- Spellcheck with correct text" - select case iSprache - case 01 : hTextrahmenErstellen ("This is a text without any error.<Return>",10,10,50,20) - case 33 : hTextrahmenErstellen ("Il nous faut donc un de temps pour examiner avec soin tous les dossiers.<Return>",10,10,70,20) - case 34 : hTextrahmenErstellen ("Este es un chico muy importante.",10,10,50,20) - case 36 : hTextrahmenErstellen ("akit a b�r�s�g vagy a szab�lys�rt�si hat�s�g a eltiltott",10,10,70,20) - case 39 : hTextrahmenErstellen ("La ringraziamo per l'interesse mostrato a collaborare con la firma.<Return>",10,10,70,20) - case 46 : hTextrahmenErstellen ("Det varierar vad som behandlas och ur vilket perspektiv.<Return>",10,10,50,20) - case 49 : hTextrahmenErstellen ("Dies ist ein Text ohne Fehler.<Return>",10,10,50,20) - case 55 : hTextrahmenErstellen ("Esta poderia ser a resposta para suas preces?<Return>",10,10,50,20) - case else : - if bAsianLan then - printlog "For the language " + iSprache +" nothing is prepared yet, but is AsianLan, so OK :-) will use english instaed" - ' there was smth wrong, try to find out : - kontext - if active.exists then - printlog "ERROR: active: '"+active.gettext+"'" - active.ok - end if - hTextrahmenErstellen ("This is a text without any error.<Return>",10,10,50,20) - else - Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" - hTextrahmenErstellen ("This is a text without any error.<Return>",10,10,50,20) - end if - end select - ToolsSpellcheck - WaitSlot (2000) - Kontext "Active" - if active.exists(5) then - printlog "Message: spellchecking has finished?: '" + active.gettext + "'" - Active.OK + Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt) + call fMakeDocumentWritable() + + sleep(1) + + ' Perform the test now: + printlog "Call Tools->Spellcheck" + ToolsSpellcheck + sleep(2) + Kontext "Spellcheck" + printlog "Click button 'Always ignore' on dialog." + IgnoreAll.Click + Sleep 2 + + ToolsOptions + printlog "Select in category 'Languagesettings' entry 'Writing Aids.'" + hToolsOptions ("LANGUAGESETTINGS","WRITINGAIDS") + + fSelectWithString(Benutzerwoerterbuch,"IgnoreAllList") + + Bearbeiten.Click + + Kontext "BenutzerwoerterbuchBearbeiten" + if(Inhalt.getText <> sWrongWord) then + warnlog " added word is not in dictionary: '" + Buch.getSelText + "'" else - errorLog "Spellcheck started :" - Kontext "Spellcheck" - if Spellcheck.exists then - errorlog " - spellcheck came up and will be closed now" - Spellcheck.Close - else - printlog "spellcheck didn't come up" - end if + printlog " added word is in dictionary: '" + Buch.getSelText + "'" end if - WaitSlot (2000) + + printlog "Close dialog 'Edit Custom Dictionary'." + BenutzerwoerterbuchBearbeiten.Close + Kontext "ExtrasOptionenDlg" + printlog "Close the Option dialog." + ExtrasOptionenDlg.OK + + printlog "Close document" Call hCloseDocument -endcase 'tiToolsSpellcheckCorrect -'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -testcase tiToolsSpellcheckError - if iSprache = 48 then - qaerrorlog "This test is not adapted for polish, 48." - got endsub - endif - Dim Fehler$ - Dim Sprachenname$ - Dim Dummy$ - Dim FehlerText$ - Dim i as integer - - printlog "New document" - Call hNewDocument - printlog "Selecting language case: " & iSprache - select case iSprache - case 01 : FehlerText$ = "Thatt is a failure test." : Fehler$ = "Thatt" : Sprachenname$ = "English (US)" - case 34 : FehlerText$ = "Ezte es un chico muy importante." : Fehler$ = "Ezte" : Sprachenname$ = "Niederlaendisch" - case 33 : FehlerText$ = "Ler nous faut donc un de temps pour examiner." : Fehler$ = "Ler" : Sprachenname$ = "Franzoesisch" - case 36 : FehlerText$ = "Boszniai americkai kontingens háromnegyedesek – mintegy négyezer katona – magyarországi telepítése egy éven belül megtörténhet" : Fehler$ = "tellepítésel" : Sprachenname$ = "Ungarisch" - case 39 : FehlerText$ = "Ringrarziamo per l'interessa mostrato a collaborare con la firma." : Fehler$ = "Ringrarziamo" : Sprachenname$ = "Italienisch" - case 46 : FehlerText$ = "Detd varierar vad som behandlas och ur vilket perspektiv." : Fehler$ = "Detd" : Sprachenname$ = "Schwedisch" - case 49 : FehlerText$ = "Diees ist ein Fehler." : Fehler$ = "Diees" : Sprachenname$ = "Deutsch" - case 55 : FehlerText$ = "Eesta poderia ser a resposta para suas preces?": Fehler$ = "Eesta" : Sprachenname$ = "Portugiesisch" - case else : - if bAsianLan then - printlog "For the language " + iSprache +" nothing is prepared yet, but is AsianLan, so OK :-) using english" - FehlerText$ = "Thatt is a failure test." - Fehler$ = "Thatt" - Sprachenname$ = "English (US)" - call hSetSpellHypLanguage - else - Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" - end if - end select - printlog "Error Text taken for testing is: " & FehlerText$ - sleep 2 + ' remove the word again from the dictionary + delete_word_from_dictionary(sWrongWord,"IgnoreAllList") + +endcase 'tiToolsSpellcheckCheck +'------------------------------------------------------------------------------- +testcase tiToolsSpellcheckCheck_Change - printlog "Delete ignore word list" - if (not wIgnorierenlisteLoeschen) then - qaErrorLog "Can't get into Dictionary lists" + Dim sExt as string + Dim sWrongWord as String + Dim sRightWord as string + + dim aWords(2) as string + aWords() = getWordsForLanguage() + + sWrongWord = aWords(0) + sRightWord = aWords(1) + + if(sWrongWord = "" OR sRightWord = "") then ' if any word is empty then the test should stop + qaerrorlog "no spellcheck test for the langauges " + iSprache + " available." goto endsub - end if - printlog "Setting doc language to english" - ToolsOptions - Kontext "ExtrasOptionenDlg" - hToolsOptions("LANGUAGESETTINGS","Languages") - Westlich.Select 34 - Kontext "ExtrasOptionenDlg" - ExtrasOptionenDlg.OK - printlog "Create 1 textbox with 1 spelling error (test replace always)" - hTextrahmenErstellen (FehlerText$,30,30,90,40) + endif + + if Ucase(gApplication) = "DRAW" then + sExt = ".odg" + else + sExt = ".odp" + endif + + Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt) + + call fMakeDocumentWritable - hTypeKeys "<HOME>" - printlog "Call 'Tools->Spellcheck->Check'" + ' Perform the test now: + printlog "Call Tools->Spellcheck" ToolsSpellcheck - printlog "Spellcheck dialog has to come up, wrong word is selected." + sleep(2) Kontext "Spellcheck" - if Spellcheck.Exists then - printlog "There has to be at least ONE suggestion." - if (Suggestions.GetItemCount < 1) then - printlog "If no suggestion avilable:" - warnlog " - no suggestion for the language: "+DictionaryLanguage.GetSelIndex+" '"+DictionaryLanguage.GetSelText+"' , press check button..." - printlog "+ press button 'Check word'" - Pruefen.click - if (Suggestions.GetItemCount < 1) then - warnlog " STILL no suggestions :-( errors will follow " - else - printlog " - now suggestion for the language: "+DictionaryLanguage.GetSelIndex+" '"+DictionaryLanguage.GetSelText+"'" + Suggestions.GetItemCount - end if - end if - Dummy$=Suggestions.GetItemText (1) - printlog "Select first spellcheck suggestion (click it!)." - Suggestions.Select (1) - printlog "Check if textfield 'word' has changed to selected word." - if (Suggestions.GetSelText <> Dummy$) Then - Warnlog "Suggestion not used" - else - Printlog "Suggestion is used" - end if - sleep 1 - kontext "Spellcheck" - printlog "click button 'Always replace'" - ChangeAll.Click - printlog "spellcheck dialog has to disappear and" - printlog "There has to come up only one active: 'Spellcheck of entire document has been completed [OK]'" - Kontext "Active" - if Active.Exists(5) then - Printlog "Message: Spellchecking has finished?: '" + active.gettext + "'" - Active.OK - else - Printlog "'Change All' seems to have worked correctly." - Kontext "Spellcheck" - Spellcheck.Close - Kontext "Active" - if active.exists(5) then - Printlog "Spellcheck dialog closed'" + active.gettext + "'" - Active.OK - else - Printlog "Spellcheck dialog closed'" - end if - end if + printlog "Click button 'Change' on dialog." + Change.Click + sleep(10) + SpellcheckClose.click + + if Ucase(gApplication) = "DRAW" then + Kontext "DocumentDraw" + DocumentDraw.TypeKeys("<TAB>",true) + DocumentDraw.TypeKeys("<SPACE>",true) else - Warnlog " Error not recognized by the Spellchecker" - if active.exists(5) then - Kontext "Active" - printlog "Message: spellchecking has finished?: '" + active.gettext + "'" - Active.OK - end if - end if + Kontext "DocumentImpress" + DocumentImpress.TypeKeys("<TAB>",true) + DocumentImpress.TypeKeys("<SPACE>",true) + endif - printlog "delete textbox" EditSelectAll - hTypeKeys "<DELETE>" - sleep 1 + EditCopy + + dim s as string + s = getClipBoard() - printlog "Create same textbox again (test IGNORE function)." - Printlog "Check function Ignore" - hTextrahmenErstellen (FehlerText$,30,30,80,40) - printlog "All 'Tools->Spellcheck->Check'." - - 'printlog "Setting Text to english" - 'sleep 1 - 'EditSelectAll - 'FormatCharacter - 'sleep 1 - 'Kontext - 'Messagebox.SetPage TabFont - 'Kontext "TabFont" - 'Language.Select 41 - 'TabFont.OK + printlog s - ToolsSpellcheck - Kontext "Spellcheck" - printlog "press button 'Ignore'" - IgnoreOnce.Click - printlog "spellcheck dialog has to disappear and " - printlog " There has to come up only one active: 'Spellcheck of entire document has been completed [OK]'." - Kontext "Active" - if Active.Exists(5) Then - Printlog " Spellcheck ended because of only 1 defined error. And Ignore worked.'" + active.gettext + "'" - Active.OK + if(Instr(s,sWrongWord) <> 0) then + warnlog "word not changed. '" + s + "' contains still wrong word '" + sWrongWord + "'" else - Printlog " 'Ignore Once' seems to work correctly." - Kontext "Spellcheck" - Spellcheck.Close - Kontext "Active" - if active.exists(5) then - Printlog " Spellcheck dialog closed'" + active.gettext + "'" - Active.OK - else - Printlog " Spellcheck dialog closed'" - end if - end if + printlog "word changed." + endif - printlog "Call 'Tools->Spellcheck->Check." - ToolsSpellcheck - Kontext "Spellcheck" - if Spellcheck.Exists Then - Printlog " Ignore worked" - Spellcheck.Close - Kontext "Active" - if active.exists(5) then - Printlog " " + active.gettext + "'" - Active.OK - else - Printlog " Spellcheck dialog closed'" - end if + if(Instr(s,sRightWord) <> 0) then + printlog "word changed." else - Warnlog " Spellcheck ended even we only ignored the error" - end if + warnlog "word not changed." + endif + + printlog "Close document" + Call hCloseDocument - printlog "delete textbox." - EditSelectAll - hTypeKeys "<DELETE>" - sleep 1 +endcase +'------------------------------------------------------------------------------- +testcase tiToolsSpellcheckCheck_ChangeAll + + + + Dim sExt as string + Dim sRightWord as String + Dim sWrongWord as string + + dim aWords(2) as string + aWords() = getWordsForLanguage() + + sWrongWord = aWords(0) + sRightWord = aWords(1) + + if(sWrongWord = "" OR sRightWord = "") then ' if any word is empty then the test should stop + qaerrorlog "no spellcheck test for the langauges " + iSprache + " available." + goto endsub + endif + + 'delete_word_from_dictionary(sWord,"IgnoreListAll") + + if Ucase(gApplication) = "DRAW" then + sExt = ".odg" + else + sExt = ".odp" + endif + + Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt) + + call fMakeDocumentWritable() - printlog "create same textbox again (test ALWAYS IGNORE function)." - hTextrahmenErstellen (FehlerText$,30,30,60,40) - - 'printlog "Setting Text to english" - 'sleep 1 - 'EditSelectAll - 'FormatCharacter - 'sleep 1 - 'Kontext - 'Messagebox.SetPage TabFont - 'Kontext "TabFont" - 'Language.Select 41 - 'TabFont.OK - - printlog "Call 'Tools->Spellcheck->Check'." + ' Perform the test now: + printlog "Call Tools->Spellcheck" ToolsSpellcheck + sleep(2) Kontext "Spellcheck" - printlog "click button 'Always Ignore." - IgnoreAll.Click - printlog "spellcheck dialog has to disappear and" - printlog "There has to come up only one active: 'Spellcheck of entire document has been completed [OK]'." - Kontext "Active" - if active.exists(5) then - Printlog " Spellcheck ended because of only 1 defined error. And Ignore worked.'" + active.gettext + "'" - Active.OK - else - Printlog " 'Ignore All' seems to work." - Kontext "Spellcheck" - Spellcheck.Close - Kontext "Active" - if active.exists(5) then - Printlog " Spellcheck dialog closed'" + active.gettext + "'" - Active.OK - else - Printlog " Spellcheck dialog closed'" - end if - end if + printlog "Click button 'Change' on dialog." + ChangeAll.Click + 'TODO: check result beware of issue 110688 + Sleep 2 - Printlog "- Delete ignore list" - sleep 1 - printlog "Delete ignore word list." - if (not wIgnorierenlisteLoeschen) then - qaErrorLog "Can't get into Dictionary lists" - goto endsub - end if + SpellCheckClose.click + + printlog "Close document" Call hCloseDocument -endcase 'tiToolsSpellcheckError -'------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -testcase tiToolsSpellcheckCheck - if iSprache = 48 then - qaerrorlog "This test is not adapted for polish, 48." - got endsub - endif - Dim Datei$ - Dim sWord(2) as string - Dim i as integer - Dim j as integer - Dim s as integer - Dim AlleBuecher as integer - Dim sExt as string - Dim sWordOne as string - Dim sWordTwo as string - Dim iBooks as integer - Dim bWordFound(2) as boolean - Dim iSuggestions as integer - Dim iWord(2) as integer - Dim bFound as boolean - - Select Case Ucase(gApplication) - case "DRAW" : sExt = ".odg" - case "IMPRESS" : sExt = ".odp" - end select +endcase - printlog "Load prepared document containing 4 errors : graphics\\required\\input\\recht_" & iSprache & sExt - if (not bAsianLan) then - printlog "Check if the document is writable." - Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt) - else - Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_1"+sExt) - end if - if fIsDocumentWritable = false then - 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 - end if - end if - select case iSprache ' sWord(1)=red : sWord(2)=turquoise - case 01 : sWord(1) = "documente" : sWord(2) = "expriss" - case 33 : sWord(1) = "intercu" : sWord(2) = "Lees" - case 34 : sWord(1) = "afekto" : sWord(2) = "fratternal" - case 36 : sWord(1) = "szeerint" : sWord(2) = "tervvezi" - case 39 : sWord(1) = "Millano" : sWord(2) = "tarrget" - case 46 : sWord(1) = "desa" : sWord(2) = "occh" - case 49 : sWord(1) = "Texxt" : sWord(2) = "reichtt" - case 55 : sWord(1) = "esktava" : sWord(2) = "noitee" - case else : - if bAsianLan then - sWord(1) = "documente" : sWord(2) = "expriss" - else - Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here and create the file" - end if - end select - sleep 2 - Printlog "Delete all added words from dictionaries." + + + +'------------------------------------------------------------------------------- +function delete_all_added_words(aWords) + + '/// this function delete the words in sWords in all user dictionaries + + Dim iBookCounter as integer + Dim iWordCounter as integer + Dim iBooks as integer + + Printlog "Delete the given words from dictionaries." printlog "Call Tools->Options." ToolsOptions printlog "Select in category 'Languagesettings' entry 'Writing Aids.'" @@ -428,487 +240,138 @@ testcase tiToolsSpellcheckCheck sleep 1 Kontext "WRITINGAIDS" sleep 1 - printlog "Click on button 'edit' in section 'User-defined dictionaries.'" - if (fGetIntoDictionary) then - qaErrorLog "wTSC" - goto endsub - end if + printlog "select the first User-defined dictionaries and click EDIT" + Benutzerwoerterbuch.select 1 + Bearbeiten.Click + Kontext "BenutzerwoerterbuchBearbeiten" sleep 1 - printlog "Check every book, if it contains the words that will be added in this test." - iBooks = Buch.getItemCount - bWordFound(1) = false - bWordFound(2) = false - for i = 1 to iBooks - Buch.select(i) + printlog "Check every book, if it contains the words." + iBooks = Buch.getItemCount + for iBookCounter = 1 to iBooks + Buch.select(iBookCounter) printlog "Items in Booklist: " & WordList.getItemCount - for j = 1 to 2 - Wort.setText sWord(j) + for iWordCounter = 1 to uBound(aWords) + Wort.setText aWords(iWordCounter) sleep 1 if ((not neu.isEnabled) and Loeschen.isEnabled) then printlog "If it contains the word, press button 'delete'." Loeschen.click - bWordFound(j) = true - printlog "Added word WAS in dictionary: '" + Buch.getSelText + "' - '" + sWord(j) + "'" + printlog "Added word WAS in dictionary: '" + Buch.getSelText + "' - '" + aWords(iWordCounter) + "'" end if - next j - next i - if (bWordFound(1) OR bWordFound(2))then - qaErrorLog "Word was found in dictionary - check why it was there. '" + sWord(1) + "': " + bWordFound(1) + " '" + sWord(2) + "': " + bWordFound(2) - end if + next iWordCounter + next iBookCounter printlog "Close dialog 'Edit Custom Dictionary.'" BenutzerwoerterbuchBearbeiten.Close sleep 1 Kontext "ExtrasOptionenDlg" printlog "Press button 'OK' on dialog 'Writing Aids'." ExtrasOptionenDlg.OK - printlog "Call dialog again and delete all remaining words from dictionary 'IgnoreAllList'." - if (not wIgnorierenlisteLoeschen) then - qaErrorLog "Can't get into Dictionary lists" - goto endsub - end if - - printlog "Test if spellcheck dialog comes up and check/set direction of spellcheck." - printlog "Call 'Tools->Spellcheck->Check'." - ToolsSpellcheck - Kontext "Spellcheck" - WaitSlot (1000) - printlog "If no dictionary for the language is available, a messagebox comes up:" - printlog ". . . 'Error executing the spellcheck.: Language is not supported by spellchecker funtion." - kontext "active" - if active.exists(5) then - warnlog "$Language is not supported by spellchecker funtion: '" + active.gettext + "'" - Active.OK - printlog ". . . exiting testcase." - goto endsub - end if - Kontext "Spellcheck" - printlog "Close dialog 'Spellcheck'." - Spellcheck.Close - Kontext "Active" - if active.exists(5) then - Warnlog " Should not be any message here: " + active.gettext + "'" - Active.OK - else - printlog "Spellcheck ended, dialog closed" - end if - printlog "Select all." - hTypeKeys "<MOD1 A>" - printlog "Check presupposition: 12 Words have to be complained about." - printlog "All 'Tools->Spellcheck->Check'." - ToolsSpellcheck - WaitSlot (2000) - Kontext "Spellcheck" - printlog "Click button 'Ignore' 12 times." - - for i = 1 to 11 - Kontext "Spellcheck" - IgnoreOnce.Click - Kontext "Active" - if active.exists(5) then - warnlog "Presupposition not met: there are less than 12 errors in the document! " + i - Active.OK - printlog "If errors < 12 -> exiting testcase." - goto endsub - end if - next i - Kontext "Spellcheck" - IgnoreOnce.Click - printlog "Spellcheck dialog has to disapear and messagebox with OK has to come up." - Kontext "Active" - if active.exists(5) then - printlog "Active dialog said: " + active.gettext + "'" - Active.OK - end if - Kontext "Spellcheck" - if Spellcheck.Exists(5) then - warnlog "Presupposition not met: there are more than 12 errors in the document!" - Spellcheck.Close - kontext "Active" - if active.exists(5) then - Active.OK - else - printlog "bug fixed #111972# " - end if - printlog "If errors > 12 -> exiting testcase." - goto endsub - else - Kontext "Active" - if active.exists(5) then - warnlog "There was a Message where none was supposed to be: '" + active.gettext + "'" - Active.NO - end if - printlog "Presupposition met: there are 12 errors in the document!" - end if - - printlog "Perform the test now:" - printlog "Call 'Tools->Spellcheck->Check'" - ToolsSpellcheck - WaitSlot (2000) - Kontext "Spellcheck" - Printlog "----------------------------------------------------------------------------" - Printlog "1st Test: - Ignore now" - printlog "1st error: ignore : 1st pink word in 1st Paragraph." - printlog "Backwards: last green word in 3rd Paragraph." - sWordOne = Suggestions.GetSelText - printlog "********* Suggestion word found: '" + sWordOne + "'" - printlog "##### suggestions: "+Suggestions.GetItemCount+"; Language: "+DictionaryLanguage.getSelText '+" ; dictionary: "+woerterbuch.getSelText - if (Suggestions.GetItemCount > 0) then - printlog "----- "+i+": "+Suggestions.GetSelText (1) - end if - printlog "Click button 'Ignore'." - IgnoreOnce.Click - Sleep 2 - - Printlog "----------------------------------------------------------------------------" - Printlog "2nd Test: - Add" - printlog "2nd error: add : 1st red word in 1st Paragraph -> hasn't to show up anymore from now on." - printlog "Backwards: last turquoise word in 3rd Paragraph -> hasn't to show up anymore from now on." - printlog "Check if word in textfield 'Word' changed." - printlog "(Check if it is the expected next error - you have to look into the source code for the right word!)." - sWordTwo = Suggestions.GetSelText - if (sWordOne = sWordTwo) then - warnlog "Ignore didn't work? Spellcheck didn't go on" - end if - if (sWord(iWord(1)) <> sWordTwo) then - Printlog "The errornous word '" + sWord(iWord(1)) + "' would be replaced with: '" + sWordTwo + "'" - end if - printlog "********* word found: '" + sWordTwo + "'" - printlog "##### suggestions: "+Suggestions.GetItemCount+"; Language: "+DictionaryLanguage.getSelText ' +" ; dictionary: "+woerterbuch.getSelText - if (Suggestions.GetItemCount > 0) then - printlog "----- "+i+": "+Suggestions.GetSelText (1) - end if - Sleep 1 - printlog "Click button 'Add' on dialog '" - AddToDictionary.Click - Sleep 2 - printlog "The menu has: " + MenuGetItemCount + " entries." - hMenuSelectNr(1) 'Default - Kontext "Active" - if Active.Exists(5) Then - Warnlog " - Word could not be added to dictionary: '" + active.getText + "'" - Active.OK - Sleep 1 - end if - printlog "Check in options, if word exists in word list." - printlog "Click button 'Options' on dialog 'Spellcheck'." - Kontext "Spellcheck" - SpellcheckOptions.Click - Kontext "TabLinguistik" - printlog "Click button 'Edit ...' on dialog 'Writing Aids' in section 'User-defined dictionaries'." - if TabLinguistik.exists(5) then - sleep 3 - if (fGetIntoDictionary) then - qaErrorLog "wTSC" - goto endsub - end if - else - qaerrorlog "baeh" - end if - Kontext "BenutzerwoerterbuchBearbeiten" - printlog "Check every book, if it contains the added word." - if not BenutzerwoerterbuchBearbeiten.exists(5) then - sleep 5 - qaerrorlog "baeh" - end if - iBooks = Buch.getItemCount - bWordFound(1) = false - for i = 1 to iBooks - Buch.select(i) - printlog "Book number selected: " & i - Wort.setText sWord(iWord(1)) - sleep 1 - if ((not neu.isEnabled) and Loeschen.isEnabled) then - bWordFound(1) = true - printlog "Added word is in dictionary: '" + Buch.getSelText + "'" - end if - next i - if (not bWordFound(1)) then - warnlog "Word was not added to dictionary" - end if - printlog "Cancel dialog 'Edit Custom Dictionary'." - BenutzerwoerterbuchBearbeiten.Close - Kontext "TabLinguistik" - printlog "Cancel dialog 'Writing Aids'." - TabLinguistik.Close - Kontext "Spellcheck" - - Printlog "----------------------------------------------------------------------------" - Printlog " 3rd Test: - Always Ignore" - printlog "3rd error: always ignore : 1st turquoise word in 1st Paragraph -> hasn't to show up anymore from now on." - printlog "Check if word in textfield 'Word' changed." - printlog "(check if it is the expected next error - you have to look into the source code for the right word!)" - sWordOne = sWordTwo - sWordTwo = Suggestions.GetSelText 'wort.getText - if (sWordOne = sWordTwo) then - warnlog "Add didn't work? Spellcheck didn't go on." - end if - if (sWord(iWord(2)) <> sWordTwo) then - Printlog "The erroneous word '" + sWord(iWord(2)) + "' would be replaced with: '" + sWordTwo + "'" - else - warnlog "ERROR: SAME WORD in the dictionary as in the text??? Must be wrong." - end if - printlog "********* word found: '" + sWordTwo + "'" - printlog "##### suggestions: "+Suggestions.GetItemCount+"; Language: "+DictionaryLanguage.getSelText ' +" ; dictionary: "+DictionaryLanguage.getSelText 'Wort.GetItemCount 'Woerterbuch.GetSelText - if (Suggestions.GetItemCount > 0) then 'Wort.GetItemCount > 0) then - printlog "----- "+i+": "+Suggestions.GetItemText (1) 'Wort.GetItemText (1) - end if - Sleep 1 - printlog "Click button 'Always ignore' on dialog." - IgnoreAll.Click - Sleep 2 - printlog "Check in options, if word exists in word list." - printlog "Click button 'Options' on dialog 'Spellcheck'." - SpellcheckOptions.Click - Kontext "TabLinguistik" - printlog "Click button 'Edit ...' on dialog 'Writing Aids' in section 'User-defined dictionaries." - if TabLinguistik.exists(5) then - sleep 3 'culprint swedish windows; wait until butrton exists? - if (fGetIntoDictionary) then - qaErrorLog "wTSC" - goto endsub - end if - else - qaerrorlog "baeh" - end if - Kontext "BenutzerwoerterbuchBearbeiten" - if not BenutzerwoerterbuchBearbeiten.exists(5) then - sleep 3 - qaerrorlog "baeh" - end if - printlog "Check every book, if it contains the added word." - iBooks = Buch.getItemCount - bWordFound(2) = false - for i = 1 to iBooks - Kontext "BenutzerwoerterbuchBearbeiten" - Buch.select(i) - Inhalt.setText sWord(iWord(2)) 'Wort.setText sWord(iWord(2)) - sleep 1 - if ((not neu.isEnabled) and Loeschen.isEnabled) then - bWordFound(2) = true - printlog " added word is in dictionary: '" + Buch.getSelText + "'" - end if - next i - if (not bWordFound(2)) then - warnlog "Word was not added to dictionary, #ixxxxxx" - end if - printlog "Cancel dialog 'Edit Custom Dictionary'." - BenutzerwoerterbuchBearbeiten.Close - Kontext "TabLinguistik" - printlog "Cancel dialog 'Writing Aids'." - TabLinguistik.Close - kontext "Spellcheck" - - Printlog "----------------------------------------------------------------------------" - Printlog "4th test: - Replace" - printlog "4th error: replace : 1st green word in 1st Paragraph." - printlog "Check if word in textfield 'Word' changed." - printlog "(check if it is the expected next error - you have to look into the source code for the right word!)." - sWordOne = sWordTwo - sWordTwo = Suggestions.GetSelText - if (sWordOne = sWordTwo) then - warnlog "Always ignore didn't work? Spellcheck didn't go on." - end if - printlog "********* word found: '" + sWordTwo + "'" - iSuggestions = Suggestions.GetItemCount - printlog "##### suggestions: " + iSuggestions + "; Language: "+DictionaryLanguage.getSelText '+"; dictionary: "+woerterbuch.getSelText - if (Suggestions.GetItemCount > 0) then - printlog "----- "+i+": "+Suggestions.GetItemText (1) - end if - Sleep 1 - printlog "Click button 'Replace'." - if (iSuggestions > 0) then - Change.click - else - qaerrorlog "Please change the text in the file, so the spellchecker can make a suggestion for the word: '" + sWordTwo + "'" - IgnoreOnce.Click - end if - - Printlog "----------------------------------------------------------------------------" - Printlog "5th Test: - Always Replace" - printlog "5th error: always replace : 1st pink word in 2nd Paragraph -> hasn't to show up anymore from now on." - printlog "backwards: 1st green word in 2nd Paragraph -> hasn't to show up anymore from now on." - printlog "check if word in textfield 'Word' changed." - printlog "(check if it is the expected next error - you have to look into the source code for the right word!)." - sWordOne = sWordTwo - sWordTwo = Suggestions.GetSelText - if (sWordOne = sWordTwo) then - warnlog "Replace didn't work? Spellcheck didn't go on" - end if - printlog "********* word found: '" + sWordTwo + "'" - iSuggestions = Suggestions.GetItemCount - printlog "##### suggestions: " + iSuggestions + "; Language: "+DictionaryLanguage.getSelText ' +" ; dictionary: "+woerterbuch.getSelText - if (Suggestions.GetItemCount > 0) then - printlog "----- "+i+": "+Suggestions.GetItemText (1) - end if - Sleep 1 - printlog "click button 'Always Replace'." - if (iSuggestions > 0) then - ChangeAll.click - else - qaErrorLog "Please change the text in the file, so the spellchecker can make a suggestion for the word: '" + sWordTwo + "'" - IgnoreOnce.Click - end if + +end function +'------------------------------------------------------------------------------- +function delete_word_from_dictionary(sWord as String, sDictionary as String) - printlog "2 errors are left: 4th word (green) in 2nd and 3rd paragraph." - printlog "backwards: 1st word (pink) in 2nd and 1st paragraph." - Kontext "Spellcheck" - sWordOne = sWordTwo - sWordTwo = Suggestions.GetSelText - if (sWordOne <> sWordTwo) then - printlog sWordTwo - else - warnlog "there is anopther word left, that wasn't expected!. '" + sWordTwo +"'" - end if - printlog "Click button 'Ignore' 2 times." - IgnoreOnce.Click + '/// this function delete the words in sWords in all user dictionaries - Kontext "Spellcheck" - sWordOne = sWordTwo - sWordTwo = Suggestions.GetSelText - if (sWordOne <> sWordTwo) then - warnlog "there is anopther word left, that wasn't expected!. '" + sWordTwo +"'" - else - printlog sWordTwo - end if - printlog "Click button 'Ignore' 2 times." - IgnoreOnce.Click - Kontext "Active" - if active.exists(5) then - printlog "Spellcheck works :-) '" + active.gettext + "'" - Active.No - else - warnlog "Spellcheck didn't work :-(! there are still errors in the document." - Kontext "Spellcheck" - Spellcheck.Close - Kontext "Active" - if active.exists(5) then - qaErrorLog " Spellcheck dialog closed'" + active.gettext + "'" - Active.No - end if - end if - sleep 2 + Dim iBookCounter as integer + Dim iWordCounter as integer + Dim iBooks as integer - Printlog "Delete all added words from dictionaries." + Printlog "Delete the given word from dictionaries." printlog "Call Tools->Options." ToolsOptions - printlog "Select in category 'Languagesettings' entry 'Writing Aids'." + printlog "Select in category 'Languagesettings' entry 'Writing Aids.'" hToolsOptions ("LANGUAGESETTINGS","WRITINGAIDS") sleep 1 Kontext "WRITINGAIDS" - printlog "Click on button 'edit' in section 'User-defined dictionaries'." - if (fGetIntoDictionary) then - qaErrorLog "wTSC" - goto endsub - end if + sleep 1 + printlog "select the dictionary and click EDIT" + + fSelectWithString(Benutzerwoerterbuch,sDictionary) + + Bearbeiten.Click + Kontext "BenutzerwoerterbuchBearbeiten" - printlog "Check every book, if it contains the added word." - iBooks = Buch.getItemCount - bWordFound(1) = false - bWordFound(2) = false - for i = 1 to iBooks - Buch.select(i) - for j = 1 to 2 - Wort.setText sWord(j) - sleep 1 - if ((not neu.isEnabled) and Loeschen.isEnabled) then - printlog "If it contains the word, press button 'delete'." - Loeschen.click - bWordFound(j) = true - printlog " added word is in dictionary: '" + Buch.getSelText + "' - '" + sWord(j) + "'" - end if - next j - next i - if ((not bWordFound(1)) AND (not bWordFound(2)))then - warnlog "Word was not found in dictionary. '" + sWord(1) + "': " + bWordFound(1) + " '" + sWord(2) + "': " + bWordFound(2) + + Wort.setText sWord + sleep 1 + if ((not neu.isEnabled) and Loeschen.isEnabled) then + printlog "If it contains the word, press button 'delete'." + Loeschen.click + printlog "Added word WAS in dictionary: '" + Buch.getSelText + "' - '" + sWord + "'" end if - printlog "Close dialog 'Edit Custom Dictionary'." + + printlog "Close dialog 'Edit Custom Dictionary.'" BenutzerwoerterbuchBearbeiten.Close sleep 1 Kontext "ExtrasOptionenDlg" - printlog "press button 'OK' on dialog 'Writing Aids'." + printlog "Press button 'OK' on dialog 'Writing Aids'." ExtrasOptionenDlg.OK - printlog "Call dialog again and delete all remaining words from dictionary 'IgnoreAllList'." - if (not wIgnorierenlisteLoeschen) then - qaErrorLog "Can't get into Dictionary lists" - goto endsub - end if - printlog "Close document" - Call hCloseDocument -endcase 'tiToolsSpellcheckCheck +end function -'------------------------------------------------------------------------------- -testcase tToolsSpellcheckAutoSpellcheck - - QaErrorLog "#i81928# - outcommented tToolsSpellcheckAutoSpellcheck due to bug." - goto endsub - dim i as integer - dim x as integer - dim y as integer - dim q as integer - dim z as integer - dim iResult as long - dim iTemp as long - dim iTemp2 as long - dim sTemp as string - dim sCompare as string - dim iCompare as long - dim iError as long - dim sError as string - - call hNewDocument - - call hTextrahmenErstellen ("Ein Tipp: Schiffahrt schreibt man nun mit 3f Tunfisch Amboss a", 10, 10, 90, 50) +function fSelectWithString(oControl as Object,sText as String) - EditSelectAll - setCharacterLanguage(glLocale(4)) - sleep 10 - printlog "## check ENGLISH auto spellchecking" - iError = 0 - ' Get underlined words / wrong recognized words by spellchecker - iResult = sAnalyseContextMenu(11, iError) - sTemp = sLongToBinary(iResult, 11) - sError = sLongToBinary(iError, 11) - ' reference of words, which should be underlined - sCompare = "11011001011" - iCompare = sBinaryToLong(sCompare) - ' compare result with reference -> get the difference - iTemp = not (iResult EQV iCompare) - ' eliminate errors from open bugs -> get the real errors - iTemp2 = iTemp AND NOT iError - if (iTemp2 > 0) then - warnlog "wrong words are not underlined? Should be: " + sCompare - warnlog "Is: " + sTemp - warnlog "Differences: " + sLongToBinary(iTemp, 11) - warnlog "Wrong after merging errors from bugs " + sLongToBinary(iTemp2, 11) - end if + dim iCounter as Integer + dim iNumberOfItems as Integer + iNumberOfItems = oControl.getItemCount() - sleep 1 - ' call hTypeKeys "<F2>" - call hTypeKeys "<mod1 end> <Shift mod1 home>" - setCharacterLanguage(glLocale(6)) - sleep 10 - printlog "## check GERMAN auto spellchecking" - iError = 0 - iResult = sAnalyseContextMenu(11, iError) - sTemp = sLongToBinary(iResult, 11) - sError = sLongToBinary(iError, 11) - sCompare = "00010000000" - iCompare = sBinaryToLong(sCompare) - ' compare result with reference -> get the difference - iTemp = not (iResult EQV iCompare) - ' eliminate errors from open bugs -> get the real errors - iTemp2 = iTemp AND NOT iError - if (iTemp2 > 0) then - warnlog "wrong words are not underlined? Should be: " + sCompare - warnlog "Is: " + sTemp - warnlog "Differences: " + sLongToBinary(iTemp, 11) - warnlog "Wrong after merging errors from bugs " + sLongToBinary(iTemp2, 11) - end if - printlog "-----------------------------------" + for iCounter = 1 to iNumberOfItems + oControl.select iCounter + if( Instr(oControl.getSelText,sText) <> 0 ) then ' the correct entry is selected + iCounter = iNumberOfItems ' stop the loop + endif + next - hCloseDocument() -endcase 'tToolsSpellcheckAutoSpellcheck +end function -'------------------------------------------------------------------------------- + +function getWordsForLanguage() + + dim sWrongWord as String + dim sRightWord as String + dim aWords(2) as String + + select case iSprache + case 1 : + sWrongWord = "documente" + sRightWord = "document" + case 31 : + sWrongWord = "miejn" + sRightWord = "mijn" + case 33 : + sWrongWord = "projjet" + sRightWord = "projet" + case 34 : + sWrongWord = "lazsos" + sRightWord = "lazos" + case 36 : + sWrongWord = "Bozniai" + sRightWord = "Boszniai" + case 39 : + sWrongWord = "borrdo" + sRightWord = "borro" + case 46 : + sWrongWord = "desa" + sRightWord = "edas" + case 48 : + sWrongWord = "werrsji" + sRightWord = "wersji" + case 49 : + sWrongWord = "Feehlern" + sRightWord = "Fehlern" + case 55 : + sWrongWord = "Elle" + sRightWord = "Elze" + case else : + sWrongWord = "" + sRightWord = "" + end select + + aWords(0) = sWrongWord + aWords(1) = sRightWord + + getWordsForLanguage = aWords + +end function diff --git a/testautomation/graphics/optional/includes/global/g_tools.inc b/testautomation/graphics/optional/includes/global/g_tools.inc index b760ad7b1b0f..c54881a0b68e 100644 --- a/testautomation/graphics/optional/includes/global/g_tools.inc +++ b/testautomation/graphics/optional/includes/global/g_tools.inc @@ -289,7 +289,7 @@ testcase tiToolsThesaurusContextMenu endif Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_" + iSprache + sExt) - + Call sMakeReadOnlyDocumentEditable Call hTextrahmenErstellen (sWord,20,20,50,30) sleep 1 diff --git a/testautomation/graphics/optional/includes/impress/i_us2_present.inc b/testautomation/graphics/optional/includes/impress/i_us2_present.inc index 1a844f299c2d..eeeeb5effb6b 100644 --- a/testautomation/graphics/optional/includes/impress/i_us2_present.inc +++ b/testautomation/graphics/optional/includes/impress/i_us2_present.inc @@ -145,6 +145,7 @@ testcase i_us2_pres1 DocumentImpress.UseMenu hMenuSelectNr (4) hMenuSelectNr (1) + call sSelectEmptyLayout sleep (1) kontext "Slides" diff --git a/testautomation/graphics/optional/includes/impress/i_us_present.inc b/testautomation/graphics/optional/includes/impress/i_us_present.inc index 4a711cf0a902..41ccd13660d5 100644 --- a/testautomation/graphics/optional/includes/impress/i_us_present.inc +++ b/testautomation/graphics/optional/includes/impress/i_us_present.inc @@ -52,12 +52,6 @@ testcase i_us_presentation1 printlog "New master" MenuSelect(MenuGetItemID(1)) sleep (1) - ViewMasterPage - kontext "Slides" - SlidesControl.OpenContextMenu(true) - sleep (2) - MenuSelect(MenuGetItemID(1)) 'New Master - sleep (1) printlog " Inserted second Master-Slide" @@ -120,7 +114,6 @@ testcase i_us_presentation1 if ExportierenDlg.IsVisible(5) then printlog " Gallery-object correctly copied into Slide." ExportierenDlg.Close - ToolsGallery WaitSlot (2000) end if kontext "GraphicObjectbar" @@ -128,33 +121,7 @@ testcase i_us_presentation1 kontext "DocumentImpress" ViewToolbarsPicture end if - Kontext "Gallery" - View.TypeKeys "<HOME><RIGHT><RIGHT>" - printlog "'OpenContextMenu" - View.TypeKeys "<SHIFT F10>" - sleep (2) - MenuSelect(MenuGetItemID(1)) 'Insert - sleep (2) - MenuSelect(MenuGetItemID(1)) 'Copy - sleep (2) - printlog "Check that we really got a copy of the object " - kontext "DocumentImpress" - DocumentImpress.OpenContextMenu(true) - sleep (2) - MenuSelect 27353 - sleep (2) - Kontext "ExportierenDlg" - if ExportierenDlg.IsVisible(5) then - printlog " Gallery-object correctly copied into Slide." - ExportierenDlg.Close - else - warnlog " Doesn't seem like we copied anything from the Gallery... ?" - end if - kontext "GraphicObjectbar" - if GraphicObjectbar.Exists(5) = FALSE then - kontext "DocumentImpress" - ViewToolbarsPicture - end if + kontext "Gallery" Gallerys.Select (iPictures) printlog " 50% Transparency" @@ -172,14 +139,7 @@ testcase i_us_presentation1 Width.SetText "16" Height.SetText "16" Mosaic.OK - kontext "GraphicFilterBar" - GraphicFilterBar.Close - ToolsGallery - WaitSlot (1000) - kontext "DocumentImpress" - hTypeKeys "<TAB>" - sleep (1) - + kontext "GraphicFilterBar" Mosaic.Click @@ -254,7 +214,7 @@ testcase i_us_presentation2 MenuSelect(MenuGetItemID(1)) 'New Slide 'No 2 printlog " Inserted second normal Slide" - + call sSelectEmptyLayout printlog "2. Layouts: Text. Bild: Gallery: Animation - Gif" Kontext "Tasks" printlog "to get to the very first position" @@ -275,11 +235,16 @@ testcase i_us_presentation2 printlog " Did the 'mistake' to FadeIn/Out the Slidepane" - printlog "activating the input picture area" - kontext "DocumentImpress" - DocumentImpress.TypeKeys "<TAB>",2 - DocumentImpress.TypeKeys "<RETURN>" - sleep (1) + +InsertGraphicsFromFile +Kontext "GrafikEinfuegenDlg" +if GrafikEinfuegenDlg.exists(5) then +printlog " The Insertgraphics-dialogue showed up correctly." +sleep (5) +else +warnlog " The Insertgraphics-dialogue didn't show up." +endif + printlog "Graphics-Import-dialogue. Select i_us_large.jpg" Kontext "GrafikEinfuegenDlg" |