View | Details | Raw Unified | Return to issue 120295
Collapse All | Expand All

(-)testoo/src/testcase/sd/headerandfooter/InsertHeaderFooterOnSlide.java (-146 lines)
Lines 1-146 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.fullPath;
27
import static testlib.AppUtil.initApp;
28
import static testlib.AppUtil.openStartcenter;
29
import static testlib.AppUtil.submitSaveDlg;
30
import static testlib.AppUtil.submitOpenDlg;
31
import static testlib.UIMap.startcenter;
32
import static testlib.UIMap.*;
33
34
import java.io.File;
35
36
import static org.junit.Assert.*;
37
import static org.openoffice.test.vcl.Tester.*;
38
import static org.openoffice.test.vcl.Tester.typeKeys;
39
40
import org.junit.Before;
41
import org.junit.Rule;
42
import org.junit.Test;
43
import org.openoffice.test.common.FileUtil;
44
45
import testlib.Log;
46
import testlib.UIMap;
47
48
public class InsertHeaderFooterOnSlide {
49
	/**
50
	 * TestCapture helps us to do
51
	 * 1. Take a screenshot when failure occurs.
52
	 * 2. Collect extra data when OpenOffice crashes.
53
	 */	
54
	@Rule
55
	public Log LOG = new Log();
56
	
57
	/**
58
	 * initApp helps us to do 
59
	 * 1. Patch the OpenOffice to enable automation if necessary.
60
	 * 2. Start OpenOffice with automation enabled if necessary.
61
	 * 3. Reset OpenOffice to startcenter.
62
	 * 
63
	 * @throws java.lang.Exception
64
	 */
65
	@Before
66
	public void setUp() throws Exception {
67
		initApp();
68
	}
69
	
70
	/**
71
	 * Test Insert Header and Footer to Slide
72
	 * Save and Reopen
73
	 * @throws Exception
74
	 */
75
	@Test
76
	public void testInsertHeaderFooterOnSlide() throws Exception{
77
		
78
		startcenter.menuItem("File->New->Presentation").select();
79
		sleep(2);
80
		
81
		for(int i=0; i<5;i++){
82
		SD_InsertPageButtonOnToolbar.click();
83
		sleep(1);
84
		}
85
		//pop up navigator panel
86
		impress.menuItem("View").select();
87
		if(!impress.menuItem("View->Navigator").isSelected()){
88
			impress.menuItem("View->Navigator").select();
89
			sleep(1);
90
		}
91
		
92
		//add header and footer
93
		impress.menuItem("View->Header and Footer...").select();
94
		sleep(1);
95
		SD_DateAndTimeFooterOnSlide.check();
96
		SD_FixedDateAndTimeFooterOnSlide.check();
97
		sleep(1);
98
		SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329");
99
		sleep(1);
100
		SD_FooterTextOnSlide.check();
101
		sleep(1);
102
		SD_FooterTextOnSlideInput.setText("Footer Test");
103
		sleep(1);
104
		SD_SlideNumAsFooterOnSlide.check();
105
		sleep(1);
106
		SD_ApplyToAllButtonOnSlideFooter.click();
107
		sleep(1);
108
				
109
		SD_SlidesPanel.focus();
110
		typeKeys("<up>");
111
112
		impress.menuItem("View->Header and Footer...").select();
113
		sleep(1);
114
		assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
115
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
116
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
117
		
118
		//close header and footer dialog.
119
		SD_ApplyButtonOnSlideFooter.focus();
120
		typeKeys("<tab>");
121
		typeKeys("<enter>");
122
		
123
		//save this file
124
		impress.menuItem("File->Save").select();
125
		String saveTo = fullPath("temp/" + "hello.odp");
126
		FileUtil.deleteFile(saveTo);
127
		submitSaveDlg(saveTo);	
128
		impress.menuItem("File->Close").select();
129
		sleep(2);
130
		
131
		//Reopen this file
132
		openStartcenter();
133
		startcenter.menuItem("File->Open").select();
134
		String openFrom=fullPath("temp/" + "hello.odp");
135
		submitOpenDlg(openFrom);
136
		
137
		//check after reopen		
138
		impress.menuItem("View->Header and Footer...").select();
139
		sleep(1);
140
		assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
141
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
142
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
143
		
144
	}
145
	
146
}
(-)testoo/src/testcase/formula/catalog/AddDeleteSymbolsFromCatalog.java (+211 lines)
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.formula.catalog;
28
29
import static testlib.AppUtil.*;
30
import static testlib.UIMap.*;
31
import static org.junit.Assert.*;
32
import org.junit.After;
33
import org.junit.Before;
34
import org.junit.Rule;
35
import org.junit.Test;
36
import testlib.Log;
37
38
/**
39
 *
40
 */
