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