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 package fvt.gui.sd.table;
23 
24 import static org.junit.Assert.*;
25 import static testlib.gui.UIMap.*;
26 
27 import org.junit.After;
28 import org.junit.Before;
29 import org.junit.Rule;
30 import org.junit.Test;
31 import org.openoffice.test.common.Logger;
32 
33 import testlib.gui.AppTool;
34 
35 public class TableFontEffectsProperty {
36 
37 	@Rule
38 	public Logger log = Logger.getLogger(this);
39 
40 	@Before
41 	public void setUp() throws Exception {
42 		app.start();
43 	}
44 
45 	@After
46 	public void tearDown() throws Exception {
47 		app.stop();
48 	}
49 
50 	/**
51 	 * Test the Font Effect property dialog in Presentation
52 	 *
53 	 * @throws Exception
54 	 */
55 
56 	@Test
57 	public void testTableFontEffectPropertyDialog() throws Exception {
58 
59 		// Create a new presentation document
60 		AppTool.newPresentation();
61 
62 		// Insert a table
63 		app.dispatch(".uno:InsertTable", 3);
64 		insertTable.ok();
65 
66 		// Verify if the table toolbar is active
67 		assertTrue("Table Toolbar exist", tableToolbar.exists(3));
68 
69 		// open Table Properties Dialog
70 		app.dispatch(".uno:TableDialog", 3);
71 		effectsPage.select();
72 		// select Font color
73 		effectsPageColor.select(1);
74 		assertEquals("EffectsPage_Color isn't black", effectsPageColor.getSelText(), "Black");
75 
76 		// select Relief
77 		effectsPageRelief.select(0);
78 		assertEquals("EffectsPage_Relief isn't no", effectsPageRelief.getSelText(), "(Without)");
79 		effectsPageOutline.check();
80 		assertTrue("EffectsPage_Outline isn't checked", effectsPageOutline.isChecked());
81 		effectsPageShadow.check();
82 		assertTrue("EffectsPage_Shadow isn't checked", effectsPageShadow.isChecked());
83 
84 		// select Overlining
85 		effectsPageOverline.select(1);
86 		assertEquals("EffectsPage_Overline isn't the first item", effectsPageOverline.getSelText(), effectsPageOverline.getItemText(1));
87 		effectsPageOverlineColor.select(1);
88 		assertEquals("EffectsPage_Overline_Color isn't the first item", effectsPageOverlineColor.getSelText(), effectsPageOverlineColor.getItemText(1));
89 
90 		// select Strikethrough
91 		effectsPageStrikeout.select(1);
92 		assertEquals("EffectsPage_Strikeout isn't the first item", effectsPageStrikeout.getSelText(), effectsPageStrikeout.getItemText(1));
93 
94 		// select Underlining
95 		effectsPageUnderline.select(1);
96 		assertEquals("EffectsPage_Underline isn't the first item", effectsPageUnderline.getSelText(), effectsPageUnderline.getItemText(1));
97 		effectsPageUnderlineColor.select(1);
98 		assertEquals("EffectsPage_Underline_Color isn't the first item", effectsPageUnderlineColor.getSelText(), effectsPageUnderlineColor.getItemText(1));
99 
100 		// select individual workds
101 		effectsPageInvidiualWords.check();
102 		assertTrue("EffectsPage_InvidiualWords isn't checked", effectsPageInvidiualWords.isChecked());
103 
104 		// select Emphasis Mark
105 		// EffectsPage_Emphasis.select(1);
106 		// assertEquals(EffectsPage_Emphasis.getSelText(), "Dot");
107 		// EffectsPage_Position.select(1);
108 		// assertEquals(EffectsPage_Position.getSelText(), "Below text");
109 		effectsPage.ok();
110 
111 	}
112 }
113