41
public class AddDeleteSymbolsFromCatalog {
42
43
	@Rule
44
	public Log LOG = new Log();
45
	
46
	@Before
47
	public void setUp() throws Exception {
48
		app.start();
49
		
50
		// New a formula document
51
		startcenter.menuItem("File->New->Formula").select();
52
		sleep(3);		
53
		
54
		// Click catalog button
55
		math_CatalogButton.click();
56
		sleep(1);
57
		
58
		// Verify if the "Symbols" dialog pop up
59
		assertTrue("Symbols dialog does not pop up", math_SymbolsDlg.exists(3));
60
		
61
		// Select "Special", click "Edit" button
62
		math_SymbolsDlgListbox.select("Special");
63
		math_SymbolsDlgEditButton.click();
64
		sleep(1);
65
		
66
		// Verify if the "Edit Symbols" dialog pop up
67
		assertTrue("Edit Symbols dialog does not pop up", math_EditSymbolsDlg.exists(3));
68
	}
69
70
	@After
71
	public void tearDown() throws Exception {
72
		app.close();
73
	}
74
75
	/**
76
	 * Test add custom symbols from Catalog->Symbols
77
	 * @throws Exception
78
	 */
79
	@Test
80
	public void testAddSymbolFromCatalog() throws Exception{
81
		
82
		// Choose a symbol which is not in the list, click "Add" and "OK"
83
		String selectedSymbol;
84
		boolean bSelectSymbolNotInList;
85
		int nListCount;
86
		int nIndex = 1;
87
		do {
88
			math_EditSymbolsDlgViewControl.click(100*nIndex, 10);	// risk: after 6 or 7 circles, this will click out of ViewControl
89
			sleep(1);
90
			selectedSymbol = math_EditSymbolsDlgSymbol.getText();
91
			nIndex++;
92
			// Find if the selected symbol is already in the list
93
			bSelectSymbolNotInList = false;
94
			nListCount = math_EditSymbolsDlgSymbol.getItemCount();
95
			for (int i=0; i<nListCount; i++) {
96
				if (selectedSymbol.equals(math_EditSymbolsDlgSymbol.getItemText(i))) {
97
					bSelectSymbolNotInList = true;
98
					break;
99
				}
100
			}
101
		} while (bSelectSymbolNotInList);
102
		math_EditSymbolsDlgAdd.click();
103
		math_EditSymbolsDlg.ok();
104
		sleep(1);
105
		
106
		// Verify if the symbol is added to Symbol set
107
		math_SymbolsDlgEditButton.click();
108
		bSelectSymbolNotInList = false;
109
		nListCount = math_EditSymbolsDlgSymbol.getItemCount();
110
		for (int i=0; i<nListCount; i++) {
111
			if (selectedSymbol.equals(math_EditSymbolsDlgSymbol.getItemText(i))) {
112
				bSelectSymbolNotInList = true;
113
				break;
114
			}
115
		}
116
		assertTrue("Symbol is not added to Symbol set", bSelectSymbolNotInList);
117
		
118
		// Close all dialogs
119
		math_EditSymbolsDlg.cancel();
120
		math_SymbolsDlg.close();
121
		app.dispatch(".uno:CloseDoc");
122
	}
123
	
124
	/**
125
	 * Test modify font of custom symbols from Catalog->Symbols
126
	 * @throws Exception
127
	 */
128
	@Test
129
	public void testModifySymbolFontFromCatalog() throws Exception{
130
		
131
		// Modify the font of selected symbol
132
		//String selectedSymbol = math_EditSymbolsDlgSymbol.getText();
133
		int oldSymbolFontIndex = math_EditSymbolsDlgFont.getSelIndex();
134
		int modifiedSymbolFondIndex = (oldSymbolFontIndex+1==math_EditSymbolsDlgFont.getItemCount()) ? 0 : (oldSymbolFontIndex+1);
135
		math_EditSymbolsDlgFont.select(modifiedSymbolFondIndex);	// select the next font of old font
136
		String modifiedSymbolFont = math_EditSymbolsDlgFont.getSelText();
137
		String selectedSymbol = math_EditSymbolsDlgSymbol.getText();
138
		math_EditSymbolsDlgModify.click();
139
		math_EditSymbolsDlg.ok();
140
		sleep(1);
141
		
142
		// Verify if the font of symbol is modified successfully
143
		math_SymbolsDlgEditButton.click();
144
		math_EditSymbolsDlgSymbol.select(selectedSymbol);
145
		assertEquals("Font of symbol is not modified successfully", modifiedSymbolFont, math_EditSymbolsDlgFont.getSelText());
146
		
147
		// Close all dialogs
148
		math_EditSymbolsDlg.cancel();
149
		math_SymbolsDlg.close();
150
		app.dispatch(".uno:CloseDoc");
151
	}
152
	
153
	/**
154
	 * Test modify typeface of custom symbols from Catalog->Symbols
155
	 * @throws Exception
156
	 */
157
	@Test
158
	public void testModifySymbolTypefaceFromCatalog() throws Exception{
159
				
160
		// Modify the typeface of selected symbol
161
//		String selectedSymbol = math_EditSymbolsDlgSymbol.getText();
162
		int oldSymbolTypefaceIndex = math_EditSymbolsDlgTypeface.getSelIndex();
163
		int modifiedSymbolTypefaceIndex = (oldSymbolTypefaceIndex+1==math_EditSymbolsDlgTypeface.getItemCount()) ? 0 : (oldSymbolTypefaceIndex+1);
164
		math_EditSymbolsDlgTypeface.select(modifiedSymbolTypefaceIndex);	// select the next typeface of old typeface
165
		String modifiedSymbolTypeface= math_EditSymbolsDlgTypeface.getSelText();
166
		String selectedSymbol = math_EditSymbolsDlgSymbol.getText();
167
		math_EditSymbolsDlgModify.click();
168
		math_EditSymbolsDlg.ok();
169
		sleep(1);
170
		
171
		// Verify if the typeface of symbol is modified successfully
172
		math_SymbolsDlgEditButton.click();
173
		math_EditSymbolsDlgSymbol.select(selectedSymbol);
174
		assertEquals("Typeface of symbol is not modified successfully", modifiedSymbolTypeface, math_EditSymbolsDlgTypeface.getSelText());
175
		
176
		// Close all dialogs
177
		math_EditSymbolsDlg.cancel();
178
		math_SymbolsDlg.close();
179
		app.dispatch(".uno:CloseDoc");
180
	}
181
	
182
	/**
183
	 * Test delete custom symbols from Catalog->Symbols
184
	 * @throws Exception
185
	 */
186
	@Test
187
	public void testDeleteSymbolFromCatalog() throws Exception{
188
		
189
		// Delete the selected symbol
190
		String selectedSymbol = math_EditSymbolsDlgSymbol.getText();
191
		math_EditSymbolsDlgDelete.click();
192
		math_EditSymbolsDlg.ok();
193
		sleep(1);
194
		
195
		// Verify if the selected symbol is deleted successfully
196
		math_SymbolsDlgEditButton.click();
197
		boolean isDeleted = true;
198
		for (int i=0; i<math_EditSymbolsDlgSymbol.getItemCount(); i++) {
199
			if (selectedSymbol.equals(math_EditSymbolsDlgSymbol.getItemText(i))){
200
				isDeleted = false;
201
				break;
202
			}
203
		}
204
		assertTrue("Symbol is not deleted successfully", isDeleted);
205
		
206
		// Close all dialogs
207
		math_EditSymbolsDlg.cancel();
208
		math_SymbolsDlg.close();
209
		app.dispatch(".uno:CloseDoc");
210
	}
211
}
(-)testoo/src/testcase/sd/headerandfooter/InsertApplyToAllFooterOnNotes.java (-158 lines)
Lines 1-158 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.initApp;
27
import static testlib.UIMap.startcenter;
28
import static testlib.UIMap.*;
29
30
import java.io.File;
31
32
33
import static org.junit.Assert.*;
34
import static org.openoffice.test.vcl.Tester.*;
35
import static org.openoffice.test.vcl.Tester.typeKeys;
36
37
38
import org.junit.Before;
39
import org.junit.Rule;
40
import org.junit.Test;
41
import org.openoffice.test.vcl.IDList;
42
import org.openoffice.test.vcl.widgets.VclButton;
43
import org.openoffice.test.vcl.widgets.VclDialog;
44
import org.openoffice.test.vcl.widgets.VclMessageBox;
45
import org.openoffice.test.vcl.widgets.VclTabControl;
46
47
import testlib.Log;
48
import testlib.UIMap;
49
50
public class InsertApplyToAllFooterOnNotes {
51
	/**
52
	 * TestCapture helps us to do
53
	 * 1. Take a screenshot when failure occurs.
54
	 * 2. Collect extra data when OpenOffice crashes.
55
	 */	
56
	@Rule
57
	public Log LOG = new Log();
58
	
59
	/**
60
	 * initApp helps us to do 
61
	 * 1. Patch the OpenOffice to enable automation if necessary.
62
	 * 2. Start OpenOffice with automation enabled if necessary.
63
	 * 3. Reset OpenOffice to startcenter.
64
	 * 
65
	 * @throws java.lang.Exception
66
	 */
67
	@Before
68
	public void setUp() throws Exception {
69
		initApp();
70
	}
71
	
72
	/**
73
	 * Test Insert Footer to Notes View
74
	 * @throws Exception
75
	 */
76
	@Test
77
	public void testInsertApplyToAllFooterOnNotes() throws Exception{
78
		
79
		startcenter.menuItem("File->New->Presentation").select();
80
		sleep(2);
81
		
82
		for(int i=0; i<5;i++){
83
		SD_InsertPageButtonOnToolbar.click();
84
		sleep(1);
85
		}
86
		
87
		//add header and footer to focus slide.
88
		impress.menuItem("View->Header and Footer...").select();
89
		sleep(1);
90
		SD_HeaderAndFooterOnNotesTabPage.select();
91
		SD_HeaderTextOnNotes.check();
92
		SD_HeaderTextOnNotesInput.setText("Header Test");
93
		SD_DateAndTimeFooterOnSlide.check();
94
		SD_FixedDateAndTimeFooterOnSlide.check();
95
		sleep(1);
96
		SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
97
		sleep(1);
98
		SD_FooterTextOnSlide.check();
99
		sleep(1);
100
		SD_FooterTextOnSlideInput.setText("Footer Test");
101
		sleep(1);
102
		SD_SlideNumAsFooterOnSlide.check();
103
		sleep(1);
104
		SD_ApplyToAllButtonOnSlideFooter.click();
105
		sleep(1);
106
107
		impress.menuItem("View->Header and Footer...").select();
108
		sleep(1);
109
		SD_HeaderAndFooterOnNotesTabPage.select();
110
		assertEquals(true,SD_HeaderTextOnNotes.isChecked());
111
		assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
112
		assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
113
		assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
114
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
115
		assertEquals(true,SD_FooterTextOnSlide.isChecked());
116
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
117
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
118
		//close header and footer dialog.
119
		SD_ApplyToAllButtonOnSlideFooter.focus();
120
		typeKeys("<tab>");
121
		typeKeys("<enter>");
122
		//end close
123
		
124
		SD_SlidesPanel.focus();
125
		typeKeys("<up>");
126
		
127
		impress.menuItem("View->Header and Footer...").select();
128
		sleep(1);
129
		SD_HeaderAndFooterOnNotesTabPage.select();
130
		assertEquals(true,SD_HeaderTextOnNotes.isChecked());
131
		assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
132
		assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
133
		assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
134
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
135
		assertEquals(true,SD_FooterTextOnSlide.isChecked());
136
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
137
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
138
		//close header and footer dialog.
139
		SD_ApplyToAllButtonOnSlideFooter.focus();
140
		typeKeys("<tab>");
141
		typeKeys("<enter>");
142
		//end close
143
		
144
		SD_InsertPageButtonOnToolbar.click();
145
		impress.menuItem("View->Header and Footer...").select();
146
		sleep(1);
147
		SD_HeaderAndFooterOnNotesTabPage.select();
148
		assertEquals(true,SD_HeaderTextOnNotes.isChecked());
149
		assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
150
		assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
151
		assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
152
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
153
		assertEquals(true,SD_FooterTextOnSlide.isChecked());
154
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
155
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
156
	}
157
	
158
}
(-)testoo/src/testcase/sd/headerandfooter/OpenPPTWithHeaderFooter.java (-145 lines)
Lines 1-145 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.fullPath;
27
import static testlib.AppUtil.initApp;
28
import static testlib.AppUtil.openStartcenter;
29
import static testlib.AppUtil.submitSaveDlg;
30
import static testlib.AppUtil.submitOpenDlg;
31
import static testlib.AppUtil.testFile;
32
import static testlib.UIMap.startcenter;
33
import static testlib.UIMap.*;
34
35
import java.io.File;
36
37
import static org.junit.Assert.*;
38
import static org.openoffice.test.vcl.Tester.*;
39
import static org.openoffice.test.vcl.Tester.typeKeys;
40
41
import org.junit.Before;
42
import org.junit.Rule;
43
import org.junit.Test;
44
import org.openoffice.test.common.FileUtil;
45
46
import testlib.Log;
47
import testlib.UIMap;
48
49
public class OpenPPTWithHeaderFooter {
50
	/**
51
	 * TestCapture helps us to do
52
	 * 1. Take a screenshot when failure occurs.
53
	 * 2. Collect extra data when OpenOffice crashes.
54
	 */	
55
	@Rule
56
	public Log LOG = new Log();
57
	
58
	/**
59
	 * initApp helps us to do 
60
	 * 1. Patch the OpenOffice to enable automation if necessary.
61
	 * 2. Start OpenOffice with automation enabled if necessary.
62
	 * 3. Reset OpenOffice to startcenter.
63
	 * 
64
	 * @throws java.lang.Exception
65
	 */
66
	@Before
67
	public void setUp() throws Exception {
68
		initApp();
69
	}
70
	
71
	/**
72
	 * Test open ppt file with header and footer.
73
	 * edit and save to PPT/ODP
74
	 * @throws Exception
75
	 */
76
	@Test
77
	public void testOpenPPTWithHeaderFooter() throws Exception{
78
		//open sample file
79
		String file = testFile("sd/gfdd.ppt");
80
		startcenter.menuItem("File->Open").select();
81
		submitOpenDlg(file);
82
		
83
		//check after reopen		
84
		impress.menuItem("View->Header and Footer...").select();
85
		sleep(1);
86
		assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
87
		assertEquals("testdte",SD_FixedDateAndTimeOnSlideInput.getText());
88
		assertEquals(true,SD_FooterTextOnSlide.isChecked());
89
		assertEquals("yesy",SD_FooterTextOnSlideInput.getText());
90
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
91
				
92
		SD_SlideNumAsFooterOnSlide.uncheck();
93
		SD_ApplyToAllButtonOnSlideFooter.click();
94
		
95
96
		//save to ppt and reopen
97
		impress.menuItem("File->Save As...").select();
98
		String saveTo = fullPath("temp/" + "gfdd.ppt");
99
		FileUtil.deleteFile(saveTo);
100
		submitSaveDlg(saveTo);	
101
		SaveInODFOrNot.focus();
102
		typeKeys("<enter>");
103
		sleep(1);
104
		impress.menuItem("File->Close").select();
105
		sleep(1);
106
		
107
		openStartcenter();
108
		startcenter.menuItem("File->Open").select();
109
		String openFrom=fullPath("temp/" + "gfdd.ppt");
110
		submitOpenDlg(openFrom);
111
		
112
		impress.menuItem("View->Header and Footer...").select();
113
		sleep(1);
114
		assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
115
		//end-save to ppt and reopen
116
		
117
		//close Header and Footer dialog.
118
		SD_ApplyButtonOnSlideFooter.focus();
119
		typeKeys("<tab>");
120
		typeKeys("<enter>");
121
	
122
		//end
123
		
124
		//save to odp and reopen
125
		impress.menuItem("File->Save As...").select();
126
		String saveTo2 = fullPath("temp/" + "gfdd.odp");
127
		FileUtil.deleteFile(saveTo2);
128
		submitSaveDlg(saveTo2);	
129
		impress.menuItem("File->Close").select();
130
		sleep(1);
131
		
132
		openStartcenter();
133
		startcenter.menuItem("File->Open").select();
134
		String openFrom2=fullPath("temp/" + "gfdd.odp");
135
		submitOpenDlg(openFrom2);
136
		
137
		impress.menuItem("View->Header and Footer...").select();
138
		sleep(1);
139
		assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
140
		//end-save to odp and reopen
141
	}
142
	
143
144
	
145
}
(-)testoo/src/testcase/sd/headerandfooter/InsertHeaderFooterOnNotes.java (-153 lines)
Lines 1-153 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.fullPath;
27
import static testlib.AppUtil.initApp;
28
import static testlib.AppUtil.openStartcenter;
29
import static testlib.AppUtil.submitSaveDlg;
30
import static testlib.AppUtil.submitOpenDlg;
31
import static testlib.UIMap.startcenter;
32
import static testlib.UIMap.*;
33
34
import java.io.File;
35
36
import static org.junit.Assert.*;
37
import static org.openoffice.test.vcl.Tester.*;
38
import static org.openoffice.test.vcl.Tester.typeKeys;
39
40
import org.junit.Before;
41
import org.junit.Rule;
42
import org.junit.Test;
43
import org.openoffice.test.common.FileUtil;
44
45
import testlib.Log;
46
import testlib.UIMap;
47
48
public class InsertHeaderFooterOnNotes {
49
	/**
50
	 * TestCapture helps us to do
51
	 * 1. Take a screenshot when failure occurs.
52
	 * 2. Collect extra data when OpenOffice crashes.
53
	 */	
54
	@Rule
55
	public Log LOG = new Log();
56
	
57
	/**
58
	 * initApp helps us to do 
59
	 * 1. Patch the OpenOffice to enable automation if necessary.
60
	 * 2. Start OpenOffice with automation enabled if necessary.
61
	 * 3. Reset OpenOffice to startcenter.
62
	 * 
63
	 * @throws java.lang.Exception
64
	 */
65
	@Before
66
	public void setUp() throws Exception {
67
		initApp();
68
	}
69
	
70
	/**
71
	 * Test Insert Header and Footer to Notes view.
72
	 * Save and ReOpen
73
	 * @throws Exception
74
	 */
75
	@Test
76
	public void testInsertHeaderFooterOnNotes() throws Exception{
77
		
78
		startcenter.menuItem("File->New->Presentation").select();
79
		sleep(2);
80
		
81
		for(int i=0; i<5;i++){
82
		SD_InsertPageButtonOnToolbar.click();
83
		sleep(1);
84
		}
85
		//pop up navigator panel
86
		impress.menuItem("View").select();
87
		if(!impress.menuItem("View->Navigator").isSelected()){
88
			impress.menuItem("View->Navigator").select();
89
			sleep(1);
90
		}
91
		
92
		//add header and footer
93
		impress.menuItem("View->Header and Footer...").select();
94
		sleep(1);
95
		SD_HeaderAndFooterOnNotesTabPage.select();
96
		SD_HeaderTextOnNotes.check();
97
		SD_HeaderTextOnNotesInput.setText("Header Test");
98
		SD_DateAndTimeFooterOnSlide.check();
99
		SD_FixedDateAndTimeFooterOnSlide.check();
100
		sleep(1);
101
		SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329");
102
		sleep(1);
103
		SD_FooterTextOnSlide.check();
104
		sleep(1);
105
		SD_FooterTextOnSlideInput.setText("Footer Test");
106
		sleep(1);
107
		SD_SlideNumAsFooterOnSlide.check();
108
		sleep(1);
109
		SD_ApplyToAllButtonOnSlideFooter.click();
110
		sleep(1);
111
				
112
		SD_SlidesPanel.focus();
113
		typeKeys("<up>");
114
115
		impress.menuItem("View->Header and Footer...").select();
116
		sleep(1);
117
		SD_HeaderAndFooterOnNotesTabPage.select();
118
		assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
119
		assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
120
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
121
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
122
		
123
		//close header and footer dialog.
124
		SD_ApplyToAllButtonOnSlideFooter.focus();
125
		typeKeys("<tab>");
126
		typeKeys("<enter>");
127
		
128
		//save this file
129
		impress.menuItem("File->Save").select();
130
		String saveTo = fullPath("temp/" + "hello.odp");
131
		FileUtil.deleteFile(saveTo);
132
		submitSaveDlg(saveTo);	
133
		impress.menuItem("File->Close").select();
134
		sleep(2);
135
		
136
		//Reopen this file
137
		openStartcenter();
138
		startcenter.menuItem("File->Open").select();
139
		String openFrom=fullPath("temp/" + "hello.odp");
140
		submitOpenDlg(openFrom);
141
		
142
		//check after reopen		
143
		impress.menuItem("View->Header and Footer...").select();
144
		sleep(1);
145
		SD_HeaderAndFooterOnNotesTabPage.select();
146
		assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
147
		assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
148
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
149
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
150
		
151
	}
152
	
153
}
(-)testoo/src/testcase/sw/table/ConvertTableToText.java (-103 lines)
Lines 1-103 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.sw.table;
28
29
import static testlib.AppUtil.*;
30
import static testlib.UIMap.*;
31
32
import java.awt.Rectangle;
33
import java.io.File;
34
35
import static org.junit.Assert.*;
36
import static org.openoffice.test.vcl.Tester.*;
37
38
import org.junit.Before;
39
import org.junit.Ignore;
40
import org.junit.Rule;
41
import org.junit.Test;
42
import org.openoffice.test.common.FileUtil;
43
import org.openoffice.test.common.GraphicsUtil;
44
45
import testlib.CalcUtil;
46
import testlib.Log;
47
48
/**
49
 *
50
 */
