merge the formfield patch from ooo-build
[ooovba.git] / testautomation / framework / required / includes / basic_dialog_i18n_import.inc
blob8c26ab0d6bedefbca7f8181e87587402730126d1
1 'encoding UTF-8  Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 '* 
5 '* Copyright 2008 by Sun Microsystems, Inc.
6 '*
7 '* OpenOffice.org - a multi-platform office productivity suite
8 '*
9 '* $RCSfile: basic_delete_modules.inc,v $
11 '* $Revision: 1.1 $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org.  If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '*  owner : joerg.skottke@sun.com
36 '*  short description : 
38 '\******************************************************************************
40 testcase tBasicDialogI18nImport
42     printlog( "Dialogs that show up when importing Multi locale dialogs into BASIC IDE" )
43     
44     dim cDialogPath as string
45         cDialogPath = gTesttoolPath & "framework\required\input\basic_ide\Dialog5.xdl"
46         cDialogPath = convertpath( cDialogPath )
47         
48     const LANGUAGE_COUNT = 5
49         
50     printlog( "Open BASIC-IDE" )
51     hCreateDocument()
52     hInitFormControls( "tDialogI18nImport" )
53     
54     kontext "ToolsCollectionBar"
55     if ( ToolsCollectionBar.exists() ) then
56         ToolsCollectionBar.close()
57     endif
58     
59     Kontext "DialogBar"
60     if ( DialogBar.exists() ) then
61     
62         printlog( "Click on <Import> button on <DialogBar>" )
63         Import.click()
64         
65         kontext "OeffnenDlg"
66         if ( OeffnenDlg.exists( 2 ) ) then
67         
68             printlog( "Enter path to test dialog" )
69             DateiName.setText( cDialogPath ) 
70             Oeffnen.click()
71             
72             printlog( "Test messagebox" )
73             kontext "active"
74             if ( Active.exists( 2 ) ) then
75             
76                 printlog( "Messagebox: " & Active.getText() ) 
77                 if ( Active.getButtonCount() <> 4 ) then
78                     warnlog( "Incorrect messagebox, expected locale clash warning" )
79                 endif
80                 
81                 call DialogTest( Active )
82                 
83                 printlog( "Accept with yes" )
84                 Active.Yes()
85                 
86                 Kontext "TranslationBar"
87                 if ( TranslationBar.exists() ) then
88                 
89                     printlog( "Check number of imported languages" )
90                     if ( CurrentLanguage.getItemCount() <> LANGUAGE_COUNT ) then
91                         warnlog( "Incorrect language count in listbox <CurrentLanguage>" )
92                         printlog( "Expected: " & LANGUAGE_COUNT )
93                         printlog( "Found...: " & CurrentLanguage.getItemCount() )
94                     endif
95                     
96                     Kontext "DialogBar"
97                     if ( DialogBar.exists() ) then
98                     
99                         printlog( "Click on <Import> button on <DialogBar>" )
100                         Import.click()
101                         
102                         kontext "OeffnenDlg"
103                         if ( OeffnenDlg.exists( 2 ) ) then
105                             printlog( "Enter path to test dialog" )                        
106                             DateiName.setText( cDialogPath )
107                             Oeffnen.click()
108                             
109                             printlog( "Test messagebox" )
110                             kontext "Active"
111                             if ( Active.exists( 2 ) ) then
112                             
113                                 printlog( "Messagebox: " & Active.getText() ) 
114                                 if ( Active.getButtonCount() <> 3 ) then
115                                     warnlog( "Incorrect messagebox, expected dialog replace warning" )
116                                 endif
117                                 
118                                 call DialogTest( Active )
119                                 
120                                 Printlog( "Rename the new dialog" )
121                                 Active.Yes()
122                             else
123                                 warnlog( "Overwrite warning missing" )
124                             endif
125                         else
126                             warnlog( "<OeffnenDlg> did not open" )
127                         endif
128                     else
129                         warnlog( "<DialogBar> is not available" )
130                     endif
131                 else
132                     warnlog( "<TranslationBar> is not available" )
133                 endif
134             else
135                 warning( "Conflicting locales messagebox is missing" )
136             endif
137         else
138             warnlog( "<OeffnenDlg> did not open" )
139         endif
140     else
141         warnlog( "<DialogBar> is not available" )
142     endif
143     hCloseBasicIde()
144     hDestroyDocument()
145     
146 endcase