diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-10-26 13:28:03 +0200 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-10-26 13:28:03 +0200 |
commit | e7ef6d4dceb7e8e0c1d492d8c01296f6d88d5215 (patch) | |
tree | 3540d786d63e00e9755122a324140cd508f99705 /testautomation/graphics | |
parent | 15c93af5a0740ad15be57aefef659de243c9be2f (diff) | |
parent | ad312005bd3480e78f82824a95589e0673c56d93 (diff) |
CWS-TOOLING: integrate CWS automationdev300m87
Notes
Notes:
split repo tag: testing_ooo/DEV300_m91
Diffstat (limited to 'testautomation/graphics')
14 files changed, 1048 insertions, 596 deletions
diff --git a/testautomation/graphics/optional/includes/global/export_graphic.inc b/testautomation/graphics/optional/includes/global/export_graphic.inc index f4c34ec36795..a5ab31c82cdc 100644 --- a/testautomation/graphics/optional/includes/global/export_graphic.inc +++ b/testautomation/graphics/optional/includes/global/export_graphic.inc @@ -33,6 +33,9 @@ testcase tEPS + warnlog( "#i115138# - Test document freezes draw" ) + goto endsub + dim x as integer dim i as integer @@ -96,6 +99,11 @@ endcase 'tEPS '------------------------------------------------------------------------- testcase tPCT + warnlog( "#i115138# - Test document freezes draw" ) + goto endsub + + + dim x as integer dim i as integer dim iWaitIndex as integer @@ -167,83 +175,15 @@ testcase tPCT endif endif - printlog "----------3rd: exporting part of the picture and inserting into new file." - hTypeKeys ("<escape><tab>") - fGetSizeXY sx1, sY, TRUE - - if ( hCallExport( OutputGrafikTBO + "1", sFilter, TRUE ) ) then - - Kontext "PCTOptions" - printlog( "Export options dialog" ) - if ( PCTOptions.Exists( 2 ) ) then - hCloseDialog( PCTOptions, "ok" ) - else - warnlog( "No export options dialog was displayed" ) - endif - - sOutputFile = OutputGrafikTBO + "1" + sExt - if ( hWaitForOutputFile( sOutputFile ) ) then - printlog( "Close file and re-insert graphics into new document" ) - hInsertGraphicsToNewFile( sOutputFile ) ' local helper function, see bottom of this file - else - warnlog( "File was not saved: " & sOutputFile ) - endif - - bTemp = fGetSizeXY( sx1, sY, bTemp ) - if (bTemp = FALSE) then - warnlog "Selected original size NOT OK :-(" - endif - endif - - hFileReOpen( "" ) - printlog "----------4th: exporting rectangle and reload file." - hRechteckErstellen ( 10, 10, 30, 40 ) - - if ( hCallExport( OutputGrafikTBO + "2" , sFilter, TRUE ) ) then - - Kontext "PCTOptions" - printlog( "Export options dialog" ) - if ( PCTOptions.Exists( 2 ) ) then - Exportwidth.SetText "9" - if Exportmeasurement.GetSelText = "inches" then - sx1 = (Exportwidth.GetText)+ """" - printlog "sx1= " & sx1 - else - sx1 = (Exportwidth.GetText)+ "cm" - endif - - if Exportmeasurement.GetSelText = "inches" then - sY = (Exportheight.GetText)+ """" - printlog "sY= " & sY - else - sY = (Exportheight.GetText)+ "cm" - endif - hCloseDialog( PCTOptions, "ok" ) - else - warnlog( "No export options dialog was displayed" ) - endif - - sOutputFile = OutputGrafikTBO + "2" + sExt - - if ( not hWaitForOutputFile( sOutputFile ) ) then - warnlog( "File was not saved: " & sOutputFile ) - endif - - printlog( "Reload file if it exists. Warn if not" ) - hFileReOpen( sOutputFile ) - - kontext "DocumentDraw" - DocumentDraw.TypeKeys ("<escape><tab>") - ContextOriginalSize - bTemp = fGetSizeXY( sx1, sY, bTemp ) - if ( not bTemp ) then warnlog "Selected original size NOT OK :-(" - endif - call hCloseDocument endcase 'tPCT '------------------------------------------------------------------------------- testcase tPBM + warnlog( "#i115138# - Test document freezes draw" ) + goto endsub + + const sFilter = "PBM - Portable Bitmap (.pbm)" const sExt = ".pbm" @@ -274,6 +214,10 @@ testcase tPBM endcase 'tPBM '------------------------------------------------------------------------------- testcase tPGM + warnlog( "#i115138# - Test document freezes draw" ) + goto endsub + + const sFilter = "PGM - Portable Graymap (.pgm)" const sExt = ".pgm" @@ -303,6 +247,10 @@ testcase tPGM endcase 'tPGM '------------------------------------------------------------------------------- testcase tPPM + warnlog( "#i115138# - Test document freezes draw" ) + goto endsub + + const sFilter = "PPM - Portable Pixelmap (.ppm)" const sExt = ".ppm" @@ -332,6 +280,10 @@ testcase tPPM endcase 'tPPM '------------------------------------------------------------------------------ testcase tRAS + warnlog( "#i115138# - Test document freezes draw" ) + goto endsub + + const sFilter = "RAS - Sun Raster Image (.ras)" const sExt = ".ras" @@ -352,6 +304,10 @@ testcase tRAS endcase 'tRAS '------------------------------------------------------------------------------ testcase tTIFF + warnlog( "#i115138# - Test document freezes draw" ) + goto endsub + + dim x as integer dim i as integer @@ -375,6 +331,10 @@ testcase tTIFF endcase 'tTIFF '------------------------------------------------------------------------------ testcase tXPM + warnlog( "#i115138# - Test document freezes draw" ) + goto endsub + + const sFilter = "XPM - X PixMap (.xpm)" const sExt = ".xpm" @@ -395,6 +355,10 @@ testcase tXPM endcase 'tXPM '------------------------------------------------------------------------------- testcase tGIF + warnlog( "#i115138# - Test document freezes draw" ) + goto endsub + + const sFilter = "GIF - Graphics Interchange Format (.gif)" const sExt = ".gif" @@ -425,6 +389,10 @@ testcase tGIF endcase 'tGIF '------------------------------------------------------------------------------- testcase tJPEG + warnlog( "#i115138# - Test document freezes draw" ) + goto endsub + + const sFilter = "JPEG - Joint Photographic Experts Group (.jpg;.jpeg;.jfif;.jif;.jpe)" const sExt = ".jpg" diff --git a/testautomation/graphics/optional/includes/global/export_graphic_2.inc b/testautomation/graphics/optional/includes/global/export_graphic_2.inc index 3beefb13dd64..1e9d6e04f631 100644 --- a/testautomation/graphics/optional/includes/global/export_graphic_2.inc +++ b/testautomation/graphics/optional/includes/global/export_graphic_2.inc @@ -32,6 +32,9 @@ '\****************************************************************************** testcase tPNG + warnlog( "#i115138 - Loading test document freezes the office" ) + goto endsub + dim x as integer dim i as integer dim iWaitIndex as integer @@ -73,6 +76,10 @@ endcase 'tPNG '------------------------------------------------------------------------------- testcase tSVM + warnlog( "#i115138 - Loading test document freezes the office" ) + goto endsub + + dim x as integer dim i as integer dim sFilter as string @@ -238,6 +245,10 @@ endcase 'tSVM '------------------------------------------------------------------------------- testcase tPDF + warnlog( "#i115138 - Loading test document freezes the office" ) + goto endsub + + dim sPath as string dim sTemp as string dim iFileSize(12) as long @@ -589,6 +600,9 @@ endcase 'tPDF_Creator '------------------------------------------------------------------------------- testcase tSVG + warnlog( "#i115138 - Loading test document freezes the office" ) + goto endsub + dim x as integer dim i as integer dim sFilter as string @@ -654,6 +668,9 @@ endcase 'tSVG '------------------------------------------------------------------------------- testcase tBMP + warnlog( "#i115138 - Loading test document freezes the office" ) + goto endsub + dim x as integer dim i as integer dim bTemp as boolean @@ -821,6 +838,9 @@ endcase 'tBMP '------------------------------------------------------------------------------- testcase tEMF + warnlog( "#i115138 - Loading test document freezes the office" ) + goto endsub + dim x as integer dim i as integer dim sFilter as string @@ -952,6 +972,9 @@ endcase 'tEMF '------------------------------------------------------------------------------- testcase tMET + warnlog( "#i115138 - Loading test document freezes the office" ) + goto endsub + dim x as integer dim i as integer dim iWaitIndex as integer @@ -1145,6 +1168,9 @@ endcase 'tMET '------------------------------------------------------------------------------- testcase tSWF + warnlog( "#i115138 - Loading test document freezes the office" ) + goto endsub + dim sFilter as string dim sExt as string dim x as integer @@ -1170,6 +1196,9 @@ endcase 'tSWF '------------------------------------------------------------------------------ testcase tWMF + warnlog( "#i115138 - Loading test document freezes the office" ) + goto endsub + dim x as integer dim i as integer dim iWaitIndex as integer diff --git a/testautomation/graphics/optional/includes/global/g_clipboard.inc b/testautomation/graphics/optional/includes/global/g_clipboard.inc index 4c1900876565..e2ee473df88f 100644 --- a/testautomation/graphics/optional/includes/global/g_clipboard.inc +++ b/testautomation/graphics/optional/includes/global/g_clipboard.inc @@ -42,81 +42,98 @@ testcase tiEditUndo - Dim sDatei as string Dim Ueber_Text_1 as string + dim sTestfile as string + dim sLocaltestfile as string - if (gApplication = "IMPRESS") then + if ( gApplication = "IMPRESS" ) then ExtensionString = "odp" else ExtensionString = "odg" end if - sDatei = gTesttoolPath + "graphics\required\input\leer."+ExtensionString - - hFileOpen ConvertPath (sDatei) - sleep 5 - printlog "Checking for readonly state. If so, make it editable." - sMakeReadOnlyDocumentEditable - + sTestfile = gTesttoolPath + "graphics\required\input\leer."+ExtensionString + printlog "Loading test file.." + hFileOpenLocally( sTestfile ) + sleep 3 + printlog "Selecting grey rectangle.." hTypeKeys "<TAB><TAB>" sleep 3 + printlog "Opening Position and size dialog." ContextPositionAndSize Kontext if Messagebox.exists (5) then - Messagebox.SetPage TabPositionAndSize + Messagebox.SetPage TabPositionAndSize else - print "what" + printlog "Not the expected Dialog came up. Please check." endif Kontext "TabPositionAndSize" - Ueber_Text_1=PositionX.GetText '/// defining variable for original position of object ///' + printlog "defining variable for original position of object" + Ueber_Text_1=PositionX.GetText + printlog "Canceling dialog." TabPositionAndSize.Cancel sleep 2 Kontext "Toolbar" Auswahl.Click sleep 1 - ContextArrangeBringBackward '/// Bring Object backward ///' + printlog "Sending Rectangle backwards." + ContextArrangeBringBackward sleep 1 + printlog "Deselect." gMouseClick 60,60 sleep 1 Kontext "Toolbar" Auswahl.Click sleep 1 + printlog "trying to select blue rectangle in front" hTypeKeys "<TAB><TAB>" Kontext "Toolbar" Auswahl.Click sleep 1 - ContextPositionAndSize '/// Open Position and Size dialog, checking position ///' + printlog "Open Position and Size dialog, checking position" + ContextPositionAndSize Kontext Messagebox.SetPage TabPositionAndSize Kontext "TabPositionAndSize" - if PositionX=0 Then Warnlog " Command was not completely executed, and it could not be undone." + if PositionX=0 Then Warnlog "Command was not completely executed, and it could not be undone." TabPositionAndSize.Cancel sleep 2 gMouseClick 60,60 sleep 1 - - EditUndo '/// Edit Undo for BringBackward ///' + printlog "Edit Undo for BringBackward" + EditUndo Sleep 2 gMouseClick 60,60 sleep 1 Kontext "Toolbar" Auswahl.Click + printlog "Trying to select grey rectangle again." hTypeKeys "<TAB><TAB>" sleep 1 Kontext "Toolbar" Auswahl.Click - ContextPositionAndSize '/// Again checking position using Position and Size dialog ///' + printlog "Again checking position using Position and Size dialog" + ContextPositionAndSize kontext Messagebox.SetPage TabPositionAndSize kontext "TabPositionAndSize" + printlog "Checking if x Position is like ata the start again." if PositionX.GetText = Ueber_Text_1 then printlog "OK, last order could be redone" else warnlog "Last order could not be redone" end if TabPositionAndSize.Cancel - - Call hCloseDocument '/// Close document ///' + printlog "Close document" + sLocaltestfile = hFileGetLocalPath( gTesttoolPath + "leer."+ExtensionString ) + printlog sLocaltestfile + if (FileExists (sLocaltestfile)) then + app.kill (sLocaltestfile) + printlog "Deleting used file." + else + warnlog "File is missing." + endif + Call hCloseDocument endcase diff --git a/testautomation/graphics/optional/includes/global/g_demoguide.inc b/testautomation/graphics/optional/includes/global/g_demoguide.inc index d733c878aeb4..cb0a428d2f59 100644 --- a/testautomation/graphics/optional/includes/global/g_demoguide.inc +++ b/testautomation/graphics/optional/includes/global/g_demoguide.inc @@ -224,10 +224,8 @@ testcase t_Interoperability '///Open PowerPoint presentation printlog "Open PowerPoint presentation" - hFileOpen (Convertpath (gTesttoolPath + "graphics/required/input/dotNetOverview.ppt")) + hFileOpenLocally( gTesttoolPath + "graphics/required/input/dotNetOverview.ppt" ) - Call sMakeReadOnlyDocumentEditable - 'Save the name of the origin background (taken from last slide) Kontext "DocumentImpress" DocumentImpress.TypeKeys "<END>" @@ -251,7 +249,7 @@ testcase t_Interoperability wait(20000) Kontext "AvailableForUsePreview" AvailableForUsePreview.TypeKeys "<HOME> <RIGHT> <RETURN>" - sleep (5) + sleep (10) printlog " Verify that the background has changed" Kontext "DocumentImpress" printlog " Background is " & DocumentImpress.StatusGetText (6) 'Debugcode @@ -265,7 +263,7 @@ testcase t_Interoperability Kontext "Tasks" Kontext "AvailableForUsePreview" AvailableForUsePreview.TypeKeys "<HOME> <RETURN>" - sleep (5) + sleep (10) Kontext "DocumentImpress" if DocumentImpress.StatusGetText (6) = sTemplatename then printlog " The background has been set back to default" @@ -277,20 +275,21 @@ testcase t_Interoperability Kontext "DocumentImpress" Kontext "Slides" Kontext "SlidesControl" - SlidesControl.TypeKeys "<Mod1 X>" + SlidesControl.OpenContextMenu + sleep 1 + hMenuSelectNr (8) Kontext "DocumentImpress" - DocumentImpress.TypeKeys "<HOME>" + DocumentImpress.TypeKeys "<HOME>", true Kontext "Slides" Kontext "SlidesControl" - SlidesControl.TypeKeys "<Mod1 V>" - kontext "InsertPaste" - if InsertPaste.Exists(1) then - Before.Check - InsertPaste.OK - endif + SlidesControl.OpenContextMenu + sleep 1 + hMenuSelectNr (10) + Printlog " Verify that the slide was moved correctly" Kontext "Slides" - SlidesControl.TypeKeys "<PAGEUP>" + sleep (5) + SlidesControl.TypeKeys "<SHIFT F10>" if hMenuFindSelect(27268, true, 3) = false then Warnlog "Context-Menu-entry `Rename` was not found. Therefore the test ends." @@ -313,10 +312,9 @@ testcase t_Interoperability setclipboard("") try Kontext "DocumentImpressOutlineView" - DocumentImpressOutlineView.TypeKeys "<MOD1 HOME><SHIFT END>" DocumentImpressOutlineView.TypeKeys "<Mod1 C>" sleep (5) - if getclipboard() <> ".NET Enterprise" then + if getclipboard() <> ".NET Enterprise Federation" then warnlog " Wrong selection in outlineview. Should be '.NET Enterprise', but is '" & getclipboard() +"'." else printlog " Switching to Outlineview was successfull" endif diff --git a/testautomation/graphics/optional/includes/global/g_find_replace.inc b/testautomation/graphics/optional/includes/global/g_find_replace.inc index 4f6a045578e0..b96099be71ab 100644 --- a/testautomation/graphics/optional/includes/global/g_find_replace.inc +++ b/testautomation/graphics/optional/includes/global/g_find_replace.inc @@ -36,6 +36,8 @@ '* '\********************************************************************************** testcase tiEditSearchAndReplace + qaerrorlog "#i115121# Find and replace: wrong replacement" + goto endsub '/// This test tests the 'Search and Replace' -dialogue. ///' Dim sFile 'as string Dim sExpression(2) as string ' Expression to look for: ... Replace with diff --git a/testautomation/graphics/optional/includes/global/g_paneview.inc b/testautomation/graphics/optional/includes/global/g_paneview.inc index a2e7bdb87266..fb3620496759 100644 --- a/testautomation/graphics/optional/includes/global/g_paneview.inc +++ b/testautomation/graphics/optional/includes/global/g_paneview.inc @@ -78,7 +78,7 @@ testcase tiMinimize_Maximize_Docking_SlidePane Sleep 1 Slides.Size 300, 400 Sleep 1 - Slides.Size 150, 250 + Slides.Size 170, 250 Sleep 1 Slides.Size xSize%, ySize% Sleep 1 @@ -451,7 +451,7 @@ testcase tdMinimize_Maximize_Docking_Pagepane Sleep 1 Pagepane.Size 300, 400 Sleep 1 - Pagepane.Size 150, 250 + Pagepane.Size 170, 250 Sleep 1 Pagepane.Size xSize%, ySize% Sleep 1 diff --git a/testautomation/graphics/optional/includes/global/g_spellcheck.inc b/testautomation/graphics/optional/includes/global/g_spellcheck.inc index f46c75f3e497..e1f02de039cc 100644 --- a/testautomation/graphics/optional/includes/global/g_spellcheck.inc +++ b/testautomation/graphics/optional/includes/global/g_spellcheck.inc @@ -56,8 +56,7 @@ testcase tiToolsSpellcheckCheck_AlwaysIgnore sExt = ".odp" endif - Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt) - call fMakeDocumentWritable() + Call hFileOpenLocally (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt) sleep(1) @@ -86,164 +85,6 @@ testcase tiToolsSpellcheckCheck_AlwaysIgnore end if sleep 2 - 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 50 : hTextrahmenErstellen ("To je besedilo brez napake.<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 - 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 - end if - WaitSlot (2000) - 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 50 : FehlerText$ = "Toje napaka, ker manjka presledek." : Fehler$ = "Toje" : Sprachenname$ = "Slovenš?ina" - 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 - - printlog "Delete ignore word list" - if (not wIgnorierenlisteLoeschen) then - qaErrorLog "Can't get into Dictionary lists" - 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) - - hTypeKeys "<HOME>" - printlog "Call 'Tools->Spellcheck->Check'" - ToolsSpellcheck - printlog "Spellcheck dialog has to come up, wrong word is selected." - 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 - 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 - printlog "Close dialog 'Edit Custom Dictionary'." BenutzerwoerterbuchBearbeiten.Close Kontext "ExtrasOptionenDlg" @@ -256,7 +97,9 @@ testcase tiToolsSpellcheckError ' remove the word again from the dictionary delete_word_from_dictionary(sWrongWord,"IgnoreAllList") -endcase 'tiToolsSpellcheckCheck + kill (convertPath(gOfficePath+"user/work/"+"recht_"+iSprache+sExt)) +endcase 'tiToolsSpellcheckCorrect + '------------------------------------------------------------------------------- testcase tiToolsSpellcheckCheck_Change @@ -281,9 +124,7 @@ testcase tiToolsSpellcheckCheck_Change sExt = ".odp" endif - Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt) - - call fMakeDocumentWritable + Call hFileOpenLocally (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt) ' Perform the test now: printlog "Call Tools->Spellcheck" @@ -327,8 +168,9 @@ testcase tiToolsSpellcheckCheck_Change printlog "Close document" Call hCloseDocument + kill (convertPath(gOfficePath+"user/work/"+"recht_"+iSprache+sExt)) -endcase +endcase 'tiToolsSpellcheckCheck_Change '------------------------------------------------------------------------------- testcase tiToolsSpellcheckCheck_ChangeAll @@ -355,9 +197,7 @@ testcase tiToolsSpellcheckCheck_ChangeAll sExt = ".odp" endif - Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt) - - call fMakeDocumentWritable() + Call hFileOpenLocally (gTesttoolpath + "graphics\required\input\recht_"+iSprache+sExt) ' Perform the test now: printlog "Call Tools->Spellcheck" @@ -373,9 +213,12 @@ testcase tiToolsSpellcheckCheck_ChangeAll printlog "Close document" Call hCloseDocument + kill (convertPath(gOfficePath+"user/work/"+"recht_"+iSprache+sExt)) + +endcase 'tiToolsSpellcheckCheck_ChangeAll -endcase '------------------------------------------------------------------------------- + function delete_all_added_words(aWords) '/// this function delete the words in sWords in all user dictionaries @@ -384,44 +227,7 @@ function delete_all_added_words(aWords) Dim iWordCounter as integer Dim iBooks as integer - Select Case Ucase(gApplication) - case "DRAW" : sExt = ".odg" - case "IMPRESS" : sExt = ".odp" - end select - - 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 50 : sWord(1) = "Bsedilo" : sWord(2) = "zados?a" - 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 the given words from dictionaries." printlog "Call Tools->Options." ToolsOptions printlog "Select in category 'Languagesettings' entry 'Writing Aids.'" @@ -436,7 +242,7 @@ function delete_all_added_words(aWords) Kontext "BenutzerwoerterbuchBearbeiten" sleep 1 printlog "Check every book, if it contains the words." - iBooks = Buch.getItemCount + iBooks = Buch.getItemCount for iBookCounter = 1 to iBooks Buch.select(iBookCounter) printlog "Items in Booklist: " & WordList.getItemCount @@ -457,8 +263,10 @@ function delete_all_added_words(aWords) printlog "Press button 'OK' on dialog 'Writing Aids'." ExtrasOptionenDlg.OK -end function +end function 'delete_all_added_words + '------------------------------------------------------------------------------- + function delete_word_from_dictionary(sWord as String, sDictionary as String) '/// this function delete the words in sWords in all user dictionaries @@ -498,7 +306,9 @@ function delete_word_from_dictionary(sWord as String, sDictionary as String) printlog "Press button 'OK' on dialog 'Writing Aids'." ExtrasOptionenDlg.OK -end function +end function 'delete_word_from_dictionary + +'------------------------------------------------------------------------------- function fSelectWithString(oControl as Object,sText as String) @@ -513,8 +323,9 @@ function fSelectWithString(oControl as Object,sText as String) endif next -end function +end function 'fSelectWithString +'------------------------------------------------------------------------------- function getWordsForLanguage() @@ -563,4 +374,4 @@ function getWordsForLanguage() getWordsForLanguage = aWords -end function +end function 'getWordsForLanguage diff --git a/testautomation/graphics/optional/includes/global/g_stylist.inc b/testautomation/graphics/optional/includes/global/g_stylist.inc index fab547eb5d3b..f09e6c0fd433 100644 --- a/testautomation/graphics/optional/includes/global/g_stylist.inc +++ b/testautomation/graphics/optional/includes/global/g_stylist.inc @@ -518,8 +518,10 @@ testcase tiFormatStylist goto endsub end select + printlog "Open new doc" Call hNewDocument sleep 2 + printlog "call the navigator" Kontext "Gestalter" if Gestalter.Exists Then Warnlog "- Stylist exists, perhaps not closed last time a Impress doc was open" @@ -529,11 +531,14 @@ testcase tiFormatStylist FormatStylist Kontext "Gestalter" + printlog "opening graphics styles" Grafikvorlagen.Click sleep 1 + printlog "Select number 1" Vorlagenliste.Select Num1 ' num1 sleep 1 Printlog "- open Grafic template Dialogs using the context menue , checking if all resources exist" + printlog "Opening context menu" Vorlagenliste.OpenContextMenu sleep 1 hMenuSelectNr (2) @@ -543,6 +548,7 @@ testcase tiFormatStylist Messagebox.SetPage TabText Kontext "TabText" sleep 1 + printlog "Canceling dialog" TabText.Cancel sleep 1 @@ -550,18 +556,21 @@ testcase tiFormatStylist Kontext "Gestalter" Printlog "- presentation templates" sleep 1 + printlog "presentation styles" Praesentationsvorlagen.Click Vorlagenliste.Select Num2 sleep 1 + printlog "opening context menu" Vorlagenliste.OpenContextMenu sleep 1 + printlog "selecting modify" hMenuSelectNr (1) sleep 1 Kontext if Messagebox.exists (5) then try - ' Messagebox.SetPage TabArea + printlog "Messagebox.SetPage TabArea" Kontext "TabArea" if TabArea.Exists = false then warnlog "Where is TabArea?" @@ -578,86 +587,111 @@ testcase tiFormatStylist Kontext "Gestalter" sleep 1 + printlog "Select number 3" Vorlagenliste.Select Num3 sleep 1 + printlog "opening context menu of number 3" Vorlagenliste.OpenContextMenu sleep 1 hMenuSelectNr (1) sleep 1 + printlog "Check the styles..." call hWalkTheStyles (1,1) Kontext + printlog "setting tabpage indents and spacing" Messagebox.SetPage TabEinzuegeUndAbstaende Kontext "TabEinzuegeUndAbstaende" sleep 1 + printlog "Canceling tabpage" TabEinzuegeUndAbstaende.Cancel sleep 1 Kontext "Gestalter" sleep 1 + printlog "Select number 4" Vorlagenliste.Select Num4 sleep 1 + printlog "opening context menu of number 4" Vorlagenliste.OpenContextMenu sleep 1 hMenuSelectNr (1) sleep 1 Kontext + printlog "setting tabpage TabFont" Messagebox.SetPage TabFont kontext "TabFont" Kontext + printlog "setting tabpage TabFontEffects" Messagebox.SetPage TabFontEffects kontext "TabFontEffects" Kontext + printlog "setting tabpage TabIndents and Spacing" Messagebox.SetPage TabEinzuegeUndAbstaende kontext "TabEinzuegeUndAbstaende" sleep 1 + printlog "canceling TabIndents and Spacing" TabEinzuegeUndAbstaende.Cancel sleep 1 Kontext "Gestalter" sleep 1 + printlog "opening context menu of number 5" Vorlagenliste.Select Num5 sleep 1 + printlog "opening context menu of number 5" Vorlagenliste.OpenContextMenu sleep 1 hMenuSelectNr (1) sleep 1 Kontext + printlog "setting tabpage Tab Font" Messagebox.SetPage TabFont kontext "TabFont" Kontext + printlog "setting tabpage Tab FontEffects" Messagebox.SetPage TabFontEffects kontext "TabFontEffects" Kontext + printlog "setting tabpage TabIndents and Spacing" Messagebox.SetPage TabEinzuegeUndAbstaende kontext "TabEinzuegeUndAbstaende" sleep 1 Kontext + printlog "setting tabpage Tab Bullets" Messagebox.SetPage TabBullet Kontext "TabBullet" sleep 1 Kontext + printlog "setting tabpage Tab Numbering Type" Messagebox.SetPage TabNumerierungsart Kontext "TabNumerierungsart" sleep 1 Kontext + printlog "setting tabpage Tab Graphics" Messagebox.SetPage TabGrafiken Kontext "TabGrafiken" sleep 1 Kontext + printlog "setting tabpage Tab Numbering options" Messagebox.SetPage TabOptionenNumerierung Kontext "TabOptionenNumerierung" sleep 1 + printlog "Canceling..." TabOptionenNumerierung.Cancel sleep 1 endif + kontext "DocumentImpress" + printlog "Closing Stylist" if lcase(gPlatform) = "osx" then hTypekeys "<mod1 t>" else - hTypeKeys "<F11>" + Kontext "Gestalter" + Gestalter.Close end if sleep 1 Kontext "Gestalter" if Gestalter.Exists Then Warnlog "- Stylist could not be closed pressing F11" + printlog "Closing doc." Call hCloseDocument endcase 'tiFormatStylist diff --git a/testautomation/graphics/optional/includes/global/g_tools.inc b/testautomation/graphics/optional/includes/global/g_tools.inc index 04fc0b92d4b2..7b9ce82860d2 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,66 @@ 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 else : if bAsianLan then - hSetSpellHypLanguage - sWord = "Hello" - else - Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" - sWord = "Hello" - endif + 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 + 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 +152,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 +162,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,7 +183,7 @@ testcase tiToolsThesaurus else warnlog "thesaurus didn't come up." end if - + Call hCloseDocument endcase @@ -210,7 +207,7 @@ testcase tiToolsThesaurusWithoutText endif Call hCloseDocument - + endcase '------------------------------------------------------------------------------- @@ -236,46 +233,47 @@ 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 else : if bAsianLan then - hSetSpellHypLanguage - sWord = "Hello" - else - Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" - sWord = "Hello" - endif + 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 @@ -286,7 +284,7 @@ testcase tiToolsThesaurusContextMenu printlog "select the word" hTypeKeys "<Home><SHIFT END>" - + hOpenContextMenu hMenuSelectNr(14) ' the synonyms @@ -312,143 +310,143 @@ endcase '------------------------------------------------------------------------------- testcase tiToolsHyphenation1 - printlog " - Hyphenation without any text" - Call hNewDocument '/// New impress document ///' - sleep 3 - ToolsLanguageHyphenationDraw '/// Try with empty document ///' - Kontext "Hyphenation" + printlog " - Hyphenation without any text" + Call hNewDocument '/// New impress document ///' + sleep 3 + ToolsLanguageHyphenationDraw '/// Try with empty document ///' + Kontext "Hyphenation" 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 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 ///' - 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) - case 34 : hTextrahmenErstellen ("This ist a text with no spliting words",10,10,40,40) - case 36 : hTextrahmenErstellen ("Semmi karhozattyoc nincz most azoknac, a kic az Iesus Christusban be oltattac",10,10,40,40) - case 39 : hTextrahmenErstellen ("Il documento 'Senza nome 1' stato modififcato",10,10,40,40) - case 45 : hTextrahmenErstellen ("at du har nok i dit hvis du",10,10,40,40 ) - 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 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 :-)" - printlog " :-) will use English instead" - hTextrahmenErstellen ("This ist a text with no split words",10,10,40,40) - else - Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" - endif - end select - hTypeKeys "<Home>" - ToolsLanguageHyphenationDraw '/// Try ///' - Kontext "Hyphenation" - if Hyphenation.Exists =True Then - Warnlog "Dialog exists" - Hyphenation.Cancel - else - Kontext "Active" - if Active.Exists then Active.OK - end if - - Call hCloseDocument '/// Close document ///' - + ' 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 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 ///' + 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) + case 34 : hTextrahmenErstellen ("This ist a text with no spliting words",10,10,40,40) + case 36 : hTextrahmenErstellen ("Semmi karhozattyoc nincz most azoknac, a kic az Iesus Christusban be oltattac",10,10,40,40) + case 39 : hTextrahmenErstellen ("Il documento 'Senza nome 1' stato modififcato",10,10,40,40) + case 45 : hTextrahmenErstellen ("at du har nok i dit hvis du",10,10,40,40 ) + 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 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 :-)" + printlog " :-) will use English instead" + hTextrahmenErstellen ("This ist a text with no split words",10,10,40,40) + else + Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" + endif + end select + hTypeKeys "<Home>" + ToolsLanguageHyphenationDraw '/// Try ///' + Kontext "Hyphenation" + if Hyphenation.Exists =True Then + Warnlog "Dialog exists" + Hyphenation.Cancel + else + Kontext "Active" + if Active.Exists then Active.OK + end if + + Call hCloseDocument '/// Close document ///' + 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 - - if ((not bAsianLan) AND (iSprache <> 07)) then - sFile = gTesttoolpath + "graphics\required\input\silben_"+iSprache+sExt - Call hFileOpen (sFile) - endif - - select case iSprache '/// Open prepared document ///' - case 01 :DasWort = "ation" : DasWort2 = "tion" : DasWort3 = "ion" : DasWort4 = "on" '+Chr(34) - case 07 : qaerrorlog "- No Hypenation for Russian available" - goto endsub - case 31 :DasWort = "siteit" : DasWort2 = "iteit" : DasWort3 = "teit" : DasWort4 = "eit" - case 33 :DasWort = "ture" : DasWort2 = "ure" : DasWort3 = "re" : DasWort4 = "e" - case 34 :DasWort = "chvo" : DasWort2 = "hvo" : DasWort3 = "vo" : DasWort4 = "o" - case 36 :DasWort = "zatnal" : DasWort2 = "atnal" : DasWort3 = "tnal" : DasWort4 = "nal" - case 39 :DasWort = "sentu" : DasWort2 = "entu" : DasWort3 = "ntu" : DasWort4 = "tu" - case 46 :DasWort = "niska" : DasWort2 = "iska" : DasWort3 = "ska" : DasWort4 = "ka" - case 48 :DasWort = "nie" : DasWort2 = "ie" : DasWort3 = "e" - case 49 :DasWort = "nung" : DasWort2 = "ung" : DasWort3 = "ng" : DasWort4 = "g" - case 50 :DasWort = "nica" : DasWort2 = "ica" : DasWort3 = "ca" : DasWort4 = "a" - case 55 :DasWort = "gia" : DasWort2 = "ia" : DasWort3 = "a" : DasWort4 = "ogia" - case else : if bAsianLan then - printlog "For the language " + iSprache +" nothing is prepared yet, but is AsianLan, so OK :-)" - printlog " :-) will use English instead" - Call hFileOpen (gTesttoolpath + "graphics\required\input\silben_"+"1"+sExt) - DasWort = "ation" : DasWort2 = "tion" : DasWort3 = "ion" : DasWort4 = "on" '+Chr(34) - else - Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here and create file: "+sFile - hNewDocument - endif - end select - - Call sMakeReadOnlyDocumentEditable - - printlog " - Test hyphenation" - EditSelectAll '/// Press CTRL + A to select all ///' - '/// 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 ///' - else - hTypeKeys "<MOD1 END><HOME><MOD1 SHIFT RIGHT>" - endif - EditCopy - sDraw = GetClipboardText() - EditSelectAll '/// Select whole text ///' - ToolsLanguageHyphenationDraw '/// Run Hyphenation ///' - gMouseClick 50,50 - hTypeKeys "<MOD1 END><HOME><MOD1 SHIFT RIGHT>" '/// Select part of text and compare it with original text at this place ///' - sleep 3 - EditCopy -printlog GetClipboardText + 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 + hFileOpenLocally( sFile ) + endif + + select case iSprache '/// Open prepared document ///' + case 01 :DasWort = "ation" : DasWort2 = "tion" : DasWort3 = "ion" : DasWort4 = "on" '+Chr(34) + case 07 : qaerrorlog "- No Hypenation for Russian available" + goto endsub + case 31 :DasWort = "siteit" : DasWort2 = "iteit" : DasWort3 = "teit" : DasWort4 = "eit" + case 33 :DasWort = "ture" : DasWort2 = "ure" : DasWort3 = "re" : DasWort4 = "e" + case 34 :DasWort = "chvo" : DasWort2 = "hvo" : DasWort3 = "vo" : DasWort4 = "o" + case 36 :DasWort = "zatnal" : DasWort2 = "atnal" : DasWort3 = "tnal" : DasWort4 = "nal" + case 39 :DasWort = "sentu" : DasWort2 = "entu" : DasWort3 = "ntu" : DasWort4 = "tu" + case 46 :DasWort = "niska" : DasWort2 = "iska" : DasWort3 = "ska" : DasWort4 = "ka" + case 48 :DasWort = "nie" : DasWort2 = "ie" : DasWort3 = "e" + case 49 :DasWort = "nung" : DasWort2 = "ung" : DasWort3 = "ng" : DasWort4 = "g" + case 50 :DasWort = "nica" : DasWort2 = "ica" : DasWort3 = "ca" : DasWort4 = "a" + case 55 :DasWort = "gia" : DasWort2 = "ia" : DasWort3 = "a" : DasWort4 = "ogia" + case else + if bAsianLan then + printlog "For the language " + iSprache +" nothing is prepared yet, but is AsianLan, so OK :-)" + printlog " :-) will use English instead" + hFileOpenLocally( gTesttoolpath + "graphics\required\input\silben_"+"1"+sExt ) + DasWort = "ation" : DasWort2 = "tion" : DasWort3 = "ion" : DasWort4 = "on" '+Chr(34) + else + Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here and create file: "+sFile + hNewDocument + endif + end select + + printlog " - Test hyphenation" + EditSelectAll '/// Press CTRL + A to select all ///' + '/// 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 ///' + else + hTypeKeys "<MOD1 END><HOME><MOD1 SHIFT RIGHT>" + endif + EditCopy + sDraw = GetClipboardText() + EditSelectAll '/// Select whole text ///' + ToolsLanguageHyphenationDraw '/// Run Hyphenation ///' + gMouseClick 50,50 + hTypeKeys "<MOD1 END><HOME><MOD1 SHIFT RIGHT>" '/// Select part of text and compare it with original text at this place ///' + sleep 3 + EditCopy + 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 ///' - + sleep 1 + Call hCloseDocument '/// Close document ///' + endcase 'tiToolsHyphenation2 '------------------------------------------------------------------------------- @@ -578,5 +576,5 @@ testcase tToolsMacro 'TODO: organizer testing! Call hCloseDocument Call hCloseDocument - + endcase 'tToolsMacro diff --git a/testautomation/graphics/optional/includes/global/g_tools.inc.orig b/testautomation/graphics/optional/includes/global/g_tools.inc.orig new file mode 100644 index 000000000000..9dc207b481b9 --- /dev/null +++ b/testautomation/graphics/optional/includes/global/g_tools.inc.orig @@ -0,0 +1,586 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +' +' Copyright 2000, 2010 Oracle and/or its affiliates. +' +' OpenOffice.org - a multi-platform office productivity suite +' +' This file is part of OpenOffice.org. +' +' OpenOffice.org is free software: you can redistribute it and/or modify +' it under the terms of the GNU Lesser General Public License version 3 +' only, as published by the Free Software Foundation. +' +' OpenOffice.org is distributed in the hope that it will be useful, +' but WITHOUT ANY WARRANTY; without even the implied warranty of +' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +' GNU Lesser General Public License version 3 for more details +' (a copy is included in the LICENSE file that accompanied this code). +' +' You should have received a copy of the GNU Lesser General Public License +' version 3 along with OpenOffice.org. If not, see +' <http://www.openoffice.org/license.html> +' for a copy of the LGPLv3 License. +' +'/************************************************************************ +'* +'* Owner : wolfram.garten@oracle.com +'* +'* short description : will be moved to autocorrection.bas/inc +'* +'\************************************************************************************* +' sFile = gTesttoolpath + "graphics\required\input\silben_"+iSprache+sExt + +'------------------------------------------------------------------------------- +testcase tiToolsThesaurus + + Dim sWord as string + Dim sChangedWord as string + Dim sReplaceWord as string + 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 + '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 : 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( gApplication = "DRAW" ) then + sExt = ".odg" + elseif( gApplication = "IMPRESS" ) then + sExt = ".odp" + endif + + sWorkFile = gTesttoolPath & "graphics\required\input\recht_" & iSprache & sExt + hFileDelete( sWorkFile ) + + Call hFileOpenLocally( sWorkFile ) + 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 + + if Alternatives.GetItemCount = 0 Then + warnlog "There are no alternative for this word" + sleep 1 + else + printlog "select the first alternative" + Alternatives.Select 1 + + printlog "check if the selected alternative apprear in the ReplaceWith field." + + sAlternativeText = Alternatives.getSeltext(1,3) + 'remove the part in the () if there is any + if( Instr(sAlternativeText, "(") <> 0 ) then + sAlternativeText = left(sAlternativeText, Instr(sAlternativeText, "(") - 2 ) + endif + + if ( ReplaceWith.getText() <> sAlternativeText ) then + 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 + + sReplaceWord = ReplaceWith.getText() + sleep 1 + endif + Thesaurus.OK + + if( gApplication = "DRAW" ) then + Kontext "Draw" + elseif( 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 tiToolsThesaurusContextMenu + + Dim sWord as string + Dim sExt as string + Dim iItemCount as Integer + + '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 : 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( gApplication = "DRAW" ) then + sExt = ".odg" + Kontext "DrawDocument" + elseif( gApplication = "IMPRESS" ) then + sExt = ".odp" + Kontext "ImpressDocument" + endif + + hFileOpenLocally(gTesttoolpath + "graphics\required\input\recht_" + iSprache + sExt) + Call hTextrahmenErstellen (sWord,20,20,50,30) + sleep 1 + + printlog "select the word" + hTypeKeys "<Home><SHIFT END>" + + hOpenContextMenu + + hMenuSelectNr(14) ' the synonyms + iItemCount = hMenuItemGetCount + printlog iItemCount + if(iItemCount <= 2 ) then ' none and Thesaurus item + warnlog "There should be a synonymus display for the word '" + sWord + "' but it isn't." + endif + + hMenuSelectNr(iItemCount) ' the last item + + Kontext "Thesaurus" + if Thesaurus.Exists(5) then + printlog "Thesaurus dialog appear from the context menu" + Thesaurus.Cancel + else + warnlog "the thesaurus dialog does not appear fro mthe context menu of a selected word" + endif + + call hCloseDocument + +endcase +'------------------------------------------------------------------------------- +testcase tiToolsHyphenation1 + + printlog " - Hyphenation without any text" + Call hNewDocument '/// New impress document ///' + sleep 3 + ToolsLanguageHyphenationDraw '/// Try with empty document ///' + Kontext "Hyphenation" + if Hyphenation.Exists(1) = True Then + Warnlog " - Dialog ist da" + Hyphenation.Cancel + else + 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 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 ///' + 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) + case 34 : hTextrahmenErstellen ("This ist a text with no spliting words",10,10,40,40) + case 36 : hTextrahmenErstellen ("Semmi karhozattyoc nincz most azoknac, a kic az Iesus Christusban be oltattac",10,10,40,40) + case 39 : hTextrahmenErstellen ("Il documento 'Senza nome 1' stato modififcato",10,10,40,40) + case 45 : hTextrahmenErstellen ("at du har nok i dit hvis du",10,10,40,40 ) + 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 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 :-)" + printlog " :-) will use English instead" + hTextrahmenErstellen ("This ist a text with no split words",10,10,40,40) + else + Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here" + endif + end select + hTypeKeys "<Home>" + ToolsLanguageHyphenationDraw '/// Try ///' + Kontext "Hyphenation" + if Hyphenation.Exists =True Then + Warnlog "Dialog exists" + Hyphenation.Cancel + else + Kontext "Active" + if Active.Exists then Active.OK + end if + + Call hCloseDocument '/// Close document ///' + +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 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 + hFileOpenLocally( sFile ) + endif + + select case iSprache '/// Open prepared document ///' + case 01 :DasWort = "ation" : DasWort2 = "tion" : DasWort3 = "ion" : DasWort4 = "on" '+Chr(34) + case 07 : qaerrorlog "- No Hypenation for Russian available" + goto endsub + case 31 :DasWort = "siteit" : DasWort2 = "iteit" : DasWort3 = "teit" : DasWort4 = "eit" + case 33 :DasWort = "ture" : DasWort2 = "ure" : DasWort3 = "re" : DasWort4 = "e" + case 34 :DasWort = "chvo" : DasWort2 = "hvo" : DasWort3 = "vo" : DasWort4 = "o" + case 36 :DasWort = "zatnal" : DasWort2 = "atnal" : DasWort3 = "tnal" : DasWort4 = "nal" + case 39 :DasWort = "sentu" : DasWort2 = "entu" : DasWort3 = "ntu" : DasWort4 = "tu" + case 46 :DasWort = "niska" : DasWort2 = "iska" : DasWort3 = "ska" : DasWort4 = "ka" + case 48 :DasWort = "nie" : DasWort2 = "ie" : DasWort3 = "e" + case 49 :DasWort = "nung" : DasWort2 = "ung" : DasWort3 = "ng" : DasWort4 = "g" + case 50 :DasWort = "nica" : DasWort2 = "ica" : DasWort3 = "ca" : DasWort4 = "a" + case 55 :DasWort = "gia" : DasWort2 = "ia" : DasWort3 = "a" : DasWort4 = "ogia" + case else : if bAsianLan then + printlog "For the language " + iSprache +" nothing is prepared yet, but is AsianLan, so OK :-)" + printlog " :-) will use English instead" + hFileOpenLocally( gTesttoolpath + "graphics\required\input\silben_"+"1"+sExt ) + DasWort = "ation" : DasWort2 = "tion" : DasWort3 = "ion" : DasWort4 = "on" '+Chr(34) + else + Warnlog "For the language " + iSprache +" nothing is prepared yet: insert text here and create file: "+sFile + hNewDocument + endif + end select + + printlog " - Test hyphenation" + EditSelectAll '/// Press CTRL + A to select all ///' + '/// 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 ///' + else + hTypeKeys "<MOD1 END><HOME><MOD1 SHIFT RIGHT>" + endif + EditCopy + sDraw = GetClipboardText() + EditSelectAll '/// Select whole text ///' + ToolsLanguageHyphenationDraw '/// Run Hyphenation ///' + gMouseClick 50,50 + hTypeKeys "<MOD1 END><HOME><MOD1 SHIFT RIGHT>" '/// Select part of text and compare it with original text at this place ///' + sleep 3 + EditCopy +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" + end select + if GetClipboardText <> sDraw then + 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+"'" + end if + sleep 1 + Call hCloseDocument '/// Close document ///' + +endcase 'tiToolsHyphenation2 + +'------------------------------------------------------------------------------- +testcase tToolsMacro + + Dim i as integer + Dim j as integer + Dim Zaehler as integer + Dim ZaehlerListe as integer + + Call hNewDocument + + ToolsMacro + Kontext "Makro" + + '/// 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>" + next i + next j + Zaehler=MakroAus.GetItemCount + for i= 1 to Zaehler + printlog "Starting Macro: (" + i + "/"+ Zaehler + ")" + MakroAus.Select i + if Makroname.GetText = "" Then + try + Ausfuehren.Click + Aufzeichnen.Click + Zuordnen.Click + Bearbeiten.Click + Warnlog " - Controls should not be visible" + catch + Printlog " Contrls invisible because no macro choosen" + endcatch + else + SetClipboard = Makroname.GetText + ZaehlerListe=MakroListe.GetItemCount + for j=2 to ZaehlerListe + Makroliste.Select j + if Makroname.GetText<>GetClipboardText Then + Printlog " Selection got used" + else + Warnlog " - Selection not right, it should be: " + Makroliste.GetSelText + " but it is: " + GetClipboardText + end if + next j + end if + next i + + Printlog " run macros" + MakroAus.Select 6 '3 + Ausfuehren.Click + sleep 10 + if Makro.Exists Then + Warnlog " - Macro not executed" + else + Printlog " Macro executed" + ToolsMacro + Kontext "Makro" + end if + + Zuordnen.Click + Kontext + Active.SetPage TabCustomizeMenu + Kontext "TabCustomizeMenu" + If TabCustomizeMenu.Exists Then + Printlog " Assign macro works" + TabCustomizeMenu.Cancel + sleep 3 + Kontext "Makro" + else + Warnlog " - Assigning macro does not work" + end if + + Bearbeiten.Click + try + sleep 1 ' this sleep is necessary. it takes some time, until focuse switched to basic window! + ViewNavigator + kontext "NavigatorDraw" + if NavigatorDraw.exists (5) then + Warnlog " - Edit macro does not work" + ViewNavigator + endif + catch + hCloseDocument + Kontext "DocumentDraw" + ToolsMacro + Kontext "Makro" + Printlog " Edit macro works" + endcatch + + MakroAus.typeKeys "<end>" + Zaehler = Makroliste.GetItemCount + Neu.Click ' same as delete + kontext "NeuesModul" + Modulname.SetText "NewMarco" + NeuesModul.OK + ToolsMacro + Kontext "Makro" + if (Makroliste.GetItemCount = (Zaehler+1)) Then + Printlog " New macro works" + else + Warnlog " - Macro wasn't created" + end if + + if (Makroliste.GetItemCount <> Makroliste.getSelIndex) Then + Warnlog " created Macro not selected" + Makroaus.Select(Makroaus.GetItemCount) + end if + sleep 1 + Loeschen.Click + sleep 1 + Kontext "Active" + printlog Active.getText + Active.Yes + sleep 2 + Kontext "Makro" + if (Makroliste.GetItemCount = 0) Then + Printlog " Delete macro works" + else + Warnlog " - Macro wasn't deleted" + end if + sleep 2 + makro.close + 'TODO: organizer testing! + Call hCloseDocument + Call hCloseDocument + +endcase 'tToolsMacro diff --git a/testautomation/graphics/optional/includes/impress/i_slideshow.inc b/testautomation/graphics/optional/includes/impress/i_slideshow.inc index d313f444994b..cfcc0fbd2e2f 100644 --- a/testautomation/graphics/optional/includes/impress/i_slideshow.inc +++ b/testautomation/graphics/optional/includes/impress/i_slideshow.inc @@ -29,28 +29,20 @@ '* '* short description : '* -'******************************************************************* -'* -' #1 tSlideShowSlideShow -' #1 tSlideShowRehearseTimings -' #1 tSlideShowSlideShowSettings -' #1 tSlideShowCustomSlideShow -' #1 tSlideShowSlideTransition -' #1 tSlideShowShowHideSlide -'* '\****************************************************************** + testcase tSlideShowSlideShow dim bLoaded as boolean dim i as integer + dim testfile as string + dim localtestfile as string '/// open file 'graphics\\input\\diashow.odp' ///' - hFileOpen ConvertPath (gTesttoolPath + "graphics\required\input\diashow.odp") + testfile = ( gTesttoolPath + "graphics\required\input\diashow.odp" ) + hFileOpenLocally( testfile ) sleep 30 - printlog "check if the document is writable" - sMakeReadOnlyDocumentEditable - bLoaded = false Kontext "Navigator" @@ -137,8 +129,15 @@ testcase tSlideShowSlideShow '/// Set "Start with current page" back to default = on, in ToolsOptions ///' setStartCurrentPage(TRUE) '/// close the application ///' - Call hCloseDocument - + Call hCloseDocument + localtestfile = hFileGetLocalPath( gTesttoolPath + "diashow.odp" ) + printlog localtestfile + if (FileExists (localtestfile)) then + app.kill (localtestfile) + printlog "Deleting used file." + else + warnlog "File is missing." + endif endcase 'tSlideShowSlideShow '------------------------------------------------------------------------------- @@ -227,6 +226,8 @@ testcase tSlideShowSlideShowSettings dim sTemp as string dim saSlideNames(4) as string dim bCurrentPage as boolean + dim sTestfile as string + dim sLocaltestfile as string S1 = glLocale (2) + " 1" S2 = glLocale (2) + " 2" @@ -290,12 +291,11 @@ testcase tSlideShowSlideShowSettings Call hCloseDocument sleep 5 - bLoaded = false - '/// open file 'graphics\\input\\diashow.odp' (Slide Show with 4 Slides) ///' - hFileOpen ConvertPath (gTesttoolPath + "graphics\required\input\diashow.odp") + bLoaded = false + '/// open file 'graphics\\input\\diashow.odp' (Slide Show with 4 Slides) ///' + sTestfile = ( gTesttoolPath + "graphics\required\input\diashow.odp" ) + hFileOpenLocally( sTestfile ) sleep 10 - printlog "check if the document is writable" - sMakeReadOnlyDocumentEditable try Kontext "DocumentImpress" @@ -694,7 +694,15 @@ testcase tSlideShowSlideShowSettings setStartCurrentPage(TRUE) '/// Close the document ///' call hCloseDocument - + sLocaltestfile = hFileGetLocalPath( gTesttoolPath + "diashow.odp" ) + printlog sLocaltestfile + if (FileExists (sLocaltestfile)) then + app.kill (sLocaltestfile) + printlog "Deleting used file." + else + warnlog "File is missing." + endif + endcase 'tSlideShowSlideShowSettings '------------------------------------------------------------------------------- diff --git a/testautomation/graphics/optional/includes/impress/i_slideshow3.inc b/testautomation/graphics/optional/includes/impress/i_slideshow3.inc index 63a04aa6f8d5..bc138fef445d 100644 --- a/testautomation/graphics/optional/includes/impress/i_slideshow3.inc +++ b/testautomation/graphics/optional/includes/impress/i_slideshow3.inc @@ -529,7 +529,8 @@ endcase testcase tExtrasIndividuellePraesentation Printlog "- Slideshow/Individual slideshow" - Call hNewDocument '/// new impress document ///' + Call hNewDocument + Call sSelectEmptyLayout '/// new impress document ///' '/// Deactivate "Start with current page" in ToolsOptions ///' setStartCurrentPage(FALSE) '/// check state of navigator ! expected: closed ///' @@ -546,24 +547,27 @@ testcase tExtrasIndividuellePraesentation Kontext "Bildschirmpraesentation" Fenster.Check Bildschirmpraesentation.OK - InsertSlide '/// insert slide ///' - sleep 2 - hTypekeys "<Pagedown>" - sleep 2 - InsertSlide - sleep 2 - hTypekeys "<Pagedown>" - sleep 2 - InsertSlide '/// insert another slide ///' - sleep 2 - hTypekeys "<Pagedown>" - sleep 2 - Printlog " - Slides added" - sleep 1 - Kontext "DocumentImpress" - DocumentImpress.TypeKeys "<MOD1 SHIFT F5>" '/// open navigator ///' - sleep 1 - Kontext "NavigatorDraw" + InsertSlide '/// insert slide ///' + sleep 2 + Call sSelectEmptyLayout + hTypekeys "<Pagedown>" + sleep 2 + InsertSlide + sleep 2 + Call sSelectEmptyLayout + hTypekeys "<Pagedown>" + sleep 2 + InsertSlide '/// insert another slide ///' + sleep 2 + Call sSelectEmptyLayout + hTypekeys "<Pagedown>" + sleep 2 + Printlog " - Slides added" + sleep 1 + Kontext "DocumentImpress" + DocumentImpress.TypeKeys "<MOD1 SHIFT F5>" '/// open navigator ///' + sleep 1 + Kontext "NavigatorDraw" if NavigatorDraw.Exists Then Printlog " - Navigator exists" Erste.Click '/// switch to 1st slide ///' diff --git a/testautomation/graphics/optional/includes/impress/i_view.inc b/testautomation/graphics/optional/includes/impress/i_view.inc index 54ba5132d16e..e82ec2ec38a3 100644 --- a/testautomation/graphics/optional/includes/impress/i_view.inc +++ b/testautomation/graphics/optional/includes/impress/i_view.inc @@ -61,11 +61,9 @@ testcase tViewWorkspaceHandoutView Call hNewDocument '/// new document ///' sleep 2 Kontext "DocumentImpress" - if NOT documentImpress.Exists then - hNewDocument - sleep 1 - end if - sleep 2 + DocumentImpress.UseMenu + hMenuSelectNr (5) + hMenuSelectNr (13) Printlog " ViewWorkspaceHandoutView" ViewWorkspaceHandoutView '/// view background handout ///' sleep 2 diff --git a/testautomation/graphics/required/includes/global/id_006.inc b/testautomation/graphics/required/includes/global/id_006.inc index 434959a7ac2d..ccdfc5eb3e69 100644 --- a/testautomation/graphics/required/includes/global/id_006.inc +++ b/testautomation/graphics/required/includes/global/id_006.inc @@ -167,14 +167,13 @@ testcase tiToolsThesaurus PrintLog "Thesaurus with 1 word: " + sWord - if( Ucase(gApplication) = "DRAW" ) then + if( gApplication = "DRAW" ) then sExt = ".odg" elseif( Ucase(gApplication) = "IMPRESS" ) then sExt = ".odp" endif - Call hFileOpen (gTesttoolpath + "graphics\required\input\recht_" + iSprache + sExt) - Call sMakeReadOnlyDocumentEditable() + hFileOpenLocally( gTesttoolpath + "graphics\required\input\recht_" + iSprache + sExt) Call hTextrahmenErstellen (sWord,20,20,50,30) sleep 1 |