51
public class ConvertTableToText {
52
	
53
	/**
54
	 * TestCapture helps us to do
55
	 * 1. Take a screenshot when failure occurs.
56
	 * 2. Collect extra data when OpenOffice crashes.
57
	 */	
58
	@Rule
59
	public Log LOG = new Log();
60
	
61
	/**
62
	 * initApp helps us to do 
63
	 * 1. Patch the OpenOffice to enable automation if necessary.
64
	 * 2. Start OpenOffice with automation enabled if necessary.
65
	 * 3. Reset OpenOffice to startcenter.
66
	 * 
67
	 * @throws java.lang.Exception
68
	 */
69
	@Before
70
	public void setUp() throws Exception {
71
		initApp();
72
	}
73
	
74
	/**
75
	 * Test convert table to text in text document
76
	 * @throws Exception
77
	 */
78
	@Test
79
	public void testConvertTableToText() throws Exception{
80
		
81
		//Create a new text document
82
		startcenter.menuItem("File->New->Text Document").select();
83
		sleep(3);
84
		
85
		// Insert a table and input some data
86
		writer.menuItem("Insert->Table...").select();
87
		writer_InsertTable.ok();
88
		writer.click(1, 1);
89
		typeKeys("1<right>2<right>3<right>4");
90
		sleep(1);
91
		
92
		// Convert table to text
93
		writer.menuItem("Table->Convert->Table to Text...").select();
94
		assertTrue("Convert Table to Text dialog pop up", writer_ConvertTableToTextDlg.exists());
95
		typeKeys("<enter>");
96
		sleep(1);
97
		
98
		// Verify if text is converted successfully
99
		writer.menuItem("Edit->Select All").select();
100
		typeKeys("<$copy>");
101
		assertEquals("Converted text", "1	2\n3	4\n", app.getClipboard());
102
	}
103
}
(-)testoo/src/testcase/formula/catalog/InputCharacterFromCatalogDlg.java (+155 lines)
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.formula.catalog;
28
29
import static testlib.AppUtil.*;
30
import static testlib.UIMap.*;
31
import static org.junit.Assert.*;
32
import org.junit.After;
33
import org.junit.Before;
34
import org.junit.Rule;
35
import org.junit.Test;
36
import testlib.Log;
37
38
/**
39
 *
40
 */
41
public class InputCharacterFromCatalogDlg {
42
43
	@Rule
44
	public Log LOG = new Log();
45
	
46
	@Before
47
	public void setUp() throws Exception {
48
		app.start();
49
		
50
		// New a formula document
51
		startcenter.menuItem("File->New->Formula").select();
52
		sleep(3);		
53
		
54
		// Click catalog button
55
		math_CatalogButton.click();
56
		sleep(1);
57
		
58
		// Verify if the "Symbols" dialog pop up
59
		assertTrue("Symbols dialog does not pop up", math_SymbolsDlg.exists(3));
60
	}
61
62
	@After
63
	public void tearDown() throws Exception {
64
		app.close();
65
	}
66
	
67
	/**
68
	 * Test input Greek character from Catalog->Symbols
69
	 * @throws Exception
70
	 */
71
	@Test
72
	public void testInputGreekFromCatalog() throws Exception{
73
		
74
		// Select "Greek", click "Edit" button to get the selected Symbol
75
		math_SymbolsDlgListbox.select("Greek");
76
		math_SymbolsDlgEditButton.click();
77
		sleep(1);
78
		String selectedSymbol = math_EditSymbolsDlgSymbol.getText();
79
		math_EditSymbolsDlg.ok();
80
		sleep(1);		
81
		
82
		// Insert the selected symbol
83
		math_SymbolsDlgInsertButton.click();
84
		math_SymbolsDlgCloseButton.click();
85
		
86
		// Verify if the symbol is inserted successfully
87
		math_EditWindow.activate();
88
		math_EditWindow.menuItem("Edit->Select All").select();
89
		math_EditWindow.menuItem("Edit->Copy").select();
90
		sleep(1);
91
		assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol).concat(" "), app.getClipboard());	// add "%" in the front, add " " in the end
92
		
93
		// Close all dialogs
94
		app.dispatch(".uno:CloseDoc");
95
	}
96
	
97
	/**
98
	 * Test input iGreek character from Catalog->Symbols
99
	 * @throws Exception
100
	 */
101
	@Test
102
	public void testInputIGreekFromCatalog() throws Exception{
103
		
104
		// Select "iGreek", click "Edit" button to get the selected Symbol
105
		math_SymbolsDlgListbox.select("iGreek");
106
		math_SymbolsDlgEditButton.click();
107
		sleep(1);
108
		String selectedSymbol = math_EditSymbolsDlgSymbol.getText();
109
		math_EditSymbolsDlg.ok();
110
		sleep(1);		
111
		
112
		// Insert the selected symbol
113
		math_SymbolsDlgInsertButton.click();
114
		math_SymbolsDlgCloseButton.click();
115
		
116
		// Verify if the symbol is inserted successfully
117
		math_EditWindow.click(5, 5);
118
		math_EditWindow.menuItem("Edit->Select All").select();
119
		math_EditWindow.menuItem("Edit->Copy").select();
120
		sleep(1);
121
		assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol).concat(" "), app.getClipboard());	// add "%" in the front, add " " in the end
122
		
123
		// Close all dialogs
124
		app.dispatch(".uno:CloseDoc");
125
	}
126
	
127
	/**
128
	 * Test input Special character from Catalog->Symbols
129
	 * @throws Exception
130
	 */
131
	@Test
132
	public void testInputSpecialFromCatalog() throws Exception{
133
		
134
		// Select "Special", "Insert" the default first symbol
135
		math_SymbolsDlgListbox.select("Special");
136
		math_SymbolsDlgInsertButton.click();	
137
		
138
		// Click "Edit" button to get the selected Symbol
139
		math_SymbolsDlgEditButton.click();
140
		sleep(1);
141
		String selectedSymbol = math_EditSymbolsDlgSymbol.getText();
142
		math_EditSymbolsDlg.ok();
143
		math_SymbolsDlgCloseButton.click();
144
		
145
		// Verify if the symbol is inserted successfully
146
		math_EditWindow.click(5, 5);
147
		math_EditWindow.menuItem("Edit->Select All").select();
148
		math_EditWindow.menuItem("Edit->Copy").select();
149
		sleep(1);
150
		assertEquals("Symbol is not inserted succcessfully", "%".concat(selectedSymbol).concat(" "), app.getClipboard());	// add "%" in the front, add " " in the end
151
		
152
		// Close all dialogs
153
		app.dispatch(".uno:CloseDoc");
154
	}
