xref: /AOO41X/test/testgui/source/fvt/gui/sd/table/TableFontEffectsProperty.java (revision 35ff5cfc2f8c125a15f006fc0936078cd39d0a42)
1c37bcbf4SLi Feng Wang /**************************************************************
2c37bcbf4SLi Feng Wang  *
3c37bcbf4SLi Feng Wang  * Licensed to the Apache Software Foundation (ASF) under one
4c37bcbf4SLi Feng Wang  * or more contributor license agreements.  See the NOTICE file
5c37bcbf4SLi Feng Wang  * distributed with this work for additional information
6c37bcbf4SLi Feng Wang  * regarding copyright ownership.  The ASF licenses this file
7c37bcbf4SLi Feng Wang  * to you under the Apache License, Version 2.0 (the
8c37bcbf4SLi Feng Wang  * "License"); you may not use this file except in compliance
9c37bcbf4SLi Feng Wang  * with the License.  You may obtain a copy of the License at
10c37bcbf4SLi Feng Wang  *
11c37bcbf4SLi Feng Wang  *   http://www.apache.org/licenses/LICENSE-2.0
12c37bcbf4SLi Feng Wang  *
13c37bcbf4SLi Feng Wang  * Unless required by applicable law or agreed to in writing,
14c37bcbf4SLi Feng Wang  * software distributed under the License is distributed on an
15c37bcbf4SLi Feng Wang  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16c37bcbf4SLi Feng Wang  * KIND, either express or implied.  See the License for the
17c37bcbf4SLi Feng Wang  * specific language governing permissions and limitations
18c37bcbf4SLi Feng Wang  * under the License.
19c37bcbf4SLi Feng Wang  *
20c37bcbf4SLi Feng Wang  *************************************************************/
21c37bcbf4SLi Feng Wang 
22c37bcbf4SLi Feng Wang package fvt.gui.sd.table;
23c37bcbf4SLi Feng Wang 
24c37bcbf4SLi Feng Wang import static org.junit.Assert.*;
25c37bcbf4SLi Feng Wang import static testlib.gui.UIMap.*;
26c37bcbf4SLi Feng Wang 
27c37bcbf4SLi Feng Wang import org.junit.After;
28c37bcbf4SLi Feng Wang import org.junit.Before;
29c37bcbf4SLi Feng Wang import org.junit.Rule;
30c37bcbf4SLi Feng Wang import org.junit.Test;
31c37bcbf4SLi Feng Wang import org.openoffice.test.common.Logger;
32c37bcbf4SLi Feng Wang 
33c37bcbf4SLi Feng Wang import testlib.gui.AppTool;
34c37bcbf4SLi Feng Wang 
35c37bcbf4SLi Feng Wang public class TableFontEffectsProperty {
36fd348426SLi Feng Wang 
37fd348426SLi Feng Wang 	@Rule
38fd348426SLi Feng Wang 	public Logger log = Logger.getLogger(this);
39c37bcbf4SLi Feng Wang 
40c37bcbf4SLi Feng Wang 	@Before
setUp()41c37bcbf4SLi Feng Wang 	public void setUp() throws Exception {
42c37bcbf4SLi Feng Wang 		app.start();
43c37bcbf4SLi Feng Wang 	}
44c37bcbf4SLi Feng Wang 
45c37bcbf4SLi Feng Wang 	@After
tearDown()46c37bcbf4SLi Feng Wang 	public void tearDown() throws Exception {
47c37bcbf4SLi Feng Wang 		app.stop();
48c37bcbf4SLi Feng Wang 	}
49c37bcbf4SLi Feng Wang 
50c37bcbf4SLi Feng Wang 	/**
51c37bcbf4SLi Feng Wang 	 * Test the Font Effect property dialog in Presentation
52c37bcbf4SLi Feng Wang 	 *
53c37bcbf4SLi Feng Wang 	 * @throws Exception
54c37bcbf4SLi Feng Wang 	 */
55c37bcbf4SLi Feng Wang 
56c37bcbf4SLi Feng Wang 	@Test
testTableFontEffectPropertyDialog()57c37bcbf4SLi Feng Wang 	public void testTableFontEffectPropertyDialog() throws Exception {
58c37bcbf4SLi Feng Wang 
59c37bcbf4SLi Feng Wang 		// Create a new presentation document
60c37bcbf4SLi Feng Wang 		AppTool.newPresentation();
61c37bcbf4SLi Feng Wang 
62c37bcbf4SLi Feng Wang 		// Insert a table
63c37bcbf4SLi Feng Wang 		app.dispatch(".uno:InsertTable", 3);
64c37bcbf4SLi Feng Wang 		insertTable.ok();
65c37bcbf4SLi Feng Wang 
66c37bcbf4SLi Feng Wang 		// Verify if the table toolbar is active
67c37bcbf4SLi Feng Wang 		assertTrue("Table Toolbar exist", tableToolbar.exists(3));
68c37bcbf4SLi Feng Wang 
69c37bcbf4SLi Feng Wang 		// open Table Properties Dialog
70c37bcbf4SLi Feng Wang 		app.dispatch(".uno:TableDialog", 3);
71c37bcbf4SLi Feng Wang 		effectsPage.select();
72c37bcbf4SLi Feng Wang 		// select Font color
73*35ff5cfcSHerbert Dürr 		final int nBlackIndex = 12; // according to standard.soc as of #i121520#
74*35ff5cfcSHerbert Dürr 		effectsPageColor.select( nBlackIndex);
75c37bcbf4SLi Feng Wang 		assertEquals("EffectsPage_Color isn't black", effectsPageColor.getSelText(), "Black");
76c37bcbf4SLi Feng Wang 
77c37bcbf4SLi Feng Wang 		// select Relief
78c37bcbf4SLi Feng Wang 		effectsPageRelief.select(0);
79c37bcbf4SLi Feng Wang 		assertEquals("EffectsPage_Relief isn't no", effectsPageRelief.getSelText(), "(Without)");
80c37bcbf4SLi Feng Wang 		effectsPageOutline.check();
81c37bcbf4SLi Feng Wang 		assertTrue("EffectsPage_Outline isn't checked", effectsPageOutline.isChecked());
82c37bcbf4SLi Feng Wang 		effectsPageShadow.check();
83c37bcbf4SLi Feng Wang 		assertTrue("EffectsPage_Shadow isn't checked", effectsPageShadow.isChecked());
84c37bcbf4SLi Feng Wang 
85c37bcbf4SLi Feng Wang 		// select Overlining
86c37bcbf4SLi Feng Wang 		effectsPageOverline.select(1);
87c37bcbf4SLi Feng Wang 		assertEquals("EffectsPage_Overline isn't the first item", effectsPageOverline.getSelText(), effectsPageOverline.getItemText(1));
88c37bcbf4SLi Feng Wang 		effectsPageOverlineColor.select(1);
89c37bcbf4SLi Feng Wang 		assertEquals("EffectsPage_Overline_Color isn't the first item", effectsPageOverlineColor.getSelText(), effectsPageOverlineColor.getItemText(1));
90c37bcbf4SLi Feng Wang 
91c37bcbf4SLi Feng Wang 		// select Strikethrough
92c37bcbf4SLi Feng Wang 		effectsPageStrikeout.select(1);
93c37bcbf4SLi Feng Wang 		assertEquals("EffectsPage_Strikeout isn't the first item", effectsPageStrikeout.getSelText(), effectsPageStrikeout.getItemText(1));
94c37bcbf4SLi Feng Wang 
95c37bcbf4SLi Feng Wang 		// select Underlining
96c37bcbf4SLi Feng Wang 		effectsPageUnderline.select(1);
97c37bcbf4SLi Feng Wang 		assertEquals("EffectsPage_Underline isn't the first item", effectsPageUnderline.getSelText(), effectsPageUnderline.getItemText(1));
98c37bcbf4SLi Feng Wang 		effectsPageUnderlineColor.select(1);
99c37bcbf4SLi Feng Wang 		assertEquals("EffectsPage_Underline_Color isn't the first item", effectsPageUnderlineColor.getSelText(), effectsPageUnderlineColor.getItemText(1));
100c37bcbf4SLi Feng Wang 
101c37bcbf4SLi Feng Wang 		// select individual workds
102c37bcbf4SLi Feng Wang 		effectsPageInvidiualWords.check();
103c37bcbf4SLi Feng Wang 		assertTrue("EffectsPage_InvidiualWords isn't checked", effectsPageInvidiualWords.isChecked());
104c37bcbf4SLi Feng Wang 
105c37bcbf4SLi Feng Wang 		// select Emphasis Mark
106c37bcbf4SLi Feng Wang 		// EffectsPage_Emphasis.select(1);
107c37bcbf4SLi Feng Wang 		// assertEquals(EffectsPage_Emphasis.getSelText(), "Dot");
108c37bcbf4SLi Feng Wang 		// EffectsPage_Position.select(1);
109c37bcbf4SLi Feng Wang 		// assertEquals(EffectsPage_Position.getSelText(), "Below text");
110c37bcbf4SLi Feng Wang 		effectsPage.ok();
111c37bcbf4SLi Feng Wang 
112c37bcbf4SLi Feng Wang 	}
113c37bcbf4SLi Feng Wang }
114