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