155
}
(-)testoo/src/testcase/sd/headerandfooter/InsertAutoUpdateTimeFooter.java (-103 lines)
Lines 1-103 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.fullPath;
27
import static testlib.AppUtil.initApp;
28
import static testlib.AppUtil.openStartcenter;
29
import static testlib.AppUtil.submitSaveDlg;
30
import static testlib.AppUtil.submitOpenDlg;
31
import static testlib.UIMap.startcenter;
32
import static testlib.UIMap.*;
33
34
import java.io.File;
35
import java.util.Calendar;
36
37
import static org.junit.Assert.*;
38
import static org.openoffice.test.vcl.Tester.*;
39
import static org.openoffice.test.vcl.Tester.typeKeys;
40
41
import org.junit.Before;
42
import org.junit.Rule;
43
import org.junit.Test;
44
import org.openoffice.test.common.FileUtil;
45
46
import testlib.Log;
47
import testlib.UIMap;
48
49
public class InsertAutoUpdateTimeFooter {
50
	/**
51
	 * TestCapture helps us to do
52
	 * 1. Take a screenshot when failure occurs.
53
	 * 2. Collect extra data when OpenOffice crashes.
54
	 */	
55
	@Rule
56
	public Log LOG = new Log();
57
	
58
	/**
59
	 * initApp helps us to do 
60
	 * 1. Patch the OpenOffice to enable automation if necessary.
61
	 * 2. Start OpenOffice with automation enabled if necessary.
62
	 * 3. Reset OpenOffice to startcenter.
63
	 * 
64
	 * @throws java.lang.Exception
65
	 */
66
	@Before
67
	public void setUp() throws Exception {
68
		initApp();
69
	}
70
	
71
	/**
72
	 * Test Insert update automatically time footer to slides.
73
	 * @throws Exception
74
	 */
75
	@Test
76
	public void testInsertAutoUpdateTimeFooter() throws Exception{
77
		
78
		startcenter.menuItem("File->New->Presentation").select();
79
		sleep(2);
80
		
81
		for(int i=0; i<3;i++){
82
		SD_InsertPageButtonOnToolbar.click();
83
		sleep(1);
84
		}
85
86
		//add header and footer
87
		impress.menuItem("View->Header and Footer...").select();
88
		sleep(1);
89
		SD_AutoUpdateTimeFooter.check();
90
		SD_AutoUpdateTimeFooterType.select(7);
91
		String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7);
92
		SD_ApplyToAllButtonOnSlideFooter.click();
93
		sleep(2);
94
				
95
		impress.menuItem("View->Header and Footer...").select();
96
		sleep(1);
97
98
		String currentTime2=SD_AutoUpdateTimeFooterType.getItemText(7);
99
		assertFalse(currentTime.equals(currentTime2));
100
101
	}
102
	
103
}
(-)testoo/src/testcase/textdocument/table/Table.java (+90 lines)
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.textdocument.table;
28
29
import static testlib.AppUtil.*;
30
import static testlib.UIMap.*;
31
import static org.junit.Assert.*;
32
import org.junit.After;
33
import org.junit.Before;
34
import org.junit.Rule;
35
import org.junit.Test;
36
import org.openoffice.test.common.SystemUtil;
37
38
import testlib.Log;
39
40
/**
41
 *
42
 */
43
public class Table {
44
45
	@Rule
46
	public Log LOG = new Log();
47
48
	@Before
49
	public void setUp() throws Exception {
50
		app.start();
51
	}
52
53
	@After
54
	public void tearDown() throws Exception {
55
		app.close();
56
	}
57
58
	/**
59
	 * Test convert table to text in text document
60
	 * @throws Exception
61
	 */
62
	@Test
63
	public void testConvertTableToText() throws Exception{
64
65
		//Create a new text document
66
		startcenter.menuItem("File->New->Text Document").select();
67
		sleep(3);
68
69
		// Insert a table and input some data
70
		writer.menuItem("Insert->Table...").select();
71
		writer_InsertTable.ok();
72
		writer.focus();
73
		typeKeys("1<right>2<right>3<right>4");
74
		sleep(1);
75
76
		// Convert table to text
77
		writer.menuItem("Table->Convert->Table to Text...").select();
78
		assertTrue("Convert Table to Text dialog pop up", writer_ConvertTableToTextDlg.exists());
79
		typeKeys("<enter>");
80
		sleep(1);
81
82
		// Verify if text is converted successfully
83
		writer.menuItem("Edit->Select All").select();
84
		app.dispatch(".uno:Copy");
85
		if (SystemUtil.isWindows())
86
			assertEquals("Converted text", "1\t2\r\n3\t4\r\n", app.getClipboard());	// windowsÖлسµ»»ÐÐÊÇ\r\n
87
		else
88
			assertEquals("Converted text", "1\t2\n3\t4\n", app.getClipboard());
89
	}
90
}
(-)testoo/src/testcase/presentation/headerandfooter/HeaderAndFooterSetting.java (+724 lines)
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
}
(-)testoo/src/testcase/sd/headerandfooter/FooterNotShowOn1stSlide.java (-110 lines)
Lines 1-110 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.initApp;
27
import static testlib.UIMap.startcenter;
28
import static testlib.UIMap.*;
29
30
import java.io.File;
31
32
import static org.junit.Assert.*;
33
import static org.openoffice.test.vcl.Tester.*;
34
import static org.openoffice.test.vcl.Tester.typeKeys;
35
36
import org.junit.Before;
37
import org.junit.Rule;
38
import org.junit.Test;
39
40
import testlib.Log;
41
import testlib.UIMap;
42
43
public class FooterNotShowOn1stSlide {
44
	/**
45
	 * TestCapture helps us to do
46
	 * 1. Take a screenshot when failure occurs.
47
	 * 2. Collect extra data when OpenOffice crashes.
48
	 */	
49
	@Rule
50
	public Log LOG = new Log();
51
	
52
	/**
53
	 * initApp helps us to do 
54
	 * 1. Patch the OpenOffice to enable automation if necessary.
55
	 * 2. Start OpenOffice with automation enabled if necessary.
56
	 * 3. Reset OpenOffice to startcenter.
57
	 * 
58
	 * @throws java.lang.Exception
59
	 */
60
	@Before
61
	public void setUp() throws Exception {
62
		initApp();
63
	}
64
	
65
	/**
66
	 * Test footer not show on the first slide. 
67
	 * @throws Exception
68
	 */
69
	@Test
70
	public void testFooterNotShowOn1stSlide() throws Exception{
71
		
72
		startcenter.menuItem("File->New->Presentation").select();
73
		sleep(2);
74
		
75
		for(int i=0; i<2;i++){
76
		SD_InsertPageButtonOnToolbar.click();
77
		sleep(1);
78
		}
79
		//pop up navigator panel
80
		impress.menuItem("View").select();
81
		if(!impress.menuItem("View->Navigator").isSelected()){
82
			impress.menuItem("View->Navigator").select();
83
			sleep(1);
84
		}
85
		
86
		//add header and footer
87
		impress.menuItem("View->Header and Footer...").select();
88
		sleep(2);
89
		SD_FooterTextOnSlide.check();
90
		sleep(1);
91
		SD_FooterTextOnSlideInput.setText("Footer Test");
92
		sleep(1);
93
		SD_FooterNotShowOn1stSlide.check();
94
		SD_ApplyToAllButtonOnSlideFooter.click();
95
		sleep(1);
96
							
97
		SD_SlidesPanel.focus();
98
		for(int j=0; j<2;j++){
99
		typeKeys("<up>");
100
		sleep(1);
101
		}
102
103
		impress.menuItem("View->Header and Footer...").select();
104
		sleep(1);
105
		assertEquals(true,SD_FooterNotShowOn1stSlide.isChecked());
106
		assertEquals(false,SD_FooterTextOnSlide.isChecked());
107
108
	}
109
	
110
}
(-)testoo/src/testcase/sd/headerandfooter/InsertApplyFooterOnSlide.java (-141 lines)
Lines 1-141 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.initApp;
27
import static testlib.UIMap.startcenter;
28
import static testlib.UIMap.*;
29
30
import java.io.File;
31
32
33
import static org.junit.Assert.*;
34
import static org.openoffice.test.vcl.Tester.*;
35
import static org.openoffice.test.vcl.Tester.typeKeys;
36
37
38
import org.junit.Before;
39
import org.junit.Rule;
40
import org.junit.Test;
41
import org.openoffice.test.vcl.IDList;
42
import org.openoffice.test.vcl.widgets.VclButton;
43
import org.openoffice.test.vcl.widgets.VclDialog;
44
import org.openoffice.test.vcl.widgets.VclMessageBox;
45
import org.openoffice.test.vcl.widgets.VclTabControl;
46
47
import testlib.Log;
48
import testlib.UIMap;
49
50
public class InsertApplyFooterOnSlide {
51
	/**
52
	 * TestCapture helps us to do
53
	 * 1. Take a screenshot when failure occurs.
54
	 * 2. Collect extra data when OpenOffice crashes.
55
	 */	
56
	@Rule
57
	public Log LOG = new Log();
58
	
59
	/**
60
	 * initApp helps us to do 
61
	 * 1. Patch the OpenOffice to enable automation if necessary.
62
	 * 2. Start OpenOffice with automation enabled if necessary.
63
	 * 3. Reset OpenOffice to startcenter.
64
	 * 
65
	 * @throws java.lang.Exception
66
	 */
67
	@Before
68
	public void setUp() throws Exception {
69
		initApp();
70
	}
71
	
72
	/**
73
	 * Test Insert Footer to focus slide.
74
	 * @throws Exception
75
	 */
76
	@Test
77
	public void testInsertApplyFooterOnSlide() throws Exception{
78
		
79
		startcenter.menuItem("File->New->Presentation").select();
80
		sleep(2);
81
		
82
		for(int i=0; i<5;i++){
83
		SD_InsertPageButtonOnToolbar.click();
84
		sleep(1);
85
		}
86
		
87
		//add header and footer to focus slide.
88
		impress.menuItem("View->Header and Footer...").select();
89
		sleep(2);
90
		
91
		SD_DateAndTimeFooterOnSlide.check();
92
		SD_FixedDateAndTimeFooterOnSlide.check();
93
		sleep(1);
94
		SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
95
		sleep(1);
96
		SD_FooterTextOnSlide.check();
97
		sleep(1);
98
		SD_FooterTextOnSlideInput.setText("Footer Test");
99
		sleep(1);
100
		SD_SlideNumAsFooterOnSlide.check();
101
		sleep(1);
102
		SD_ApplyButtonOnSlideFooter.click();
103
		sleep(1);
104
105
		impress.menuItem("View->Header and Footer...").select();
106
		sleep(1);
107
		assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
108
		assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
109
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
110
		assertEquals(true,SD_FooterTextOnSlide.isChecked());
111
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
112
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
113
		//close header and footer dialog.
114
		SD_ApplyButtonOnSlideFooter.focus();
115
		typeKeys("<tab>");
116
		typeKeys("<enter>");
117
		//end close
118
		
119
		SD_SlidesPanel.focus();
120
		typeKeys("<up>");
121
		
122
		impress.menuItem("View->Header and Footer...").select();
123
		sleep(1);
124
		assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText());
125
		assertEquals("",SD_FooterTextOnSlideInput.getText());
126
		assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
127
		//close header and footer dialog.
128
		SD_ApplyButtonOnSlideFooter.focus();
129
		typeKeys("<tab>");
130
		typeKeys("<enter>");
131
		//end close
132
		
133
		SD_InsertPageButtonOnToolbar.click();
134
		impress.menuItem("View->Header and Footer...").select();
135
		sleep(1);
136
		assertEquals("",SD_FixedDateAndTimeOnSlideInput.getText());
137
		assertEquals("",SD_FooterTextOnSlideInput.getText());
138
		assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
139
	}
