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