xref: /AOO41X/test/testgui/source/fvt/gui/sd/headerandfooter/HeaderAndFooterSetting.java (revision bcbf76e83f272441e14591e1f0148577f41e0979)
180a6f5c5SLiu Zhe /**************************************************************
280a6f5c5SLiu Zhe  *
380a6f5c5SLiu Zhe  * Licensed to the Apache Software Foundation (ASF) under one
480a6f5c5SLiu Zhe  * or more contributor license agreements.  See the NOTICE file
580a6f5c5SLiu Zhe  * distributed with this work for additional information
680a6f5c5SLiu Zhe  * regarding copyright ownership.  The ASF licenses this file
780a6f5c5SLiu Zhe  * to you under the Apache License, Version 2.0 (the
880a6f5c5SLiu Zhe  * "License"); you may not use this file except in compliance
980a6f5c5SLiu Zhe  * with the License.  You may obtain a copy of the License at
1080a6f5c5SLiu Zhe  *
1180a6f5c5SLiu Zhe  *   http://www.apache.org/licenses/LICENSE-2.0
1280a6f5c5SLiu Zhe  *
1380a6f5c5SLiu Zhe  * Unless required by applicable law or agreed to in writing,
1480a6f5c5SLiu Zhe  * software distributed under the License is distributed on an
1580a6f5c5SLiu Zhe  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1680a6f5c5SLiu Zhe  * KIND, either express or implied.  See the License for the
1780a6f5c5SLiu Zhe  * specific language governing permissions and limitations
1880a6f5c5SLiu Zhe  * under the License.
1980a6f5c5SLiu Zhe  *
2080a6f5c5SLiu Zhe  *************************************************************/
2180a6f5c5SLiu Zhe 
2280a6f5c5SLiu Zhe /**
2380a6f5c5SLiu Zhe  *
2480a6f5c5SLiu Zhe  */
2580a6f5c5SLiu Zhe package fvt.gui.sd.headerandfooter;
2680a6f5c5SLiu Zhe 
2780a6f5c5SLiu Zhe import static org.junit.Assert.*;
2880a6f5c5SLiu Zhe import static org.openoffice.test.common.Testspace.*;
2980a6f5c5SLiu Zhe import static org.openoffice.test.vcl.Tester.*;
3080a6f5c5SLiu Zhe import static testlib.gui.AppTool.*;
3180a6f5c5SLiu Zhe import static testlib.gui.UIMap.*;
3280a6f5c5SLiu Zhe 
3380a6f5c5SLiu Zhe import org.junit.After;
3480a6f5c5SLiu Zhe import org.junit.Before;
3580a6f5c5SLiu Zhe import org.junit.Rule;
3680a6f5c5SLiu Zhe import org.junit.Test;
3780a6f5c5SLiu Zhe import org.openoffice.test.common.FileUtil;
3880a6f5c5SLiu Zhe import org.openoffice.test.common.Logger;
3980a6f5c5SLiu Zhe 
4080a6f5c5SLiu Zhe import testlib.gui.SDTool;
4180a6f5c5SLiu Zhe 
4280a6f5c5SLiu Zhe public class HeaderAndFooterSetting {
4380a6f5c5SLiu Zhe 
4480a6f5c5SLiu Zhe 	@Rule
4580a6f5c5SLiu Zhe 	public Logger log = Logger.getLogger(this);
4680a6f5c5SLiu Zhe 
4780a6f5c5SLiu Zhe 	@Before
4880a6f5c5SLiu Zhe 	public void setUp() throws Exception {
4980a6f5c5SLiu Zhe 		app.start(true); // Bug 120476
5080a6f5c5SLiu Zhe 
5180a6f5c5SLiu Zhe 		// New a impress, insert some slides
5280a6f5c5SLiu Zhe 		app.dispatch("private:factory/simpress?slot=6686");
5380a6f5c5SLiu Zhe 		presentationWizard.ok();
5480a6f5c5SLiu Zhe 		impress.waitForExistence(10, 2);
5580a6f5c5SLiu Zhe 
5680a6f5c5SLiu Zhe 		for (int i = 0; i < 5; i++) {
5780a6f5c5SLiu Zhe 			sdInsertPageButtonOnToolbar.click();
5880a6f5c5SLiu Zhe 		}
5980a6f5c5SLiu Zhe 		// Pop up navigator panel
6080a6f5c5SLiu Zhe 		if (!sdNavigatorDlg.exists()) {
6180a6f5c5SLiu Zhe 			app.dispatch(".uno:Navigator");
6280a6f5c5SLiu Zhe 		}
6380a6f5c5SLiu Zhe 	}
6480a6f5c5SLiu Zhe 
6580a6f5c5SLiu Zhe 	@After
6680a6f5c5SLiu Zhe 	public void tearDown() throws Exception {
6770375b46SLi Feng Wang 		sleep(3);
681ff8e3a9SLi Feng Wang 		if (sdNavigatorDlg.exists()) {
691ff8e3a9SLi Feng Wang 			app.dispatch(".uno:Navigator");
701ff8e3a9SLi Feng Wang 		}
714a13b48eSLi Feng Wang 		app.stop();
7280a6f5c5SLiu Zhe 	}
7380a6f5c5SLiu Zhe 
7480a6f5c5SLiu Zhe 	/**
7580a6f5c5SLiu Zhe 	 * Test Copy slide with Apply Footer to same file and different file
7680a6f5c5SLiu Zhe 	 *
7780a6f5c5SLiu Zhe 	 * @throws Exception
7880a6f5c5SLiu Zhe 	 */
7980a6f5c5SLiu Zhe 	@Test
8080a6f5c5SLiu Zhe 	public void testCopySlideWithApplyFooter() throws Exception {
8180a6f5c5SLiu Zhe 
8280a6f5c5SLiu Zhe 		// add header and footer
8380a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
8480a6f5c5SLiu Zhe 
8580a6f5c5SLiu Zhe 		sdDateAndTimeFooterOnSlide.check();
8680a6f5c5SLiu Zhe 		sdFixedDateAndTimeFooterOnSlide.check();
8780a6f5c5SLiu Zhe 		sdFixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
8880a6f5c5SLiu Zhe 		sdFooterTextOnSlide.check();
8980a6f5c5SLiu Zhe 		sdFooterTextOnSlideInput.setText("Footer Test");
9080a6f5c5SLiu Zhe 		sdSlideNumAsFooterOnSlide.check();
9180a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.click();
9280a6f5c5SLiu Zhe 
9380a6f5c5SLiu Zhe 		// Click slide 3
9480a6f5c5SLiu Zhe 		impressSlideSorter.focus();
9580a6f5c5SLiu Zhe 		typeKeys("<up><up><up>");
9680a6f5c5SLiu Zhe 		sleep(1);
9780a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
9880a6f5c5SLiu Zhe 		sdSlideNumAsFooterOnSlide.uncheck();
9980a6f5c5SLiu Zhe 		sdApplyButtonOnSlideFooter.click();
10080a6f5c5SLiu Zhe 
10180a6f5c5SLiu Zhe 		// paste to the same file
10280a6f5c5SLiu Zhe 		impressSlideSorter.focus();
10380a6f5c5SLiu Zhe 		app.dispatch(".uno:Copy");
10480a6f5c5SLiu Zhe 		app.dispatch(".uno:Paste");
10580a6f5c5SLiu Zhe 
10680a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
10780a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
10880a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
10980a6f5c5SLiu Zhe 		assertEquals(false, sdSlideNumAsFooterOnSlide.isChecked());
11080a6f5c5SLiu Zhe 		sdHeaderAndFooterDlgSlideTab.cancel();
11180a6f5c5SLiu Zhe 
11280a6f5c5SLiu Zhe 		// paste to different file
11380a6f5c5SLiu Zhe 		impress.focus();
11480a6f5c5SLiu Zhe 		app.dispatch("private:factory/simpress?slot=6686");
11580a6f5c5SLiu Zhe 		presentationWizard.ok();
11680a6f5c5SLiu Zhe 		app.dispatch(".uno:Paste");
11780a6f5c5SLiu Zhe 		impressSlideSorter.focus();
11880a6f5c5SLiu Zhe 		typeKeys("<down>");
11980a6f5c5SLiu Zhe 		sleep(1);
12080a6f5c5SLiu Zhe 
12180a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
12280a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
12380a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
12480a6f5c5SLiu Zhe 		assertEquals(false, sdSlideNumAsFooterOnSlide.isChecked());
125*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterDlgSlideTab.cancel();
126*bcbf76e8SLi Feng Wang 
12780a6f5c5SLiu Zhe 	}
12880a6f5c5SLiu Zhe 
12980a6f5c5SLiu Zhe 	/**
13080a6f5c5SLiu Zhe 	 * Test Copy slide with Apply to all Footer to same file and different file
13180a6f5c5SLiu Zhe 	 *
13280a6f5c5SLiu Zhe 	 * @throws Exception
13380a6f5c5SLiu Zhe 	 */
13480a6f5c5SLiu Zhe 	@Test
13580a6f5c5SLiu Zhe 	public void testCopySlideWithApplyToAllFooter() throws Exception {
13680a6f5c5SLiu Zhe 
13780a6f5c5SLiu Zhe 		// add header and footer
13880a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
13980a6f5c5SLiu Zhe 
14080a6f5c5SLiu Zhe 		sdDateAndTimeFooterOnSlide.check();
14180a6f5c5SLiu Zhe 		sdFixedDateAndTimeFooterOnSlide.check();
14280a6f5c5SLiu Zhe 		sdFixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
14380a6f5c5SLiu Zhe 		sdFooterTextOnSlide.check();
14480a6f5c5SLiu Zhe 		sdFooterTextOnSlideInput.setText("Footer Test");
14580a6f5c5SLiu Zhe 		sdSlideNumAsFooterOnSlide.check();
14680a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.click();
14780a6f5c5SLiu Zhe 
14880a6f5c5SLiu Zhe 		impressSlideSorter.focus();
14980a6f5c5SLiu Zhe 		for (int j = 0; j <= 2; j++) {
15080a6f5c5SLiu Zhe 			typeKeys("<up>");
15180a6f5c5SLiu Zhe 		}
15280a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
15380a6f5c5SLiu Zhe 		sdSlideNumAsFooterOnSlide.uncheck();
15480a6f5c5SLiu Zhe 		sdApplyButtonOnSlideFooter.click();
15580a6f5c5SLiu Zhe 
15680a6f5c5SLiu Zhe 		// paste to the same file
15780a6f5c5SLiu Zhe 		impressSlideSorter.focus();
15880a6f5c5SLiu Zhe 		typeKeys("<up>");
15980a6f5c5SLiu Zhe 		app.dispatch(".uno:Copy");
16080a6f5c5SLiu Zhe 		typeKeys("<down>");
16180a6f5c5SLiu Zhe 		app.dispatch(".uno:Paste");
16280a6f5c5SLiu Zhe 
16380a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
16480a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
16580a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
16680a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
16780a6f5c5SLiu Zhe 		sdHeaderAndFooterDlgSlideTab.cancel();
16880a6f5c5SLiu Zhe 
16980a6f5c5SLiu Zhe 		// paste to different file
17080a6f5c5SLiu Zhe 		app.dispatch("private:factory/simpress?slot=6686");
17180a6f5c5SLiu Zhe 		presentationWizard.ok();
17280a6f5c5SLiu Zhe 		app.dispatch(".uno:Paste");
17380a6f5c5SLiu Zhe 		impressSlideSorter.focus();
17480a6f5c5SLiu Zhe 		typeKeys("<down>");
17580a6f5c5SLiu Zhe 		sleep(1); // If no sleep, error occur
17680a6f5c5SLiu Zhe 
17780a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
17880a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
17980a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
18080a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
181*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterDlgSlideTab.cancel();
18280a6f5c5SLiu Zhe 	}
18380a6f5c5SLiu Zhe 
18480a6f5c5SLiu Zhe 	/**
18580a6f5c5SLiu Zhe 	 * Test Copy slide with Notes Footer to same file and different file
18680a6f5c5SLiu Zhe 	 *
18780a6f5c5SLiu Zhe 	 * @throws Exception
18880a6f5c5SLiu Zhe 	 */
18980a6f5c5SLiu Zhe 	@Test
19080a6f5c5SLiu Zhe 	public void testCopySlideWithNotesHeaderFooter() throws Exception {
19180a6f5c5SLiu Zhe 
19280a6f5c5SLiu Zhe 		// add header and footer
19380a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
19480a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
19580a6f5c5SLiu Zhe 		sdHeaderTextOnNotes.check();
19680a6f5c5SLiu Zhe 		sdHeaderTextOnNotesInput.setText("Header Test");
19780a6f5c5SLiu Zhe 		sdDateAndTimeFooterOnSlide.check();
19880a6f5c5SLiu Zhe 		sdFixedDateAndTimeFooterOnSlide.check();
19980a6f5c5SLiu Zhe 		sdFixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329");
20080a6f5c5SLiu Zhe 		sdFooterTextOnSlide.check();
20180a6f5c5SLiu Zhe 		sdFooterTextOnSlideInput.setText("Footer Test");
20280a6f5c5SLiu Zhe 		sdSlideNumAsFooterOnSlide.check();
20380a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.click();
20480a6f5c5SLiu Zhe 
20580a6f5c5SLiu Zhe 		// paste to the same file
20680a6f5c5SLiu Zhe 		impressSlideSorter.focus();
20780a6f5c5SLiu Zhe 		typeKeys("<up>");
20880a6f5c5SLiu Zhe 		app.dispatch(".uno:Copy");
20980a6f5c5SLiu Zhe 		typeKeys("<down>");
21080a6f5c5SLiu Zhe 		app.dispatch(".uno:Paste");
21180a6f5c5SLiu Zhe 
21280a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
21380a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
21480a6f5c5SLiu Zhe 		assertEquals("Header Test", sdHeaderTextOnNotesInput.getText());
21580a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120329", sdFixedDateAndTimeOnSlideInput.getText());
21680a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
21780a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
21880a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.cancel();
21980a6f5c5SLiu Zhe 
22080a6f5c5SLiu Zhe 		// paste to different file
22180a6f5c5SLiu Zhe 		impress.focus();
22280a6f5c5SLiu Zhe 		app.dispatch("private:factory/simpress?slot=6686");
22380a6f5c5SLiu Zhe 		presentationWizard.ok();
22480a6f5c5SLiu Zhe 		app.dispatch(".uno:Paste");
22580a6f5c5SLiu Zhe 		impressSlideSorter.focus();
22680a6f5c5SLiu Zhe 		typeKeys("<down>");
22780a6f5c5SLiu Zhe 		SDTool.getActiveView().activate();
22880a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
22980a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
23080a6f5c5SLiu Zhe 		assertEquals("Header Test", sdHeaderTextOnNotesInput.getText());
23180a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120329", sdFixedDateAndTimeOnSlideInput.getText());
23280a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
23380a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
234*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterOnNotesTabPage.cancel();
23580a6f5c5SLiu Zhe 	}
23680a6f5c5SLiu Zhe 
23780a6f5c5SLiu Zhe 	/**
23880a6f5c5SLiu Zhe 	 * Test duplicate slide with Apply to all Footer to same file
23980a6f5c5SLiu Zhe 	 *
24080a6f5c5SLiu Zhe 	 * @throws Exception
24180a6f5c5SLiu Zhe 	 */
24280a6f5c5SLiu Zhe 	@Test
24380a6f5c5SLiu Zhe 	public void testDuplicateSlideWithApplyToAllFooter() throws Exception {
24480a6f5c5SLiu Zhe 
24580a6f5c5SLiu Zhe 		// add header and footer
24680a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
24780a6f5c5SLiu Zhe 
24880a6f5c5SLiu Zhe 		sdDateAndTimeFooterOnSlide.check();
24980a6f5c5SLiu Zhe 		sdFixedDateAndTimeFooterOnSlide.check();
25080a6f5c5SLiu Zhe 		sdFixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
25180a6f5c5SLiu Zhe 		sdFooterTextOnSlide.check();
25280a6f5c5SLiu Zhe 		sdFooterTextOnSlideInput.setText("Footer Test");
25380a6f5c5SLiu Zhe 		sdSlideNumAsFooterOnSlide.check();
25480a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.click();
25580a6f5c5SLiu Zhe 
25680a6f5c5SLiu Zhe 		impressSlideSorter.focus();
25780a6f5c5SLiu Zhe 		for (int j = 0; j <= 2; j++) {
25880a6f5c5SLiu Zhe 			typeKeys("<up>");
25980a6f5c5SLiu Zhe 		}
26080a6f5c5SLiu Zhe 		app.dispatch(".uno:DuplicatePage");
26180a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
26280a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
26380a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
26480a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
265*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterDlgSlideTab.cancel();
26680a6f5c5SLiu Zhe 	}
26780a6f5c5SLiu Zhe 
26880a6f5c5SLiu Zhe 	/**
26980a6f5c5SLiu Zhe 	 * Test footer not show on the first slide.
27080a6f5c5SLiu Zhe 	 *
27180a6f5c5SLiu Zhe 	 * @throws Exception
27280a6f5c5SLiu Zhe 	 */
27380a6f5c5SLiu Zhe 	@Test
27480a6f5c5SLiu Zhe 	public void testFooterNotShowOn1stSlide() throws Exception {
27580a6f5c5SLiu Zhe 
27680a6f5c5SLiu Zhe 		// add header and footer
27780a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
27880a6f5c5SLiu Zhe 		sdFooterTextOnSlide.check();
27980a6f5c5SLiu Zhe 		sdFooterTextOnSlideInput.setText("Footer Test");
28080a6f5c5SLiu Zhe 		sdFooterNotShowOn1stSlide.check();
28180a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.click();
28280a6f5c5SLiu Zhe 
28380a6f5c5SLiu Zhe 		// Check slide 1
28480a6f5c5SLiu Zhe 		impressSlideSorter.focus();
28580a6f5c5SLiu Zhe 		// typeKeys("<up><up><up><up><up>"); // Not stable on ubuntu10.04
28680a6f5c5SLiu Zhe 		// sleep(1); // If no sleep, error occur
28780a6f5c5SLiu Zhe 		for (int i = 0; i < 5; i++) {
28880a6f5c5SLiu Zhe 			typeKeys("<up>");
28980a6f5c5SLiu Zhe 			sleep(1);
29080a6f5c5SLiu Zhe 		}
29180a6f5c5SLiu Zhe 
29280a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
29380a6f5c5SLiu Zhe 		assertEquals(true, sdFooterNotShowOn1stSlide.isChecked());
29480a6f5c5SLiu Zhe 		assertEquals(false, sdFooterTextOnSlide.isChecked());
295*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterDlgSlideTab.cancel();
29680a6f5c5SLiu Zhe 	}
29780a6f5c5SLiu Zhe 
29880a6f5c5SLiu Zhe 	/**
29980a6f5c5SLiu Zhe 	 * Test Insert Footer to focus slide.
30080a6f5c5SLiu Zhe 	 *
30180a6f5c5SLiu Zhe 	 * @throws Exception
30280a6f5c5SLiu Zhe 	 */
30380a6f5c5SLiu Zhe 	@Test
30480a6f5c5SLiu Zhe 	public void testInsertApplyFooterOnSlide() throws Exception {
30580a6f5c5SLiu Zhe 
30680a6f5c5SLiu Zhe 		// add header and footer to focus slide.
30780a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
30880a6f5c5SLiu Zhe 
30980a6f5c5SLiu Zhe 		sdDateAndTimeFooterOnSlide.check();
31080a6f5c5SLiu Zhe 		sdFixedDateAndTimeFooterOnSlide.check();
31180a6f5c5SLiu Zhe 		sdFixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
31280a6f5c5SLiu Zhe 		sdFooterTextOnSlide.check();
31380a6f5c5SLiu Zhe 		sdFooterTextOnSlideInput.setText("Footer Test");
31480a6f5c5SLiu Zhe 		sdSlideNumAsFooterOnSlide.check();
31580a6f5c5SLiu Zhe 		sdApplyButtonOnSlideFooter.click();
31680a6f5c5SLiu Zhe 
31780a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
31880a6f5c5SLiu Zhe 		assertEquals(true, sdDateAndTimeFooterOnSlide.isChecked());
31980a6f5c5SLiu Zhe 		assertEquals(true, sdFixedDateAndTimeFooterOnSlide.isChecked());
32080a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
32180a6f5c5SLiu Zhe 		assertEquals(true, sdFooterTextOnSlide.isChecked());
32280a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
32380a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
32480a6f5c5SLiu Zhe 		// close header and footer dialog.
32580a6f5c5SLiu Zhe 		sdApplyButtonOnSlideFooter.focus();
32680a6f5c5SLiu Zhe 		typeKeys("<tab>");
32780a6f5c5SLiu Zhe 		typeKeys("<enter>");
32880a6f5c5SLiu Zhe 		// end close
32980a6f5c5SLiu Zhe 
33080a6f5c5SLiu Zhe 		impressSlideSorter.focus();
33180a6f5c5SLiu Zhe 		typeKeys("<up>");
33280a6f5c5SLiu Zhe 		sleep(1); // If no sleep, error occur
33380a6f5c5SLiu Zhe 
33480a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
33580a6f5c5SLiu Zhe 		assertEquals("", sdFixedDateAndTimeOnSlideInput.getText());
33680a6f5c5SLiu Zhe 		assertEquals("", sdFooterTextOnSlideInput.getText());
33780a6f5c5SLiu Zhe 		assertEquals(false, sdSlideNumAsFooterOnSlide.isChecked());
33880a6f5c5SLiu Zhe 		// close header and footer dialog.
33980a6f5c5SLiu Zhe 		sdApplyButtonOnSlideFooter.focus();
34080a6f5c5SLiu Zhe 		typeKeys("<tab>");
34180a6f5c5SLiu Zhe 		typeKeys("<enter>");
34280a6f5c5SLiu Zhe 		// end close
34380a6f5c5SLiu Zhe 
34480a6f5c5SLiu Zhe 		sdInsertPageButtonOnToolbar.click();
34580a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
34680a6f5c5SLiu Zhe 		assertEquals("", sdFixedDateAndTimeOnSlideInput.getText());
34780a6f5c5SLiu Zhe 		assertEquals("", sdFooterTextOnSlideInput.getText());
34880a6f5c5SLiu Zhe 		assertEquals(false, sdSlideNumAsFooterOnSlide.isChecked());
349*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterDlgSlideTab.cancel();
35080a6f5c5SLiu Zhe 	}
35180a6f5c5SLiu Zhe 
35280a6f5c5SLiu Zhe 	/**
35380a6f5c5SLiu Zhe 	 * Test Insert Footer to Notes View
35480a6f5c5SLiu Zhe 	 *
35580a6f5c5SLiu Zhe 	 * @throws Exception
35680a6f5c5SLiu Zhe 	 */
35780a6f5c5SLiu Zhe 	@Test
35880a6f5c5SLiu Zhe 	public void testInsertApplyToAllFooterOnNotes() throws Exception {
35980a6f5c5SLiu Zhe 
36080a6f5c5SLiu Zhe 		// add header and footer to focus slide.
36180a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
36280a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
36380a6f5c5SLiu Zhe 		sdHeaderTextOnNotes.check();
36480a6f5c5SLiu Zhe 		sdHeaderTextOnNotesInput.setText("Header Test");
36580a6f5c5SLiu Zhe 		sdDateAndTimeFooterOnSlide.check();
36680a6f5c5SLiu Zhe 		sdFixedDateAndTimeFooterOnSlide.check();
36780a6f5c5SLiu Zhe 		sdFixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
36880a6f5c5SLiu Zhe 		sdFooterTextOnSlide.check();
36980a6f5c5SLiu Zhe 		sdFooterTextOnSlideInput.setText("Footer Test");
37080a6f5c5SLiu Zhe 		sdSlideNumAsFooterOnSlide.check();
37180a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.click();
37280a6f5c5SLiu Zhe 
37380a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
37480a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
37580a6f5c5SLiu Zhe 		assertEquals(true, sdHeaderTextOnNotes.isChecked());
37680a6f5c5SLiu Zhe 		assertEquals("Header Test", sdHeaderTextOnNotesInput.getText());
37780a6f5c5SLiu Zhe 		assertEquals(true, sdDateAndTimeFooterOnSlide.isChecked());
37880a6f5c5SLiu Zhe 		assertEquals(true, sdFixedDateAndTimeFooterOnSlide.isChecked());
37980a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
38080a6f5c5SLiu Zhe 		assertEquals(true, sdFooterTextOnSlide.isChecked());
38180a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
38280a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
38380a6f5c5SLiu Zhe 		// close header and footer dialog.
38480a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.focus();
38580a6f5c5SLiu Zhe 		typeKeys("<tab>");
38680a6f5c5SLiu Zhe 		typeKeys("<enter>");
38780a6f5c5SLiu Zhe 		// end close
38880a6f5c5SLiu Zhe 
38980a6f5c5SLiu Zhe 		impressSlideSorter.focus();
39080a6f5c5SLiu Zhe 		typeKeys("<up>");
39180a6f5c5SLiu Zhe 
39280a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
39380a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
39480a6f5c5SLiu Zhe 		assertEquals(true, sdHeaderTextOnNotes.isChecked());
39580a6f5c5SLiu Zhe 		assertEquals("Header Test", sdHeaderTextOnNotesInput.getText());
39680a6f5c5SLiu Zhe 		assertEquals(true, sdDateAndTimeFooterOnSlide.isChecked());
39780a6f5c5SLiu Zhe 		assertEquals(true, sdFixedDateAndTimeFooterOnSlide.isChecked());
39880a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
39980a6f5c5SLiu Zhe 		assertEquals(true, sdFooterTextOnSlide.isChecked());
40080a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
40180a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
40280a6f5c5SLiu Zhe 		// close header and footer dialog.
40380a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.focus();
40480a6f5c5SLiu Zhe 		typeKeys("<tab>");
40580a6f5c5SLiu Zhe 		typeKeys("<enter>");
40680a6f5c5SLiu Zhe 		// end close
40780a6f5c5SLiu Zhe 
40880a6f5c5SLiu Zhe 		sdInsertPageButtonOnToolbar.click();
40980a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
41080a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
41180a6f5c5SLiu Zhe 		assertEquals(true, sdHeaderTextOnNotes.isChecked());
41280a6f5c5SLiu Zhe 		assertEquals("Header Test", sdHeaderTextOnNotesInput.getText());
41380a6f5c5SLiu Zhe 		assertEquals(true, sdDateAndTimeFooterOnSlide.isChecked());
41480a6f5c5SLiu Zhe 		assertEquals(true, sdFixedDateAndTimeFooterOnSlide.isChecked());
41580a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
41680a6f5c5SLiu Zhe 		assertEquals(true, sdFooterTextOnSlide.isChecked());
41780a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
41880a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
419*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterOnNotesTabPage.cancel();
42080a6f5c5SLiu Zhe 	}
42180a6f5c5SLiu Zhe 
42280a6f5c5SLiu Zhe 	/**
42380a6f5c5SLiu Zhe 	 * Test Insert Footer to Slide, use Apply to All
42480a6f5c5SLiu Zhe 	 *
42580a6f5c5SLiu Zhe 	 * @throws Exception
42680a6f5c5SLiu Zhe 	 */
42780a6f5c5SLiu Zhe 	@Test
42880a6f5c5SLiu Zhe 	public void testInsertApplyToAllFooterOnSlide() throws Exception {
42980a6f5c5SLiu Zhe 
43080a6f5c5SLiu Zhe 		// add header and footer to focus slide.
43180a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
43280a6f5c5SLiu Zhe 
43380a6f5c5SLiu Zhe 		sdDateAndTimeFooterOnSlide.check();
43480a6f5c5SLiu Zhe 		sdFixedDateAndTimeFooterOnSlide.check();
43580a6f5c5SLiu Zhe 		sdFixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
43680a6f5c5SLiu Zhe 		sdFooterTextOnSlide.check();
43780a6f5c5SLiu Zhe 		sdFooterTextOnSlideInput.setText("Footer Test");
43880a6f5c5SLiu Zhe 		sdSlideNumAsFooterOnSlide.check();
43980a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.click();
44080a6f5c5SLiu Zhe 
44180a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
44280a6f5c5SLiu Zhe 		assertEquals(true, sdDateAndTimeFooterOnSlide.isChecked());
44380a6f5c5SLiu Zhe 		assertEquals(true, sdFixedDateAndTimeFooterOnSlide.isChecked());
44480a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
44580a6f5c5SLiu Zhe 		assertEquals(true, sdFooterTextOnSlide.isChecked());
44680a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
44780a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
44880a6f5c5SLiu Zhe 		// close header and footer dialog.
44980a6f5c5SLiu Zhe 		sdApplyButtonOnSlideFooter.focus();
45080a6f5c5SLiu Zhe 		typeKeys("<tab>");
45180a6f5c5SLiu Zhe 		typeKeys("<enter>");
45280a6f5c5SLiu Zhe 		// end close
45380a6f5c5SLiu Zhe 
45480a6f5c5SLiu Zhe 		impressSlideSorter.focus();
45580a6f5c5SLiu Zhe 		typeKeys("<up>");
45680a6f5c5SLiu Zhe 
45780a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
45880a6f5c5SLiu Zhe 		assertEquals(true, sdDateAndTimeFooterOnSlide.isChecked());
45980a6f5c5SLiu Zhe 		assertEquals(true, sdFixedDateAndTimeFooterOnSlide.isChecked());
46080a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
46180a6f5c5SLiu Zhe 		assertEquals(true, sdFooterTextOnSlide.isChecked());
46280a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
46380a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
46480a6f5c5SLiu Zhe 		// close header and footer dialog.
46580a6f5c5SLiu Zhe 		sdApplyButtonOnSlideFooter.focus();
46680a6f5c5SLiu Zhe 		typeKeys("<tab>");
46780a6f5c5SLiu Zhe 		typeKeys("<enter>");
46880a6f5c5SLiu Zhe 		// end close
46980a6f5c5SLiu Zhe 
47080a6f5c5SLiu Zhe 		sdInsertPageButtonOnToolbar.click();
47180a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
47280a6f5c5SLiu Zhe 		assertEquals(true, sdDateAndTimeFooterOnSlide.isChecked());
47380a6f5c5SLiu Zhe 		assertEquals(true, sdFixedDateAndTimeFooterOnSlide.isChecked());
47480a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120323", sdFixedDateAndTimeOnSlideInput.getText());
47580a6f5c5SLiu Zhe 		assertEquals(true, sdFooterTextOnSlide.isChecked());
47680a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
47780a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
478*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterDlgSlideTab.cancel();
47980a6f5c5SLiu Zhe 	}
48080a6f5c5SLiu Zhe 
48180a6f5c5SLiu Zhe 	/**
48280a6f5c5SLiu Zhe 	 * Test Insert update automatically time footer to slides.
48380a6f5c5SLiu Zhe 	 *
48480a6f5c5SLiu Zhe 	 * @throws Exception
48580a6f5c5SLiu Zhe 	 */
48680a6f5c5SLiu Zhe 	@Test
48780a6f5c5SLiu Zhe 	public void testInsertAutoUpdateTimeFooter() throws Exception {
48880a6f5c5SLiu Zhe 
48980a6f5c5SLiu Zhe 		// add header and footer
49080a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
49180a6f5c5SLiu Zhe 		sdAutoUpdateTimeFooter.check();
49280a6f5c5SLiu Zhe 		sdAutoUpdateTimeFooterType.select(7);
49380a6f5c5SLiu Zhe 		String currentTime = sdAutoUpdateTimeFooterType.getItemText(7);
49480a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.click();
49580a6f5c5SLiu Zhe 		sleep(1); // Wait some time to check the time update
49680a6f5c5SLiu Zhe 
49780a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
49880a6f5c5SLiu Zhe 		String updatedTime = sdAutoUpdateTimeFooterType.getItemText(7);
49980a6f5c5SLiu Zhe 		assertNotSame("Time can not update", currentTime, updatedTime);
500*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterDlgSlideTab.cancel();
50180a6f5c5SLiu Zhe 	}
50280a6f5c5SLiu Zhe 
50380a6f5c5SLiu Zhe 	/**
50480a6f5c5SLiu Zhe 	 * Test Insert update automatically time footer to Notes view.
50580a6f5c5SLiu Zhe 	 *
50680a6f5c5SLiu Zhe 	 * @throws Exception
50780a6f5c5SLiu Zhe 	 */
50880a6f5c5SLiu Zhe 	@Test
50980a6f5c5SLiu Zhe 	public void testInsertAutoUpdateTimeFooterOnNotes() throws Exception {
51080a6f5c5SLiu Zhe 
51180a6f5c5SLiu Zhe 		// add header and footer
51280a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
51380a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
51480a6f5c5SLiu Zhe 		sdAutoUpdateTimeFooter.check();
51580a6f5c5SLiu Zhe 		String currentTime = sdAutoUpdateTimeFooterType.getItemText(7);
51680a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.click();
51780a6f5c5SLiu Zhe 		sleep(1); // Wait some time to check the time update
51880a6f5c5SLiu Zhe 
51980a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
52080a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
52180a6f5c5SLiu Zhe 		String updatedTime = sdAutoUpdateTimeFooterType.getItemText(7);
52280a6f5c5SLiu Zhe 
52380a6f5c5SLiu Zhe 		assertNotSame("Time can not update", currentTime, updatedTime);
524*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterOnNotesTabPage.cancel();
52580a6f5c5SLiu Zhe 	}
52680a6f5c5SLiu Zhe 
52780a6f5c5SLiu Zhe 	/**
52880a6f5c5SLiu Zhe 	 * Test Insert Header and Footer to Notes view. Save and ReOpen
52980a6f5c5SLiu Zhe 	 *
53080a6f5c5SLiu Zhe 	 * @throws Exception
53180a6f5c5SLiu Zhe 	 */
53280a6f5c5SLiu Zhe 	@Test
53380a6f5c5SLiu Zhe 	public void testInsertHeaderFooterOnNotes() throws Exception {
53480a6f5c5SLiu Zhe 
53580a6f5c5SLiu Zhe 		// add header and footer
53680a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
53780a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
53880a6f5c5SLiu Zhe 		sdHeaderTextOnNotes.check();
53980a6f5c5SLiu Zhe 		sdHeaderTextOnNotesInput.setText("Header Test");
54080a6f5c5SLiu Zhe 		sdDateAndTimeFooterOnSlide.check();
54180a6f5c5SLiu Zhe 		sdFixedDateAndTimeFooterOnSlide.check();
54280a6f5c5SLiu Zhe 		sdFixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329");
54380a6f5c5SLiu Zhe 		sdFooterTextOnSlide.check();
54480a6f5c5SLiu Zhe 		sdFooterTextOnSlideInput.setText("Footer Test");
54580a6f5c5SLiu Zhe 		sdSlideNumAsFooterOnSlide.check();
54680a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.click();
54780a6f5c5SLiu Zhe 
54880a6f5c5SLiu Zhe 		impressSlideSorter.focus();
54980a6f5c5SLiu Zhe 		typeKeys("<up>");
55080a6f5c5SLiu Zhe 
55180a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
55280a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
55380a6f5c5SLiu Zhe 		assertEquals("Header Test", sdHeaderTextOnNotesInput.getText());
55480a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120329", sdFixedDateAndTimeOnSlideInput.getText());
55580a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
55680a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
55780a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.cancel();
55880a6f5c5SLiu Zhe 
55980a6f5c5SLiu Zhe 		// save this file
56080a6f5c5SLiu Zhe 		app.dispatch(".uno:SaveAs");
56180a6f5c5SLiu Zhe 		String saveTo = getPath("temp/" + "hello.odp");
56280a6f5c5SLiu Zhe 		FileUtil.deleteFile(saveTo);
56380a6f5c5SLiu Zhe 		submitSaveDlg(saveTo);
5644a13b48eSLi Feng Wang 		if (activeMsgBox.exists()) {
5654a13b48eSLi Feng Wang 			activeMsgBox.yes();
5664a13b48eSLi Feng Wang 			sleep(2);
5674a13b48eSLi Feng Wang 		}
5684a13b48eSLi Feng Wang 		sleep(5);
56980a6f5c5SLiu Zhe 		app.dispatch(".uno:CloseDoc");
57080a6f5c5SLiu Zhe 
57180a6f5c5SLiu Zhe 		// Reopen this file
57280a6f5c5SLiu Zhe 		openStartcenter();
57380a6f5c5SLiu Zhe 		app.dispatch(".uno:Open");
57480a6f5c5SLiu Zhe 		String openFrom = getPath("temp/" + "hello.odp");
57580a6f5c5SLiu Zhe 		submitOpenDlg(openFrom);
5764a13b48eSLi Feng Wang 		sleep(5);
57780a6f5c5SLiu Zhe 		// check after reopen
57880a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
57980a6f5c5SLiu Zhe 		sdHeaderAndFooterOnNotesTabPage.select();
58080a6f5c5SLiu Zhe 		assertEquals("Header Test", sdHeaderTextOnNotesInput.getText());
58180a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120329", sdFixedDateAndTimeOnSlideInput.getText());
58280a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
58380a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
584*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterOnNotesTabPage.cancel();
58580a6f5c5SLiu Zhe 	}
58680a6f5c5SLiu Zhe 
58780a6f5c5SLiu Zhe 	/**
58880a6f5c5SLiu Zhe 	 * Test Insert Header and Footer to Slide Save and Reopen
58980a6f5c5SLiu Zhe 	 *
59080a6f5c5SLiu Zhe 	 * @throws Exception
59180a6f5c5SLiu Zhe 	 */
59280a6f5c5SLiu Zhe 	@Test
59380a6f5c5SLiu Zhe 	public void testInsertHeaderFooterOnSlide() throws Exception {
59480a6f5c5SLiu Zhe 
59580a6f5c5SLiu Zhe 		// add header and footer
59680a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
59780a6f5c5SLiu Zhe 		sdDateAndTimeFooterOnSlide.check();
59880a6f5c5SLiu Zhe 		sdFixedDateAndTimeFooterOnSlide.check();
59980a6f5c5SLiu Zhe 		sdFixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329");
60080a6f5c5SLiu Zhe 		sdFooterTextOnSlide.check();
60180a6f5c5SLiu Zhe 		sdFooterTextOnSlideInput.setText("Footer Test");
60280a6f5c5SLiu Zhe 		sdSlideNumAsFooterOnSlide.check();
60380a6f5c5SLiu Zhe 		sdApplyToAllButtonOnSlideFooter.click();
60480a6f5c5SLiu Zhe 
60580a6f5c5SLiu Zhe 		impressSlideSorter.focus();
60680a6f5c5SLiu Zhe 		typeKeys("<up>");
60780a6f5c5SLiu Zhe 
60880a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
60980a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120329", sdFixedDateAndTimeOnSlideInput.getText());
61080a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
61180a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
61280a6f5c5SLiu Zhe 
61380a6f5c5SLiu Zhe 		// close header and footer dialog.
61480a6f5c5SLiu Zhe 		sdApplyButtonOnSlideFooter.focus();
61580a6f5c5SLiu Zhe 		typeKeys("<tab>");
61680a6f5c5SLiu Zhe 		typeKeys("<enter>");
61780a6f5c5SLiu Zhe 
61880a6f5c5SLiu Zhe 		// save this file
61980a6f5c5SLiu Zhe 		app.dispatch(".uno:SaveAs");
62080a6f5c5SLiu Zhe 		String saveTo = getPath("temp/" + "hello.odp");
62180a6f5c5SLiu Zhe 		FileUtil.deleteFile(saveTo);
62280a6f5c5SLiu Zhe 		submitSaveDlg(saveTo);
6234a13b48eSLi Feng Wang 		if (activeMsgBox.exists()) {
6244a13b48eSLi Feng Wang 			activeMsgBox.yes();
6254a13b48eSLi Feng Wang 			sleep(2);
6264a13b48eSLi Feng Wang 		}
6274a13b48eSLi Feng Wang 		sleep(5);
62880a6f5c5SLiu Zhe 		app.dispatch(".uno:CloseDoc");
62980a6f5c5SLiu Zhe 
63080a6f5c5SLiu Zhe 		// Reopen this file
63180a6f5c5SLiu Zhe 		openStartcenter();
63280a6f5c5SLiu Zhe 		app.dispatch(".uno:Open");
63380a6f5c5SLiu Zhe 		String openFrom = getPath("temp/" + "hello.odp");
63480a6f5c5SLiu Zhe 		submitOpenDlg(openFrom);
6354a13b48eSLi Feng Wang 		sleep(5);
63680a6f5c5SLiu Zhe 		// check after reopen
63780a6f5c5SLiu Zhe 		app.dispatch(".uno:HeaderAndFooter");
63880a6f5c5SLiu Zhe 		assertEquals("Fix Date: 20120329", sdFixedDateAndTimeOnSlideInput.getText());
63980a6f5c5SLiu Zhe 		assertEquals("Footer Test", sdFooterTextOnSlideInput.getText());
64080a6f5c5SLiu Zhe 		assertEquals(true, sdSlideNumAsFooterOnSlide.isChecked());
641*bcbf76e8SLi Feng Wang 		sdHeaderAndFooterDlgSlideTab.cancel();
64280a6f5c5SLiu Zhe 	}
64380a6f5c5SLiu Zhe }
644