140
	
141
}
(-)testoo/src/testcase/sd/headerandfooter/CopySlideWithApplyToAllFooter.java (-158 lines)
Lines 1-158 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.initApp;
27
import static testlib.UIMap.startcenter;
28
import static testlib.UIMap.*;
29
30
import java.io.File;
31
32
33
import static org.junit.Assert.*;
34
import static org.openoffice.test.vcl.Tester.*;
35
import static org.openoffice.test.vcl.Tester.typeKeys;
36
37
38
import org.junit.Before;
39
import org.junit.Rule;
40
import org.junit.Test;
41
import org.openoffice.test.vcl.IDList;
42
import org.openoffice.test.vcl.widgets.VclButton;
43
import org.openoffice.test.vcl.widgets.VclDialog;
44
import org.openoffice.test.vcl.widgets.VclMessageBox;
45
import org.openoffice.test.vcl.widgets.VclTabControl;
46
47
import testlib.Log;
48
import testlib.UIMap;
49
50
public class CopySlideWithApplyToAllFooter {
51
	/**
52
	 * TestCapture helps us to do
53
	 * 1. Take a screenshot when failure occurs.
54
	 * 2. Collect extra data when OpenOffice crashes.
55
	 */	
56
	@Rule
57
	public Log LOG = new Log();
58
	
59
	/**
60
	 * initApp helps us to do 
61
	 * 1. Patch the OpenOffice to enable automation if necessary.
62
	 * 2. Start OpenOffice with automation enabled if necessary.
63
	 * 3. Reset OpenOffice to startcenter.
64
	 * 
65
	 * @throws java.lang.Exception
66
	 */
67
	@Before
68
	public void setUp() throws Exception {
69
		initApp();
70
	}
71
	
72
	/**
73
	 * Test Copy slide with Apply to all Footer to same file and different file
74
	 * @throws Exception
75
	 */
76
	@Test
77
	public void testCopySlideWithApplyToAllFooter() throws Exception{
78
		
79
		startcenter.menuItem("File->New->Presentation").select();
80
		sleep(2);
81
		
82
		for(int i=0; i<5;i++){
83
		SD_InsertPageButtonOnToolbar.click();
84
		sleep(1);
85
		}
86
		//pop up navigator panel
87
		impress.menuItem("View").select();
88
		if(!impress.menuItem("View->Navigator").isSelected()){
89
			impress.menuItem("View->Navigator").select();
90
			sleep(1);
91
		}
92
		
93
		//add header and footer
94
		impress.menuItem("View->Header and Footer...").select();
95
		sleep(2);
96
		
97
		SD_DateAndTimeFooterOnSlide.check();
98
		SD_FixedDateAndTimeFooterOnSlide.check();
99
		sleep(1);
100
		SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
101
		sleep(1);
102
		SD_FooterTextOnSlide.check();
103
		sleep(1);
104
		SD_FooterTextOnSlideInput.setText("Footer Test");
105
		sleep(1);
106
		SD_SlideNumAsFooterOnSlide.check();
107
		sleep(1);
108
		SD_ApplyToAllButtonOnSlideFooter.click();
109
		sleep(1);
110
		
111
		
112
		SD_SlidesPanel.focus();
113
		for(int j=0; j<=2;j++){
114
		typeKeys("<up>");
115
		sleep(1);
116
		}
117
		impress.menuItem("View->Header and Footer...").select();
118
		sleep(1);
119
		SD_SlideNumAsFooterOnSlide.uncheck();
120
		SD_ApplyButtonOnSlideFooter.click();
121
		
122
		//paste to the same file
123
		SD_SlidesPanel.focus();
124
		typeKeys("<up>");
125
		typeKeys("<$copy>");
126
		typeKeys("<down>");
127
		sleep(1);
128
		typeKeys("<$paste>");
129
		
130
		impress.menuItem("View->Header and Footer...").select();
131
		sleep(1);
132
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
133
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
134
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
135
		
136
		//close header and footer dialog.
137
		SD_ApplyButtonOnSlideFooter.focus();
138
		typeKeys("<tab>");
139
		typeKeys("<enter>");
140
		
141
		//paste to different file
142
		impress.focus();
143
		impress.menuItem("File->New->Presentation").select();
144
		sleep(1);
145
		typeKeys("<$paste>");
146
		SD_SlidesPanel.focus();
147
		typeKeys("<down>");
148
		sleep(1);
149
		
150
		impress.menuItem("View->Header and Footer...").select();
151
		sleep(1);
152
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
153
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
154
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
155
		
156
	}
157
	
158
}
(-)testoo/src/testcase/sd/headerandfooter/InsertApplyToAllFooterOnSlide.java (-147 lines)
Lines 1-147 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.initApp;
27
import static testlib.UIMap.startcenter;
28
import static testlib.UIMap.*;
29
30
import java.io.File;
31
32
33
import static org.junit.Assert.*;
34
import static org.openoffice.test.vcl.Tester.*;
35
import static org.openoffice.test.vcl.Tester.typeKeys;
36
37
38
import org.junit.Before;
39
import org.junit.Rule;
40
import org.junit.Test;
41
import org.openoffice.test.vcl.IDList;
42
import org.openoffice.test.vcl.widgets.VclButton;
43
import org.openoffice.test.vcl.widgets.VclDialog;
44
import org.openoffice.test.vcl.widgets.VclMessageBox;
45
import org.openoffice.test.vcl.widgets.VclTabControl;
46
47
import testlib.Log;
48
import testlib.UIMap;
49
50
public class InsertApplyToAllFooterOnSlide {
51
	/**
52
	 * TestCapture helps us to do
53
	 * 1. Take a screenshot when failure occurs.
54
	 * 2. Collect extra data when OpenOffice crashes.
55
	 */	
56
	@Rule
57
	public Log LOG = new Log();
58
	
59
	/**
60
	 * initApp helps us to do 
61
	 * 1. Patch the OpenOffice to enable automation if necessary.
62
	 * 2. Start OpenOffice with automation enabled if necessary.
63
	 * 3. Reset OpenOffice to startcenter.
64
	 * 
65
	 * @throws java.lang.Exception
66
	 */
67
	@Before
68
	public void setUp() throws Exception {
69
		initApp();
70
	}
71
	
72
	/**
73
	 * Test Insert Footer to Slide, use Apply to All
74
	 * @throws Exception
75
	 */
76
	@Test
77
	public void testInsertApplyToAllFooterOnSlide() throws Exception{
78
		
79
		startcenter.menuItem("File->New->Presentation").select();
80
		sleep(2);
81
		
82
		for(int i=0; i<5;i++){
83
		SD_InsertPageButtonOnToolbar.click();
84
		sleep(1);
85
		}
86
		
87
		//add header and footer to focus slide.
88
		impress.menuItem("View->Header and Footer...").select();
89
		sleep(2);
90
		
91
		SD_DateAndTimeFooterOnSlide.check();
92
		SD_FixedDateAndTimeFooterOnSlide.check();
93
		sleep(1);
94
		SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
95
		sleep(1);
96
		SD_FooterTextOnSlide.check();
97
		sleep(1);
98
		SD_FooterTextOnSlideInput.setText("Footer Test");
99
		sleep(1);
100
		SD_SlideNumAsFooterOnSlide.check();
101
		sleep(1);
102
		SD_ApplyToAllButtonOnSlideFooter.click();
103
		sleep(1);
104
105
		impress.menuItem("View->Header and Footer...").select();
106
		sleep(1);
107
		assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
108
		assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
109
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
110
		assertEquals(true,SD_FooterTextOnSlide.isChecked());
111
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
112
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
113
		//close header and footer dialog.
114
		SD_ApplyButtonOnSlideFooter.focus();
115
		typeKeys("<tab>");
116
		typeKeys("<enter>");
117
		//end close
118
		
119
		SD_SlidesPanel.focus();
120
		typeKeys("<up>");
121
		
122
		impress.menuItem("View->Header and Footer...").select();
123
		sleep(1);
124
		assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
125
		assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
126
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
127
		assertEquals(true,SD_FooterTextOnSlide.isChecked());
128
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
129
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
130
		//close header and footer dialog.
131
		SD_ApplyButtonOnSlideFooter.focus();
132
		typeKeys("<tab>");
133
		typeKeys("<enter>");
134
		//end close
135
		
136
		SD_InsertPageButtonOnToolbar.click();
137
		impress.menuItem("View->Header and Footer...").select();
138
		sleep(1);
139
		assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
140
		assertEquals(true,SD_FixedDateAndTimeFooterOnSlide.isChecked());
141
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
142
		assertEquals(true,SD_FooterTextOnSlide.isChecked());
143
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
144
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
145
	}
146
	
147
}
(-)testoo/src/testcase/sd/headerandfooter/InsertAutoUpdateTimeOnNotes.java (-105 lines)
Lines 1-105 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.fullPath;
27
import static testlib.AppUtil.initApp;
28
import static testlib.AppUtil.openStartcenter;
29
import static testlib.AppUtil.submitSaveDlg;
30
import static testlib.AppUtil.submitOpenDlg;
31
import static testlib.UIMap.startcenter;
32
import static testlib.UIMap.*;
33
34
import java.io.File;
35
import java.util.Calendar;
36
37
import static org.junit.Assert.*;
38
import static org.openoffice.test.vcl.Tester.*;
39
import static org.openoffice.test.vcl.Tester.typeKeys;
40
41
import org.junit.Before;
42
import org.junit.Rule;
43
import org.junit.Test;
44
import org.openoffice.test.common.FileUtil;
45
46
import testlib.Log;
47
import testlib.UIMap;
48
49
public class InsertAutoUpdateTimeOnNotes {
50
	/**
51
	 * TestCapture helps us to do
52
	 * 1. Take a screenshot when failure occurs.
53
	 * 2. Collect extra data when OpenOffice crashes.
54
	 */	
55
	@Rule
56
	public Log LOG = new Log();
57
	
58
	/**
59
	 * initApp helps us to do 
60
	 * 1. Patch the OpenOffice to enable automation if necessary.
61
	 * 2. Start OpenOffice with automation enabled if necessary.
62
	 * 3. Reset OpenOffice to startcenter.
63
	 * 
64
	 * @throws java.lang.Exception
65
	 */
66
	@Before
67
	public void setUp() throws Exception {
68
		initApp();
69
	}
70
	
71
	/**
72
	 * Test Insert update automatically time footer to Notes view.
73
	 * @throws Exception
74
	 */
75
	@Test
76
	public void testInsertAutoUpdateTimeFooterOnNotes() throws Exception{
77
		
78
		startcenter.menuItem("File->New->Presentation").select();
79
		sleep(2);
80
		
81
		for(int i=0; i<3;i++){
82
		SD_InsertPageButtonOnToolbar.click();
83
		sleep(1);
84
		}
85
86
		//add header and footer
87
		impress.menuItem("View->Header and Footer...").select();
88
		sleep(1);
89
		SD_HeaderAndFooterOnNotesTabPage.select();
90
		SD_AutoUpdateTimeFooter.check();
91
		SD_AutoUpdateTimeFooterType.select(7);
92
		String currentTime=SD_AutoUpdateTimeFooterType.getItemText(7);
93
		SD_ApplyToAllButtonOnSlideFooter.click();
94
		sleep(2);
95
				
96
		impress.menuItem("View->Header and Footer...").select();
97
		sleep(1);
98
		SD_HeaderAndFooterOnNotesTabPage.select();
99
		String currentTime2=SD_AutoUpdateTimeFooterType.getItemText(7);
100
101
		assertFalse(currentTime.equals(currentTime2));
102
103
	}
104
	
105
}
(-)testoo/src/testcase/sd/headerandfooter/CopySlideWithApplyFooter.java (-155 lines)
Lines 1-155 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.initApp;
27
import static testlib.UIMap.startcenter;
28
import static testlib.UIMap.*;
29
30
import java.io.File;
31
32
33
import static org.junit.Assert.*;
34
import static org.openoffice.test.vcl.Tester.*;
35
import static org.openoffice.test.vcl.Tester.typeKeys;
36
37
38
import org.junit.Before;
39
import org.junit.Rule;
40
import org.junit.Test;
41
import org.openoffice.test.vcl.IDList;
42
import org.openoffice.test.vcl.widgets.VclButton;
43
import org.openoffice.test.vcl.widgets.VclDialog;
44
import org.openoffice.test.vcl.widgets.VclMessageBox;
45
import org.openoffice.test.vcl.widgets.VclTabControl;
46
47
import testlib.Log;
48
import testlib.UIMap;
49
50
public class CopySlideWithApplyFooter {
51
	/**
52
	 * TestCapture helps us to do
53
	 * 1. Take a screenshot when failure occurs.
54
	 * 2. Collect extra data when OpenOffice crashes.
55
	 */	
56
	@Rule
57
	public Log LOG = new Log();
58
	
59
	/**
60
	 * initApp helps us to do 
61
	 * 1. Patch the OpenOffice to enable automation if necessary.
62
	 * 2. Start OpenOffice with automation enabled if necessary.
63
	 * 3. Reset OpenOffice to startcenter.
64
	 * 
65
	 * @throws java.lang.Exception
66
	 */
67
	@Before
68
	public void setUp() throws Exception {
69
		initApp();
70
	}
71
	
72
	/**
73
	 * Test Copy slide with Apply Footer to same file and different file
74
	 * @throws Exception
75
	 */
76
	@Test
77
	public void testCopySlideWithApplyFooter() throws Exception{
78
		
79
		startcenter.menuItem("File->New->Presentation").select();
80
		sleep(2);
81
		
82
		for(int i=0; i<5;i++){
83
		SD_InsertPageButtonOnToolbar.click();
84
		sleep(1);
85
		}
86
		//pop up navigator panel
87
		impress.menuItem("View").select();
88
		if(!impress.menuItem("View->Navigator").isSelected()){
89
			impress.menuItem("View->Navigator").select();
90
			sleep(1);
91
		}
92
		
93
		//add header and footer
94
		impress.menuItem("View->Header and Footer...").select();
95
		sleep(2);
96
		
97
		SD_DateAndTimeFooterOnSlide.check();
98
		SD_FixedDateAndTimeFooterOnSlide.check();
99
		sleep(1);
100
		SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
101
		sleep(1);
102
		SD_FooterTextOnSlide.check();
103
		sleep(1);
104
		SD_FooterTextOnSlideInput.setText("Footer Test");
105
		sleep(1);
106
		SD_SlideNumAsFooterOnSlide.check();
107
		sleep(1);
108
		SD_ApplyToAllButtonOnSlideFooter.click();
109
		sleep(1);
110
		
111
		
112
		SD_SlidesPanel.focus();
113
		for(int j=0; j<=2;j++){
114
		typeKeys("<up>");
115
		sleep(1);
116
		}
117
		impress.menuItem("View->Header and Footer...").select();
118
		sleep(1);
119
		SD_SlideNumAsFooterOnSlide.uncheck();
120
		SD_ApplyButtonOnSlideFooter.click();
121
		
122
		//paste to the same file
123
		SD_SlidesPanel.focus();
124
		typeKeys("<$copy>");
125
		typeKeys("<$paste>");
126
		
127
		impress.menuItem("View->Header and Footer...").select();
128
		sleep(1);
129
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
130
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
131
		assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
132
		
133
		//close header and footer dialog.
134
		SD_ApplyButtonOnSlideFooter.focus();
135
		typeKeys("<tab>");
136
		typeKeys("<enter>");
137
		
138
		//paste to different file
139
		impress.focus();
140
		impress.menuItem("File->New->Presentation").select();
141
		sleep(1);
142
		typeKeys("<$paste>");
143
		SD_SlidesPanel.focus();
144
		typeKeys("<down>");
145
		sleep(1);
146
		
147
		impress.menuItem("View->Header and Footer...").select();
148
		sleep(1);
149
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
150
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
151
		assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
152
		
153
	}
154
	
155
}
(-)testoo/src/testcase/presentation/headerandfooter/OpenDocumentWithHeaderFooter.java (+171 lines)
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.submitSaveDlg;
32
import static testlib.AppUtil.submitOpenDlg;
33
import static testlib.AppUtil.testFile;
34
import static testlib.UIMap.*;
35
import static org.junit.Assert.*;
36
import static org.openoffice.test.vcl.Tester.*;
37
import org.junit.After;
38
import org.junit.Before;
39
import org.junit.Rule;
40
import org.junit.Test;
41
import org.openoffice.test.common.FileUtil;
42
import testlib.Log;
43
44
public class OpenDocumentWithHeaderFooter {
45
46
	@Rule
47
	public Log LOG = new Log();
48
49
	@Before
50
	public void setUp() throws Exception {
51
		app.start();
52
	}
53
54
	@After
55
	public void tearDown() throws Exception {
56
		app.close();
57
	}
58
59
	/**
60
	 * Test open AOO3.4 presentation with header and footer.
61
	 * edit and save to ODP
62
	 * @throws Exception
63
	 */
64
	@Test
65
	public void testOpenAOO34WithHeaderFooter() throws Exception{
66
		//open sample file
67
		String file = testFile("sd/AOO3.4HeaderFooter.odp");
68
		app.dispatch(".uno:Open");
69
		submitOpenDlg(file);
70
71
		//check after reopen		
72
		impress.menuItem("View->Header and Footer...").select();
73
		sleep(1);
74
		assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
75
		assertEquals("fixed date",SD_FixedDateAndTimeOnSlideInput.getText());
76
		assertEquals(true,SD_FooterTextOnSlide.isChecked());
77
		assertEquals("footer test",SD_FooterTextOnSlideInput.getText());
78
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
79
80
		SD_SlideNumAsFooterOnSlide.uncheck();
81
		SD_ApplyToAllButtonOnSlideFooter.click();
82
83
		//save to odp and reopen
84
		impress.menuItem("File->Save As...").select();
85
		String saveTo2 = fullPath("temp/" + "AOO3.4HeaderFooter.odp");
86
		FileUtil.deleteFile(saveTo2);
87
		submitSaveDlg(saveTo2);	
88
		impress.menuItem("File->Close").select();
89
		sleep(1);
90
91
		openStartcenter();
92
		app.dispatch(".uno:Open");
93
		String openFrom2=fullPath("temp/" + "AOO3.4HeaderFooter.odp");
94
		submitOpenDlg(openFrom2);
95
96
		impress.menuItem("View->Header and Footer...").select();
97
		sleep(1);
98
		assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
99
		//end-save to odp and reopen
100
	}
101
102
	/**
103
	 * Test open ppt file with header and footer.
104
	 * edit and save to PPT/ODP
105
	 * @throws Exception
106
	 */
107
	@Test
108
	public void testOpenPPTWithHeaderFooter() throws Exception{
109
		//open sample file
110
		String file = testFile("sd/gfdd.ppt");
111
		app.dispatch(".uno:Open");
112
		submitOpenDlg(file);
113
114
		//check after reopen		
115
		impress.menuItem("View->Header and Footer...").select();
116
		sleep(1);
117
		assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
118
		assertEquals("testdte",SD_FixedDateAndTimeOnSlideInput.getText());
119
		assertEquals(true,SD_FooterTextOnSlide.isChecked());
120
		assertEquals("yesy",SD_FooterTextOnSlideInput.getText());
121
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
122
123
		SD_SlideNumAsFooterOnSlide.uncheck();
124
		SD_ApplyToAllButtonOnSlideFooter.click();
125
126
		//save to ppt and reopen
127
		impress.menuItem("File->Save As...").select();
128
		String saveTo = fullPath("temp/" + "gfdd.ppt");
129
		FileUtil.deleteFile(saveTo);
130
		submitSaveDlg(saveTo);	
131
		if (AlienFormatDlg.exists(3))
132
			AlienFormatDlg.ok();
133
		sleep(1);
134
		impress.menuItem("File->Close").select();
135
		sleep(1);
136
137
		openStartcenter();
138
		app.dispatch(".uno:Open");
139
		String openFrom=fullPath("temp/" + "gfdd.ppt");
140
		submitOpenDlg(openFrom);
141
142
		impress.menuItem("View->Header and Footer...").select();
143
		sleep(1);
144
		assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
145
		//end-save to ppt and reopen
146
147
		//close Header and Footer dialog.
148
		SD_ApplyButtonOnSlideFooter.focus();
149
		typeKeys("<tab>");
150
		typeKeys("<enter>");
151
		//end
152
153
		//save to odp and reopen
154
		impress.menuItem("File->Save As...").select();
155
		String saveTo2 = fullPath("temp/" + "gfdd.odp");
156
		FileUtil.deleteFile(saveTo2);
157
		submitSaveDlg(saveTo2);	
158
		impress.menuItem("File->Close").select();
159
		sleep(1);
160
161
		openStartcenter();
162
		app.dispatch(".uno:Open");
163
		String openFrom2=fullPath("temp/" + "gfdd.odp");
164
		submitOpenDlg(openFrom2);
165
166
		impress.menuItem("View->Header and Footer...").select();
167
		sleep(1);
168
		assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
169
		//end-save to odp and reopen
170
	}
171
}
(-)testoo/src/testcase/sd/headerandfooter/OpenAOO34WithHeaderFooter.java (-117 lines)
Lines 1-117 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.fullPath;
27
import static testlib.AppUtil.initApp;
28
import static testlib.AppUtil.openStartcenter;
29
import static testlib.AppUtil.submitSaveDlg;
30
import static testlib.AppUtil.submitOpenDlg;
31
import static testlib.AppUtil.testFile;
32
import static testlib.UIMap.startcenter;
33
import static testlib.UIMap.*;
34
35
import java.io.File;
36
37
import static org.junit.Assert.*;
38
import static org.openoffice.test.vcl.Tester.*;
39
import static org.openoffice.test.vcl.Tester.typeKeys;
40
41
import org.junit.Before;
42
import org.junit.Rule;
43
import org.junit.Test;
44
import org.openoffice.test.common.FileUtil;
45
46
import testlib.Log;
47
import testlib.UIMap;
48
49
public class OpenAOO34WithHeaderFooter {
50
	/**
51
	 * TestCapture helps us to do
52
	 * 1. Take a screenshot when failure occurs.
53
	 * 2. Collect extra data when OpenOffice crashes.
54
	 */	
55
	@Rule
56
	public Log LOG = new Log();
57
	
58
	/**
59
	 * initApp helps us to do 
60
	 * 1. Patch the OpenOffice to enable automation if necessary.
61
	 * 2. Start OpenOffice with automation enabled if necessary.
62
	 * 3. Reset OpenOffice to startcenter.
63
	 * 
64
	 * @throws java.lang.Exception
65
	 */
66
	@Before
67
	public void setUp() throws Exception {
68
		initApp();
69
	}
70
	
71
	/**
72
	 * Test open AOO3.4 presentation with header and footer.
73
	 * edit and save to ODP
74
	 * @throws Exception
75
	 */
76
	@Test
77
	public void testOpenAOO34WithHeaderFooter() throws Exception{
78
		//open sample file
79
		String file = testFile("sd/AOO3.4HeaderFooter.odp");
80
		startcenter.menuItem("File->Open").select();
81
		submitOpenDlg(file);
82
		
83
		//check after reopen		
84
		impress.menuItem("View->Header and Footer...").select();
85
		sleep(1);
86
		assertEquals(true,SD_DateAndTimeFooterOnSlide.isChecked());
87
		assertEquals("fixed date",SD_FixedDateAndTimeOnSlideInput.getText());
88
		assertEquals(true,SD_FooterTextOnSlide.isChecked());
89
		assertEquals("footer test",SD_FooterTextOnSlideInput.getText());
90
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
91
				
92
		SD_SlideNumAsFooterOnSlide.uncheck();
93
		SD_ApplyToAllButtonOnSlideFooter.click();
94
		
95
	
96
		//save to odp and reopen
97
		impress.menuItem("File->Save As...").select();
98
		String saveTo2 = fullPath("temp/" + "AOO3.4HeaderFooter.odp");
99
		FileUtil.deleteFile(saveTo2);
100
		submitSaveDlg(saveTo2);	
101
		impress.menuItem("File->Close").select();
102
		sleep(1);
103
		
104
		openStartcenter();
105
		startcenter.menuItem("File->Open").select();
106
		String openFrom2=fullPath("temp/" + "AOO3.4HeaderFooter.odp");
107
		submitOpenDlg(openFrom2);
108
		
109
		impress.menuItem("View->Header and Footer...").select();
110
		sleep(1);
111
		assertEquals(false,SD_SlideNumAsFooterOnSlide.isChecked());
112
		//end-save to odp and reopen
113
	}
114
	
115
116
	
117
}
(-)testoo/src/testcase/BVTFunction.java (-1 lines)
Lines 145-151 Link Here
145
	@Test
