jl165 merging heads
[LibreOffice.git] / testautomation / framework / required / includes / wizard_webpage.inc
blob465fae368db1e2ceecf91523e842edb8b7b7f935
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 Web Page Wizard
32 '\************************************************************************
34 testcase tUpdtWizardWebpage
36     printlog( "Resource test for the webpage wizard" )
38     dim i as integer
39     dim a as integer
40     a = getDocumentCount
41     FileWizardsWebPage
43     Kontext "WebWizard"
44     if WebWizard.exists(20) then
46         printlog " 1. Introduction"
47         Call DialogTest (WebWizard,1)
48         IntroductionChooseSettings.getItemCount
49         IntroductionChooseSettings.getSelText
50         NextButton.click
51         
52         printlog " 2. Documents"
53         Call DialogTest (WebWizard,2)
54         DocumentsAdd.click
56         Kontext "OeffnenDlg"
57         if OeffnenDlg.exists(5) then
58             Dateiname.setText ConvertPath ( gTesttoolPath + "global\input\graf_inp\borabora.jpg"
59             Oeffnen.click           
60         else
61             warnlog "File Dialog didn't came up"
62         endif
63         WaitSlot( 5000 )
64         
65         Kontext "WebWizard"
66         DocumentsWebSiteContent.getSelText
67         DocumentsWebSiteContent.getItemcount
68         DocumentsExportFileFormat.getItemCount
69         DocumentsExportFileFormat.getSelText
70         DocumentsInformationTitle.getText
71         DocumentsInformationsummary.setText "A"
72         DocumentsInformationAuthor.setText "B"
73         NextButton.click
74         
75         printlog " 3. Main Layout"
76         Call DialogTest (WebWizard,3)
77         MainLayoutLayout2.typeKeys "<space>"
78         NextButton.click
79         
80         printlog " 4. Layout details"
81         Call DialogTest (WebWizard,4)
82         LayoutDetailsFileName.isChecked
83         LayoutDetailsDescription.isChecked
84         LayoutDetailsAuthor.isChecked
85         LayoutDetailsCreationDate.isChecked
86         LayoutDetailsLastChangeDate.isChecked
87         LayoutDetailsFileFormat.isChecked
88         LayoutDetailsFileFormatIcon.isChecked
89         LayoutDetailsNumberOfPages.isChecked
90         LayoutDetailsSizeInKB.isChecked
91         LayoutDetails640x480.isChecked
92         LayoutDetails800x600.isChecked
93         LayoutDetails1024x768.isChecked
94         NextButton.click
95         
96         printlog " 5. Style"
97         Call DialogTest (WebWizard,5)
98         StyleStyle.getItemCount
99         StyleStyle.getSelText
100         StyleBackgroundImage.click
101         Kontext "BackgroundImages"
102         if BackgroundImages.exists(10) then
103             Call Dialogtest (BackgroundImages)
104             Forward.click
105             Back.click
106             Other.click
107             Kontext "OeffnenDlg"
108             if OeffnenDlg.exists(5) then
109                 OeffnenDlg.cancel
110             else
111                 warnlog "File Dialog didn't came up"
112             endif
113             WaitSlot( 5000 )
115             Kontext "BackgroundImages"
116             None.click
117             cancelB.click
118         else
119             warnlog "Dialog Background images didn't came up"
120         endif
121         Kontext "WebWizard"
122         StyleIconSet.click
123         Kontext "IconSets"
124         if IconSets.exists(5) then
125             Call Dialogtest (IconSets)
126             None.click
127             cancelB.click
128         else
129             warnlog "File Dialog didn't came up"
130         endif
131         Kontext "WebWizard"
132         NextButton.click
134         printlog " 6. Web site information"
135         Call DialogTest (WebWizard,6)
136         WebSiteInformationTitle.getText
137         WebSiteInformationDescription.getText
138         WebSiteInformationEmail.getText
139         WebSiteInformationCopyrightNotice.getText
140         WebSiteInformationCreated.getText
141         WebSiteInformationCreated.more
142         WebSiteInformationCreated.getText
143         WebSiteInformationCreated.toMax
144         WebSiteInformationCreated.getText
145         WebSiteInformationModified.getText
146         NextButton.click
147         
148         printlog " 7. Preview"
149         Call DialogTest (WebWizard,7)
150         PreviewToALocalFolderCB.unCheck
151         PreviewToALocalFolderTF.getText
152         PublishToALocalFolderB.click
153             Kontext "OeffnenDlg"
154             if OeffnenDlg.exists(5) then
155                 OeffnenDlg.cancel
156             else
157                 warnlog "File Dialog didn't came up"
158             endif
159             WaitSlot( 5000 )
160         Kontext "WebWizard"
161         PublishToAZIPArchiveCB.isChecked
162         PublishToAZIPArchiveTF.getText
163         PublishToAZIPArchiveB.click
164             Kontext "SpeichernDlg"
165             if SpeichernDlg.exists(5) then
166                 SpeichernDlg.cancel
167             else
168                 warnlog "File Dialog didn't came up"
169             endif
170             WaitSlot( 5000 )
171         Kontext "WebWizard"
172         PublishToAWebServer.isChecked
173         try
174             PublishFTPConfigure.click
175             Kontext "FTPConnection"
176             if FTPConnection.exists(5) then
177                 Call Dialogtest (FTPConnection)
178                 ServerName.getText
179                 UserName.getText
180                 Password.getText
181                 Connect.isEnabled
182                 ChooseARemoteDirectory.getText
183                 ChooseARemoteDirectoryB.isEnabled
184                 CancelB.click
185             endif
186         catch
187             printlog "no ftp"
188         endcatch
189         
190         Kontext "WebWizard"
191         if ( webwizard.exists( 10 ) ) then
192             PublishSaveSettings.check()
193             PublishSaveAs.getItemCount
194             PublishSaveAs.getSelText
195             CancelB.click
196             i = 0
197             while ((getdocumentcount > a) AND (i<30))
198                 printlog "waiting for closing of wizard (max 30 sec): " + i
199                 inc i
200                 sleep 1
201             wend
202             if i > 29 then
203                 qaErrorlog "Wizard performance issue; takes longer than 30 sec to close."
204             endif
205         else
206             warnlog( "Cannot access webwizard" )
207         endif
208     else
209         warnlog "Web page wizard didn't come up"
210     endif
211 endcase