diff options
Diffstat (limited to 'testautomation/writer/tools/includes')
-rwxr-xr-x | testautomation/writer/tools/includes/w_tool1.inc | 61 | ||||
-rw-r--r-- | testautomation/writer/tools/includes/w_tool2.inc | 69 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/writer/tools/includes/w_tool3.inc | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/writer/tools/includes/w_tool4.inc | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | testautomation/writer/tools/includes/w_tool6.inc | 50 | ||||
-rw-r--r--[-rwxr-xr-x] | testautomation/writer/tools/includes/w_tools.inc | 77 |
6 files changed, 94 insertions, 171 deletions
diff --git a/testautomation/writer/tools/includes/w_tool1.inc b/testautomation/writer/tools/includes/w_tool1.inc index 34b83bc5e97b..6150cb8e1fbc 100755 --- a/testautomation/writer/tools/includes/w_tool1.inc +++ b/testautomation/writer/tools/includes/w_tool1.inc @@ -154,32 +154,48 @@ end sub sub hEinfuegenFloatingFrame InsertFloatingFrame + Kontext "TabEigenschaften" - FrameName.SetText "Hallo" - Inhalt.SetText ConvertPath ( gTesttoolpath + "input\desktop\frameset.htm" ) - TabEigenschaften.OK - Sleep 10 + if ( Tabeigenschaften.exists( 2 ) ) then + FrameName.SetText "Hallo" + Inhalt.SetText ConvertPath ( gTesttoolpath + "input\desktop\frameset.htm" ) + hCloseDialog( TabEigenschaften, "ok" ) + else + warnlog( "Failed to open <TabEigenschaften>" ) + endif end sub ' ----------------------------------------------------------------------- sub hEinfuegenRahmen + InsertFrame + Kontext - Active.SetPage TabType - Kontext "TabType" - TabType.OK - Sleep 3 + if ( Active.exists( 2 ) ) then + Active.SetPage TabType + Kontext "TabType" + hCloseDialog( TabType, "ok" ) + else + warnlog( "Failed to open <TabType>" ) + endif + end sub ' ----------------------------------------------------------------------- sub hEinfuegenChart + InsertObjectChart + Kontext "AutoformatDiagramm1" - Fertigstellen.Click - WaitSlot() ' NOOP + if ( AutoformatDiagramm1.exists( 2 ) ) then + hClickButton( Fertigstellen ) + else + warnlog( "Failed to open <AutoformatDiagramm1>" ) + endif + end sub ' ----------------------------------------------------------------------- @@ -315,6 +331,8 @@ end sub '---------------------------------------------------------------- sub sMenufunktionen(Fuer_Was as string) + + const RC_FAILURE = -1 Dim i as integer Kontext "FormControls" @@ -336,33 +354,20 @@ sub sMenufunktionen(Fuer_Was as string) next i Kontext - try - FormatControl - WaitSlot() + if ( hUseAsyncSlot( "FormatControl" ) <> RC_FAILURE ) then Kontext "ControlPropertiesDialog" if ControlPropertiesDialog.Exists( 2 ) then - ControlPropertiesDialog.Close - ControlPropertiesDialog.notExists( 2 ) - else - FormatControl - Wait 500 - Kontext "ControlPropertiesDialog" - if ControlPropertiesDialog.Exists( 2 ) then - ControlPropertiesDialog.Close - ControlPropertiesDialog.notExists( 2 ) - else - Warnlog " - Controlfieldproperties "+ Fuer_Was +" from Menu not available!" - end if - end if + hCloseDialog( ControlPropertiesDialog, "close" ) + endif printlog Fuer_Was - catch + else if gPlatform = "osx" then Warnlog "#i82427#-Mac OS X (Aqua): Drawing function does not draw anything" else Warnlog " - Controlfieldproperties "+ Fuer_Was +" from Menu not available!" end if - endcatch + endif Call wTypeKeys "<Escape>" Kontext "FormControls" diff --git a/testautomation/writer/tools/includes/w_tool2.inc b/testautomation/writer/tools/includes/w_tool2.inc index 44e78fd589b4..0aa4238520a1 100644 --- a/testautomation/writer/tools/includes/w_tool2.inc +++ b/testautomation/writer/tools/includes/w_tool2.inc @@ -28,13 +28,6 @@ '* ** '* short description : Description of file ** '* ** -'******************************************************************* -'* ** -' #1 OptionenAufrufen -' #1 CheckUberpruefen -' #1 UnCheckUeberpruefen -' #1 WortErgaenzen -'* ** '\****************************************************************** sub OptionenAufrufen(Seite as string) @@ -346,7 +339,7 @@ function wDeleteAutotext(vAutotextName as string) as boolean Dim bDeleted as boolean Dim sAllGroups as integer Dim sAllInGroups as integer - + Kontext "Autotext" if Not Autotext.Exists then EditAutotext @@ -370,36 +363,36 @@ function wDeleteAutotext(vAutotextName as string) as boolean ' count all groups sAllGroups = Liste.GetItemCount ' travel through all groups - For ik = 1 to sAllGroups - Liste.Select ik - Liste.TypeKeys "+" - - sAllInGroups = Liste.GetItemCount - sAllGroups - For j = 1 to sAllInGroups - Liste.TypeKeys "<Down>" - if Liste.Gettext = vAutotextName then - try - Menue.Click - wait 500 - Call hMenuSelectNr ( 3 ) - Kontext "Active" - if Active.Exists and Active.GetRT = 304 then - Active.yes - wDeleteAutotext = true - else - Warnlog "No messages to confirm deleting the Autotext!" - end if - bDeleted = true - exit for - catch - Warnlog "Menu Autotext->'Delete' disabled ! Test failed !" - endcatch - end if - next j - if bDeleted = true then exit for - ' close group + For ik = 1 to sAllGroups + Liste.Select ik + Liste.TypeKeys "+" + + sAllInGroups = Liste.GetItemCount - sAllGroups + For j = 1 to sAllInGroups + Liste.TypeKeys "<Down>" + if Liste.Gettext = vAutotextName then + try + Menue.Click + wait 500 + Call hMenuSelectNr ( 3 ) + Kontext "Active" + if Active.Exists and Active.GetRT = 304 then + Active.yes + wDeleteAutotext = true + else + Warnlog "No messages to confirm deleting the Autotext!" + end if + bDeleted = true + exit for + catch + Warnlog "Menu Autotext->'Delete' disabled ! Test failed !" + endcatch + end if + next j + if bDeleted = true then exit for + ' close group Liste.Select ik - Liste.TypeKeys "-" + Liste.TypeKeys "-" next ik end function @@ -420,4 +413,4 @@ sub wChangeDefaultView() Massstab.Ok Call hCloseDocument -end sub
\ No newline at end of file +end sub diff --git a/testautomation/writer/tools/includes/w_tool3.inc b/testautomation/writer/tools/includes/w_tool3.inc index 8be27ca7bc3c..235d66c86f07 100644..100755 --- a/testautomation/writer/tools/includes/w_tool3.inc +++ b/testautomation/writer/tools/includes/w_tool3.inc @@ -33,7 +33,7 @@ sub InTabelleKontrollieren Call wTypeKeys ("<Home>") Call wTypeKeys ("<Tab><Shift End>") - EditCopy + hUseAsyncSlot( "EditCopy" ) if GetClipBoardText <> "Text" then Warnlog "Text has not been inserted in a table" else @@ -45,7 +45,7 @@ end sub ' **** sub InTabelleKontrollierenExtra Call wTypeKeys ("<Home><Shift Tab><Shift End>") - EditCopy + hUseAsyncSlot( "EditCopy" ) if GetClipBoardText <> "Der" then Warnlog "Text has not been inserted in a table" else @@ -57,7 +57,7 @@ end sub '*** sub InTextKontrollieren Call wTypeKeys ("<Home><Shift Mod1 Right>") - EditCopy + hUseAsyncSlot( "EditCopy" ) if Left$(GetClipBoardText,3) <> "Der" AND Left$(GetClipboardText,4) <> "Der " then Warnlog "Table has not been changed to text" else diff --git a/testautomation/writer/tools/includes/w_tool4.inc b/testautomation/writer/tools/includes/w_tool4.inc index 78cee6ca3042..8b8c52e12627 100644..100755 --- a/testautomation/writer/tools/includes/w_tool4.inc +++ b/testautomation/writer/tools/includes/w_tool4.inc @@ -143,7 +143,7 @@ function wGetSpellcheckDocumentName(xCategory as integer) as string end select if sReturn <> "None" then - if hFileExists(sTemp) then + if FileExists(sTemp) then sReturn = sTemp else sReturn = "Empty" diff --git a/testautomation/writer/tools/includes/w_tool6.inc b/testautomation/writer/tools/includes/w_tool6.inc index caba673ae6be..0da02a8373a7 100644..100755 --- a/testautomation/writer/tools/includes/w_tool6.inc +++ b/testautomation/writer/tools/includes/w_tool6.inc @@ -575,54 +575,6 @@ end function '-------------------------------------------------------------- -function hIsNamedDocLoaded (ShouldFile as String) as Boolean - '/// Input: name of loaded file; Output: True/False///' - '///+ Several checks may be combined: ///' - '///+ disabled: Plan A: requires clippboard: check, if not untitled 1 window... ///' - '///+ Plan B: SaveAs Dialog ///' - '///+ not used now: Plan C: check if hNavigatorOpenWindows() > 0 ///' - - '///' Plan A :-( /// - ''///+ to be able to check, that document was loaded, print something before opening new doc ///' - ''///+ during test, check if it is readable ... ///' - ' Kontext "DocumentWriter" - ' DocumentWriter.TypeKeys "<Mod1 home>" - ' DocumentWriter.TypeKeys "TBOlastWindow" - ' DocumentWriter.TypeKeys "<Return>" - - ' Kontext "DocumentWriter" - ' DocumentWriter.TypeKeys "<Mod1 Home>" - ' DocumentWriter.TypeKeys "<Shift End>" - ' EditCopy - ' DocumentWriter.TypeKeys "<Home>" - ' if GetClipboardText <> "TBOlastWindow" Then ///' - - '/// ' Plan B :-) /// - '///+' if a doc got loaded, the filename in a 'SaveAs' Dlg is different from "" /// - '///+' usually the file name of the loaded document with an changed extension chosen from SO /// - - hIsNamedDocLoaded = False ' Let's start WorstCase :-( - FileSaveAs ' (Plan B) - Kontext "SpeichernDlg" - If DateiOhneExt(DateiExtract(Dateiname.GetSelText)) = DateiOhneExt(DateiExtract(ShouldFile)) Then - hIsNamedDocLoaded = True - ' Printlog "Filename: " + Dateiname.GetSelText+"; "+ShouldFile - ' Printlog "--------------------------------------------------Loaded as: " + Dateityp.GetSelText - Else - 'exception! for templates - if lcase(right(ShouldFile,3)) = "vor" or lcase(right(ShouldFile,3)) = "dot" then hIsNamedDocLoaded = True - End If - SpeichernDlg.Cancel - - '/ remove text of last window test text ///' - ' Kontext "DocumentWriter" - ' DocumentWriter.TypeKeys "<Mod1 home>" - ' DocumentWriter.TypeKeys "TBOlastWindow" - ' DocumentWriter.TypeKeys "<delete>" -end function - -'-------------------------------------------------------------- - sub hSetSpellHypLanguage dim sTrieit if bAsianLan then @@ -753,7 +705,7 @@ end sub function fInsertFrame (x1 as Integer , y1 as Integer , x2 as Integer , y2 as Integer) 'This function will insert a frame with the coordinate - Call wDocSetContext + hSetDocumentContext() Call hToolbarSelect("INSERT", true ) Sleep 1 diff --git a/testautomation/writer/tools/includes/w_tools.inc b/testautomation/writer/tools/includes/w_tools.inc index 122a44f7da53..e2edcc69f640 100755..100644 --- a/testautomation/writer/tools/includes/w_tools.inc +++ b/testautomation/writer/tools/includes/w_tools.inc @@ -64,6 +64,7 @@ end sub ' ----------------------------------------------------------------------- sub wTypeKeys ( OutputText , optional iLoop as Integer ) + Dim i as integer If lcase(OutputText) = "<mod1 a>" then If iSprache = 34 then OutputText = "<Mod1 E>" @@ -90,35 +91,7 @@ sub wTypeKeys ( OutputText , optional iLoop as Integer ) end select wait 500 next i -end sub - -' ----------------------------------------------------------------------- - -sub wDocSetContext - Select Case Ucase(gApplication) - Case "WRITER" - Kontext "DocumentWriter" - - Case "MASTERDOCUMENT" - Kontext "DocumentMasterDoc" - - Case "HTML" - Kontext "DocumentWriterWeb" - - Case "IMPRESS" - Kontext "DocumentImpress" - Case "DRAW" - Kontext "DocumentDraw" - - Case "MATH" - Kontext "DocumentMath" - - Case "CALC" - Kontext "DocumentCalc" - - end select - wait 500 end sub ' ----------------------------------------------------------------------- @@ -176,28 +149,28 @@ sub wZeichenobjektEinfuegen ( Objekt$, xStart%, yStart%, xEnde%, yEnde%, optiona Objekt = UCase( Objekt ) select case Objekt - case "RECHTECK" : Rechteck.Click - case "LINIE" : Linie.Click - case "ELLIPSE" : Ellipse.Click - case "TEXT" : Textobjekt.Click - case "VTEXT" : - try - VerticalText.Click - catch - if gAsianSup = True then - Warnlog "Unable to insert Vertical Text! Asian Support in Options activated ?" - end if - endcatch - case "LAUFTEXT" : Lauftext.Click - case "LEGENDE" : Legende.Click - case "VLEGENDE" : - try - VerticalCallout.Click - catch - Warnlog "Unable to insert Vertical Callout! Asian Support in Options activated ?" - endcatch + case "RECHTECK" : Rechteck.Click + case "LINIE" : Linie.Click + case "ELLIPSE" : Ellipse.Click + case "TEXT" : Textobjekt.Click + case "VTEXT" : + try + VerticalText.Click + catch + if gAsianSup = True then + Warnlog "Unable to insert Vertical Text! Asian Support in Options activated ?" + end if + endcatch + case "LAUFTEXT" : Lauftext.Click + case "LEGENDE" : Legende.Click + case "VLEGENDE" : + try + VerticalCallout.Click + catch + Warnlog "Unable to insert Vertical Callout! Asian Support in Options activated ?" + endcatch end select - Sleep (2) + Sleep (2) Select Case gApplication Case "WRITER" @@ -236,7 +209,7 @@ sub wZeichenobjektEinfuegen ( Objekt$, xStart%, yStart%, xEnde%, yEnde%, optiona wait 100 end if end select - sleep (1) + sleep (1) end sub ' ----------------------------------------------------------------------- @@ -534,7 +507,7 @@ sub wNavigatorAuswahl(Gruppe as integer, Eintrag as integer,optional LeaveFocus Sleep 2 - Select Case Ucase(gApplication) + Select Case gApplication Case "CALC" if (Liste.GetItemCount < MinEntrys) then Umschalten.Click if Liste.GetItemCount >MinEntrys then @@ -552,7 +525,7 @@ sub wNavigatorAuswahl(Gruppe as integer, Eintrag as integer,optional LeaveFocus Liste.TypeKeys "<Return>" end if - Case "WRITER","HTML", "HTML" + Case "WRITER","HTML" if (Auswahlliste.GetItemCount < MinEntrys) then try Inhaltsansicht.Click |