145
	@Test
146
	public void testAboutDialog()
146
	public void testAboutDialog()
147
	{
147
	{
148
149
		app.dispatch(".uno:About");
148
		app.dispatch(".uno:About");
150
		assertTrue(AboutDialog.exists(5));
149
		assertTrue(AboutDialog.exists(5));
151
		AboutDialog.ok();
150
		AboutDialog.ok();
(-)testoo/src/testlib/UIMap.java (-18 / +17 lines)
Lines 235-251 Link Here
235
	public static final VclControl DataPilotFieldSelect = control("59030");
235
	public static final VclControl DataPilotFieldSelect = control("59030");
236
	public static final VclButton DataPilotAutomaticallyUpdateCheckBox = button("3643262003");
236
	public static final VclButton DataPilotAutomaticallyUpdateCheckBox = button("3643262003");
237
	public static final VclButton DataPilotTableUpdateButton = button("3643265586");
237
	public static final VclButton DataPilotTableUpdateButton = button("3643265586");
238
	public static final VclButton SD_DateAndTimeFooterOnSlide = button("553255938");
238
	public static final VclButton SD_DateAndTimeFooterOnSlide = button("sd:CheckBox:RID_SD_TABPAGE_HEADERFOOTER:CB_DATETIME");
239
	public static final VclButton SD_FixedDateAndTimeFooterOnSlide = button("553255427");
239
	public static final VclButton SD_FixedDateAndTimeFooterOnSlide = button("sd:RadioButton:RID_SD_TABPAGE_HEADERFOOTER:RB_DATETIME_FIXED");
240
	public static final VclEditBox SD_FixedDateAndTimeOnSlideInput = editbox("553256964");
240
	public static final VclEditBox SD_FixedDateAndTimeOnSlideInput = editbox("sd:Edit:RID_SD_TABPAGE_HEADERFOOTER:TB_DATETIME_FIXED");
241
	public static final VclButton SD_FooterTextOnSlide = button("553255946");
241
	public static final VclButton SD_FooterTextOnSlide = button("sd:CheckBox:RID_SD_TABPAGE_HEADERFOOTER:CB_FOOTER");
242
	public static final VclEditBox SD_FooterTextOnSlideInput = editbox("553256972");
242
	public static final VclEditBox SD_FooterTextOnSlideInput = editbox("sd:Edit:RID_SD_TABPAGE_HEADERFOOTER:TB_FOOTER_FIXED");
243
	public static final VclButton SD_SlideNumAsFooterOnSlide = button("553255950");
243
	public static final VclButton SD_SlideNumAsFooterOnSlide = button("sd:CheckBox:RID_SD_TABPAGE_HEADERFOOTER:CB_SLIDENUMBER");
244
	public static final VclButton SD_ApplyToAllButtonOnSlideFooter = button("553259537");
244
	public static final VclButton SD_ApplyToAllButtonOnSlideFooter = button("sd:PushButton:RID_SD_TABPAGE_HEADERFOOTER:BT_APPLYTOALL");
245
	public static final VclWindow SD_SlidesPanel = window("59787");
245
//	public static final VclWindow SD_SlidesPanel = window("HID_SD_WIN_DOCUMENT");
246
	public static final VclControl SD_SlidelistInNaviagtor = control("59793");
246
	public static final VclControl SD_SlidelistInNaviagtor = control("HID_SD_NAVIGATOR_TLB");
247
	public static final VclControl SD_HeaderAndFooterDialog = control("59901");
247
	public static final VclControl SD_HeaderAndFooterDialog = control("HID_SD_TABPAGE_HEADERFOOTER_SLIDE");
248
	public static final VclButton SD_ApplyButtonOnSlideFooter = button("553259538");
248
	public static final VclButton SD_ApplyButtonOnSlideFooter = button("sd:PushButton:RID_SD_TABPAGE_HEADERFOOTER:BT_APPLY");
249
	public static final VclButton SD_InsertPageButtonOnToolbar = button(".uno:InsertPage");
249
	public static final VclButton SD_InsertPageButtonOnToolbar = button(".uno:InsertPage");
250
	public static final VclControl DataPilotPaneRowArea = control("59036");
250
	public static final VclControl DataPilotPaneRowArea = control("59036");
251
	public static final VclEditBox DataPilotFieldDisplayNameEditBox = editbox("971868166");
251
	public static final VclEditBox DataPilotFieldDisplayNameEditBox = editbox("971868166");
Lines 257-266 Link Here
257
	public static final VclButton DataPilotFieldOptionSortDescendingRadioButton = button("958972620");
257
	public static final VclButton DataPilotFieldOptionSortDescendingRadioButton = button("958972620");
258
	public static final VclControl DataPiloPaneDataArea = control("59038");
258
	public static final VclControl DataPiloPaneDataArea = control("59038");
259
	public static final VclControl DataPilotColumnArea = control("59034");
259
	public static final VclControl DataPilotColumnArea = control("59034");
260
	public static final VclButton SD_HeaderTextOnNotes = button("553255958");
260
	public static final VclButton SD_HeaderTextOnNotes = button("sd:CheckBox:RID_SD_TABPAGE_HEADERFOOTER:CB_HEADER");
261
	public static final VclEditBox SD_HeaderTextOnNotesInput = editbox("553256984");
261
	public static final VclEditBox SD_HeaderTextOnNotesInput = editbox("sd:Edit:RID_SD_TABPAGE_HEADERFOOTER:TB_HEADER_FIXED");
262
	public static final VclTabPage SD_HeaderAndFooterOnNotesTabPage = tabpage("59902");
262
	public static final VclTabPage SD_HeaderAndFooterOnNotesTabPage = tabpage("SD_HID_SD_TABPAGE_HEADERFOOTER_NOTESHANDOUT");
263
	public static final VclButton SD_FooterNotShowOn1stSlide = button("553255952");
263
	public static final VclButton SD_FooterNotShowOn1stSlide = button("sd:CheckBox:RID_SD_TABPAGE_HEADERFOOTER:CB_NOTONTITLE");
264
	public static final VclTabPage SortOptionsPage = tabpage("SC_HID_SCPAGE_SORT_OPTIONS");
264
	public static final VclTabPage SortOptionsPage = tabpage("SC_HID_SCPAGE_SORT_OPTIONS");
265
	public static final VclButton SortOptionsPage_CaseSensitive = button("sc:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_CASESENSITIVE");
265
	public static final VclButton SortOptionsPage_CaseSensitive = button("sc:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_CASESENSITIVE");
266
	public static final VclButton SortOptionsPage_CopyResultTo = button("sc:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_COPYRESULT");
266
	public static final VclButton SortOptionsPage_CopyResultTo = button("sc:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_COPYRESULT");
Lines 272-283 Link Here
272
	public static final VclButton DataPilotFieldOptionSubTotalsNeverRadioButton = button("958956135");
272
	public static final VclButton DataPilotFieldOptionSubTotalsNeverRadioButton = button("958956135");
273
	public static final VclButton DataPilotFieldOptionSortAscendingRadioButton = button("958972619");
273
	public static final VclButton DataPilotFieldOptionSortAscendingRadioButton = button("958972619");
274
	public static final VclControl DataPilotPanePageArea = control("59032");
274
	public static final VclControl DataPilotPanePageArea = control("59032");
275
	public static final VclDialog SaveInODFOrNot = dialog("33388");
276
	public static final VclButton OnlyDisplayTopNItemCheckBox = button("1495745540");
275
	public static final VclButton OnlyDisplayTopNItemCheckBox = button("1495745540");
277
	public static final VclField NumberOfItemShowInTopNEditBox = field("1495750661");
276
	public static final VclField NumberOfItemShowInTopNEditBox = field("1495750661");
278
	public static final VclDialog FieldTopNSettingDialog = dialog("59039");
277
	public static final VclDialog FieldTopNSettingDialog = dialog("59039");
279
	public static final VclButton SD_AutoUpdateTimeFooter = button("553255429");
278
	public static final VclButton SD_AutoUpdateTimeFooter = button("sd:RadioButton:RID_SD_TABPAGE_HEADERFOOTER:RB_DATETIME_AUTOMATIC");
280
	public static final VclListBox SD_AutoUpdateTimeFooterType = listbox("553258502");
279
	public static final VclListBox SD_AutoUpdateTimeFooterType = listbox("sd:ListBox:RID_SD_TABPAGE_HEADERFOOTER:CB_DATETIME_FORMAT");
281
	public static final VclButton DataPilotButton = button("59270");
280
	public static final VclButton DataPilotButton = button("59270");
282
	public static final VclDockingWin DataPilotPanel = dockingwin("3643260928");
281
	public static final VclDockingWin DataPilotPanel = dockingwin("3643260928");
283
	public static final VclListBox SCSubTotalsGroupByListBox = listbox("SC_HID_SC_SUBT_GROUP");
282
	public static final VclListBox SCSubTotalsGroupByListBox = listbox("SC_HID_SC_SUBT_GROUP");
(-)testoo/src/testcase/sd/headerandfooter/DuplicateSlideWithApplyToAllFooter.java (-119 lines)
Lines 1-119 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.initApp;
27
import static testlib.UIMap.startcenter;
28
import static testlib.UIMap.*;
29
30
import java.io.File;
31
32
import static org.junit.Assert.*;
33
import static org.openoffice.test.vcl.Tester.*;
34
import static org.openoffice.test.vcl.Tester.typeKeys;
35
36
import org.junit.Before;
37
import org.junit.Rule;
38
import org.junit.Test;
39
40
import testlib.Log;
41
import testlib.UIMap;
42
43
public class DuplicateSlideWithApplyToAllFooter {
44
	/**
45
	 * TestCapture helps us to do
46
	 * 1. Take a screenshot when failure occurs.
47
	 * 2. Collect extra data when OpenOffice crashes.
48
	 */	
49
	@Rule
50
	public Log LOG = new Log();
51
	
52
	/**
53
	 * initApp helps us to do 
54
	 * 1. Patch the OpenOffice to enable automation if necessary.
55
	 * 2. Start OpenOffice with automation enabled if necessary.
56
	 * 3. Reset OpenOffice to startcenter.
57
	 * 
58
	 * @throws java.lang.Exception
59
	 */
60
	@Before
61
	public void setUp() throws Exception {
62
		initApp();
63
	}
64
	
65
	/**
66
	 * Test duplicate slide with Apply to all Footer to same file 
67
	 * @throws Exception
68
	 */
69
	@Test
70
	public void testDuplicateSlideWithApplyToAllFooter() throws Exception{
71
		
72
		startcenter.menuItem("File->New->Presentation").select();
73
		sleep(2);
74
		
75
		for(int i=0; i<5;i++){
76
		SD_InsertPageButtonOnToolbar.click();
77
		sleep(1);
78
		}
79
		//pop up navigator panel
80
		impress.menuItem("View").select();
81
		if(!impress.menuItem("View->Navigator").isSelected()){
82
			impress.menuItem("View->Navigator").select();
83
			sleep(1);
84
		}
85
		
86
		//add header and footer
87
		impress.menuItem("View->Header and Footer...").select();
88
		sleep(2);
89
		
90
		SD_DateAndTimeFooterOnSlide.check();
91
		SD_FixedDateAndTimeFooterOnSlide.check();
92
		sleep(1);
93
		SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120323");
94
		sleep(1);
95
		SD_FooterTextOnSlide.check();
96
		sleep(1);
97
		SD_FooterTextOnSlideInput.setText("Footer Test");
98
		sleep(1);
99
		SD_SlideNumAsFooterOnSlide.check();
100
		sleep(1);
101
		SD_ApplyToAllButtonOnSlideFooter.click();
102
		sleep(1);
103
		
104
					
105
		SD_SlidesPanel.focus();
106
		for(int j=0; j<=2;j++){
107
		typeKeys("<up>");
108
		sleep(1);
109
		}
110
		impress.menuItem("Insert->Duplicate Slide").select();
111
		impress.menuItem("View->Header and Footer...").select();
112
		sleep(1);
113
		assertEquals("Fix Date: 20120323",SD_FixedDateAndTimeOnSlideInput.getText());
114
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
115
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
116
117
	}
118
	
119
}
(-)testoo/src/testcase/sd/headerandfooter/CopySlideWithNotesHeaderFooter.java (-149 lines)
Lines 1-149 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
package testcase.sd.headerandfooter;
25
26
import static testlib.AppUtil.initApp;
27
import static testlib.UIMap.startcenter;
28
import static testlib.UIMap.*;
29
30
import java.io.File;
31
32
import static org.junit.Assert.*;
33
import static org.openoffice.test.vcl.Tester.*;
34
import static org.openoffice.test.vcl.Tester.typeKeys;
35
36
import org.junit.Before;
37
import org.junit.Rule;
38
import org.junit.Test;
39
40
import testlib.ImpressUtil;
41
import testlib.Log;
42
import testlib.UIMap;
43
44
public class CopySlideWithNotesHeaderFooter {
45
	/**
46
	 * TestCapture helps us to do
47
	 * 1. Take a screenshot when failure occurs.
48
	 * 2. Collect extra data when OpenOffice crashes.
49
	 */	
50
	@Rule
51
	public Log LOG = new Log();
52
	
53
	/**
54
	 * initApp helps us to do 
55
	 * 1. Patch the OpenOffice to enable automation if necessary.
56
	 * 2. Start OpenOffice with automation enabled if necessary.
57
	 * 3. Reset OpenOffice to startcenter.
58
	 * 
59
	 * @throws java.lang.Exception
60
	 */
61
	@Before
62
	public void setUp() throws Exception {
63
		initApp();
64
	}
65
	
66
	/**
67
	 * Test Copy slide with Notes Footer to same file and different file
68
	 * @throws Exception
69
	 */
70
	@Test
71
	public void testCopySlideWithNotesHeaderFooter() throws Exception{
72
		
73
		startcenter.menuItem("File->New->Presentation").select();
74
		sleep(2);
75
		
76
		for(int i=0; i<5;i++){
77
		SD_InsertPageButtonOnToolbar.click();
78
		sleep(1);
79
		}
80
		//pop up navigator panel
81
		impress.menuItem("View").select();
82
		if(!impress.menuItem("View->Navigator").isSelected()){
83
			impress.menuItem("View->Navigator").select();
84
			sleep(1);
85
		}
86
		
87
		//add header and footer
88
		impress.menuItem("View->Header and Footer...").select();
89
		sleep(1);
90
		SD_HeaderAndFooterOnNotesTabPage.select();
91
		SD_HeaderTextOnNotes.check();
92
		SD_HeaderTextOnNotesInput.setText("Header Test");
93
		SD_DateAndTimeFooterOnSlide.check();
94
		SD_FixedDateAndTimeFooterOnSlide.check();
95
		sleep(1);
96
		SD_FixedDateAndTimeOnSlideInput.setText("Fix Date: 20120329");
97
		sleep(1);
98
		SD_FooterTextOnSlide.check();
99
		sleep(1);
100
		SD_FooterTextOnSlideInput.setText("Footer Test");
101
		sleep(1);
102
		SD_SlideNumAsFooterOnSlide.check();
103
		sleep(1);
104
		SD_ApplyToAllButtonOnSlideFooter.click();
105
		sleep(1);
106
				
107
		//paste to the same file
108
		SD_SlidesPanel.focus();
109
		typeKeys("<up>");
110
		typeKeys("<$copy>");
111
		typeKeys("<down>");
112
		sleep(1);
113
		typeKeys("<$paste>");
114
		
115
		ImpressUtil.getCurView().activate();
116
		
117
		impress.menuItem("View->Header and Footer...").select();
118
		sleep(1);
119
		SD_HeaderAndFooterOnNotesTabPage.select();
120
		assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
121
		assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
122
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
123
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
124
		
125
		//close header and footer dialog.
126
		SD_ApplyToAllButtonOnSlideFooter.focus();
127
		typeKeys("<tab>");
128
		typeKeys("<enter>");
129
		
130
		//paste to different file
131
		impress.focus();
132
		impress.menuItem("File->New->Presentation").select();
133
		sleep(1);
134
		typeKeys("<$paste>");
135
		SD_SlidesPanel.focus();
136
		typeKeys("<down>");
137
		sleep(1);
138
		ImpressUtil.getCurView().activate();
139
		impress.menuItem("View->Header and Footer...").select();
140
		sleep(1);
141
		SD_HeaderAndFooterOnNotesTabPage.select();
142
		assertEquals("Header Test",SD_HeaderTextOnNotesInput.getText());
143
		assertEquals("Fix Date: 20120329",SD_FixedDateAndTimeOnSlideInput.getText());
144
		assertEquals("Footer Test",SD_FooterTextOnSlideInput.getText());
145
		assertEquals(true,SD_SlideNumAsFooterOnSlide.isChecked());
146
		
147
	}
148
	
149
}
(-).project (+11 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<projectDescription>
3
	<name>test</name>
4
	<comment></comment>
5
	<projects>
6
	</projects>
7
	<buildSpec>
8
	</buildSpec>
9
	<natures>
10
	</natures>
11
</projectDescription>

Return to issue 120295