summaryrefslogtreecommitdiff
path: root/testautomation/writer/optional/includes/drawing
diff options
context:
space:
mode:
Diffstat (limited to 'testautomation/writer/optional/includes/drawing')
-rwxr-xr-xtestautomation/writer/optional/includes/drawing/w_drawing_tools1.inc1027
-rwxr-xr-xtestautomation/writer/optional/includes/drawing/w_drawing_tools2.inc698
2 files changed, 1725 insertions, 0 deletions
diff --git a/testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc b/testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc
new file mode 100755
index 000000000000..659bb2a4ddb7
--- /dev/null
+++ b/testautomation/writer/optional/includes/drawing/w_drawing_tools1.inc
@@ -0,0 +1,1027 @@
+'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 : helge.delfs@oracle.com
+'*
+'* short description : Test of the drawing tools
+'*
+'\***********************************************************************
+
+sub w_drawing_tools1
+
+ printLog Chr(13) + "- Test of the drawing tools 1"
+
+ printLog Chr(13) + " -- Format/Position And Size"
+
+ Call tCreateObjects_1 'Create objects from the drawing functions of the Toolbar
+
+ Call tPositionAndSize_1 'check checkbox "protect position" of the object
+ Call tPositionAndSize_2 'check Undo/Redo function of position assignment
+ Call tPositionAndSize_3 'check "keep ratio" option
+ Call tPositionAndSize_4 'check Undo/Redo function of size assignment
+ Call tPositionAndSize_5 'check rotation angle of an object
+ Call tPositionAndSize_6 'check corner radius of rectangles
+ Call tPositionAndSize_7 'check corner radius of textboxes
+ Call tPositionAndSize_8
+
+ printLog Chr(13) + " -- Format/line"
+ 'Dialog format/line/line
+ Call tLine_1 'check style, color, width and arrow styles . Test undo and redo .
+ Call tLine_2 'Check call Format.Line dialog via Button in object bar
+ Call tLine_3 'check line attributes are applied in object bar
+ Call tLine_4 'check "synchronize ends"
+ 'Dialog format/line/line styles
+ Call tline_5 'check the attributes in format/line/line styles
+ 'Dialog format/line/arrow styles
+ Call tline_6 'check the attributes in format/line/arrow styles
+
+end sub
+
+'-------------------------------------------------------------------------
+
+testcase tCreateObjects_1
+
+ PrintLog "- Create objects from the drawing functions of the Toolbar , include ..."
+
+ Call hNewDocument
+
+ Call hToolbarSelect("DRAWING", true)
+
+ PrintLog "- Draw a line"
+ Kontext "Drawbar"
+ Linie.Click
+ gMouseMove(30,30,55,55)
+ gMouseClick (75,5)
+ Sleep 1
+
+ PrintLog "- Draw a rectangle"
+ Kontext "Drawbar"
+ Rechteck.Click
+ gMouseMove(35,35,40,40)
+ gMouseClick (75,5)
+ Sleep 1
+
+ PrintLog "- Draw a ellipse (circle)"
+ Kontext "Drawbar"
+ Ellipse.Click
+ Call gMouseMove(50,30,75,50)
+ gMouseClick (75,5)
+ Sleep 1
+
+ PrintLog "- Draw textobject"
+ Kontext "Drawbar"
+ Textobjekt.Click
+ gMouseMove(40,60,60,75)
+ Sleep 1
+ Kontext "DocumentWriter"
+ Call wTypeKeys "This is StarOffice Test !"
+ gMouseClick (75,5)
+
+ PrintLog "- Draw callouts"
+ Kontext "Drawbar"
+ Legende.Click
+ gMouseMove(30,80,50,95)
+ gMouseClick (75,5)
+ Sleep 1
+
+ Kontext "Drawbar"
+ Drawbar.Close
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tPositionAndSize_1
+
+ Dim sPositionX as String
+ Dim sPositionY as String
+ Dim sPositionXMove as String
+ Dim sPositionYMove as String
+
+ sPositionX = "3" + gSeperator + "00" + gMeasurementUnit
+ sPositionY = "3" + gSeperator + "00" + gMeasurementUnit
+ sPositionXMove = "5" + gSeperator + "00" + gMeasurementUnit
+ sPositionYMove = "5" + gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- Check the checkbox 'protect position' of the object"
+
+ Call hNewDocument
+
+ PrintLog "- Insert a drawing object (rectangle)"
+ Call wZeichenobjektEinfuegen("RECHTECK", 30, 40, 60, 60)
+ Call gMouseClick(40,50)
+
+ printLog "when 'protect position' is Checked"
+ PrintLog "- Format/Position and size /Position and size ,"
+ PrintLog "- + set positionX and positionY , and Check 'postion' in protect area"
+ PrintLog "- + close the dialogue and reopen it"
+ PrintLog "- check wether the rectangle can be removed when 'protect position' is Checked"
+ fPositionAndSize("TabPositionAndSizeWriter")
+
+ Horizontalby.Settext "3"
+ Verticalby.Settext "3"
+ ProtectPosition.Check
+
+ TabPositionAndSizeWriter.OK
+ Sleep 1
+
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<Right>",2
+ Call wTypeKeys "<Down>" ,2
+ Sleep 1
+
+ fPositionAndSize("TabPositionAndSizeWriter")
+
+ if Horizontalby.Gettext <> sPositionX then Warnlog "X-Position is wrong: Not -> "+sPositionX+" but -> "+Horizontalby.Gettext
+ if Verticalby.Gettext <> sPositionY then Warnlog "Y-Position is wrong: Not -> "+sPositionY+" but -> "+Verticalby.Gettext
+
+ ProtectPosition.UnCheck
+ TabPositionAndSizeWriter.OK
+
+ PrintLog "- check wether the rectangle can be removed when 'protect position' is UnChecked"
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<Right>",2
+ Call wTypeKeys "<Down>" ,2
+ Sleep 1
+
+ fPositionAndSize("TabPositionAndSizeWriter")
+
+ if Horizontalby.Gettext <> sPositionXMove then Warnlog "X-Position is wrong: Not -> "+sPositionXMove+" but -> "+Horizontalby.Gettext
+ if Verticalby.Gettext <> sPositionYMove then Warnlog "Y-Position is wrong: Not -> "+sPositionYMove+" but -> "+Verticalby.Gettext
+
+ TabPositionAndSizeWriter.OK
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tPositionAndSize_2
+
+ Dim sPositionX as String
+ Dim sPositionY as String
+ Dim sPositionXMove as String
+ Dim sPositionYMove as String
+
+ sPositionX = "3" + gSeperator + "00" + gMeasurementUnit
+ sPositionY = "3" + gSeperator + "00" + gMeasurementUnit
+ sPositionXMove = "4" + gSeperator + "00" + gMeasurementUnit
+ sPositionYMove = "4" + gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- check Undo/Redo function of position assignment"
+
+ Call hNewDocument
+
+ PrintLog "- Insert a drawing object (rectangle)"
+ Call wZeichenobjektEinfuegen("RECHTECK", 30, 40, 60, 60)
+ Call gMouseClick(40,50)
+
+ fPositionAndSize("TabPositionAndSizeWriter")
+ Horizontalby.Settext "3"
+ Verticalby.Settext "3"
+ TabPositionAndSizeWriter.OK
+ Sleep 1
+
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<Right>"
+ Call wTypeKeys "<Down>"
+ Sleep 1
+
+ PrintLog "- check undo function"
+ EditUndo
+ Sleep 1
+ EditUndo
+ Sleep 1
+
+ fPositionAndSize("TabPositionAndSizeWriter")
+ if Horizontalby.Gettext <> sPositionX then Warnlog "#i40845# X-Position is wrong: Not -> "+sPositionX+" but -> "+Horizontalby.Gettext
+ if Verticalby.Gettext <> sPositionY then Warnlog "Y-Position is wrong: Not -> "+sPositionY+" but -> "+Verticalby.Gettext
+ TabPositionAndSizeWriter.Cancel
+
+ PrintLog "- check redo function"
+ EditRedo
+ Sleep 1
+ EditRedo
+ Sleep 1
+
+ fPositionAndSize("TabPositionAndSizeWriter")
+ if Horizontalby.Gettext <> sPositionXMove then Warnlog "X-Position is wrong: Not -> "+sPositionXMove+" but -> "+Horizontalby.Gettext
+ if Verticalby.Gettext <> sPositionYMove then Warnlog "Y-Position is wrong: Not -> "+sPositionYMove+" but -> "+Verticalby.Gettext
+ TabPositionAndSizeWriter.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tPositionAndSize_3
+
+ Dim sWidth as String
+ Dim sHeight as String
+ Dim sWidthChange as String
+ Dim sHeightChange as String
+
+ sHeightChange = "8" + gSeperator + "00" + gMeasurementUnit
+ sWidthChange = "6" + gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- check 'keep ratio' option"
+
+ Call hNewDocument
+
+ PrintLog "- Insert a drawing object (rectangle)"
+ Call wZeichenobjektEinfuegen("RECHTECK", 30, 40, 60, 60)
+ Call gMouseClick(40,50)
+
+ fPositionAndSize("TabPositionAndSizeWriter")
+
+ PrintLog "- Check when ratio is 5:4"
+ Width.Settext "5"
+ Height.Settext "4"
+
+ KeepRatio.Check
+ Width.Settext "10"
+ Sleep 2
+ if Height.GetText <> sHeightChange then Warnlog "Height is wrong: Not -> "+sHeightChange+" but -> "+Height.GetText
+
+ KeepRatio.UnCheck
+ PrintLog "- Check when ratio is 3:5"
+ Width.Settext "3"
+ Height.Settext "5"
+
+ KeepRatio.Check
+ Height.Settext "10"
+ Sleep 2
+ if Width.GetText <> sWidthChange then Warnlog "Width is wrong: Not -> "+sWidthChange+" but -> "+Width.GetText
+
+ 'Recover to the default
+ KeepRatio.UnCheck
+ TabPositionAndSizeWriter.OK
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tPositionAndSize_4
+
+ Dim sWidth as String
+ Dim sHeight as String
+ Dim sWidthChange as String
+ Dim sHeightChange as String
+
+ sWidth = "5" + gSeperator + "00" + gMeasurementUnit
+ sHeight = "4" + gSeperator + "00" + gMeasurementUnit
+ sWidthChange = "8" + gSeperator + "00" + gMeasurementUnit
+ sHeightChange = "6" + gSeperator + "00" + gMeasurementUnit
+
+ PrintLog "- check Undo/Redo function of size assignment"
+
+ Call hNewDocument
+
+ PrintLog "- Insert a drawing object (rectangle) , and set the first Size"
+ Call wZeichenobjektEinfuegen("RECHTECK", 30, 40, 60, 60)
+ Call gMouseClick(40,50)
+
+ fPositionAndSize("TabPositionAndSizeWriter")
+ Width.Settext sWidth
+ Height.Settext sHeight
+ TabPositionAndSizeWriter.OK
+ Sleep 1
+
+ PrintLog "- Set the second Size."
+ fPositionAndSize("TabPositionAndSizeWriter")
+ Width.Settext sWidthChange
+ Height.Settext sHeightChange
+ TabPositionAndSizeWriter.OK
+ Sleep 1
+
+ PrintLog "- check undo function"
+ EditUndo
+ Sleep 1
+ fPositionAndSize("TabPositionAndSizeWriter")
+ if Width.GetText <> sWidth then Warnlog "Width is wrong: Not -> "+sWidth+" but -> "+Width.GetText
+ if Height.GetText <> sHeight then Warnlog "Height is wrong: Not -> "+sHeight+" but -> "+Height.GetText
+ TabPositionAndSizeWriter.Cancel
+
+ PrintLog "- check redo function"
+ EditRedo
+ Sleep 1
+
+ fPositionAndSize("TabPositionAndSizeWriter")
+ if Width.GetText <> sWidthChange then Warnlog "Width is wrong: Not -> "+sWidthChange+" but -> "+Width.GetText
+ if Height.GetText <> sHeightChange then Warnlog "Height is wrong: Not -> "+sHeightChange+" but -> "+Height.GetText
+ TabPositionAndSizeWriter.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tPositionAndSize_5
+
+ PrintLog "- check rotation angle of an object"
+
+ Call hNewDocument
+
+ PrintLog "- Insert a drawing object (rectangle) , and set its rotation angle"
+ Call wZeichenobjektEinfuegen("RECHTECK", 30, 40, 60, 60)
+ Call gMouseClick(40,50)
+
+ Call fPositionAndSize("TabDrehung")
+ Winkel.SetText "45"
+ TabDrehung.OK
+ Sleep 1
+
+ Call fPositionAndSize("TabDrehung")
+ if Left$(Winkel.GetText,5) <> "45" + gSeperator + "00" then
+ Warnlog "The rotation angle isn't corroct! It should be 45" & gSeperator & "00, but get " + Left$(Winkel.GetText, 5)
+ end if
+ TabDrehung.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tPositionAndSize_6
+
+ Dim sRadius as String
+
+ sRadius = "0" + gSeperator + "50" + gMeasurementUnit
+
+ PrintLog "- check corner radius of rectangles"
+
+ Call hNewDocument
+
+ PrintLog "- Insert a rectangle , and set its corner radius."
+ Call wZeichenobjektEinfuegen("RECHTECK", 30, 40, 60, 60)
+ Call gMouseClick(40,50)
+
+ fPositionAndSize("TabSchraegstellen")
+ Radius.SetText sRadius
+ TabSchraegstellen.OK
+ Sleep 1
+
+ fPositionAndSize("TabSchraegstellen")
+ if Radius.GetText <> sRadius then Warnlog "The Radius isn't corroct! It should be " +sRadius + " , but was " +Radius.GetText
+ TabSchraegstellen.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tPositionAndSize_7
+
+ Dim sRadius as String
+
+ sRadius = "0" + gSeperator + "50" + gMeasurementUnit
+
+ PrintLog "- check corner radius of textboxes."
+
+ Call hNewDocument
+
+ PrintLog "- Insert a rectangle , and set its corner radius"
+
+ Call wZeichenobjektEinfuegen("TEXT", 30, 40, 60, 60)
+ Call wTypeKeys "The test for corner radius of textboxes..."
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<ESCAPE>"
+
+ fPositionAndSize("TabSchraegstellen")
+ Radius.SetText sRadius
+ TabSchraegstellen.OK
+ Sleep 1
+
+ fPositionAndSize("TabSchraegstellen")
+ if Radius.GetText <> sRadius then Warnlog "The Radius isn't corroct! It should be " +sRadius + " ,but get " +Radius.GetText
+ TabSchraegstellen.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tPositionAndSize_8
+
+ Dim sPositionStartX as String
+ Dim sPositionStartY as String
+ Dim sWidth as String
+ Dim sHeight as String
+ Dim sPivotDefaultX as String
+ Dim sPivotDefaultY as String
+ Dim sPivotStartX as String
+ Dim sPivotStartY as String
+ Dim sPivotEndX as String
+ Dim sPivotEndY as String
+
+ sPositionStartX = "3" + gSeperator + "00" + gMeasurementUnit
+ sPositionStartY = "3" + gSeperator + "00" + gMeasurementUnit
+ sWidth = "4" + gSeperator + "00" + gMeasurementUnit
+ sHeight = "3" + gSeperator + "00" + gMeasurementUnit
+
+ sPivotDefaultX = "5" + gSeperator + "00" + gMeasurementUnit
+ sPivotDefaultY = "4" + gSeperator + "50" + gMeasurementUnit
+ sPivotStartX = "3" + gSeperator + "50" + gMeasurementUnit
+ sPivotStartY = "2" + gSeperator + "50" + gMeasurementUnit
+ sPivotEndX = "6" + gSeperator + "50" + gMeasurementUnit
+ sPivotEndY = "6" + gSeperator + "50" + gMeasurementUnit
+
+ PrintLog "- check 'keep ratio' option"
+
+ Call hNewDocument
+
+ PrintLog "- Insert a drawing object (rectangle)"
+ Call wZeichenobjektEinfuegen("RECHTECK", 30, 40, 60, 60)
+ Call gMouseClick(40,50)
+
+ fPositionAndSize("TabPositionAndSizeWriter")
+ Width.Settext sWidth
+ Height.Settext sHeight
+ Horizontalby.Settext sPositionStartX
+ Verticalby.Settext sPositionStartY
+ TabPositionAndSizeWriter.OK
+ Sleep 1
+ fPositionAndSize("TabDrehung")
+ Winkel.SetText "270"
+ TabDrehung.OK
+ Sleep 1
+
+ fPositionAndSize("TabDrehung")
+ if PositionX.Gettext <> sPivotDefaultX then Warnlog "X-Position is wrong: Not -> "+sPivotDefaultX+" but -> "+PositionX.Gettext
+ if PositionY.Gettext <> sPivotDefaultY then Warnlog "Y-Position is wrong: Not -> "+sPivotDefaultY+" but -> "+PositionY.Gettext
+
+ Drehpunkt.TypeKeys "<Up>"
+ Drehpunkt.TypeKeys "<Left>"
+
+ if PositionX.Gettext <> sPivotStartX then Warnlog "X-Position is wrong: Not -> "+sPivotStartX+" but -> "+PositionX.Gettext
+ if PositionY.Gettext <> sPivotStartY then Warnlog "Y-Position is wrong: Not -> "+sPivotStartY+" but -> "+PositionY.Gettext
+
+ Drehpunkt.TypeKeys "<Right>" , 2
+ Drehpunkt.TypeKeys "<Down>" , 2
+
+ if PositionX.Gettext <> sPivotEndX then Warnlog "X-Position is wrong: Not -> "+sPivotEndX+" but -> "+PositionX.Gettext
+ if PositionY.Gettext <> sPivotEndY then Warnlog "Y-Position is wrong: Not -> "+sPivotEndY+" but -> "+PositionY.Gettext
+ TabDrehung.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tLine_1
+
+ Dim iLineStyle as Integer
+ Dim iColor as Integer
+ Dim iArrowStyleLeft as Integer
+ Dim iArrowStyleRight as Integer
+ Dim sLineWidth as String
+ Dim sTransparency as String
+ Dim sArrowWidthLeft as String
+ Dim sArrowWidthRight as String
+
+ Dim iLineStyleDefault as Integer
+ Dim iColorDefault as Integer
+ Dim iArrowStyleLeftDefault as Integer
+ Dim iArrowStyleRightDefault as Integer
+ Dim sLineWidthDefault as String
+ Dim sTransparencyDefault as String
+ Dim sArrowWidthLeftDefault as String
+ Dim sArrowWidthRightDefault as String
+
+ sTransparency = "25%"
+ iLineStyle = 3
+ iColor = 7
+ iArrowStyleLeft = 2
+ iArrowStyleRight = 3
+ sLineWidth = "0" + gSeperator + "10" + gMeasurementUnit
+ sArrowWidthLeft = "0" + gSeperator + "55" + gMeasurementUnit
+ sArrowWidthRight = "0" + gSeperator + "60" + gMeasurementUnit
+
+ PrintLog "- check style, color, width and arrow styles"
+
+ Call hNewDocument
+
+ PrintLog "- Insert a line"
+ Call wZeichenobjektEinfuegen("LINIE", 40,40 , 60,50 , false)
+ Sleep 2
+ Call gMouseClick(40,40)
+ Sleep 2
+ Call wTypeKeys ( "<Shift F4>" )
+ Sleep 1
+
+ PrintLog "- modify Style ,color , width and arrow styles"
+ fFormatLine("TabLinie")
+
+ iLineStyleDefault = Stil.GetSelIndex
+ iColorDefault = Farbe.GetSelIndex
+ slineWidthDefault = Breite.GetText
+ sTransparencyDefault = Transparenz.GetText
+ iArrowStyleLeftDefault = StilLinks.GetSelIndex
+ iArrowStyleRightDefault = StilRechts.GetSelIndex
+ sArrowWidthLeftDefault = BreiteLinks.GetText
+ sArrowWidthRightDefault = BreiteRechts.GetText
+
+ PrintLog "- Line properties , include :"
+ PrintLog "- - Style"
+ Stil.Select iLineStyle
+ wait 500
+ PrintLog "- - Color"
+ Farbe.Select iColor
+ wait 500
+ PrintLog "- - Width"
+ Breite.SetText sLineWidth
+ wait 500
+ PrintLog "- - Transparency"
+ Transparenz.SetText sTransparency
+ wait 500
+
+ PrintLog "- Arrow styles , include :"
+ PrintLog "- - Synchronize ends"
+ EndenSynchronisieren.UnCheck
+ PrintLog "- - Style (left and right)"
+ StilLinks.Select iArrowStyleLeft
+ StilRechts.Select iArrowStyleRight
+ wait 500
+ PrintLog "- - Width (left and right)"
+ BreiteLinks.SetText sArrowWidthLeft
+ BreiteRechts.SetText sArrowWidthRight
+ PrintLog "- - Center (left and right)"
+ ZentriertLinks.Check
+ ZentriertRechts.Check
+
+ TabLinie.OK
+
+ PrintLog "- Check all changes"
+ fFormatLine("TabLinie")
+
+ if Stil.GetSelIndex <> iLineStyle then Warnlog "Line style is wrong."
+ if Farbe.GetSelIndex <> iColor then Warnlog "Line color is wrong."
+ if Breite.GetText <> sLineWidth then Warnlog "Line width is wrong."
+ if Transparenz.GetText <> sTransparency then Warnlog "Line transparency is wrong."
+
+ if EndenSynchronisieren.IsChecked = TRUE then Warnlog "Synchronize ends should NOT be checked."
+ if StilLinks.GetSelIndex <> iArrowStyleLeft then Warnlog "The left arrow style is wrong."
+ if StilRechts.GetSelIndex <> iArrowStyleRight then Warnlog "The right arrow style is wrong."
+ if BreiteLinks.GetText <> sArrowWidthLeft then Warnlog "The left arrow width is wrong."
+ if BreiteRechts.GetText <> sArrowWidthRight then Warnlog "The right arrow width is wrong."
+ if ZentriertLinks.IsChecked <> TRUE then Warnlog "The left 'center' should be checked"
+ if ZentriertRechts.IsChecked <> TRUE then Warnlog "The right 'center' should be checked"
+ TabLinie.Cancel
+
+ PrintLog "- Test Undo function"
+ Kontext "DocumentWriter"
+ EditUndo
+ Sleep 1
+
+ fFormatLine("TabLinie")
+ if Stil.GetSelIndex <> iLineStyleDefault then Warnlog "Line style is wrong."
+ if Farbe.GetSelIndex <> iColorDefault then Warnlog "Line color is wrong."
+ if Breite.GetText <> sLineWidthDefault then Warnlog "Line width is wrong."
+ if Transparenz.GetText <> sTransparencyDefault then Warnlog "Line transparency is wrong."
+
+ if EndenSynchronisieren.IsChecked = TRUE then Warnlog "Synchronize ends should NOT be checked."
+ if StilLinks.GetSelIndex <> iArrowStyleLeftDefault then Warnlog "The left arrow style is wrong."
+ if StilRechts.GetSelIndex <> iArrowStyleRightDefault then Warnlog "The right arrow style is wrong."
+ if BreiteLinks.GetText <> sArrowWidthLeftDefault then Warnlog "The left arrow width is wrong."
+ if BreiteRechts.GetText <> sArrowWidthRightDefault then Warnlog "The right arrow width is wrong."
+ if ZentriertLinks.IsChecked = TRUE then Warnlog "The left 'center' should be checked"
+ if ZentriertRechts.IsChecked = TRUE then Warnlog "The right 'center' should be checked"
+ TabLinie.Cancel
+
+ PrintLog "- Test Redo function"
+ Kontext "DocumentWriter"
+ EditRedo
+ Sleep 1
+
+ fFormatLine("TabLinie")
+ if Stil.GetSelIndex <> iLineStyle then Warnlog "Line style is wrong."
+ if Farbe.GetSelIndex <> iColor then Warnlog "Line color is wrong."
+ if Breite.GetText <> sLineWidth then Warnlog "Line width is wrong."
+ if Transparenz.GetText <> sTransparency then Warnlog "Line transparency is wrong."
+
+ if EndenSynchronisieren.IsChecked = TRUE then Warnlog "Synchronize ends should NOT be checked."
+ if StilLinks.GetSelIndex <> iArrowStyleLeft then Warnlog "The left arrow style is wrong."
+ if StilRechts.GetSelIndex <> iArrowStyleRight then Warnlog "The right arrow style is wrong."
+ if BreiteLinks.GetText <> sArrowWidthLeft then Warnlog "The left arrow width is wrong."
+ if BreiteRechts.GetText <> sArrowWidthRight then Warnlog "The right arrow width is wrong."
+ if ZentriertLinks.IsChecked <> TRUE then Warnlog "The left 'center' should be checked"
+ if ZentriertRechts.IsChecked <> TRUE then Warnlog "The right 'center' should be checked"
+ TabLinie.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tLine_2
+
+ PrintLog "- Check call Format.Line dialog via Button in object bar."
+
+ Call hNewDocument
+
+ PrintLog "- Insert a line."
+ Call wZeichenobjektEinfuegen("LINIE", 40,40 , 60,50 , false)
+ Sleep 2
+ Call gMouseClick(40,40)
+ Sleep 2
+ Call wTypeKeys ( "<Shift F4>" )
+ Sleep 1
+
+ PrintLog "- call Format/Line dialog via Button in object bar."
+ try
+ Kontext "DrawingObjectbar"
+ Linie.Click
+ Kontext
+ active.SetPage TabLinie
+ Sleep 1
+ Kontext "TabLinie"
+ Kontext
+ active.SetPage TabLinienstile
+ Sleep 1
+ Kontext "TabLinienstile"
+ Kontext
+ active.SetPage TabLinienenden
+ Sleep 1
+ Kontext "TabLinienenden"
+ TabLinienenden.Cancel
+ catch
+ Warnlog "Can't call format/line via Button in object bar."
+ endcatch
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tLine_3
+
+ Dim iLineStyle as Integer
+ Dim iColor as Integer
+ Dim iArrowStyleLeft as Integer
+ Dim iArrowStyleRight as Integer
+ Dim sLineWidth as String
+
+ iLineStyle = 4
+ iColor = 5
+ iArrowStyleLeft = 4
+ iArrowStyleRight = 6
+
+ PrintLog "- check line attributes are applied in object bar ,include -"
+
+ Call hNewDocument
+
+ PrintLog "- Insert a line"
+ Call wZeichenobjektEinfuegen("LINIE", 40,40 , 60,50 , false)
+ Sleep 2
+ Call gMouseClick(40,40)
+ Sleep 2
+ Call wTypeKeys ( "<Shift F4>" )
+ Sleep 1
+
+ PrintLog "- set Arrow Styles"
+ Kontext "DrawingObjectbar"
+ Linienendenstil.TearOff
+ Kontext "Linienenden"
+ Sleep 1
+ Auswahl.TypeKeys "<Down>" , 4
+ Sleep 2
+ Auswahl.TypeKeys "<Return>"
+ Sleep 2
+ Auswahl.TypeKeys "<Right>"
+ Sleep 2
+ Auswahl.TypeKeys "<Down>" , 2
+ Sleep 2
+ Auswahl.TypeKeys "<Return>"
+ Sleep 2
+ Linienenden.Close
+ Sleep 2
+
+ PrintLog "- set Line Style"
+ Kontext "DrawingObjectbar"
+ Linienstil.Select iLineStyle
+
+ PrintLog "- + Line Width"
+ Linienbreite.More 4
+ sLineWidth = Linienbreite.GetText
+
+ PrintLog "- + Line Color"
+ Linienfarbe.Select iColor
+
+ PrintLog "- check the lines status"
+ fFormatLine("TabLinie")
+ if Stil.GetSelIndex <> iLineStyle then Warnlog "Line style is wrong."
+ if Farbe.GetSelIndex <> iColor then Warnlog "Line color is wrong."
+ if Breite.GetText <> sLineWidth then warnlog "Line width is wrong."
+
+ if StilLinks.GetSelIndex <> iArrowStyleLeft then Warnlog "Arrow style is not correctly shown in format dialog"
+ if StilRechts.GetSelIndex <> iArrowStyleRight then Warnlog "Arrow style is not correctly shown in format dialog"
+
+ TabLinie.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tLine_4
+
+ Dim iArrowStyleLeft as Integer
+ Dim iArrowStyleRight as Integer
+
+ iArrowStyleLeft = 2
+ iArrowStyleRight = 3
+
+ PrintLog "- check 'synchronize ends'"
+
+ Call hNewDocument
+
+ Call wZeichenobjektEinfuegen("LINIE", 40,40 , 60,50 , false)
+ Sleep 2
+ Call gMouseClick(40,40)
+ Sleep 2
+ Call wTypeKeys ( "<Shift F4>" )
+ Sleep 1
+
+ fFormatLine("TabLinie")
+ PrintLog "- Check Synchronize ends"
+ EndenSynchronisieren.Check
+
+ PrintLog "- Style (left and right)"
+ StilLinks.Select iArrowStyleLeft
+ Sleep 1
+ if StilRechts.GetSelIndex <> iArrowStyleLeft then Warnlog "The right arrow style is wrong."
+
+ StilRechts.Select iArrowStyleRight
+ Sleep 1
+ if StilLinks.GetSelIndex <> iArrowStyleRight then Warnlog "The left arrow style is wrong."
+
+ TabLinie.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tLine_5
+
+ Dim iLineTypeLeft as Integer
+ Dim iLineTypeRight as Integer
+ Dim sLineStyle as String
+ Dim sRightLength as String
+ Dim sSpace as String
+ Dim sLeftNumber as String
+ Dim sRightNumber as String
+
+ sLineStyle = "myTest"
+ iLineTypeLeft = 1
+ iLineTypeRight = 2
+ sLeftNumber = "3"
+ sRightNumber = "2"
+ sRightLength = "0" + gSeperator + "30" + gMeasurementUnit
+ sSpace = "0" + gSeperator + "10" + gMeasurementUnit
+
+ PrintLog "- check 'check the attributes in format/line/line styles'"
+
+ Call hNewDocument
+
+ Call wZeichenobjektEinfuegen("LINIE", 40,40 , 60,50 , false)
+ Sleep 2
+ Call gMouseClick(40,40)
+ Sleep 2
+ Call wTypeKeys ( "<Shift F4>" )
+ Sleep 1
+
+ Call fFormatLine("TabLinienstile")
+
+ AnLinienbreite.UnCheck
+
+ TypLinks.Select iLineTypeLeft
+ TypRechts.Select iLineTypeRight
+ AnzahlLinks.SetText sLeftNumber
+ AnzahlRechts.SetText sRightNumber
+ LaengeRechts.SetText sRightLength
+ Abstand.SetText sSpace
+ TabLinienstile.OK
+ Sleep 1
+
+ Kontext
+ Kontext "Linienstil"
+ if Linienstil.Exists then
+ Hinzufuegen.Click
+ else
+ Warnlog "The dialog doesn't appear ! No test for this case"
+ Kontext "TabLinienstile"
+ goto NoTEST
+ end if
+ Sleep 1
+
+ Kontext
+ Kontext "LinieName"
+
+ if LinieName.Exists then
+ Sleep 1
+ Eingabefeld.SetText sLineStyle
+ Sleep 1
+ LinieName.OK
+ Sleep 1
+ else
+ Warnlog "The dialog doesn't appear !"
+ Goto endsub
+ end if
+
+ Call fFormatLine("TabLinienstile")
+ Sleep 2
+ if AnLinienbreite.IsChecked = TRUE then Warnlog "Fit to line width should NOT be checked"
+ Sleep 1
+ if TypLinks.GetSelIndex <> iLineTypeLeft then Warnlog "The left line type is wrong !"
+ Sleep 1
+ if TypRechts.GetSelIndex <> iLineTypeRight then Warnlog "The right line type is wrong !"
+ Sleep 1
+ if AnzahlLinks.GetText <> sLeftNumber then Warnlog "The left number is wrong !"
+ Sleep 1
+ if AnzahlRechts.GetText <> sRightNumber then Warnlog "The right number is wrong !"
+ Sleep 1
+ if LaengeLinks.IsEnabled then Warnlog "The left length should be unable !"
+ Sleep 1
+ if LaengeRechts.GetText <> sRightLength then Warnlog "The right length is wrong !"
+ Sleep 1
+ if Abstand.GetText <> sSpace then Warnlog "The spacing is wrong !"
+ Sleep 1
+
+NoTEST:
+ 'delete the testing line type , recover to the default
+ Loeschen.Click
+ Sleep 1
+ Kontext "Active"
+ if Active.Exists then
+ if Active.GetRT = 304 then
+ Active.Yes
+ Sleep 1
+ else
+ Warnlog "Something wrong when deleting the new line type!"
+ end if
+ end if
+
+ Kontext
+ Kontext "TabLinienstile"
+ TabLinienstile.OK
+ Sleep 1
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tLine_6
+
+ Dim i as Integer
+ Dim sArrowTitle1 as String
+ Dim sArrowTitle2 as String
+ Dim soeFile as String
+ Dim soeDefaultFile as String
+
+ sArrowTitle1 = "myTest1"
+ sArrowTitle2 = "myTest2"
+
+ soeFile = ConvertPath(gOfficePath + "user\work\standard_reserver.soe")
+ soeDefaultFile = ConvertPath(gOfficePath + "user\config\standard.soe")
+
+ if FileExists ( soeFile ) then app.kill ( soeFile )
+
+ PrintLog "- check the attributes in format/line/arrow styles"
+
+ Call hNewDocument
+
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 40, 40, 60)
+ Call wZeichenobjektEinfuegen("ELLIPSE", 32, 65, 40, 85)
+
+ Call wZeichenobjektEinfuegen("LINIE", 30,40 , 60,50 , false)
+ Call gMouseClick(30,40)
+
+ PrintLog "- add the first test arrow type."
+ fFormatLine("TabLinienenden")
+ PrintLog "- save the arrow types first."
+ Speichern.Click
+ Kontext
+ Kontext "SpeichernDlg"
+ Dateiname.SetText soeFile
+ Speichern.Click
+ Sleep 2
+
+ Kontext
+ Kontext "TabLinienenden"
+ PrintLog "- delete the all arrow types."
+ if Loeschen.IsEnabled then
+ for i = 1 to Liste.GetItemCount
+ Loeschen.Click
+ Kontext "Active"
+ if Active.Exists then
+ if Active.GetRT = 304 then
+ Active.Yes
+ else
+ Warnlog "Something wrong when deleting the arrow types!"
+ end if
+ end if
+ Kontext
+ Kontext "TabLinienenden"
+ next i
+ end if
+
+ Hinzufuegen.Click
+ Kontext
+ Kontext "LinieName"
+ Eingabefeld.SetText sArrowTitle1
+ LinieName.OK
+
+ Kontext
+ Kontext "TabLinienenden"
+ TabLinienenden.OK
+
+ PrintLog "- add the second test arrow type."
+ Call wZeichenobjektEinfuegen("LINIE", 30,70 , 60,50 , false)
+ Call gMouseClick(30,70)
+ fFormatLine("TabLinienenden")
+ Hinzufuegen.Click
+ Kontext
+ Kontext "LinieName"
+ Eingabefeld.SetText sArrowTitle2
+ LinieName.OK
+
+ Kontext
+ Kontext "TabLinienenden"
+ TabLinienenden.OK
+
+ Call gMouseClick(30,40)
+ fFormatLine("TabLinienenden")
+
+ Liste.Select 1
+ if TextFeld.GetText <> sArrowTitle1 then Warnlog "The first arraw title is wrong, hope "+sArrowTitle1+ " but get " +TextFeld.GetText
+ Liste.Select 2
+ if TextFeld.GetText <> sArrowTitle2 then Warnlog "The first arraw title is wrong, hope "+sArrowTitle2+ " but get " +TextFeld.GetText
+
+ Oeffnen.Click
+ Kontext
+ Kontext "OeffnenDlg"
+ Pfad.SetText soeFile
+ Oeffnen.Click
+ Sleep 1
+ Kontext
+ Kontext "TabLinienenden"
+
+ if FileExists ( soeDefaultFile ) then app.kill ( soeDefaultFile )
+
+ Speichern.Click
+ Kontext
+ Kontext "SpeichernDlg"
+ Dateiname.SetText soeDefaultFile
+ Speichern.Click
+ Sleep 2
+
+ Kontext
+ Kontext "TabLinienenden"
+ TabLinienenden.OK
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
diff --git a/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc b/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc
new file mode 100755
index 000000000000..8b6b8e8329e8
--- /dev/null
+++ b/testautomation/writer/optional/includes/drawing/w_drawing_tools2.inc
@@ -0,0 +1,698 @@
+'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 : helge.delfs@oracle.com
+'*
+'* short description : Test of the drawing tools - group
+'*
+'\***********************************************************************
+
+sub w_drawing_tools2
+
+ printLog Chr(13) + "- Test of the drawing tools 2 -- Group"
+ 'Group objects
+ Call tGroup_1 'Generate a objects group via menu Format/Group/Group
+ Call tGroup_2 'Generate a objects group via contextmenu Format/Group/Group
+ Call tGroup_3 'Menu entries may not be enabled if less then two objects are selected
+ Call tGroup_4 'Name a selected object group via Menu Format/Name object
+ Call tGroup_5 'Name a selected object group via context menu Name object
+ Call tGroup_6 'Edit object group via Menu Format/Group/Edit Group
+ Call tGroup_7 'Edit object group via context menu Group/Edit Group
+ Call tGroup_8 'Leave object group via Menu Format/Group/Exit Group
+ Call tGroup_9 'Leave object group via context menu Group/Exit Group
+ Call tGroup_10 'Create new objects inside the group ,Undo new created objects before leaving the group
+ Call tGroup_11 'Create new objects inside the group ,Undo new created objects after leaving the group
+ Call tGroup_12 'Save and reload document while editing a group
+ Call tEncapsulatedGroup_1 'Group objects inside the group
+
+end sub
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_1
+
+ PrintLog "- Generate a objects group via menu Format/Group/Group"
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse)"
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 30, 50, 65, false)
+ Sleep 1
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 45, 60, 70, false)
+ Sleep 1
+ Call wObjektSelektieren ( 30, 28, 70, 80 )
+ Sleep 1
+
+ PrintLog "- via menu Format/Group/Group objects."
+ try
+ FormatGroupGroup
+ catch
+ Warnlog "Something wrong when creating group via menu - Format/Group/Group."
+ endcatch
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_2
+
+ PrintLog "- Generate a objects group via contextmenu Format/Group/Group"
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse)"
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 30, 50, 65, false)
+ Sleep 1
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 45, 60, 70, false)
+ Sleep 1
+ Call wObjektSelektieren ( 30, 28, 70, 80 )
+ Sleep 1
+
+ PrintLog "- via contextmenu Group/Group objects."
+ try
+ Call wOpenContextMenu
+ Call hMenuSelectNr(10)
+ Call hMenuSelectNr(1)
+ catch
+ Warnlog "Something wrong when creating group via contextmenu Group/Group"
+ endcatch
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_3
+
+ PrintLog "- Menu entries may not be enabled if less then two objects are selected."
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse)"
+ Call wZeichenobjektEinfuegen("RECHTECK", 30, 30, 50, 65, false)
+ Sleep 1
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 45, 60, 70, false)
+ Sleep 1
+
+ PrintLog "- Only select 1 object."
+ Call gMouseClick(32,32)
+ Sleep 1
+
+ PrintLog "- via menu Format/Group/Group objects."
+ try
+ FormatGroupGroup
+ Warnlog "Should NOT generate the group when less then two objects are selected!"
+ catch
+ endcatch
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_4
+
+ Dim sGroupName as String
+
+ sGroupName = "myTestGroup"
+
+ PrintLog "- Name a selected object group via Menu Format/Name object"
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse)"
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 30, 50, 65, false)
+ Sleep 1
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 45, 60, 70, false)
+ Sleep 1
+ Call wObjektSelektieren ( 30, 28, 70, 80 )
+ Sleep 1
+
+ PrintLog "- via menu Format/Group/Group objects."
+ FormatGroupGroup
+ Sleep 1
+
+ try
+ FormatNameObject
+ Kontext "NameDlgObject"
+ NameField.SetText sGroupName
+ NameDlgObject.OK
+ catch
+ Warnlog "Something wrong when Naming the group"
+ endcatch
+
+ PrintLog "- let the focus out of the group."
+ Call gMouseClick(5,5)
+
+ Call wNavigatorAuswahl( 12 , 1 )
+ Sleep 1
+
+ try
+ FormatNameObject
+ Sleep 1
+ Kontext "NameDlgObject"
+ if NameField.GetText <> sGroupName then Warnlog "The group name is wrong !"
+ NameDlgObject.Cancel
+ catch
+ Warnlog "Something wrong when checking the group name"
+ endcatch
+
+ Call wNavigatorClose
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_5
+
+ Dim sGroupName as String
+
+ sGroupName = "myTestGroup"
+
+ PrintLog "- Name a selected object group via context menu Name object "
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse)"
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 30, 50, 65, false)
+ Sleep 1
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 45, 60, 70, false)
+ Sleep 1
+ Call wObjektSelektieren ( 28, 28, 70, 80 )
+ Sleep 1
+
+ PrintLog "- via menu Format/Group/Group objects"
+ FormatGroupGroup
+ Sleep 1
+
+ try
+ Call wOpenContextMenu
+ Call hMenuSelectNr(6)
+ Kontext "NameDlgObject"
+ NameField.SetText sGroupName
+ NameDlgObject.OK
+ catch
+ Warnlog "Something wrong when Naming the group"
+ endcatch
+
+ PrintLog "- let the focus out of the group."
+ Call gMouseClick(95,95)
+
+ Call wNavigatorAuswahl( 12 , 1 )
+ Sleep 1
+
+ try
+ Call wOpenContextMenu
+ Call hMenuSelectNr(6)
+ Kontext "NameDlgObject"
+ if NameField.GetText <> sGroupName then Warnlog "The group name is wrong !"
+ NameDlgObject.Cancel
+ catch
+ Warnlog "Something wrong when checking the group name"
+ endcatch
+
+ Call wNavigatorClose
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_6
+
+ Dim sPositionX1 as String
+ Dim sPositionY1 as String
+ Dim sPositionX2 as String
+ Dim sPositionY2 as String
+
+ PrintLog "- Edit object group via Menu Format/Group/Enter Group"
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse) , generate a group."
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 32, 50, 65, false)
+ Sleep 1
+ Call gMouseClick(34,34)
+ Sleep 1
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ sPositionX1 = Horizontalby.Gettext
+ sPositionY1 = Verticalby.Gettext
+ TabPositionAndSizeWriter.Cancel
+ Sleep 2
+ Call gMouseClick(80,80)
+ Sleep 1
+
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 40, 60, 70, false)
+ Sleep 2
+ Call gMouseClick(50,50)
+ Sleep 1
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ sPositionX2 = Horizontalby.Gettext
+ sPositionY2 = Verticalby.Gettext
+ TabPositionAndSizeWriter.Cancel
+ Sleep 2
+ Call gMouseClick(80,80)
+
+ Call wObjektSelektieren ( 28, 28, 70, 80 )
+ Sleep 2
+ FormatGroupGroup
+ Sleep 1
+
+ PrintLog "- Format/Group/Enter Group."
+ FormatGroupEditGroup
+ Sleep 1
+
+ PrintLog "- Set the focus to ellipse, and move it."
+ Call gMouseClick(50,50)
+ Sleep 1
+ Call wTypeKeys "<Right>",2
+
+ PrintLog "- Set the focus to rectangle , check if it is moved (Should NOT)"
+ Call gMouseClick(41,40)
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ if Horizontalby.Gettext <> sPositionX1 then Warnlog "#i106719#Rectangle should NOT be moved: X Not -> "+sPositionX1+" but -> "+ Horizontalby.Gettext
+ if Verticalby.Gettext <> sPositionY1 then Warnlog "Rectangle should NOT be moved: Y Not -> "+sPositionY1+" but -> "+ Verticalby.Gettext
+ TabPositionAndSizeWriter.Cancel
+
+ PrintLog "- Set the focus to ellipse , check if it is moved (Should)"
+ Call wTypeKeys "<TAB>"
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ if Horizontalby.Gettext = sPositionX2 then Warnlog "ellipse should be moved"
+ if Verticalby.Gettext = sPositionY2 then Warnlog "ellipse should be moved"
+ TabPositionAndSizeWriter.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_7
+
+ Dim sPositionX1 as String
+ Dim sPositionY1 as String
+ Dim sPositionX2 as String
+ Dim sPositionY2 as String
+
+ PrintLog "- Edit object group via context menu Group/Enter Group"
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse) , generate a group."
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 32, 50, 65, false)
+ Sleep 1
+ Call gMouseClick(40,40)
+ Sleep 1
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ sPositionX1 = Horizontalby.Gettext
+ sPositionY1 = Verticalby.Gettext
+ TabPositionAndSizeWriter.Cancel
+ Sleep 2
+ Call gMouseClick(80,80)
+ Sleep 1
+
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 40, 60, 70, false)
+ Sleep 2
+ Call gMouseClick(50,50)
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ sPositionX2 = Horizontalby.Gettext
+ sPositionY2 = Verticalby.Gettext
+ TabPositionAndSizeWriter.Cancel
+ Sleep 2
+ Call gMouseClick(80,80)
+
+ Call wObjektSelektieren ( 28, 28, 70, 80 )
+ Sleep 2
+ FormatGroupGroup
+ Sleep 1
+
+ PrintLog "- Context menu Group/Enter Group."
+ Call wOpenContextMenu
+ Call hMenuSelectNr(12)
+ Sleep 1
+ Call hMenuSelectNr(2)
+ Sleep 1
+
+ PrintLog "- Set the focus to ellipse , and move it."
+ Call gMouseClick(50,50)
+ Sleep 1
+ Call wTypeKeys "<Right>",2
+
+ PrintLog "- Set the focus to rectangle , check if it is moved (Should NOT)."
+ Call gMouseClick(40,40)
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ if Horizontalby.Gettext <> sPositionX1 then Warnlog "#i106719#Rectangle should NOT be moved: X Not -> "+sPositionX1+" but -> "+ Horizontalby.Gettext
+ if Verticalby.Gettext <> sPositionY1 then Warnlog "Rectangle should NOT be moved: Y Not -> "+sPositionY1+" but -> "+ Verticalby.Gettext
+ TabPositionAndSizeWriter.Cancel
+
+ PrintLog "- Set the focus to ellipse , check if it is moved (Should)."
+ Call wTypeKeys "<TAB>"
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ if Horizontalby.Gettext = sPositionX2 then Warnlog "ellipse should be moved"
+ if Verticalby.Gettext = sPositionY2 then Warnlog "ellipse should be moved"
+ TabPositionAndSizeWriter.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_8
+
+ Dim sPositionX as String
+ Dim sPositionY as String
+
+ PrintLog "- Leave object group via Menu Format/Group/Exit Group"
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse) , generate a group."
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 32, 50, 65, false)
+ Sleep 1
+ Call gMouseClick(34,34)
+ Sleep 1
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ sPositionX = Horizontalby.Gettext
+ sPositionY = Verticalby.Gettext
+ TabPositionAndSizeWriter.Cancel
+
+ Call gMouseClick(80,80)
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 45, 60, 70, false)
+ Sleep 1
+ Call wObjektSelektieren ( 28, 28, 70, 80 )
+ Sleep 1
+
+ FormatGroupGroup
+ Sleep 1
+
+ PrintLog "- Format/Group/Edit Group."
+ FormatGroupEditGroup
+ Sleep 1
+
+ PrintLog "- Leave group via Format/Group/Exit Group."
+ FormatGroupExitGroup 'after this group , the focus should be on the group
+ Sleep 1
+
+ PrintLog "- Set the focus to ellipse(in fact, the focus is on the group), and move it."
+ Call gMouseClick(50,50)
+ Sleep 1
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<Right>",2
+ Call wTypeKeys "<Down>"
+
+ PrintLog "- Set the focus to rectangle (in fact, the focus is still on the group) ,"
+ PrintLog "- check if it is moved . Group is moved , Rectangle is moved ..."
+ Call gMouseClick(45,45)
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ if Horizontalby.Gettext = sPositionX then Warnlog "Rectangle X should be moved!"
+ if Verticalby.Gettext = sPositionY then Warnlog "Rectangle Y should be moved!"
+ TabPositionAndSizeWriter.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_9
+
+ Dim sPositionX as String
+ Dim sPositionY as String
+
+ PrintLog "- Leave object group via context Menu Format/Group/Exit Group"
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse) , generate a group."
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 32, 50, 65, false)
+ Sleep 1
+ Call gMouseClick(35,35)
+ Sleep 1
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ sPositionX = Horizontalby.Gettext
+ sPositionY = Verticalby.Gettext
+ TabPositionAndSizeWriter.Cancel
+
+ Call gMouseClick(80,80)
+ Sleep 1
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 45, 60, 70, false)
+ Sleep 1
+ Call wObjektSelektieren ( 28, 28, 70, 80 )
+ Sleep 1
+ FormatGroupGroup
+ Sleep 1
+
+ PrintLog "- Format/Group/Edit Group."
+ FormatGroupEditGroup
+ Sleep 1
+
+ PrintLog "- Leave group via context menu Group/Exit Group."
+ Call gMouseClick(35,50)
+ Sleep 1
+ Call wOpenContextMenu
+ Sleep 2
+ call hMenuSelectNr(12)
+ Sleep 2
+ Call hMenuSelectNr(1) 'after this group , the focus should be on the group
+ Sleep 2
+
+ PrintLog "- Set the focus to ellipse(in fact, the focus is on the group), and move it."
+ Call gMouseClick(50,50)
+ Kontext "DocumentWriter"
+ Call wTypeKeys "<Right>",2
+ Call wTypeKeys "<Down>"
+
+ PrintLog "- Set the focus to rectangle (in fact, the focus is still on the group) ,"
+ PrintLog "- check if it is moved . Group is moved , Rectangle is moved ..."
+ Call gMouseClick(45,45)
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ if Horizontalby.Gettext = sPositionX then Warnlog "Rectangle X should be moved!"
+ if Verticalby.Gettext = sPositionY then Warnlog "Rectangle Y should be moved!"
+ TabPositionAndSizeWriter.Cancel
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_10
+
+ PrintLog "- create new objects inside the group ,"
+ PrintLog " Undo new created objects before leaving the group"
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse) , generate a group "
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 32, 50, 35, false)
+ Sleep 1
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 60, 50, 80, false)
+ Sleep 1
+ Call wObjektSelektieren ( 30, 30, 55, 85 )
+ Sleep 1
+
+ FormatGroupGroup
+ Sleep 1
+
+ PrintLog "- insert another object (rectangle) in the group"
+ Call wZeichenobjektEinfuegen("RECHTECK", 35, 40, 45, 55)
+ Sleep 1
+
+ PrintLog "- Format/Group/Edit Group."
+ Call gMouseClick(32,32)
+ Sleep 1
+ FormatGroupEditGroup
+ Sleep 1
+
+ PrintLog "- Undo new created object( rectangle) before leaving the group."
+ EditUndo
+ Sleep 1
+
+ Call gMouseClick(35,40) 'set focus in the rectangle , in fact, the rectangle should be undone now.
+ Sleep 1
+ try
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ TabPositionAndSizeWriter.Cancel
+ Warnlog "Undo before leaving the group is FAILED!"
+ catch
+ endcatch
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_11
+
+ PrintLog "- create new objects inside the group ,"
+ PrintLog " Undo new created objects after leaving the group"
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse) , generate a group "
+ Call wZeichenobjektEinfuegen("RECHTECK", 30, 30, 50, 35, false)
+ Sleep 1
+ Call wZeichenobjektEinfuegen("ELLIPSE", 30, 60, 50, 80, false)
+ Sleep 1
+ Call wObjektSelektieren ( 28, 28, 55, 85 )
+ Sleep 1
+
+ FormatGroupGroup
+ Sleep 1
+
+ PrintLog "- insert another object (rectangle) in the group"
+ Call wZeichenobjektEinfuegen("RECHTECK", 35, 40, 45, 55, false)
+ Sleep 2
+ PrintLog "- Format/Group/Edit Group"
+ Call gMouseClick(32,32)
+ Sleep 3
+ FormatGroupEditGroup
+ Sleep 1
+
+ PrintLog "- Leave the group , Format/Group/Exit Group"
+ FormatGroupExitGroup
+ Sleep 1
+
+ PrintLog "- Undo new created object( rectangle) after leaving the group"
+ EditUndo
+ Sleep 1
+
+ Call gMouseClick(37,42) 'set focus in the rectangle , in fact, the rectangle should be undone now.
+ Sleep 1
+ try
+ Call fPositionAndSize("TabPositionAndSizeWriter")
+ TabPositionAndSizeWriter.Cancel
+ Warnlog "Undo before leaving the group is FAILED!"
+ catch
+ endcatch
+
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tGroup_12
+
+ Dim sDocument as String
+
+ PrintLog "- Edit object group via Menu Format/Group/Edit Group"
+
+ sDocument = ConvertPath ( gOfficePath +"user\work\tGroup_12.odt")
+ if FileExists ( sDocument ) then app.kill ( sDocument )
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse) , generate a group "
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 32, 50, 65, false)
+ Sleep 1
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 45, 60, 70, false)
+ Sleep 1
+ Call wObjektSelektieren ( 30, 30, 70, 80 )
+ Sleep 1
+
+ FormatGroupGroup
+ Sleep 1
+
+ PrintLog "- Format/Group/Edit Group"
+ FormatGroupEditGroup
+ Sleep 1
+
+ PrintLog "- Save document"
+ Call hFileSaveAsKill(sDocument)
+
+ PrintLog "- close document"
+ Call hCloseDocument
+
+ PrintLog "- Open previous saved document "
+ Call hFileOpen (sDocument)
+ Call sMakeReadOnlyDocumentEditable
+ Kontext "DocumentWriter"
+ Call gMouseClick(34,34) 'set focus in the group
+
+ PrintLog "- try formatGroupEditGroup"
+ try
+ FormatGroupEditGroup
+ catch
+ Warnlog "It should be in the group mode!"
+ endcatch
+
+ PrintLog "- close document"
+ Call hCloseDocument
+
+endcase
+
+'-------------------------------------------------------------------------
+
+testcase tEncapsulatedGroup_1
+
+ PrintLog "- Group objects inside the group ,Encapsulated Group"
+
+ Call hNewDocument
+
+ PrintLog "- Insert 2 drawing objects (rectangle and ellipse) , generate a group "
+
+ Call wZeichenobjektEinfuegen("RECHTECK", 32, 32, 50, 65, false)
+ Sleep 1
+ Call wZeichenobjektEinfuegen("ELLIPSE", 40, 45, 60, 70, false)
+ Sleep 1
+ Call wObjektSelektieren ( 28, 28, 70, 80 )
+ Sleep 1
+
+ FormatGroupGroup
+ Sleep 1
+
+ Call gMouseClick(90,90) 'set focus outside of the group
+
+ PrintLog "- insert 2 drawing objects (rectangle and ellipse) in the group"
+ Call wZeichenobjektEinfuegen("RECHTECK", 35, 40, 38, 45, false)
+ Call wZeichenobjektEinfuegen("ELLIPSE", 52, 40, 78, 45, false)
+ Call wObjektSelektieren ( 28, 38, 80, 48 )
+
+ try
+ PrintLog "- generate a new group"
+ FormatGroupGroup
+ PrintLog "- edit the new group"
+ FormatGroupEditGroup
+ PrintLog "- leave the new group"
+ FormatGroupExitGroup
+ PrintLog "- Undo the new group"
+ FormatGroupUnGroup
+ catch
+ Warnlog "Something wrong where operating the Encapsulated group!"
+ endcatch
+
+ Call hCloseDocument
+
+endcase