diff options
author | Joerg Skottke [jsk] <jsk@openoffice.org> | 2010-04-22 13:59:07 +0200 |
---|---|---|
committer | Joerg Skottke [jsk] <jsk@openoffice.org> | 2010-04-22 13:59:07 +0200 |
commit | 3838624a088cd2e06b097b084bb94b78e334d332 (patch) | |
tree | fc86b312f98cd96c4264dbeef6957993959f95ed /testautomation/math/required | |
parent | 8ea12b2273375008f127d7b285304d509a9ea925 (diff) |
vitomation01: #i109562 - Speedup
Diffstat (limited to 'testautomation/math/required')
-rw-r--r-- | testautomation/math/required/includes/m_001_.inc | 379 |
1 files changed, 205 insertions, 174 deletions
diff --git a/testautomation/math/required/includes/m_001_.inc b/testautomation/math/required/includes/m_001_.inc index 1e9a1be3fae3..7696cb852d29 100644 --- a/testautomation/math/required/includes/m_001_.inc +++ b/testautomation/math/required/includes/m_001_.inc @@ -39,7 +39,8 @@ Const cActFilterExt = ".odf" ' used filter for save (extension) ' Datei$ = convertpath( gOfficePath + "user\work\Erwin2"+cActFilterExt) ' Datei = convertpath(gofficepath + "user\work\test"+cActFilterExt) -sub M_001Printlog Chr(13) + "-- File Menu m_001_ --" +sub M_001_ + Printlog Chr(13) + "-- File Menu m_001_ --" cActFilter = gMathFilter @@ -104,76 +105,79 @@ testcase tmFileNew endcase testcase tmFilePassword + Dim DokumentPfad$ Dim Datei$ '/// open application ///' hFileCloseAll() hNewDocument '/// type a formula ///' - SchreibenInMathdok "a over b" + SchreibenInMathdok "a over b" : WaitSlot() printlog "'/// - save doc as "+cActFilter+" with passwd - ///'" - FileSaveAs + hUseAsyncSlot( "FileSaveAs" ) + Kontext "SpeichernDlg" - Datei$ = convertpath( gOfficePath + "user\work\killme" + cActFilterExt) - if Dir (Datei$) <> "" then kill Datei$ - printlog " Testfile: "+Datei$ - 'Dateityp.Select (cActFilter) - Passwort.Check - Dateiname.SetText Datei$ - Speichern.Click - Kontext "Active" - if Active.Exists (5) then - ' TBO: ??? what will be ??! - Printlog "(1/5) " + Active.GetText - Active.Yes - end if + if ( SpeichernDlg.exists( 2 ) ) then + Datei$ = convertpath( gOfficePath + "user\work\killme" + cActFilterExt) + hDeleteFile( Datei$ ) + + printlog " Testfile: "+Datei$ + Passwort.Check + Dateiname.SetText Datei$ + Speichern.Click + Kontext "Active" + if Active.Exists (5) then + ' TBO: ??? what will be ??! + Printlog "(1/5) " + Active.GetText + hCloseDialog( Active, "yes" ) + end if + else + warnlog( "File Save As dialog did not open" ) + endif printlog "'/// Try wrong passwd confirmation ///'" - Sleep 2 Kontext "PasswordFileSave" - sleep (2) - try + if ( PasswordFileSave.exists( 2 ) ) then Password.SetText "12345" PasswordConfirm.Settext "54321" - PasswordFileSave.OK - Sleep 2 - catch - warnlog "had to ask for passwd!!!!" - endcatch - Kontext - if (Active.Exists (5) = FALSE ) then - Warnlog "Wrong passwordinput not detected" + hCloseDialog( PasswordFileSave, "ok" ) else + warnlog( "Password dialog on File Save is missing" ) + endif + + Kontext + if ( Active.Exists ( 5 ) ) then Printlog "(2/5) " + Active.GetText - Active.OK + hCloseDialog( Active, "ok" ) + else + Warnlog "Wrong passwordinput not detected" end if printlog "'/// Now do it right ///'" Kontext "PasswordFileSave" - try + if ( PasswordFileSave.exists( 3 ) ) then Password.SetText "12345" PasswordConfirm.Settext "12345" - PasswordFileSave.OK - catch - warnlog "had to ask for passwd!!!!" - endcatch + hCloseDialog( PasswordFileSave, "ok" ) + else + warnlog( "Password dialog on File Save is missing" ) + endif - Sleep 2 printlog "'/// Gotcha & Close file/window ///'" - FileClose - sleep 1 + hUseAsyncSlot( "FileClose" ) printlog "'/// load again with wrong passwd ///'" - Call hFileOpen Datei$ - sleep 1 + Call hFileOpen( Datei$ ) + Kontext "PasswordFileOpen" - try + if ( PasswordFileOpen.exists( 3 ) ) then Passwortname.SetText "34567" - PasswordFileOpen.OK - catch - warnlog "had to ask for passwd!!!!" - endcatch + hCloseDialog( PasswordFileOpen, "ok" ) + else + warnlog( "Password dialog on File Open is missing" ) + endif + Kontext "Active" if Active.Exists(5) then Printlog "(3/5) " + Active.GetText @@ -183,29 +187,33 @@ testcase tmFilePassword end if printlog "'///load now with right passwd ///'" - Sleep 3 - 'Call hDateiOeffnen Datei$ Kontext "PasswordFileOpen" - try + if ( PasswordFileOpen.exists( 3 ) ) then Passwortname.SetText "12345" - PasswordFileOpen.OK - catch - warnlog "had to ask for passwd!!!!" - endcatch - Sleep 2 + hCloseDialog( PasswordFileOpen, "ok" ) + else + warnlog( "Password dialog on File Open is missing" ) + endif printlog "'/// - save doc with new name under 6.... (has to be automagical selected by loading this doc!) w/o passwd - ///'" Datei$ = convertpath( gOfficePath + "user\work\Erwin2"+cActFilterExt) - if Dir (Datei$) <> "" then kill Datei$ - FileSaveAs + hDeleteFile( Datei$ ) + + hUseAsyncSlot( "FileSaveAs" ) + Kontext "SpeichernDlg" - Dateiname.SetText Datei$ - if (Passwort.IsChecked <> TRUE) then - Warnlog "#i36015# Password has to be checked! :-(" - Passwort.Check - printlog "will be forced checked no!" + if ( SpeichernDlg.exists( 2 ) ) then + Dateiname.SetText Datei$ + if (Passwort.IsChecked <> TRUE) then + Warnlog "#i36015# Password has to be checked! :-(" + Passwort.Check + printlog "will be forced checked no!" + endif + Speichern.Click + else + warnlog( "File Save dialog is missing" ) endif - Speichern.Click + Kontext "Messagebox" '/// (if messagebox comes up, say YES) ///' if Messagebox.Exists(2) then @@ -213,33 +221,37 @@ testcase tmFilePassword endif '/// password dialog has to show up! ///' Kontext "PasswordFileSave" - if (PasswordFileSave.Exists(5) = FALSE)then - Warnlog "- Password dialog Didn't popped up after pressing save" - else - Kontext "PasswordFileSave" + if ( PasswordFileSave.exists( 2 ) ) then '/// type password "a12345", confirm password: "a12345" -> RIGHT ///' Password.SetText "a12345" PasswordConfirm.SetText "a12345" - PasswordFileSave.OK - sleep 2 - '/// close document ///' - FileClose - sleep 1 + hCloseDialog( PasswordFileSave, "ok" ) + else + warnlog( "Password dialog on FileSave is missing" ) endif + '/// close document ///' + hUseAsyncSlot( "FileClose" ) '/// open document ///' - FileOpen - sleep 1 + hUseAsyncSlot( "FileOpen" ) + Kontext "OeffnenDlg" - Dateiname.SetText Datei$ - Oeffnen.Click - Kontext "PasswordFileOpen" - sleep 1 - '/// type password: "a12345" -> RIGHT ///' - PasswortName.SetText "a12345" - PasswordFileOpen.OK - sleep 5 - '/// File->SaveAs ///' - FileSaveAs + if ( OeffnenDlg.exists( 2 ) ) then + Dateiname.SetText Datei$ + Oeffnen.Click + Kontext "PasswordFileOpen" + if ( PasswordFileOpen.exists( 2 ) ) then + '/// type password: "a12345" -> RIGHT ///' + PasswortName.SetText "a12345" + hCloseDialog( PasswordFileOpen, "ok" ) + else + warnlog( "Password dialog on FileOpen is missing" ) + endif + else + warnlog( "Failed to open File Open dialog" ) + endif + +'/// File->SaveAs ///' + hUseAsyncSlot( "FileSaveAs" ) Kontext "SpeichernDlg" Dateiname.SetText Datei$ if (Passwort.IsChecked <> TRUE) then @@ -258,9 +270,9 @@ testcase tmFilePassword if (PasswordFileSave.Exists(5))then Warnlog "- Password dialog neeedn't popped up after pressing save" Kontext "PasswordFileSave" - passwordFileSave.cancel + hCloseDialog( passwordFileSave, "cancel" ) '/// close document ///' - FileClose + hUseAsyncSlot( "FileClose" ) else '/// close document ///' hCloseDocument @@ -274,7 +286,7 @@ testcase tmFileReload dim sFilterExt() as string Datei = convertpath(gofficepath + "user\work\test"+cActFilterExt) - if Dir (Datei) <> "" then kill (Datei) + hDeleteFile( Datei ) ' make sure saving in latest math filter works, checking global filtername and if necessary change it sFilter = hGetUIFiltername("math8") @@ -284,19 +296,24 @@ testcase tmFileReload '/// type a formula ///' call SchreibenInMathdok "a over b" '/// File->Save As ///' - FileSaveAs + hUseAsyncSlot( "FileSaveAs" ) Kontext "SpeichernDlg" - '/// select the actual default file format ///' - Dateityp.Select (hFindFilterPosition( sFilter )) - '/// type a file name ///' - Dateiname.SetText Datei - '/// click button 'save' ///' - Speichern.Click - Kontext "Active" - if Active.Exists(2) then Active.Yes - sleep 3 + if ( SpeichernDlg.exists( 2 ) ) then + '/// select the actual default file format ///' + Dateityp.Select (hFindFilterPosition( sFilter )) + '/// type a file name ///' + Dateiname.SetText Datei + '/// click button 'save' ///' + Speichern.Click + Kontext "Active" + + if Active.Exists(2) then hCloseDialog( Active, "yes" ) + else + warnlog( "File Save dialog did not open" ) + endif + '/// File->Close ///' - FileClose + hUseAsyncSlot( "FileClose" ) Kontext if MessageBox.Exists (1) then WarnLog "After Saving and Closing the following MessageBox appears: " + MessageBox.GetText @@ -304,15 +321,15 @@ testcase tmFileReload end if '/// open just saved file ///' - Call hFileOpen Datei + Call hFileOpen( Datei ) '/// type a formula ///' + sleep( 2 ) call SchreibenInMathdok "a over b" - sleep (3) - '/// File->Reload ///' - FileReload - sleep (3) + sleep( 2 ) +'/// File->Reload ///' + hUseAsyncSlot( "FileReload" ) Kontext - if Active.Exists (1) then + if Active.Exists ( 3 ) then PrintLog "Say no to: " + Active.GetText '/// say NO to active ///' active.No @@ -320,9 +337,9 @@ testcase tmFileReload WarnLog "Missing smth to say no to! " end if - Sleep 3 + '/// File->Reload ///' - FileReload + hUseAsyncSlot( "FileReload" ) Kontext if Active.Exists (1) then PrintLog "Said yes to: " + Active.GetText @@ -381,16 +398,17 @@ testcase tmFileOpen '/// File->Open ///' FileOpen Kontext "OeffnenDlg" - '/// klick button 'Up one level' ///' - UebergeordneterOrdner.Click - '/// klick button 'Default Directory' ///' - Standard.Click - '/// check checkbox 'Read Only' ///' - NurLesen.check - Call DialogTest ( OeffnenDlg ) - '/// cancel dialog 'Open' ///' - OeffnenDlg.Cancel - Sleep 2 + if ( OeffnenDlg.exists( 2 ) ) then + '/// klick button 'Up one level' ///' + UebergeordneterOrdner.Click + '/// klick button 'Default Directory' ///' + Standard.Click + '/// check checkbox 'Read Only' ///' + NurLesen.check + Call DialogTest ( OeffnenDlg ) + '/// cancel dialog 'Open' ///' + hCloseDialog( OeffnenDlg, "cancel" ) + endif '/// close application ///' Call hCloseDocument endcase @@ -399,10 +417,11 @@ testcase tmFileClose '/// open application ///' hNewDocument ' just for the records: i open ONE document '/// type a formula ///' + sleep( 2 ) call SchreibenInMathdok "a over b" - sleep (2) - '/// File->Close ///' - FileClose + sleep( 2 ) +'/// File->Close ///' + hUseAsyncSlot( "FileClose" ) Kontext ' expecting 'modified, do you want to close?' if active.exists (5) then printlog " ok, active came up: " + active.gettext @@ -411,24 +430,27 @@ testcase tmFileClose else warnlog "active missing (1)" endif - sleep (2) + '/// File->Close ///' - FileClose + hUseAsyncSlot( "FileClose" ) Kontext '/// say YES to active about 'modified stuff :-)' ///' - Active.Yes ' but now - records: this document is closed - sleep (2) + hCloseDialog( Active, "yes" ) + Kontext "SpeichernDlg" - Call DialogTest ( SpeichernDlg ) - '/// cancel dialog 'Save As' ///' - SpeichernDlg.Cancel - sleep (2) + if ( SpeichernDlg.exists( 2 ) ) then + Call DialogTest ( SpeichernDlg ) + '/// cancel dialog 'Save As' ///' + hCloseDialog( SpeichernDlg, "cancel" ) + else + warnlog( "File Save dialog did not open" ) + endif '/// File->Close ///' - FileClose ' now the office gets closed! (if there were no modifications!) + hUseAsyncSlot( "FileClose" ) ' now the office gets closed! (if there were no modifications!) Kontext - if active.exists (5) then Active.No - sleep (2) + if active.exists (5) then hCloseDialog( Active, "No" ) + endcase testcase tmFileSave @@ -437,20 +459,23 @@ testcase tmFileSave '/// type a formula ///' call SchreibenInMathdok "a over b" '/// File->Save ///' - FileSave - sleep 2 + hUseAsyncSlot( "FileSave" ) + Kontext "SpeichernDlg" - UebergeordneterOrdner.click - Standard.Click - ' NeuerOrdner.Click - ' DateiAuswahl.TypeKeys "Hallo<Return>" - ' DateiLoeschen - ' Kontext "Messagebox" - ' MessageBox.Yes - Call DialogTest (SpeichernDlg) - '/// cancel dialog 'Save' ///' - SpeichernDlg.Cancel - sleep 2 + if ( SpeichernDlg.exists( 2 ) ) then + UebergeordneterOrdner.click + Standard.Click + ' NeuerOrdner.Click + ' DateiAuswahl.TypeKeys "Hallo<Return>" + ' DateiLoeschen + ' Kontext "Messagebox" + ' MessageBox.Yes + Call DialogTest (SpeichernDlg) + '/// cancel dialog 'Save' ///' + hCloseDialog( SpeichernDlg, "cancel" ) + else + warnlog( "File Save dialog did not open" ) + endif '/// close application ///' Call hCloseDocument endcase @@ -462,31 +487,32 @@ testcase tmFileSaveAs '/// type a formula ///' call SchreibenInMathdok "a over b" '/// File->Save As ///' - FileSaveAs - sleep 1 + hUseAsyncSlot( "FileSaveAs" ) + Kontext "SpeichernDlg" - if (SpeichernDlg.exists (5) = FALSE) then - warnlog "error :-(" + if (SpeichernDlg.exists ( 5 ) ) then + + '/// check ceckbox 'save with Password' ///' + Passwort.check + '/// UNcheck ceckbox 'save with Password' ///' + Passwort.uncheck + '/// click button 'up one level' ///' + UebergeordneterOrdner.click + '/// click button 'default directory' ///' + Standard.Click + '/// click button 'create new directory' ///' + NeuerOrdner.click + kontext "NeuerOrdner" + '/// cancel dialog 'create new folder' ///' + NeuerOrdner.cancel + Kontext "SpeichernDlg" + Call DialogTest (SpeichernDlg) + '/// cancel dialog 'Save As' ///' + hCloseDialog( SpeichernDlg, "cancel" ) + else + warnlog( "File Save dialog did not open" ) endif - sleep 2 - '/// check ceckbox 'save with Password' ///' - Passwort.check - '/// UNcheck ceckbox 'save with Password' ///' - Passwort.uncheck - '/// click button 'up one level' ///' - UebergeordneterOrdner.click - '/// click button 'default directory' ///' - Standard.Click - '/// click button 'create new directory' ///' - NeuerOrdner.click - kontext "NeuerOrdner" - '/// cancel dialog 'create new folder' ///' - NeuerOrdner.cancel - Kontext "SpeichernDlg" - Call DialogTest (SpeichernDlg) - '/// cancel dialog 'Save As' ///' - SpeichernDlg.Cancel - sleep (2) + '/// close application ///' Call hCloseDocument endcase @@ -583,7 +609,7 @@ testcase tmExportAsPDF Standard.Click '///+ - cancel dialog ///' Kontext "ExportierenDlg" - ExportierenDlg.Cancel + hCloseDialog( ExportierenDlg, "cancel" ) '/// close application ///' Call hCloseDocument @@ -593,7 +619,7 @@ testcase tmFileProperties '/// open application ///' Call hNewDocument '/// File->Properties... ///' - FileProperties + hUseAsyncSlot( "FileProperties" ) Kontext '/// select tabpage 'General' ///' @@ -612,7 +638,7 @@ testcase tmFileProperties active.SetPage TabInternet Kontext "TabInternet" Call DialogTest (TabInternet) - TabInternet.Cancel + hCloseDialog( TabInternet, "cancel" ) '/// close application ///' Call hCloseDocument @@ -629,26 +655,31 @@ testcase tmFileProperties Kontext "InfonamenBearbeiten" Call DialogTest (InfonamenBearbeiten) '/// close dialog 'edit field names' ///' - InfoNamenBearbeiten.Cancel + hCloseDialog( InfoNamenBearbeiten, "cancel" ) endcase testcase tmFilePrinterSetting '/// open application ///' Call hNewDocument - sleep 3 - '/// File->Printer Settings ///' - FilePrintersettings + +'/// File->Printer Settings ///' + hUseAsyncSlot( "FilePrintersettings" ) kontext if active.exists(2) then active.ok qaerrorlog "There is no printer available - please install one on your system!" endif + Kontext "DruckerEinrichten" - Call DialogTest (DruckerEinrichten) - sleep 2 - '/// cancel dialog 'printer setup' ///' - DruckerEinrichten.Cancel - sleep 2 + if ( DruckerEinrichten.exists( 2 ) ) then + Call DialogTest (DruckerEinrichten) + + '/// cancel dialog 'printer setup' ///' + hCloseDialog( DruckerEinrichten, "cancel" ) + else + warnlog( "Printer Configuration dialog did not open" ) + endif + '/// close application ///' Call hCloseDocument endcase |