diff options
Diffstat (limited to 'testautomation/graphics/optional/includes/global/g_load_save.inc')
-rw-r--r-- | testautomation/graphics/optional/includes/global/g_load_save.inc | 357 |
1 files changed, 176 insertions, 181 deletions
diff --git a/testautomation/graphics/optional/includes/global/g_load_save.inc b/testautomation/graphics/optional/includes/global/g_load_save.inc index 8d64e158eb2a..d0d51e8337c7 100644 --- a/testautomation/graphics/optional/includes/global/g_load_save.inc +++ b/testautomation/graphics/optional/includes/global/g_load_save.inc @@ -45,76 +45,79 @@ ' #1 tSaveLoadLayoutSpreadsheet '\************************************************************************************* testcase tFileOpenSaveEtc - Dim Dokument$ - Dim Dokument2$ + Dim Dokument$ + Dim Dokument2$ 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?' ///' + printlog "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 ///' + printlog "open application" hNewDocument gMouseclick 90,90 - '/// create a textframe with content ///' + printlog "create a textframe with content" Call hTextrahmenErstellen ( "This is a test",20,20,40,30 ) - '/// save file as 'test1' ///' + printlog "save file as 'test1'" hFileSaveAsKill (Dokument$ + "." + ExtensionString) Sleep 10 - '/// close Document ///' + printlog "close Document" hCloseDocument - printlog "- Document Saved and Closed" + printlog "Document Saved and Closed" - '/// load document 'test1' ///' + printlog "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 + Sleep 10 + printlog "close Document" + hCloseDocument + printlog "- document Loaded and closed" + Sleep 10 + printlog "load document 'test1'" + hFileOpen (Dokument$ + "." + ExtensionString) + printlog "check if the document is writable" + 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 + endif + endif + Sleep 10 + gMouseclick 90,90 + printlog "create another textbox with content" + Call hTextrahmenerstellen ( "Change",60,60,80,80 ) + printlog "File->Close needn't work, just say CANCEL to the question about saving changes!" + FileClose + Kontext + printlog "message about 'something changed should i [overwrite discard cancel]?'" + if Messagebox.exists (5) then printlog "2:"+messagebox.gettext Messagebox.Cancel - else + else Warnlog "Mesagebox is missing :-(" - endif - printlog "- Document loaded, changed and closed discarding all changes" + endif + printlog "Document loaded, changed and closed discarding all changes" - printlog "- Last version" - try - FileReload '/// File Reload ///' + printlog "Last version" + try + printlog "File Reload" + FileReload + catch + kontext "DocumentImpress" + try + printlog "File Reload" + FileReload catch - kontext "documentimpress" - try - FileReload '/// File Reload ///' - catch - warnlog "Damn reload ?? Why ? BREAKPOINT! File reload doesn't work. Create new object and try again :-(" + warnlog "BREAKPOINT! File reload doesn't work. Create new object and try again :-(" endcatch endcatch Kontext @@ -128,22 +131,24 @@ testcase tFileOpenSaveEtc 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 ///' + printlog "new textbox" + Call hTextrahmenErstellen ("Change2",10,10,50,20 ) 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 + 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 ///' + printlog "Close document" + FileClose sleep 10 Kontext "Messagebox" if Messagebox.Exists Then @@ -152,42 +157,42 @@ testcase tFileOpenSaveEtc end if sleep 2 printlog "- Loading write protected file" - FileOpen '/// Open write protected file ///' + FileOpen + printlog "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" + Sleep 10 + printlog "check if the document is writable" + try + printlog "attempt to create a textbox" + Call hTextrahmenErstellen ( "Hello",85,85,95,95 ) + 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" + Printlog "- Write protected document could not be edited" endcatch sleep 5 - FileClose '/// Close document ///' + printlog "Close document" + FileClose endcase 'tFileOpenSaveEtc -'-------------------------------------------------------- +'------------------------------------------------------------------------------- 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) - if (gApplication = "IMPRESS") then ExtensionString = "odp" else ExtensionString = "odg" end if - FileProperties - Kontext active.SetPage TabDokumentinfo Kontext "TabDokumentinfo" @@ -212,9 +217,7 @@ testcase tFileProperties RefreshThisDocument.Check TabInternet.OK - hFileSaveAsKill ConvertPath (gOfficePath + "user\work\eigen." & ExtensionString) - FileClose Kontext "Active" if Active.Exists(2) then Active.Yes @@ -223,45 +226,45 @@ testcase tFileProperties Sleep 2 hFileOpen ConvertPath (gOfficePath + "user\work\eigen." + ExtensionString) - ' check if the document is writable + printlog "check if the document is writable" if fIsDocumentWritable = false then - ' make the document writable and check if it's succesfull + 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 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 - -'******************************************************************************************** + 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 'tFileProperties + +'------------------------------------------------------------------------------- testcase tFilePassword52 Dim Datei$ @@ -271,7 +274,6 @@ testcase tFilePassword52 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$) @@ -290,9 +292,9 @@ testcase tFilePassword52 endif hCloseDocument next i -endcase +endcase 'tFilePassword52 -'******************************************************************************************** +'------------------------------------------------------------------------------- testcase tFileOpenImport dim q as integer @@ -324,28 +326,28 @@ testcase tFileOpenImport if (gApplication="DRAW") then Call hCloseDocument endif -endcase +endcase 'tFileOpenImport -'******************************************************************************************** +'------------------------------------------------------------------------------- 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 + printlog "tries to load a DXF-document which has a string-leght of 255 characters." + dim q as integer + call hNewDocument + printlog "insert graphic " + InsertGraphicsFromFile + 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 + Kontext "GrafikEinfuegenDlg" + sleep 2 + Dateiname.SetText (ConvertPath (gTesttoolpath + "graphics\required\input\255chars.dxf")) + Oeffnen.Click + Sleep 2 if gApplication = "DRAW" then Kontext "Documentdraw" @@ -375,7 +377,7 @@ dim q as integer Call hCloseDocument endcase 'tTestDXF255CharBug -'******************************************************************************************** +'------------------------------------------------------------------------------- testcase tDeletedTemplate dim i as integer @@ -395,35 +397,35 @@ testcase tDeletedTemplate - '/// delete previous created documents: 'user\\work\\test*.odp' ///' + printlog "delete previous created documents: 'user\\work\\test*.odp'" if Dir (Dokument1$) <> "" then kill Dokument1$ if Dir (Dokument2$) <> "" then kill Dokument2$ - '/// open application ///' + printlog "open application" hNewDocument gMouseclick 90,90 - '/// create a textframe with content ///' + printlog "create a textframe with content" Call hTextrahmenErstellen ( "This is the first file",20,20,40,30 ) - '/// save file as 'test1.odp' ///' + printlog "save file as 'test1.odp'" hFileSaveAsKill (Dokument1$) Sleep 10 - '/// close Document ///' + printlog "close Document" hCloseDocument printlog "- Document 'test1.odp' Saved and Closed" - '/// open application again ///' + printlog "open application again" hNewDocument gMouseclick 90,90 - '/// create another textframe with content ///' + printlog "create another textframe with content" Call hTextrahmenErstellen ( "This is the second file",20,20,40,30 ) - '/// save file as 'test2.odp' ///' + printlog "save file as 'test2.odp'" hFileSaveAsKill (Dokument2$) Sleep 10 - '/// close Document ///' + printlog "close Document" hCloseDocument printlog "- Document 'test2.odp' Saved and Closed" - '/// Delete the first file ///' + printlog "Delete the first file" try kill Dokument1$ Printlog " Correctly deleted the file: " + Dokument1$ @@ -431,28 +433,29 @@ testcase tDeletedTemplate 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 + printlog "File => New => Presentation" + printlog "new document-autopilot" + FileAutopilotPresentation + 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 @@ -473,7 +476,7 @@ testcase tDeletedTemplate if found = true then warnlog " An error-message showed up. Eventually a result of '138498'" AutopilotPraesentation1.Cancel Sleep 2 - '/// Delete the second file ///' + printlog "Delete the second file" try kill Dokument2$ Printlog " Correctly deleted the file: " + Dokument2$ @@ -482,7 +485,7 @@ testcase tDeletedTemplate endcatch endcase 'tDeletedTemplate -'**************************************************************************************************** +'------------------------------------------------------------------------------- testcase tSaveLoadLayoutEmpty Dim NewFileDir as String @@ -492,7 +495,6 @@ testcase tSaveLoadLayoutEmpty printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - gApplication = "IMPRESS" Call hNewDocument @@ -510,13 +512,12 @@ testcase tSaveLoadLayoutEmpty sleep (5) call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. - - printlog " Will try to delete the directory: " + NewFileDir + printlog "Will try to delete the directory: " + NewFileDir app.rmDir NewFileDir endcase 'tSaveLoadLayoutEmpty -'**************************************************************************************************** +'------------------------------------------------------------------------------- testcase tSaveLoadLayoutOLE qaerrorlog "not yet ready" @@ -525,7 +526,7 @@ testcase tSaveLoadLayoutOLE NewFileDir = ConvertPath (gOfficePath + "user\work\LayoutTest\") - printlog " Will try to create the directory: " + NewFileDir + printlog "Will try to create the directory: " + NewFileDir app.mkdir NewFileDir @@ -563,12 +564,12 @@ testcase tSaveLoadLayoutOLE call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. - printlog " Will try to delete the directory: " + NewFileDir + printlog "Will try to delete the directory: " + NewFileDir app.rmDir ConvertPath (gOfficePath + "user\work\LayoutTest\")' NewFileDir endcase 'tSaveLoadLayoutOLE -'**************************************************************************************************** +'------------------------------------------------------------------------------- testcase tSaveLoadLayoutText qaerrorlog "not yet ready" @@ -580,7 +581,6 @@ testcase tSaveLoadLayoutText printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - gApplication = "IMPRESS" Call hNewDocument @@ -601,17 +601,16 @@ testcase tSaveLoadLayoutText hTypeKeys ("<TAB><TAB><TAB>") hTypeKeys ("<Return>") hTypeKeys ("<ESCAPE>") - ' LayoutsPreview.TypeKeys "<RETURN>" sleep (5) call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. - printlog " Will try to delete the directory: " + NewFileDir + printlog "Will try to delete the directory: " + NewFileDir app.rmDir ConvertPath (gOfficePath + "user\work\LayoutTest\")' NewFileDir endcase 'tSaveLoadLayoutText -'**************************************************************************************************** +'------------------------------------------------------------------------------- testcase tSaveLoadLayoutOutline qaerrorlog "not yet ready" @@ -623,7 +622,6 @@ testcase tSaveLoadLayoutOutline printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - gApplication = "IMPRESS" Call hNewDocument @@ -653,7 +651,7 @@ testcase tSaveLoadLayoutOutline endcase 'tSaveLoadLayoutOutline -'**************************************************************************************************** +'------------------------------------------------------------------------------- testcase tSaveLoadLayoutPicture qaerrorlog "not yet ready" @@ -665,7 +663,6 @@ testcase tSaveLoadLayoutPicture printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - gApplication = "IMPRESS" Call hNewDocument @@ -695,7 +692,7 @@ testcase tSaveLoadLayoutPicture endcase 'tSaveLoadLayoutPicture -'**************************************************************************************************** +'------------------------------------------------------------------------------- testcase tSaveLoadLayoutChart qaerrorlog "not yet ready" @@ -707,7 +704,6 @@ testcase tSaveLoadLayoutChart printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - gApplication = "IMPRESS" Call hNewDocument @@ -737,7 +733,7 @@ testcase tSaveLoadLayoutChart endcase 'tSaveLoadLayoutChart -'**************************************************************************************************** +'------------------------------------------------------------------------------- testcase tSaveLoadLayoutSpreadsheet qaerrorlog "not yet ready" @@ -749,7 +745,6 @@ testcase tSaveLoadLayoutSpreadsheet printlog " Will try to create the directory: " + NewFileDir app.mkdir NewFileDir - gApplication = "IMPRESS" Call hNewDocument @@ -774,10 +769,10 @@ testcase tSaveLoadLayoutSpreadsheet call fSaveLoadAllFormats (NewFileDir) 'Runs the Function below. - printlog " Will try to delete the directory: " + NewFileDir + printlog "Will try to delete the directory: " + NewFileDir app.rmDir ConvertPath (gOfficePath + "user\work\LayoutTest\")' NewFileDir endcase 'tSaveLoadLayoutSpreadsheet -'**************************************************************************************************** +'------------------------------------------------------------------------------- |