jl165 merging heads
[LibreOffice.git] / testautomation / framework / optional / includes / fontworkgallery.inc
blobc83ce1fb5740fc1d2364ee837befc7edfba75cb1
1 'encoding UTF-8  Do not remove or change this line!
2 '**************************************************************************
3 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 ' Copyright 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org.  If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : thorsten.bosbach@oracle.com
30 '* short description : Resource test of font work gallery
32 '\************************************************************************
34 sub sFontworkGalleryUpdate
35     dim sApplication
36     dim i,a as integer
38     sApplication = array("WRITER","MASTERDOCUMENT","CALC","IMPRESS","DRAW")
40     ' for every application
41     a = uBound(sApplication())
42     for i = 0 to a
43         gApplication = sApplication(i)
44         printlog "********** " + gApplication
45         tFontworkGalleryUpdate
46     next i
47 end sub
49 testcase tFontworkGalleryUpdate
50     dim j,b as integer
51         
52 'i67024     -     tbo     sj     Help-IDs missing on the windows items for FontworkAlignment and FontworkCharacterSpacing
53 'i66989     -     tbo     sj     Fontwork Gallery control has no Help-ID
54     b = getDocumentCount
55     for j = 1 to b
56         printlog "closing: " + j
57         hCloseDocument()
58     next j
59     hNewDocument()
60     sleep (5)
61     Kontext "Drawbar"
62     if NOT Drawbar.exists then
63         hToolbarSelect("DRAWING",true)
64         printlog "opened drawing toolbar"
65     endif
66     if Drawbar.exists then
67         FontworkGallery.click
68         
69         Kontext "FontworkGallery"
70         dialogtest(FontworkGallery)
71         FontworkGallery.typeKeys("<right>", true)
72         FontworkGallery.mousedown(50,50)
73         FontworkGallery.mouseup(50,50)
74         FontworkGallery.OK
75         
76         sleep 5
77         Kontext "FontworkObjectbar"
78         if FontworkObjectbar.exists then
79             FontworkGallery.click
80             Kontext "FontworkGallery"
81             dialogtest(FontworkGallery)
82             FontworkGallery.cancel
83         
84             Kontext "FontworkObjectbar"
85             FontworkShape.click
86             Kontext "FontworkShape"
87             PlainText.click
88             
89             Kontext "FontworkObjectbar"
90             FontworkSameLetterHeights.click
91             sleep 3
92             
93             Kontext "FontworkObjectbar"
94             FontworkAlignment.click
95             Kontext "FontworkAlignment"
96             if FontworkAlignment.exists(5) then
97                 dialogtest(FontworkAlignment)
98                 FontworkAlignment.close
99             else
100                 printlog "beginning workaround lockup"
101                 hUseMenu()
102                 hMenuClose()
103                 sleep 3
104                 Kontext "FontworkObjectbar"
105                 FontworkAlignment.click
106                 Kontext "FontworkAlignment"
107                 if FontworkAlignment.exists(5) then
108                     dialogtest(FontworkAlignment)
109                     FontworkAlignment.close
110                 else
111                     warnlog "FontworkAlignment dialog not visible"
112                 endif
113             endif
114             
115             Kontext "FontworkObjectbar"
116             FontworkCharacterSpacing.click
117             Kontext "FontworkCharacterSpacing"
118             if FontworkCharacterSpacing.exists(5) then
119                 'dialogtest(FontworkCharacterSpacing)
120                 FontworkCharacterSpacing.typeKeys ("<down><down><down><down><down><return>")
121                 Kontext "FontworkCharacterSpacingCustom"
122                 if FontworkCharacterSpacingCustom.exists(5) then
123                     dialogtest(FontworkCharacterSpacingCustom)
124                     printlog value.getText
125                     FontworkCharacterSpacingCustom.close
126                 else
127                     printlog "dialog FontworkCharacterSpacingCustom didn't came up"
128                 endif
129                 Kontext "FontworkCharacterSpacing"
130                 if FontworkCharacterSpacing.exists(5) then
131                     FontworkCharacterSpacing.close    
132                 else
133                     printlog "dialog FontworkCharacterSpacing was closed in another way"
134                 endif
135             else
136                 warnlog "fontWork characterspacing drop down menu is not visible"
137             endif
138         else
139             warnlog "fontWork toolbar is not visible"
140         endif
141     else
142         warnlog "Draw toolbar is not visible"
143     endif
144     hCloseDocument()
145 endcase