diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-06-17 11:36:51 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-06-17 11:36:51 +0000 |
commit | 6ed1958b83babfda36cef3512198dfeba98d5894 (patch) | |
tree | efae0b1cbeac4b284d6a280f2ddedf3667916d5b /testautomation/graphics/optional/includes/global/g_load_save.inc | |
parent | 2574c2381e36c7feac8ed6cfa83bc5bceae509ab (diff) |
CWS-TOOLING: integrate CWS automation006
2009-05-26 13:25:30 +0200 jsk r272296 : #i102088# - final cosmetic touch
2009-05-25 14:40:06 +0200 jsk r272244 : #i102202# - quite a chunk.
2009-05-25 05:29:48 +0200 jsk r272215 : #i102202# - Cleanup, code refactored, indention and headers fixed
2009-05-25 04:55:58 +0200 jsk r272214 : #i102088# - update .bas-files to load call GetOLEDefaultNames from external file
2009-05-20 12:55:18 +0200 jsk r272116 : #i102088# Replace old OLE stuff, get it from API, localized
Diffstat (limited to 'testautomation/graphics/optional/includes/global/g_load_save.inc')
-rwxr-xr-x | testautomation/graphics/optional/includes/global/g_load_save.inc | 1000 |
1 files changed, 445 insertions, 555 deletions
diff --git a/testautomation/graphics/optional/includes/global/g_load_save.inc b/testautomation/graphics/optional/includes/global/g_load_save.inc index 55685cfb9fbf..2fd40014a58a 100755 --- a/testautomation/graphics/optional/includes/global/g_load_save.inc +++ b/testautomation/graphics/optional/includes/global/g_load_save.inc @@ -1,7 +1,7 @@ 'encoding UTF-8 Do not remove or change this line! '************************************************************************** '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -'* +'* '* Copyright 2008 by Sun Microsystems, Inc. '* '* OpenOffice.org - a multi-platform office productivity suite @@ -52,131 +52,114 @@ '\************************************************************************************* testcase tFileOpenSaveEtc - Dim Dokument$ - Dim Dokument2$ + Dim Dokument$ + Dim Dokument2$ - Dokument$ = ConvertPath ( gOfficePath + "user\work\test1") - Dokument2$ = ConvertPath ( gOfficePath + "user\work\test1_2") + Dokument$ = ConvertPath ( gOfficePath + "user\work\test1") + Dokument2$ = ConvertPath ( gOfficePath + "user\work\test1_2") - if (gApplication = "IMPRESS") then + if (gApplication = "IMPRESS") then ExtensionString = "odp" else ExtensionString = "odg" end if - '/// delete previous created documents: 'user\\work\\test1*.od?' ///' - if Dir (Dokument$ + ".odp") <> "" then kill (Dokument$ + ".odp") - if Dir (Dokument2$ + ".odg") <> "" then kill (Dokument2$ + ".odg") - - '/// open application ///' - hNewDocument - gMouseclick 90,90 - '/// create a textframe with content ///' - Call hTextrahmenErstellen ( "This is a test",20,20,40,30 ) - '/// save file as 'test1' ///' - hFileSaveAsKill (Dokument$ + "." + ExtensionString) - Sleep 10 - '/// close Document ///' - hCloseDocument - printlog "- Document Saved and Closed" - - '/// load document 'test1' ///' - hFileOpen (Dokument$ + "." + ExtensionString) - - Sleep 10 - '/// close Document ///' - hCloseDocument - printlog "- document Loaded and closed" - Sleep 10 - '/// load document 'test1' ///' - hFileOpen (Dokument$ + "." + ExtensionString) - ' check if the document is writable - if fIsDocumentWritable = false then - ' 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 - endif - endif - Sleep 10 - gMouseclick 90,90 - '/// create another textbox with content ///' - Call hTextrahmenerstellen ( "Change",60,60,80,80 ) - '/// File->Close needn't work, just say CANCEL to the question about saving changes! ///' - FileClose - Kontext ' message about 'something changed should i [overwrite discard cancel]?' - if Messagebox.exists (5) then - printlog "2:"+messagebox.gettext - Messagebox.Cancel - else - Warnlog "Mesagebox is missing :-(" - endif - printlog "- Document loaded, changed and closed discarding all changes" - - printlog "- Last version" - try - FileReload '/// File Reload ///' - catch - kontext "documentimpress" - try - FileReload '/// File Reload ///' - catch - warnlog "Damn reload ?? Why ? BREAKPOINT! File reload doesn't work. Create new object and try again :-(" - endcatch - endcatch - Kontext - Messagebox.Yes - Sleep 10 - gMouseDoubleClick 70,70 - hTypeKeys "<Down>", 3 - hTypeKeys "<SHIFT LEFT>",10 - hTypeKeys "<MOD1 C>" - Sleep 1 - if GetClipboardText = "Change" then Warnlog "- Last version not loaded. Changes in the document still in." - printlog "- Change document, save it under different name" - Kontext "DocumentImpress" - Call hTextrahmenErstellen ("Change2",10,10,50,20 ) '/// new textbox ///' - gMouseclick 90,90 - sleep 1 - FileSaveAs - Kontext "SpeichernDlg" - Dateiname.SetText Dokument2$ - Speichern.Click - kontext "AlienWarning" - if AlienWarning.exists(5) then - warnlog "#i41983# Alien Warning on export not allowed" - AlienWarning.OK - endif - Kontext "Messagebox" - if Messagebox.Exists(2) then Messagebox.Yes - Sleep 3 - FileClose '/// Close document ///' - sleep 10 - Kontext "Messagebox" - if Messagebox.Exists Then - Warnlog "- Document saved, but Msgbox appeared, even no changes were made: " + Messagebox.GetText - Messagebox.Yes - end if - sleep 2 - printlog "- Loading write protected file" - FileOpen '/// Open write protected file ///' - Kontext "OeffnenDlg" - Dateiname.SetText (Dokument2$ + "." + ExtensionString) - NurLesen.Check - Oeffnen.Click - Sleep 10 - ' check if the document is writable - try - Call hTextrahmenErstellen ( "Hello",85,85,95,95 ) '/// attempt to create a textbox ///' - hTypeKeys "<SHIFT LEFT>",5 - hTypeKeys "<MOD1 C>" - sleep 1 - if GetClipboardText = "Hello" then Warnlog "Write protected document could be edited" - catch - Printlog "- Write protected document could not be edited" - endcatch - sleep 5 - FileClose '/// Close document ///' + if Dir (Dokument$ + ".odp") <> "" then kill (Dokument$ + ".odp") + if Dir (Dokument2$ + ".odg") <> "" then kill (Dokument2$ + ".odg") + + hNewDocument + gMouseclick 90,90 + Call hTextrahmenErstellen ( "This is a test",20,20,40,30 ) + hFileSaveAsKill (Dokument$ + "." + ExtensionString) + Sleep 10 + hCloseDocument + printlog "- Document Saved and Closed" + + hFileOpen (Dokument$ + "." + ExtensionString) + + Sleep 10 + hCloseDocument + printlog "- document Loaded and closed" + Sleep 10 + hFileOpen (Dokument$ + "." + ExtensionString) + ' check if the document is writable + if fIsDocumentWritable = false then + ' 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 + endif + endif + Sleep 10 + gMouseclick 90,90 + Call hTextrahmenerstellen ( "Change",60,60,80,80 ) + FileClose + Kontext ' message about 'something changed should i [overwrite discard cancel]?' + if Messagebox.exists (5) then + printlog "2:"+messagebox.gettext + Messagebox.Cancel + else + Warnlog "Mesagebox is missing :-(" + endif + printlog "- Document loaded, changed and closed discarding all changes" + + printlog "- Last version" + try + catch + kontext "documentimpress" + try + catch + warnlog "Damn reload ?? Why ? BREAKPOINT! File reload doesn't work. Create new object and try again :-(" + endcatch + endcatch + Kontext + Messagebox.Yes + Sleep 10 + gMouseDoubleClick 70,70 + hTypeKeys "<Down>", 3 + hTypeKeys "<SHIFT LEFT>",10 + hTypeKeys "<MOD1 C>" + Sleep 1 + if GetClipboardText = "Change" then Warnlog "- Last version not loaded. Changes in the document still in." + printlog "- Change document, save it under different name" + Kontext "DocumentImpress" + gMouseclick 90,90 + sleep 1 + FileSaveAs + Kontext "SpeichernDlg" + Dateiname.SetText Dokument2$ + Speichern.Click + kontext "AlienWarning" + if AlienWarning.exists(5) then + warnlog "#i41983# Alien Warning on export not allowed" + AlienWarning.OK + endif + Kontext "Messagebox" + if Messagebox.Exists(2) then Messagebox.Yes + Sleep 3 + sleep 10 + Kontext "Messagebox" + if Messagebox.Exists Then + Warnlog "- Document saved, but Msgbox appeared, even no changes were made: " + Messagebox.GetText + Messagebox.Yes + end if + sleep 2 + printlog "- Loading write protected file" + Kontext "OeffnenDlg" + Dateiname.SetText (Dokument2$ + "." + ExtensionString) + NurLesen.Check + Oeffnen.Click + Sleep 10 + ' check if the document is writable + try + hTypeKeys "<SHIFT LEFT>",5 + hTypeKeys "<MOD1 C>" + sleep 1 + if GetClipboardText = "Hello" then Warnlog "Write protected document could be edited" + catch + Printlog "- Write protected document could not be edited" + endcatch + sleep 5 endcase '******************************************************************************************** @@ -184,214 +167,204 @@ endcase testcase tFileProperties qaerrorlog "#i88163#, File/properties/user defined fields get mixed up." goto endsub - Call hNewDocument - Call hTextrahmenErstellen ("This is a document to test the Menupoint in File/Properties",30,30,60,40) + Call hNewDocument + Call hTextrahmenErstellen ("This is a document to test the Menupoint in File/Properties",30,30,60,40) - if (gApplication = "IMPRESS") then + if (gApplication = "IMPRESS") then ExtensionString = "odp" else ExtensionString = "odg" end if - FileProperties - - Kontext - active.SetPage TabDokumentinfo - Kontext "TabDokumentinfo" - Titel.SetText "Properties" - Thema.SetText "Documentproperties" - Schluesselworte.SetText "None" - - qaerrorlog "#i95523#" - 'Kontext - 'active.SetPage TabBenutzer - 'Kontext "TabBenutzer" - 'Info2.SetText "Thorsten Peters" - - 'Infofelder.Click - 'Kontext "InfonamenBearbeiten" - 'Namen2.SetText "Name" - 'InfonamenBearbeiten.OK - 'sleep 2 - Kontext - active.SetPage TabInternet - Kontext "TabInternet" - RefreshThisDocument.Check - - TabInternet.OK - - hFileSaveAsKill ConvertPath (gOfficePath + "user\work\eigen." & ExtensionString) - - FileClose - Kontext "Active" + FileProperties + + Kontext + active.SetPage TabDokumentinfo + Kontext "TabDokumentinfo" + Titel.SetText "Properties" + Thema.SetText "Documentproperties" + Schluesselworte.SetText "None" + + qaerrorlog "#i95523#" + 'Kontext + 'active.SetPage TabBenutzer + 'Kontext "TabBenutzer" + 'Info2.SetText "Thorsten Peters" + + 'Infofelder.Click + 'Kontext "InfonamenBearbeiten" + 'Namen2.SetText "Name" + 'InfonamenBearbeiten.OK + 'sleep 2 + Kontext + active.SetPage TabInternet + Kontext "TabInternet" + RefreshThisDocument.Check + + TabInternet.OK + + hFileSaveAsKill ConvertPath (gOfficePath + "user\work\eigen." & ExtensionString) + + FileClose + Kontext "Active" if Active.Exists(2) then Active.Yes - PrintLog "- File / Properties compare" - Sleep 2 - hFileOpen ConvertPath (gOfficePath + "user\work\eigen." + ExtensionString) - - ' check if the document is writable - if fIsDocumentWritable = false then - ' 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 - endif - endif - FileProperties - Kontext - active.SetPage TabDokumentinfo - Kontext "TabDokumentinfo" - if Titel.GetText <> "Properties" then Warnlog "Description / Titel is wrong" - if Thema.GetText <> "Documentproperties" then Warnlog "Description / Thema is wrong" - if Schluesselworte.GetText <> "None" then Warnlog "Description / Keywords is wrong" - - qaerrorlog "#i95523#" - 'Kontext - 'active.SetPage TabBenutzer - 'Kontext "TabBenutzer" - 'if Info2.GetText <> "Thorsten Peters" then Warnlog "User Defined / Info2 is wrong" - - 'Infofelder.Click - 'sleep 2 - 'Kontext "InfonamenBearbeiten" - 'if Namen2.GetText <> "Name" then Warnlog "Edit Field Names / Info2 is wrong" - 'InfonamenBearbeiten.OK - - Kontext - active.SetPage TabInternet - Kontext "TabInternet" - if RefreshThisDocument.IsChecked = FALSE then Warnlog "Internet / 'Refresh this document' is not checked" - - TabInternet.Close - - Call hCloseDocument + PrintLog "- File / Properties compare" + Sleep 2 + hFileOpen ConvertPath (gOfficePath + "user\work\eigen." + ExtensionString) + + ' check if the document is writable + if fIsDocumentWritable = false then + ' 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 + endif + endif + FileProperties + Kontext + active.SetPage TabDokumentinfo + Kontext "TabDokumentinfo" + if Titel.GetText <> "Properties" then Warnlog "Description / Titel is wrong" + if Thema.GetText <> "Documentproperties" then Warnlog "Description / Thema is wrong" + if Schluesselworte.GetText <> "None" then Warnlog "Description / Keywords is wrong" + + qaerrorlog "#i95523#" + 'Kontext + 'active.SetPage TabBenutzer + 'Kontext "TabBenutzer" + 'if Info2.GetText <> "Thorsten Peters" then Warnlog "User Defined / Info2 is wrong" + + 'Infofelder.Click + 'sleep 2 + 'Kontext "InfonamenBearbeiten" + 'if Namen2.GetText <> "Name" then Warnlog "Edit Field Names / Info2 is wrong" + 'InfonamenBearbeiten.OK + + Kontext + active.SetPage TabInternet + Kontext "TabInternet" + if RefreshThisDocument.IsChecked = FALSE then Warnlog "Internet / 'Refresh this document' is not checked" + + TabInternet.Close + + Call hCloseDocument endcase '******************************************************************************************** testcase tFilePassword52 -'/// load files with password from version 5.2 ///' - Dim Datei$ - dim i as integer - dim x as integer - dim y as integer - dim sExt() as string - - sExt = array("d","a") -' passwo52.sd d-preas a-draw - for i = 0 to 1 - Datei$ = ConvertPath ( gTesttoolPath + "graphics\required\input\passwo52.sd"+sExt(i) ) - '/// open document graphics\\required\\input\\passwo52.sd? ///' - hFileOpen(Datei$) - sleep 2 - Kontext "passwordFileOpen" - '/// password dialog has to came up ! ELSE: error! ///' - if passwordFileOpen.exists(5) then - '/// type password: "12345" -> RIGHT ///' - PasswortName.SetText "12345" - passwordFileOpen.OK - Printlog "Ok, password dialog came up :-) for file : '" + datei$ + "'" - else - Warnlog "No password dialog came up :-( for file : '" + datei$ + "'" - endif - Kontext "Messagebox" - if Messagebox.Exists(2) then - Warnlog "messagebox ?: '" + Messagebox.GetText + "'" - endif - '/// close document ///' - hCloseDocument - next i + Dim Datei$ + dim i as integer + dim x as integer + dim y as integer + dim sExt() as string + + sExt = array("d","a") + ' passwo52.sd d-preas a-draw + for i = 0 to 1 + Datei$ = ConvertPath ( gTesttoolPath + "graphics\required\input\passwo52.sd"+sExt(i) ) + hFileOpen(Datei$) + sleep 2 + Kontext "passwordFileOpen" + if passwordFileOpen.exists(5) then + PasswortName.SetText "12345" + passwordFileOpen.OK + Printlog "Ok, password dialog came up :-) for file : '" + datei$ + "'" + else + Warnlog "No password dialog came up :-( for file : '" + datei$ + "'" + endif + Kontext "Messagebox" + if Messagebox.Exists(2) then + Warnlog "messagebox ?: '" + Messagebox.GetText + "'" + endif + hCloseDocument + next i endcase '******************************************************************************************** testcase tFileOpenImport -'/// tries to load a document of type 'ComputerGraphicsMetafile'; gets loaded as impress document. ///' -dim q as integer - call hNewDocument - FileOpen - Kontext "OeffnenDlg" -'/// Dateiname.SetText (gTesttoolpath + "graphics\required\input\imsusmap.cgm") ///' - Dateiname.SetText (ConvertPath (gTesttoolpath + "graphics\required\input\imsusmap.cgm")) - Oeffnen.Click - Sleep 2 - ' check if the document is writable - if fIsDocumentWritable = false then - ' 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 - endif - endif - kontext "DocumentImpress" - if DocumentImpress.exists(5) then - DocumentImpress.TypeKeys ("<Tab>") - else - warnlog "Not loaded in impress" - endif - try - ContextPositionAndSize - kontext - messagebox.setpage TabPositionAndSize - sleep 1 - TabPositionAndSize.Close - catch - warnlog "Documents of Type 'ComputerGraphicsMetafile' can't get loaded :-(" - endcatch - Call hCloseDocument - if (gApplication="DRAW") then - Call hCloseDocument - endif + dim q as integer + call hNewDocument + FileOpen + Kontext "OeffnenDlg" + Dateiname.SetText (ConvertPath (gTesttoolpath + "graphics\required\input\imsusmap.cgm")) + Oeffnen.Click + Sleep 2 + ' check if the document is writable + if fIsDocumentWritable = false then + ' 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 + endif + endif + kontext "DocumentImpress" + if DocumentImpress.exists(5) then + DocumentImpress.TypeKeys ("<Tab>") + else + warnlog "Not loaded in impress" + endif + try + ContextPositionAndSize + kontext + messagebox.setpage TabPositionAndSize + sleep 1 + TabPositionAndSize.Close + catch + warnlog "Documents of Type 'ComputerGraphicsMetafile' can't get loaded :-(" + endcatch + Call hCloseDocument + if (gApplication="DRAW") then + Call hCloseDocument + endif endcase '******************************************************************************************** testcase tTestDXF255CharBug -'/// tries to load a DXF-document which has a string-leght of 255 characters. ///' -dim q as integer - call hNewDocument - InsertGraphicsFromFile '/// insert graphic ///' - sleep 1 - kontext "Active" - sleep 1 + dim q as integer + call hNewDocument + sleep 1 + kontext "Active" + sleep 1 if Active.Exists Then - Active.OK + Active.OK end if sleep 1 - Kontext "GrafikEinfuegenDlg" - sleep 2 - '/// Dateiname.SetText (ConvertPath (gTesttoolpath + "graphics\required\input\255chars.dxf")) ///' - Dateiname.SetText (ConvertPath (gTesttoolpath + "graphics\required\input\255chars.dxf")) - Oeffnen.Click - Sleep 2 - - if gApplication = "DRAW" then - Kontext "Documentdraw" - if Documentdraw.exists(5) then - Documentdraw.TypeKeys ("<Tab>") - else - warnlog "Not loaded in draw" - endif - else '(Impress) - Kontext "DocumentImpress" - if DocumentImpress.exists(5) then - DocumentImpress.TypeKeys ("<Tab>") - else - warnlog "Not loaded in impress" - endif - endif - - try - ContextPositionAndSize - kontext - messagebox.setpage TabPositionAndSize - sleep 1 - TabPositionAndSize.Close - catch - warnlog "DXF-Document could not be loaded :-(" - endcatch - Call hCloseDocument + Kontext "GrafikEinfuegenDlg" + sleep 2 + Dateiname.SetText (ConvertPath (gTesttoolpath + "graphics\required\input\255chars.dxf")) + Oeffnen.Click + Sleep 2 + + if gApplication = "DRAW" then + Kontext "Documentdraw" + if Documentdraw.exists(5) then + Documentdraw.TypeKeys ("<Tab>") + else + warnlog "Not loaded in draw" + endif + else '(Impress) + Kontext "DocumentImpress" + if DocumentImpress.exists(5) then + DocumentImpress.TypeKeys ("<Tab>") + else + warnlog "Not loaded in impress" + endif + endif + + try + ContextPositionAndSize + kontext + messagebox.setpage TabPositionAndSize + sleep 1 + TabPositionAndSize.Close + catch + warnlog "DXF-Document could not be loaded :-(" + endcatch + Call hCloseDocument endcase '******************************************************************************************** @@ -403,102 +376,89 @@ testcase tDeletedTemplate dim SavedActiveMessage as string dim found as boolean - if (gApplication = "IMPRESS") then + if (gApplication = "IMPRESS") then ExtensionString = "odp" else ExtensionString = "odg" end if - + Dokument1$ = ConvertPath ( gOfficePath + "user\work\test1." & ExtensionString) Dokument2$ = ConvertPath ( gOfficePath + "user\work\test2." & ExtensionString) - - - '/// delete previous created documents: 'user\\work\\test*.odp' ///' - if Dir (Dokument1$) <> "" then kill Dokument1$ - if Dir (Dokument2$) <> "" then kill Dokument2$ - - '/// open application ///' - hNewDocument - gMouseclick 90,90 - '/// create a textframe with content ///' - Call hTextrahmenErstellen ( "This is the first file",20,20,40,30 ) - '/// save file as 'test1.odp' ///' - hFileSaveAsKill (Dokument1$) - Sleep 10 - '/// close Document ///' - hCloseDocument - printlog "- Document 'test1.odp' Saved and Closed" - - '/// open application again ///' - hNewDocument - gMouseclick 90,90 - '/// create another textframe with content ///' - Call hTextrahmenErstellen ( "This is the second file",20,20,40,30 ) - '/// save file as 'test2.odp' ///' - hFileSaveAsKill (Dokument2$) - Sleep 10 - '/// close Document ///' - hCloseDocument - printlog "- Document 'test2.odp' Saved and Closed" - - '/// Delete the first file ///' - try - kill Dokument1$ - Printlog " Correctly deleted the file: " + Dokument1$ - catch - warnlog "Could not delete the file: " + Dokument1$ - endcatch - - '/// File => New => Presentation ///' - FileAutopilotPresentation '/// new document-autopilot ///' - Kontext "AutopilotPraesentation1" - sleep 5 - Existingpresentation.Check - sleep 5 - kontext "active" - if active.exists then - SavedActiveMessage = Active.GetText - QaErrorLog "Message: " + SavedActiveMessage - active.ok - Kontext "AutopilotPraesentation1" - if Existinglist.GetSelText = "test1.odp" then - warnlog " The deleted File was found. Messagebox said: " + SavedActiveMessage - endif - SavedActiveMessage = "" - endif - Kontext "AutopilotPraesentation1" - Existinglist.TypeKeys "<HOME>" - sleep 5 - found = false - for i = 1 to Existinglist.GetItemCount - kontext "active" - if active.exists then - SavedActiveMessage = Active.GetText - active.ok - endif - Kontext "AutopilotPraesentation1" - if Existinglist.GetSelText = "test1.odp" then - found = true - if SavedActiveMessage <> "" then - warnlog " The deleted File was found. Messagebox said: " + SavedActiveMessage - else - warnlog " The deleted File was found. However without any messagebox." - endif - endif - Existinglist.TypeKeys "<DOWN>" - sleep 5 - next i - if found = true then warnlog " An error-message showed up. Eventually a result of '138498'" - AutopilotPraesentation1.Cancel - Sleep 2 - '/// Delete the second file ///' - try - kill Dokument2$ - Printlog " Correctly deleted the file: " + Dokument2$ - catch - warnlog "Could not delete the file: " + Dokument2$ - endcatch + + + if Dir (Dokument1$) <> "" then kill Dokument1$ + if Dir (Dokument2$) <> "" then kill Dokument2$ + + hNewDocument + gMouseclick 90,90 + Call hTextrahmenErstellen ( "This is the first file",20,20,40,30 ) + hFileSaveAsKill (Dokument1$) + Sleep 10 + hCloseDocument + printlog "- Document 'test1.odp' Saved and Closed" + + hNewDocument + gMouseclick 90,90 + Call hTextrahmenErstellen ( "This is the second file",20,20,40,30 ) + hFileSaveAsKill (Dokument2$) + Sleep 10 + hCloseDocument + printlog "- Document 'test2.odp' Saved and Closed" + + try + kill Dokument1$ + Printlog " Correctly deleted the file: " + Dokument1$ + catch + warnlog "Could not delete the file: " + Dokument1$ + endcatch + + Kontext "AutopilotPraesentation1" + sleep 5 + Existingpresentation.Check + sleep 5 + kontext "active" + if active.exists then + SavedActiveMessage = Active.GetText + QaErrorLog "Message: " + SavedActiveMessage + active.ok + Kontext "AutopilotPraesentation1" + if Existinglist.GetSelText = "test1.odp" then + warnlog " The deleted File was found. Messagebox said: " + SavedActiveMessage + endif + SavedActiveMessage = "" + endif + Kontext "AutopilotPraesentation1" + Existinglist.TypeKeys "<HOME>" + sleep 5 + found = false + for i = 1 to Existinglist.GetItemCount + kontext "active" + if active.exists then + SavedActiveMessage = Active.GetText + active.ok + endif + Kontext "AutopilotPraesentation1" + if Existinglist.GetSelText = "test1.odp" then + found = true + if SavedActiveMessage <> "" then + warnlog " The deleted File was found. Messagebox said: " + SavedActiveMessage + else + warnlog " The deleted File was found. However without any messagebox." + endif + endif + Existinglist.TypeKeys "<DOWN>" + sleep 5 + next i + if found = true then warnlog " An error-message showed up. Eventually a result of '138498'" + AutopilotPraesentation1.Cancel + Sleep 2 + try + kill Dokument2$ + Printlog " Correctly deleted the file: " + Dokument2$ + catch + warnlog "Could not delete the file: " + Dokument2$ + endcatch endcase @@ -509,41 +469,31 @@ testcase tSaveLoadLayoutEmpty NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\") - '/// Create New folder in the Work-directory ///' printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - '/// Create a new document, add a Layout, Save the document in different Formats, and open the saved files. ///' - '/// Make new Presentation ///' gApplication = "IMPRESS" Call hNewDocument - '/// Choose and Insert an empty Layout. ///' printlog "Choose and Insert an empty Layout." FormatModifyPage sleep 1 kontext "Tasks" - LayoutsPreview.TypeKeys "<HOME>" - kontext "Pagelayout_UndoDeleteWarning" - if Pagelayout_UndoDeleteWarning.exists then - Pagelayout_UndoDeleteWarning.ok + LayoutsPreview.TypeKeys "<HOME>" + kontext "Pagelayout_UndoDeleteWarning" + if Pagelayout_UndoDeleteWarning.exists then + Pagelayout_UndoDeleteWarning.ok endif kontext "Tasks" - '/// Press "Enter" to use the layout on the current slide ///' LayoutsPreview.TypeKeys "<RETURN>" sleep (5) - '/// Save the document in different formats... ///' - '/// Close the file. ///' - '/// Load the different files. ///' - call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. + call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. - '/// Delete the different files. ///' printlog " Will try to delete the directory: " + NewFileDir app.rmDir NewFileDir - '/// End the test ///' endcase 'tSaveLoadLayoutEmpty '**************************************************************************************************** @@ -555,57 +505,47 @@ testcase tSaveLoadLayoutOLE NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\") - '/// Create New folder in the Work-directory ///' printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - '/// Create a new document, add a Layout, Save the document in different Formats, and open the saved files. ///' - '/// Make new Presentation ///' gApplication = "IMPRESS" Call hNewDocument - '/// Choose and Insert an Layout with an OLE. ///' printlog "Choose and Insert an Layout with an OLE." FormatModifyPage sleep 1 kontext "Tasks" - LayoutsPreview.TypeKeys "<HOME>" + LayoutsPreview.TypeKeys "<HOME>" kontext "Pagelayout_UndoDeleteWarning" if Pagelayout_UndoDeleteWarning.exists then - Pagelayout_UndoDeleteWarning.ok + Pagelayout_UndoDeleteWarning.ok endif kontext "Tasks" - '/// select the OLE placeholder and activate it with [Return] ///' - LayoutsPreview.TypeKeys ("<RIGHT>",12) - sleep (1) - LayoutsPreview.TypeKeys ("<Return>") - sleep (1) - hTypeKeys ("<TAB><TAB><TAB>") - hTypeKeys ("<Return>") - try - sleep (2) - kontext "OLEObjektInsert" - sleep (1) - OLEObjektInsert.Cancel - Printlog "Inserted a layout with an 'Insert OLE-Object'-frame. Correct." - catch - warnlog "Ole wasn't selected :-(" - CALL hCloseDocument - Goto Endsub - endcatch + LayoutsPreview.TypeKeys ("<RIGHT>",12) + sleep (1) + LayoutsPreview.TypeKeys ("<Return>") + sleep (1) + hTypeKeys ("<TAB><TAB><TAB>") + hTypeKeys ("<Return>") + try + sleep (2) + kontext "OLEObjektInsert" + sleep (1) + OLEObjektInsert.Cancel + Printlog "Inserted a layout with an 'Insert OLE-Object'-frame. Correct." + catch + warnlog "Ole wasn't selected :-(" + CALL hCloseDocument + Goto Endsub + endcatch sleep (5) - '/// Save the document in different formats... ///' - '/// Close the file. ///' - '/// Load the different files. ///' - call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. + call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. - '/// Delete the different files. ///' printlog " Will try to delete the directory: " + NewFileDir app.rmDir ConvertPath (gOfficePath + "user\work\LayoutTest\")' NewFileDir - '/// End the test ///' endcase 'tSaveLoadLayoutOLE '**************************************************************************************************** @@ -617,48 +557,38 @@ testcase tSaveLoadLayoutText NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\") - '/// Create New folder in the Work-directory ///' printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - '/// Create a new document, add a Layout, Save the document in different Formats, and open the saved files. ///' - '/// Make new Presentation ///' gApplication = "IMPRESS" Call hNewDocument - '/// Choose and Insert an Layout with a Text-field. ///' printlog "Choose and Insert an Layout with a Text-field." FormatModifyPage sleep 1 kontext "Tasks" - LayoutsPreview.TypeKeys "<HOME>" - kontext "Pagelayout_UndoDeleteWarning" - if Pagelayout_UndoDeleteWarning.exists then - Pagelayout_UndoDeleteWarning.ok + LayoutsPreview.TypeKeys "<HOME>" + kontext "Pagelayout_UndoDeleteWarning" + if Pagelayout_UndoDeleteWarning.exists then + Pagelayout_UndoDeleteWarning.ok endif kontext "Tasks" - '/// select the Text placeholder and activate it with [Return] ///' - LayoutsPreview.TypeKeys ("<RIGHT>") - sleep (1) - LayoutsPreview.TypeKeys ("<Return>") - sleep (1) - hTypeKeys ("<TAB><TAB><TAB>") - hTypeKeys ("<Return>") - hTypeKeys ("<ESCAPE>") -' LayoutsPreview.TypeKeys "<RETURN>" + LayoutsPreview.TypeKeys ("<RIGHT>") + sleep (1) + LayoutsPreview.TypeKeys ("<Return>") + sleep (1) + hTypeKeys ("<TAB><TAB><TAB>") + hTypeKeys ("<Return>") + hTypeKeys ("<ESCAPE>") + ' LayoutsPreview.TypeKeys "<RETURN>" sleep (5) - '/// Save the document in different formats... ///' - '/// Close the file. ///' - '/// Load the different files. ///' - call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. + call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. - '/// Delete the different files. ///' printlog " Will try to delete the directory: " + NewFileDir app.rmDir ConvertPath (gOfficePath + "user\work\LayoutTest\")' NewFileDir - '/// End the test ///' endcase 'tSaveLoadLayoutText '**************************************************************************************************** @@ -670,47 +600,37 @@ testcase tSaveLoadLayoutOutline NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\") - '/// Create New folder in the Work-directory ///' printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - '/// Create a new document, add a Layout, Save the document in different Formats, and open the saved files. ///' - '/// Make new Presentation ///' gApplication = "IMPRESS" Call hNewDocument - '/// Choose and Insert an Layout with a Outline-field. ///' printlog "Choose and Insert an Layout with a Outline-field." FormatModifyPage sleep 1 kontext "Tasks" - LayoutsPreview.TypeKeys "<HOME>" - kontext "Pagelayout_UndoDeleteWarning" - if Pagelayout_UndoDeleteWarning.exists then - Pagelayout_UndoDeleteWarning.ok + LayoutsPreview.TypeKeys "<HOME>" + kontext "Pagelayout_UndoDeleteWarning" + if Pagelayout_UndoDeleteWarning.exists then + Pagelayout_UndoDeleteWarning.ok endif kontext "Tasks" - '/// select the Outline placeholder and activate it with [Return] ///' - LayoutsPreview.TypeKeys ("<RIGHT>",3) - sleep (1) - LayoutsPreview.TypeKeys ("<Return>") - sleep (1) - hTypeKeys ("<TAB><TAB><TAB>") - hTypeKeys ("<Return>") - hTypeKeys ("<ESCAPE>") + LayoutsPreview.TypeKeys ("<RIGHT>",3) + sleep (1) + LayoutsPreview.TypeKeys ("<Return>") + sleep (1) + hTypeKeys ("<TAB><TAB><TAB>") + hTypeKeys ("<Return>") + hTypeKeys ("<ESCAPE>") sleep (5) - '/// Save the document in different formats... ///' - '/// Close the file. ///' - '/// Load the different files. ///' - call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. + call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. - '/// Delete the different files. ///' printlog " Will try to delete the directory: " + NewFileDir app.rmDir ConvertPath (gOfficePath + "user\work\LayoutTest\")' NewFileDir - '/// End the test ///' endcase 'tSaveLoadLayoutOutline '**************************************************************************************************** @@ -722,47 +642,37 @@ testcase tSaveLoadLayoutPicture NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\") - '/// Create New folder in the Work-directory ///' printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - '/// Create a new document, add a Layout, Save the document in different Formats, and open the saved files. ///' - '/// Make new Presentation ///' gApplication = "IMPRESS" Call hNewDocument - '/// Choose and Insert an Layout with a Graphic-field. ///' printlog "Choose and Insert an Layout with a Graphic-field." FormatModifyPage sleep 1 kontext "Tasks" - LayoutsPreview.TypeKeys "<HOME>" - kontext "Pagelayout_UndoDeleteWarning" - if Pagelayout_UndoDeleteWarning.exists then - Pagelayout_UndoDeleteWarning.ok + LayoutsPreview.TypeKeys "<HOME>" + kontext "Pagelayout_UndoDeleteWarning" + if Pagelayout_UndoDeleteWarning.exists then + Pagelayout_UndoDeleteWarning.ok endif kontext "Tasks" - '/// select the Picture placeholder and activate it with [Return] ///' - LayoutsPreview.TypeKeys ("<RIGHT>",8) - sleep (1) - LayoutsPreview.TypeKeys ("<Return>") - sleep (1) - hTypeKeys ("<TAB><TAB><TAB>") - hTypeKeys ("<Return>") - hTypeKeys ("<ESCAPE>") - sleep (5) - - '/// Save the document in different formats... ///' - '/// Close the file. ///' - '/// Load the different files. ///' - call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. - - '/// Delete the different files. ///' + LayoutsPreview.TypeKeys ("<RIGHT>",8) + sleep (1) + LayoutsPreview.TypeKeys ("<Return>") + sleep (1) + hTypeKeys ("<TAB><TAB><TAB>") + hTypeKeys ("<Return>") + hTypeKeys ("<ESCAPE>") + sleep (5) + + call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. + printlog " Will try to delete the directory: " + NewFileDir app.rmDir ConvertPath (gOfficePath + "user\work\LayoutTest\")' NewFileDir - '/// End the test ///' endcase 'tSaveLoadLayoutPicture '**************************************************************************************************** @@ -774,47 +684,37 @@ testcase tSaveLoadLayoutChart NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\") - '/// Create New folder in the Work-directory ///' printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - '/// Create a new document, add a Layout, Save the document in different Formats, and open the saved files. ///' - '/// Make new Presentation ///' gApplication = "IMPRESS" Call hNewDocument - '/// Choose and Insert an Layout with a Chart-field. ///' printlog "Choose and Insert an Layout with a Chart-field." FormatModifyPage sleep 1 kontext "Tasks" - LayoutsPreview.TypeKeys "<HOME>" - kontext "Pagelayout_UndoDeleteWarning" - if Pagelayout_UndoDeleteWarning.exists then - Pagelayout_UndoDeleteWarning.ok + LayoutsPreview.TypeKeys "<HOME>" + kontext "Pagelayout_UndoDeleteWarning" + if Pagelayout_UndoDeleteWarning.exists then + Pagelayout_UndoDeleteWarning.ok endif kontext "Tasks" - '/// select the Chart placeholder and activate it with [Return] ///' - LayoutsPreview.TypeKeys ("<RIGHT>",6) - sleep (1) - LayoutsPreview.TypeKeys ("<Return>") - sleep (1) - hTypeKeys ("<TAB><TAB><TAB>") - hTypeKeys ("<Return>") - hTypeKeys ("<ESCAPE>") - sleep (5) - - '/// Save the document in different formats... ///' - '/// Close the file. ///' - '/// Load the different files. ///' - call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. - - '/// Delete the different files. ///' + LayoutsPreview.TypeKeys ("<RIGHT>",6) + sleep (1) + LayoutsPreview.TypeKeys ("<Return>") + sleep (1) + hTypeKeys ("<TAB><TAB><TAB>") + hTypeKeys ("<Return>") + hTypeKeys ("<ESCAPE>") + sleep (5) + + call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. + printlog " Will try to delete the directory: " + NewFileDir app.rmDir ConvertPath (gOfficePath + "user\work\LayoutTest\")' NewFileDir - '/// End the test ///' endcase 'tSaveLoadLayoutChart '**************************************************************************************************** @@ -826,47 +726,37 @@ testcase tSaveLoadLayoutSpreadsheet NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\") - '/// Create New folder in the Work-directory ///' printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - '/// Create a new document, add a Layout, Save the document in different Formats, and open the saved files. ///' - '/// Make new Presentation ///' gApplication = "IMPRESS" Call hNewDocument - '/// Choose and Insert an Layout with a Spreadsheet-field. ///' printlog "Choose and Insert an Layout with a Spreadsheet-field." FormatModifyPage sleep 1 kontext "Tasks" - LayoutsPreview.TypeKeys "<HOME>" - kontext "Pagelayout_UndoDeleteWarning" - if Pagelayout_UndoDeleteWarning.exists then - Pagelayout_UndoDeleteWarning.ok + LayoutsPreview.TypeKeys "<HOME>" + kontext "Pagelayout_UndoDeleteWarning" + if Pagelayout_UndoDeleteWarning.exists then + Pagelayout_UndoDeleteWarning.ok endif kontext "Tasks" - '/// select the Spreadsheet placeholder and activate it with [Return] ///' - LayoutsPreview.TypeKeys ("<RIGHT>",7) - sleep (1) - LayoutsPreview.TypeKeys ("<Return>") - sleep (1) - hTypeKeys ("<TAB><TAB><TAB>") - hTypeKeys ("<Return>") - hTypeKeys ("<ESCAPE>") - sleep (5) - - '/// Save the document in different formats... ///' - '/// Close the file. ///' - '/// Load the different files. ///' - call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. - - '/// Delete the different files. ///' + LayoutsPreview.TypeKeys ("<RIGHT>",7) + sleep (1) + LayoutsPreview.TypeKeys ("<Return>") + sleep (1) + hTypeKeys ("<TAB><TAB><TAB>") + hTypeKeys ("<Return>") + hTypeKeys ("<ESCAPE>") + sleep (5) + + call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. + printlog " Will try to delete the directory: " + NewFileDir app.rmDir ConvertPath (gOfficePath + "user\work\LayoutTest\")' NewFileDir - '/// End the test ///' endcase 'tSaveLoadLayoutSpreadsheet '**************************************************************************************************** |