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 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: w_fields1.inc,v $
13 '* last change: $Author: vg $ $Date: 2008-08-18 12:26:27 $
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 : helge.delfs@sun.com
36 '* short description : Fields general test
38 '\***********************************************************************
42 Call tInsertFieldsDate
43 Call tInsertFieldsTime
44 Call tInsertFieldsPageNumber
45 Call tInsertFieldsPageCount
46 Call tInsertFieldsSubject
47 Call tInsertFieldsTitle
48 Call tInsertFieldsAuthor
52 '-----------------------------------------------------------------
54 testcase tInsertFieldsDate
59 printlog "Insert / Fields / Date"
60 '/// <b> Default should be mm/dd/yy </b>
64 '/// Insert / Fields / Date , the 1st date is fixed
68 Call wTypeKeys "<Return>"
70 '/// Insert / Fields / Date
73 Call wTypeKeys "<Home>"
75 '/// Set 2nd date only to be date , not fixed
76 '/// In 2nd date , Edit / Fields , select date in 'select'
77 '/// Select second format in 'Format'
79 Kontext "FeldbefehlBearbeitenDokument"
81 Zahlenformat.Select 2 'Should be the same as the value we get with 'Time'.
83 FeldbefehlBearbeitenDokument.OK
85 '/// Set first date to the right format, but leave as unfixed
86 '/// In 1nd date , Edit / Fields , select second format in 'Format'
87 Call wTypeKeys "<MOD1 Home>"
90 Kontext "FeldbefehlBearbeitenDokument"
91 Zahlenformat.Select 2 'Should be the same as the value we get with 'Time'.
92 FeldbefehlBearbeitenDokument.OK
94 '/// Check if the date is correct
95 Call wTypeKeys "<MOD1 Home>"
96 Call wTypeKeys "<Shift Right>"
98 if GetClipboard <> sDate then
99 Warnlog "Fixed date is wrong ! Hope you don't run this case in the midnight"
102 Call wTypeKeys "<Down><Home>"
103 Call wTypeKeys "<Shift Right>"
105 if GetClipboard <> sDate then
106 Warnlog "Date is wrong ! Hope you don't run this case in the midnight"
113 '-----------------------------------------------------------------
115 testcase tInsertFieldsTime
122 printlog "Insert / Fields / Time"
123 '/// <b> Default could be hh/mm/ss pm or simply hh/mm/ss , depending on the system the test is running on.</b>
128 '/// Insert / Fields / Time , the 1st time is fixed
132 Call wTypeKeys "<Return>"
134 '/// Insert / Fields / Time
137 Call wTypeKeys "<Home>"
139 '/// Set 2nd time only to be time , not fixed
140 '/// In 2nd time , Edit / Fields , select Time in 'select'
142 Kontext "FeldbefehlBearbeitenDokument"
144 FeldbefehlBearbeitenDokument.OK
146 '/// Check if the time is correct
147 Call wTypeKeys "<MOD1 Home>"
148 Call wTypeKeys "<Shift Right>"
150 sTime1 = GetClipboard
151 if NOT Len(sTime1) > 7 then Warnlog "Fixed time-format is wrong !"
153 Call wTypeKeys "<Down><Home>"
154 Call wTypeKeys "<Shift Right>"
156 sTime2 = GetClipboard
157 if NOT Len(sTime2) > 7 then Warnlog "Time-format is wrong !"
159 printlog "Stop for a while ..."
160 '/// Stop for a while , check if the time is still correct
162 Call wTypeKeys "<MOD1 Home>"
163 Call wTypeKeys "<Shift Right>"
165 if GetClipboard <> sTime1 then Warnlog "Fixed time is wrong !"
167 Call wTypeKeys "<Down><Home>"
168 Call wTypeKeys "<Shift Right>"
170 if GetClipboard = sTime2 then Warnlog "Time is wrong !"
176 '-----------------------------------------------------------------
178 testcase tInsertFieldsPageNumber
179 qaerrorlog "#i93906# - Testcase outcommented due to bug. 'Copied field-content not pastable outside Office'"
182 Dim sPage1 , sPage2 as String
184 sPage1 = "1" : sPage2 = "2"
186 printlog "Insert / Fields / Page Number"
190 '/// In 1st page , Insert / Fields / Page Number
191 InsertFieldsPageNumbers
193 '/// Insert a page break
196 kontext "UmbruchEinfuegen"
200 '/// In 2nd page , Insert / Fields / Page Number
201 InsertFieldsPageNumbers
203 Call wTypeKeys "<MOD1 Home>"
205 '/// Check if the page number is correct
206 Call wTypeKeys "<Shift Right>"
207 if fGetFieldContent( ) <> sPage1 then
208 QAErrorLog "#i31214# The 1st page number isn't correct ! should be: '" + sPage1 + "', but was: '" + GetClipboard + "'."
211 Call wTypeKeys "<MOD1 End>"
212 Call wTypeKeys "<Shift Left>"
214 if GetClipboard <> sPage2 then
215 Warnlog "The 2nd page number isn't correct !"
222 '-----------------------------------------------------------------
224 testcase tInsertFieldsPageCount
225 qaerrorlog "#i93906# - Testcase outcommented due to bug. 'Copied field-content not pastable outside Office'"
228 Dim sPage1 , sPage2 as String
230 sPage1 = "1" : sPage2 = "2"
232 printlog "Insert / Fields / Page Count"
236 '/// In 1st page , Insert / Fields / Page Count
237 InsertFieldsPageCount
239 Call wTypeKeys "<MOD1 Home>"
241 '/// Check if the 1st page count is correct
242 Call wTypeKeys "<Shift Right>"
244 if GetClipboard <> sPage1 then
245 Warnlog "1-The 1st page count isn't correct !"
247 Call wTypeKeys "<End>"
249 '/// Insert a page break
252 kontext "UmbruchEinfuegen"
256 '/// In 2nd page , Insert / Fields / Page Count
257 InsertFieldsPageCount
259 Call wTypeKeys "<MOD1 Home>"
261 '/// Check if the page count is correct
262 Call wTypeKeys "<Shift Right>"
264 if fGetFieldContent( ) <> sPage2 then
265 Warnlog "2-The 1st page count isn't correct"
268 Call wTypeKeys "<MOD1 End>"
269 Call wTypeKeys "<Shift Left>"
271 if GetClipboard <> sPage2 then
272 Warnlog "The 2nd page count isn't correct !"
279 '-----------------------------------------------------------------
281 testcase tInsertFieldsSubject
282 qaerrorlog "#i93906# - Testcase outcommented due to bug. 'Copied field-content not pastable outside Office'"
285 Dim sSubject as String
286 sSubject = "This is a Subject"
288 printlog "Insert / Fields / Subject"
292 '/// File / Properties / Description , input some
293 '/// + text in Subject
294 Call fFileProperties("TabBeschreibung")
295 Thema.Settext sSubject
298 '/// Insert / Fields / Subject
301 '/// Check if the subject is correct
302 Call wTypeKeys "<Shift Left>"
304 if GetClipboard <> sSubject then
305 Warnlog "Subject isn't correct ! should be: '" + sSubject + "', but was: '" + GetClipboard + "'."
312 '-----------------------------------------------------------------
314 testcase tInsertFieldsTitle
315 qaerrorlog "#i93906# - Testcase outcommented due to bug. 'Copied field-content not pastable outside Office'"
320 sTitle = "This is a Title"
322 printlog "Insert / Fields / Title"
326 '/// File / Properties / Description , input some
328 Call fFileProperties("TabBeschreibung")
332 '/// Insert / Fields / Title
335 '/// Check if the title is correct
336 Call wTypeKeys "<Shift Left>"
338 if GetClipboard <> sTitle then
339 Warnlog "Title isn't correct ! should be: '" + sTitle + "', but was: '" + GetClipboard + "'."
346 '-----------------------------------------------------------------
348 testcase tInsertFieldsAuthor
349 qaerrorlog "#i93906# - Testcase outcommented due to bug. 'Copied field-content not pastable outside Office'"
352 Dim sFirstName , sLastName as String
353 Dim sFirstName1 , sLastName1 as String
355 sFirstName1 = "Test1" : sLastName1 = "Test2"
357 printlog "Insert / Fields / Author"
361 '/// Change author to author :Test2 Test1
363 Call hToolsOptions("STAROFFICE","USERDATA")
364 sFirstName = VorName.GetText
365 sLastName = ZuName.GetText
366 VorName.SetText sFirstName1
367 ZuName.SetText sLastName1
368 Kontext "ExtrasOptionenDlg"
371 '/// File / Properties / General , check "Apply user
372 '/// + data" , click "delete" button
373 Call fFileProperties("TabDokument")
374 BenutzerdatenVerwenden.Check
380 '/// Insert / Fields / Author
383 '/// Check if the title is correct
384 Call wTypeKeys "<Shift Left>"
386 if GetClipboard <> (sFirstName1 + " " + sLastName1) then
387 Warnlog "Author isn't correct ! should be: '" + (sFirstName1 + " " + sLastName1) + "', but was: '" + GetClipboard + "'."
390 'Recover author to default
392 Call hToolsOptions("STAROFFICE","USERDATA")
393 VorName.SetText sFirstName
394 ZuName.SetText sLastName
395 Kontext "ExtrasOptionenDlg"