Line 0
Link Here
|
|
|
1 |
/************************************************************** |
2 |
* |
3 |
* Licensed to the Apache Software Foundation (ASF) under one |
4 |
* or more contributor license agreements. See the NOTICE file |
5 |
* distributed with this work for additional information |
6 |
* regarding copyright ownership. The ASF licenses this file |
7 |
* to you under the Apache License, Version 2.0 (the |
8 |
* "License"); you may not use this file except in compliance |
9 |
* with the License. You may obtain a copy of the License at |
10 |
* |
11 |
* http://www.apache.org/licenses/LICENSE-2.0 |
12 |
* |
13 |
* Unless required by applicable law or agreed to in writing, |
14 |
* software distributed under the License is distributed on an |
15 |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
16 |
* KIND, either express or implied. See the License for the |
17 |
* specific language governing permissions and limitations |
18 |
* under the License. |
19 |
* |
20 |
*************************************************************/ |
21 |
|
22 |
|
23 |
|
24 |
/** |
25 |
* |
26 |
*/ |
27 |
package testcase.presentation.headerandfooter; |
28 |
|
29 |
import static testlib.AppUtil.fullPath; |
30 |
import static testlib.AppUtil.openStartcenter; |
31 |
import static testlib.AppUtil.submitOpenDlg; |
32 |
import static testlib.AppUtil.submitSaveDlg; |
33 |
import static testlib.UIMap.*; |
34 |
import static org.junit.Assert.*; |
35 |
import static org.openoffice.test.vcl.Tester.*; |
36 |
import org.junit.After; |
37 |
import org.junit.Before; |
38 |
import org.junit.Rule; |
39 |
import org.junit.Test; |
40 |
import org.openoffice.test.common.FileUtil; |
41 |
import testlib.ImpressUtil; |
42 |
import testlib.Log; |
43 |
|
44 |
public class HeaderAndFooterSetting{ |
45 |
|
46 |
@Rule |
47 |
public Log LOG = new Log(); |
48 |
|
49 |
@Before |
50 |
public void setUp() throws Exception { |
51 |
app.start(); |
52 |
|
53 |
// New a impress, insert some slides |
54 |
app.dispatch("private:factory/simpress?slot=6686"); |
55 |
PresentationWizard.ok(); |
56 |
sleep(1); |
57 |
|
58 |
for(int i=0; i<5;i++){ |
59 |
SD_InsertPageButtonOnToolbar.click(); |
60 |
sleep(1); |
61 |
} |
62 |
// Pop up navigator panel |
63 |
impress.menuItem("View").select(); |
64 |
if(!impress.menuItem("View->Navigator").isSelected()){ |
65 |
impress.menuItem("View->Navigator").select(); |
66 |
} |
67 |
} |
68 |
|
69 |
@After |
70 |
public void tearDown() throws Exception { |
71 |
app.close(); |
72 |
} |
73 |
|
74 |
/** |
75 |
* Test Copy slide with Apply Footer to same file and different file |
76 |
* @throws Exception |
77 |
*/ |
78 |
@Test |
79 |
public void testCopySlideWithApplyFooter() throws Exception{ |
80 |
|
81 |
//add header and footer |
82 |
impress.menuItem("View->Header and Footer...").select(); |
83 |
sleep(2); |
84 |
|
85 |
SD_DateAndTimeFooterOnSlide.check(); |
86 |
SD_FixedDateAndTimeFooterOnSlide.check(); |
87 |
SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); |
88 |
SD_FooterTextOnSlide.check(); |
89 |
SD_FooterTextOnSlideInput.setText("Footer Test"); |
90 |
SD_SlideNumAsFooterOnSlide.check(); |
91 |
SD_ApplyToAllButtonOnSlideFooter.click(); |
92 |
sleep(1); |
93 |
|
94 |
ImpressSlideSorter.focus(); |
95 |
for(int j=0; j<=2;j++){ |
96 |
typeKeys("<up>"); |
97 |
} |
98 |
impress.menuItem("View->Header and Footer...").select(); |
99 |
sleep(1); |
100 |
SD_SlideNumAsFooterOnSlide.uncheck(); |
101 |
SD_ApplyButtonOnSlideFooter.click(); |
102 |
|
103 |
//paste to the same file |
104 |
ImpressSlideSorter.focus(); |
105 |
app.dispatch(".uno:Copy"); |
106 |
app.dispatch(".uno:Paste"); |
107 |
|
108 |
impress.menuItem("View->Header and Footer...").select(); |
109 |
sleep(1); |
110 |
assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText()); |
111 |
assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText()); |
112 |
assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked()); |
113 |
|
114 |
//close header and footer dialog. |
115 |
SD_ApplyButtonOnSlideFooter.focus(); |
116 |
typeKeys("<tab>"); |
117 |
typeKeys("<enter>"); |
118 |
|
119 |
//paste to different file |
120 |
impress.focus(); |
121 |
app.dispatch("private:factory/simpress?slot=6686"); |
122 |
PresentationWizard.ok(); |
123 |
sleep(1); |
124 |
app.dispatch(".uno:Paste"); |
125 |
ImpressSlideSorter.focus(); |
126 |
typeKeys("<down>"); |
127 |
sleep(1); |
128 |
|
129 |
impress.menuItem("View->Header and Footer...").select(); |
130 |
sleep(1); |
131 |
assertEquals("Fix Date: 20120323", SD_FixedDateAndTimeOnSlideInput.getText()); |
132 |
assertEquals("Footer Test", SD_FooterTextOnSlideInput.getText()); |
133 |
assertEquals(false, SD_SlideNumAsFooterOnSlide.isChecked()); |
134 |
} |
135 |
|
136 |
/** |
137 |
* Test Copy slide with Apply to all Footer to same file and different file |
138 |
* @throws Exception |
139 |
*/ |
140 |
@Test |
141 |
public void testCopySlideWithApplyToAllFooter() throws Exception{ |
142 |
|
143 |
//add header and footer |
144 |
impress.menuItem("View->Header and Footer...").select(); |
145 |
sleep(2); |
146 |
|
147 |
SD_DateAndTimeFooterOnSlide.check(); |
148 |
SD_FixedDateAndTimeFooterOnSlide.check(); |
149 |
sleep(1); |
150 |
SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); |
151 |
sleep(1); |
152 |
SD_FooterTextOnSlide.check(); |
153 |
sleep(1); |
154 |
SD_FooterTextOnSlideInput.setText("Footer Test"); |
155 |
sleep(1); |
156 |
SD_SlideNumAsFooterOnSlide.check(); |
157 |
sleep(1); |
158 |
SD_ApplyToAllButtonOnSlideFooter.click(); |
159 |
sleep(1); |
160 |
|
161 |
ImpressSlideSorter.focus(); |
162 |
for(int j=0; j<=2;j++){ |
163 |
typeKeys("<up>"); |
164 |
sleep(1); |
165 |
} |
166 |
impress.menuItem("View->Header and Footer...").select(); |
167 |
sleep(1); |
168 |
SD_SlideNumAsFooterOnSlide.uncheck(); |
169 |
SD_ApplyButtonOnSlideFooter.click(); |
170 |
|
171 |
//paste to the same file |
172 |
ImpressSlideSorter.focus(); |
173 |
typeKeys("<up>"); |
174 |
app.dispatch(".uno:Copy"); |
175 |
typeKeys("<down>"); |
176 |
sleep(1); |
177 |
app.dispatch(".uno:Paste"); |
178 |
|
179 |
impress.menuItem("View->Header and Footer...").select(); |
180 |
sleep(1); |
181 |
assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); |
182 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
183 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
184 |
|
185 |
//close header and footer dialog. |
186 |
SD_ApplyButtonOnSlideFooter.focus(); |
187 |
typeKeys("<tab>"); |
188 |
typeKeys("<enter>"); |
189 |
|
190 |
//paste to different file |
191 |
impress.focus(); |
192 |
impress.menuItem("File->New->Presentation").select(); |
193 |
sleep(1); |
194 |
app.dispatch(".uno:Paste"); |
195 |
ImpressSlideSorter.focus(); |
196 |
typeKeys("<down>"); |
197 |
sleep(1); |
198 |
|
199 |
impress.menuItem("View->Header and Footer...").select(); |
200 |
sleep(1); |
201 |
assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); |
202 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
203 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
204 |
} |
205 |
|
206 |
/** |
207 |
* Test Copy slide with Notes Footer to same file and different file |
208 |
* @throws Exception |
209 |
*/ |
210 |
@Test |
211 |
public void testCopySlideWithNotesHeaderFooter() throws Exception{ |
212 |
|
213 |
//add header and footer |
214 |
impress.menuItem("View->Header and Footer...").select(); |
215 |
sleep(1); |
216 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
217 |
SD_HeaderTextOnNotes.check(); |
218 |
SD_HeaderTextOnNotesInput.setText("Header Test"); |
219 |
SD_DateAndTimeFooterOnSlide.check(); |
220 |
SD_FixedDateAndTimeFooterOnSlide.check(); |
221 |
sleep(1); |
222 |
SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329"); |
223 |
sleep(1); |
224 |
SD_FooterTextOnSlide.check(); |
225 |
sleep(1); |
226 |
SD_FooterTextOnSlideInput.setText("Footer Test"); |
227 |
sleep(1); |
228 |
SD_SlideNumAsFooterOnSlide.check(); |
229 |
sleep(1); |
230 |
SD_ApplyToAllButtonOnSlideFooter.click(); |
231 |
sleep(1); |
232 |
|
233 |
//paste to the same file |
234 |
ImpressSlideSorter.focus(); |
235 |
typeKeys("<up>"); |
236 |
app.dispatch(".uno:Copy"); |
237 |
typeKeys("<down>"); |
238 |
sleep(1); |
239 |
app.dispatch(".uno:Paste"); |
240 |
|
241 |
ImpressUtil.getCurView().activate(); |
242 |
|
243 |
impress.menuItem("View->Header and Footer...").select(); |
244 |
sleep(1); |
245 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
246 |
assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); |
247 |
assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); |
248 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
249 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
250 |
|
251 |
//close header and footer dialog. |
252 |
SD_ApplyToAllButtonOnSlideFooter.focus(); |
253 |
typeKeys("<tab>"); |
254 |
typeKeys("<enter>"); |
255 |
|
256 |
//paste to different file |
257 |
impress.focus(); |
258 |
impress.menuItem("File->New->Presentation").select(); |
259 |
sleep(1); |
260 |
app.dispatch(".uno:Paste"); |
261 |
ImpressSlideSorter.focus(); |
262 |
typeKeys("<down>"); |
263 |
sleep(1); |
264 |
ImpressUtil.getCurView().activate(); |
265 |
impress.menuItem("View->Header and Footer...").select(); |
266 |
sleep(1); |
267 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
268 |
assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); |
269 |
assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); |
270 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
271 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
272 |
} |
273 |
|
274 |
/** |
275 |
* Test duplicate slide with Apply to all Footer to same file |
276 |
* @throws Exception |
277 |
*/ |
278 |
@Test |
279 |
public void testDuplicateSlideWithApplyToAllFooter() throws Exception{ |
280 |
|
281 |
//add header and footer |
282 |
impress.menuItem("View->Header and Footer...").select(); |
283 |
sleep(2); |
284 |
|
285 |
SD_DateAndTimeFooterOnSlide.check(); |
286 |
SD_FixedDateAndTimeFooterOnSlide.check(); |
287 |
sleep(1); |
288 |
SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); |
289 |
sleep(1); |
290 |
SD_FooterTextOnSlide.check(); |
291 |
sleep(1); |
292 |
SD_FooterTextOnSlideInput.setText("Footer Test"); |
293 |
sleep(1); |
294 |
SD_SlideNumAsFooterOnSlide.check(); |
295 |
sleep(1); |
296 |
SD_ApplyToAllButtonOnSlideFooter.click(); |
297 |
sleep(1); |
298 |
|
299 |
|
300 |
ImpressSlideSorter.focus(); |
301 |
for(int j=0; j<=2;j++){ |
302 |
typeKeys("<up>"); |
303 |
sleep(1); |
304 |
} |
305 |
impress.menuItem("Insert->Duplicate Slide").select(); |
306 |
impress.menuItem("View->Header and Footer...").select(); |
307 |
sleep(1); |
308 |
assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); |
309 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
310 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
311 |
} |
312 |
|
313 |
/** |
314 |
* Test footer not show on the first slide. |
315 |
* @throws Exception |
316 |
*/ |
317 |
@Test |
318 |
public void testFooterNotShowOn1stSlide() throws Exception{ |
319 |
|
320 |
//add header and footer |
321 |
impress.menuItem("View->Header and Footer...").select(); |
322 |
sleep(2); |
323 |
SD_FooterTextOnSlide.check(); |
324 |
sleep(1); |
325 |
SD_FooterTextOnSlideInput.setText("Footer Test"); |
326 |
sleep(1); |
327 |
SD_FooterNotShowOn1stSlide.check(); |
328 |
SD_ApplyToAllButtonOnSlideFooter.click(); |
329 |
sleep(1); |
330 |
|
331 |
ImpressSlideSorter.focus(); |
332 |
for(int j=0; j<5; j++){ |
333 |
typeKeys("<up>"); |
334 |
} |
335 |
|
336 |
impress.menuItem("View->Header and Footer...").select(); |
337 |
sleep(1); |
338 |
assertEquals(true,SD_FooterNotShowOn1stSlide.isChecked()); |
339 |
assertEquals(false,SD_FooterTextOnSlide.isChecked()); |
340 |
} |
341 |
|
342 |
/** |
343 |
* Test Insert Footer to focus slide. |
344 |
* @throws Exception |
345 |
*/ |
346 |
@Test |
347 |
public void testInsertApplyFooterOnSlide() throws Exception{ |
348 |
|
349 |
//add header and footer to focus slide. |
350 |
impress.menuItem("View->Header and Footer...").select(); |
351 |
sleep(2); |
352 |
|
353 |
SD_DateAndTimeFooterOnSlide.check(); |
354 |
SD_FixedDateAndTimeFooterOnSlide.check(); |
355 |
sleep(1); |
356 |
SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); |
357 |
sleep(1); |
358 |
SD_FooterTextOnSlide.check(); |
359 |
sleep(1); |
360 |
SD_FooterTextOnSlideInput.setText("Footer Test"); |
361 |
sleep(1); |
362 |
SD_SlideNumAsFooterOnSlide.check(); |
363 |
sleep(1); |
364 |
SD_ApplyButtonOnSlideFooter.click(); |
365 |
sleep(1); |
366 |
|
367 |
impress.menuItem("View->Header and Footer...").select(); |
368 |
sleep(1); |
369 |
assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); |
370 |
assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); |
371 |
assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); |
372 |
assertEquals(true,SD_FooterTextOnSlide.isChecked()); |
373 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
374 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
375 |
//close header and footer dialog. |
376 |
SD_ApplyButtonOnSlideFooter.focus(); |
377 |
typeKeys("<tab>"); |
378 |
typeKeys("<enter>"); |
379 |
//end close |
380 |
|
381 |
ImpressSlideSorter.focus(); |
382 |
typeKeys("<up>"); |
383 |
|
384 |
impress.menuItem("View->Header and Footer...").select(); |
385 |
sleep(1); |
386 |
assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText()); |
387 |
assertEquals("",SD_FooterTextOnSlideInput.getText()); |
388 |
assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); |
389 |
//close header and footer dialog. |
390 |
SD_ApplyButtonOnSlideFooter.focus(); |
391 |
typeKeys("<tab>"); |
392 |
typeKeys("<enter>"); |
393 |
//end close |
394 |
|
395 |
SD_InsertPageButtonOnToolbar.click(); |
396 |
impress.menuItem("View->Header and Footer...").select(); |
397 |
sleep(1); |
398 |
assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText()); |
399 |
assertEquals("",SD_FooterTextOnSlideInput.getText()); |
400 |
assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked()); |
401 |
} |
402 |
|
403 |
/** |
404 |
* Test Insert Footer to Notes View |
405 |
* @throws Exception |
406 |
*/ |
407 |
@Test |
408 |
public void testInsertApplyToAllFooterOnNotes() throws Exception{ |
409 |
|
410 |
//add header and footer to focus slide. |
411 |
impress.menuItem("View->Header and Footer...").select(); |
412 |
sleep(1); |
413 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
414 |
SD_HeaderTextOnNotes.check(); |
415 |
SD_HeaderTextOnNotesInput.setText("Header Test"); |
416 |
SD_DateAndTimeFooterOnSlide.check(); |
417 |
SD_FixedDateAndTimeFooterOnSlide.check(); |
418 |
sleep(1); |
419 |
SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); |
420 |
sleep(1); |
421 |
SD_FooterTextOnSlide.check(); |
422 |
sleep(1); |
423 |
SD_FooterTextOnSlideInput.setText("Footer Test"); |
424 |
sleep(1); |
425 |
SD_SlideNumAsFooterOnSlide.check(); |
426 |
sleep(1); |
427 |
SD_ApplyToAllButtonOnSlideFooter.click(); |
428 |
sleep(1); |
429 |
|
430 |
impress.menuItem("View->Header and Footer...").select(); |
431 |
sleep(1); |
432 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
433 |
assertEquals(true,SD_HeaderTextOnNotes.isChecked()); |
434 |
assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); |
435 |
assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); |
436 |
assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); |
437 |
assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); |
438 |
assertEquals(true,SD_FooterTextOnSlide.isChecked()); |
439 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
440 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
441 |
//close header and footer dialog. |
442 |
SD_ApplyToAllButtonOnSlideFooter.focus(); |
443 |
typeKeys("<tab>"); |
444 |
typeKeys("<enter>"); |
445 |
//end close |
446 |
|
447 |
ImpressSlideSorter.focus(); |
448 |
typeKeys("<up>"); |
449 |
|
450 |
impress.menuItem("View->Header and Footer...").select(); |
451 |
sleep(1); |
452 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
453 |
assertEquals(true,SD_HeaderTextOnNotes.isChecked()); |
454 |
assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); |
455 |
assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); |
456 |
assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); |
457 |
assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); |
458 |
assertEquals(true,SD_FooterTextOnSlide.isChecked()); |
459 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
460 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
461 |
//close header and footer dialog. |
462 |
SD_ApplyToAllButtonOnSlideFooter.focus(); |
463 |
typeKeys("<tab>"); |
464 |
typeKeys("<enter>"); |
465 |
//end close |
466 |
|
467 |
SD_InsertPageButtonOnToolbar.click(); |
468 |
impress.menuItem("View->Header and Footer...").select(); |
469 |
sleep(1); |
470 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
471 |
assertEquals(true,SD_HeaderTextOnNotes.isChecked()); |
472 |
assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); |
473 |
assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); |
474 |
assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); |
475 |
assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); |
476 |
assertEquals(true,SD_FooterTextOnSlide.isChecked()); |
477 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
478 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
479 |
} |
480 |
|
481 |
/** |
482 |
* Test Insert Footer to Slide, use Apply to All |
483 |
* @throws Exception |
484 |
*/ |
485 |
@Test |
486 |
public void testInsertApplyToAllFooterOnSlide() throws Exception{ |
487 |
|
488 |
//add header and footer to focus slide. |
489 |
impress.menuItem("View->Header and Footer...").select(); |
490 |
sleep(2); |
491 |
|
492 |
SD_DateAndTimeFooterOnSlide.check(); |
493 |
SD_FixedDateAndTimeFooterOnSlide.check(); |
494 |
sleep(1); |
495 |
SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323"); |
496 |
sleep(1); |
497 |
SD_FooterTextOnSlide.check(); |
498 |
sleep(1); |
499 |
SD_FooterTextOnSlideInput.setText("Footer Test"); |
500 |
sleep(1); |
501 |
SD_SlideNumAsFooterOnSlide.check(); |
502 |
sleep(1); |
503 |
SD_ApplyToAllButtonOnSlideFooter.click(); |
504 |
sleep(1); |
505 |
|
506 |
impress.menuItem("View->Header and Footer...").select(); |
507 |
sleep(1); |
508 |
assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); |
509 |
assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); |
510 |
assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); |
511 |
assertEquals(true,SD_FooterTextOnSlide.isChecked()); |
512 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
513 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
514 |
//close header and footer dialog. |
515 |
SD_ApplyButtonOnSlideFooter.focus(); |
516 |
typeKeys("<tab>"); |
517 |
typeKeys("<enter>"); |
518 |
//end close |
519 |
|
520 |
ImpressSlideSorter.focus(); |
521 |
typeKeys("<up>"); |
522 |
|
523 |
impress.menuItem("View->Header and Footer...").select(); |
524 |
sleep(1); |
525 |
assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); |
526 |
assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); |
527 |
assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); |
528 |
assertEquals(true,SD_FooterTextOnSlide.isChecked()); |
529 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
530 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
531 |
//close header and footer dialog. |
532 |
SD_ApplyButtonOnSlideFooter.focus(); |
533 |
typeKeys("<tab>"); |
534 |
typeKeys("<enter>"); |
535 |
//end close |
536 |
|
537 |
SD_InsertPageButtonOnToolbar.click(); |
538 |
impress.menuItem("View->Header and Footer...").select(); |
539 |
sleep(1); |
540 |
assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked()); |
541 |
assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked()); |
542 |
assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText()); |
543 |
assertEquals(true,SD_FooterTextOnSlide.isChecked()); |
544 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
545 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
546 |
} |
547 |
|
548 |
/** |
549 |
* Test Insert update automatically time footer to slides. |
550 |
* @throws Exception |
551 |
*/ |
552 |
@Test |
553 |
public void testInsertAutoUpdateTimeFooter() throws Exception{ |
554 |
|
555 |
//add header and footer |
556 |
impress.menuItem("View->Header and Footer...").select(); |
557 |
sleep(1); |
558 |
SD_AutoUpdateTimeFooter.check(); |
559 |
SD_AutoUpdateTimeFooterType.select(7); |
560 |
String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7); |
561 |
SD_ApplyToAllButtonOnSlideFooter.click(); |
562 |
sleep(2); |
563 |
|
564 |
impress.menuItem("View->Header and Footer...").select(); |
565 |
sleep(1); |
566 |
|
567 |
String currentTime2=SD_AutoUpdateTimeFooterType.getItemText(7); |
568 |
assertFalse(currentTime.equals(currentTime2)); |
569 |
} |
570 |
|
571 |
/** |
572 |
* Test Insert update automatically time footer to Notes view. |
573 |
* @throws Exception |
574 |
*/ |
575 |
@Test |
576 |
public void testInsertAutoUpdateTimeFooterOnNotes() throws Exception{ |
577 |
|
578 |
//add header and footer |
579 |
impress.menuItem("View->Header and Footer...").select(); |
580 |
sleep(1); |
581 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
582 |
SD_AutoUpdateTimeFooter.check(); |
583 |
SD_AutoUpdateTimeFooterType.select(7); |
584 |
String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7); |
585 |
SD_ApplyToAllButtonOnSlideFooter.click(); |
586 |
sleep(2); |
587 |
|
588 |
impress.menuItem("View->Header and Footer...").select(); |
589 |
sleep(1); |
590 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
591 |
String currentTime2=SD_AutoUpdateTimeFooterType.getItemText(7); |
592 |
|
593 |
assertFalse(currentTime.equals(currentTime2)); |
594 |
} |
595 |
|
596 |
/** |
597 |
* Test Insert Header and Footer to Notes view. |
598 |
* Save and ReOpen |
599 |
* @throws Exception |
600 |
*/ |
601 |
@Test |
602 |
public void testInsertHeaderFooterOnNotes() throws Exception{ |
603 |
|
604 |
//add header and footer |
605 |
impress.menuItem("View->Header and Footer...").select(); |
606 |
sleep(1); |
607 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
608 |
SD_HeaderTextOnNotes.check(); |
609 |
SD_HeaderTextOnNotesInput.setText("Header Test"); |
610 |
SD_DateAndTimeFooterOnSlide.check(); |
611 |
SD_FixedDateAndTimeFooterOnSlide.check(); |
612 |
sleep(1); |
613 |
SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329"); |
614 |
sleep(1); |
615 |
SD_FooterTextOnSlide.check(); |
616 |
sleep(1); |
617 |
SD_FooterTextOnSlideInput.setText("Footer Test"); |
618 |
sleep(1); |
619 |
SD_SlideNumAsFooterOnSlide.check(); |
620 |
sleep(1); |
621 |
SD_ApplyToAllButtonOnSlideFooter.click(); |
622 |
sleep(1); |
623 |
|
624 |
ImpressSlideSorter.focus(); |
625 |
typeKeys("<up>"); |
626 |
|
627 |
impress.menuItem("View->Header and Footer...").select(); |
628 |
sleep(1); |
629 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
630 |
assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); |
631 |
assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); |
632 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
633 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
634 |
|
635 |
//close header and footer dialog. |
636 |
SD_ApplyToAllButtonOnSlideFooter.focus(); |
637 |
typeKeys("<tab>"); |
638 |
typeKeys("<enter>"); |
639 |
|
640 |
//save this file |
641 |
impress.menuItem("File->Save").select(); |
642 |
String saveTo = fullPath("temp/" + "hello.odp"); |
643 |
FileUtil.deleteFile(saveTo); |
644 |
submitSaveDlg(saveTo); |
645 |
impress.menuItem("File->Close").select(); |
646 |
sleep(2); |
647 |
|
648 |
//Reopen this file |
649 |
openStartcenter(); |
650 |
app.dispatch(".uno:Open"); |
651 |
String openFrom=fullPath("temp/" + "hello.odp"); |
652 |
submitOpenDlg(openFrom); |
653 |
|
654 |
//check after reopen |
655 |
impress.menuItem("View->Header and Footer...").select(); |
656 |
sleep(1); |
657 |
SD_HeaderAndFooterOnNotesTabPage.select(); |
658 |
assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText()); |
659 |
assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); |
660 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
661 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
662 |
} |
663 |
|
664 |
/** |
665 |
* Test Insert Header and Footer to Slide |
666 |
* Save and Reopen |
667 |
* @throws Exception |
668 |
*/ |
669 |
@Test |
670 |
public void testInsertHeaderFooterOnSlide() throws Exception{ |
671 |
|
672 |
//add header and footer |
673 |
impress.menuItem("View->Header and Footer...").select(); |
674 |
sleep(1); |
675 |
SD_DateAndTimeFooterOnSlide.check(); |
676 |
SD_FixedDateAndTimeFooterOnSlide.check(); |
677 |
sleep(1); |
678 |
SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329"); |
679 |
sleep(1); |
680 |
SD_FooterTextOnSlide.check(); |
681 |
sleep(1); |
682 |
SD_FooterTextOnSlideInput.setText("Footer Test"); |
683 |
sleep(1); |
684 |
SD_SlideNumAsFooterOnSlide.check(); |
685 |
sleep(1); |
686 |
SD_ApplyToAllButtonOnSlideFooter.click(); |
687 |
sleep(1); |
688 |
|
689 |
ImpressSlideSorter.focus(); |
690 |
typeKeys("<up>"); |
691 |
|
692 |
impress.menuItem("View->Header and Footer...").select(); |
693 |
sleep(1); |
694 |
assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); |
695 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
696 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
697 |
|
698 |
//close header and footer dialog. |
699 |
SD_ApplyButtonOnSlideFooter.focus(); |
700 |
typeKeys("<tab>"); |
701 |
typeKeys("<enter>"); |
702 |
|
703 |
//save this file |
704 |
impress.menuItem("File->Save").select(); |
705 |
String saveTo = fullPath("temp/" + "hello.odp"); |
706 |
FileUtil.deleteFile(saveTo); |
707 |
submitSaveDlg(saveTo); |
708 |
impress.menuItem("File->Close").select(); |
709 |
sleep(2); |
710 |
|
711 |
//Reopen this file |
712 |
openStartcenter(); |
713 |
app.dispatch(".uno:Open"); |
714 |
String openFrom=fullPath("temp/" + "hello.odp"); |
715 |
submitOpenDlg(openFrom); |
716 |
|
717 |
//check after reopen |
718 |
impress.menuItem("View->Header and Footer...").select(); |
719 |
sleep(1); |
720 |
assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText()); |
721 |
assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText()); |
722 |
assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked()); |
723 |
} |
724 |
} |