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 setUp()41 public void setUp() throws Exception { 42 app.start(); 43 } 44 45 @After tearDown()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 testTableFontEffectPropertyDialog()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 final int nBlackIndex = 12; // according to standard.soc as of #i121520# 74 effectsPageColor.select( nBlackIndex); 75 assertEquals("EffectsPage_Color isn't black", effectsPageColor.getSelText(), "Black"); 76 77 // select Relief 78 effectsPageRelief.select(0); 79 assertEquals("EffectsPage_Relief isn't no", effectsPageRelief.getSelText(), "(Without)"); 80 effectsPageOutline.check(); 81 assertTrue("EffectsPage_Outline isn't checked", effectsPageOutline.isChecked()); 82 effectsPageShadow.check(); 83 assertTrue("EffectsPage_Shadow isn't checked", effectsPageShadow.isChecked()); 84 85 // select Overlining 86 effectsPageOverline.select(1); 87 assertEquals("EffectsPage_Overline isn't the first item", effectsPageOverline.getSelText(), effectsPageOverline.getItemText(1)); 88 effectsPageOverlineColor.select(1); 89 assertEquals("EffectsPage_Overline_Color isn't the first item", effectsPageOverlineColor.getSelText(), effectsPageOverlineColor.getItemText(1)); 90 91 // select Strikethrough 92 effectsPageStrikeout.select(1); 93 assertEquals("EffectsPage_Strikeout isn't the first item", effectsPageStrikeout.getSelText(), effectsPageStrikeout.getItemText(1)); 94 95 // select Underlining 96 effectsPageUnderline.select(1); 97 assertEquals("EffectsPage_Underline isn't the first item", effectsPageUnderline.getSelText(), effectsPageUnderline.getItemText(1)); 98 effectsPageUnderlineColor.select(1); 99 assertEquals("EffectsPage_Underline_Color isn't the first item", effectsPageUnderlineColor.getSelText(), effectsPageUnderlineColor.getItemText(1)); 100 101 // select individual workds 102 effectsPageInvidiualWords.check(); 103 assertTrue("EffectsPage_InvidiualWords isn't checked", effectsPageInvidiualWords.isChecked()); 104 105 // select Emphasis Mark 106 // EffectsPage_Emphasis.select(1); 107 // assertEquals(EffectsPage_Emphasis.getSelText(), "Dot"); 108 // EffectsPage_Position.select(1); 109 // assertEquals(EffectsPage_Position.getSelText(), "Below text"); 110 effectsPage.ok(); 111 112 } 113 } 114