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 { 36*fd348426SLi Feng Wang 37*fd348426SLi Feng Wang @Rule 38*fd348426SLi Feng Wang public Logger log = Logger.getLogger(this); 39c37bcbf4SLi Feng Wang 40c37bcbf4SLi Feng Wang @Before 41c37bcbf4SLi Feng Wang public void setUp() throws Exception { 42c37bcbf4SLi Feng Wang app.start(); 43c37bcbf4SLi Feng Wang } 44c37bcbf4SLi Feng Wang 45c37bcbf4SLi Feng Wang @After 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 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 73c37bcbf4SLi Feng Wang effectsPageColor.select(1); 74c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Color isn't black", effectsPageColor.getSelText(), "Black"); 75c37bcbf4SLi Feng Wang 76c37bcbf4SLi Feng Wang // select Relief 77c37bcbf4SLi Feng Wang effectsPageRelief.select(0); 78c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Relief isn't no", effectsPageRelief.getSelText(), "(Without)"); 79c37bcbf4SLi Feng Wang effectsPageOutline.check(); 80c37bcbf4SLi Feng Wang assertTrue("EffectsPage_Outline isn't checked", effectsPageOutline.isChecked()); 81c37bcbf4SLi Feng Wang effectsPageShadow.check(); 82c37bcbf4SLi Feng Wang assertTrue("EffectsPage_Shadow isn't checked", effectsPageShadow.isChecked()); 83c37bcbf4SLi Feng Wang 84c37bcbf4SLi Feng Wang // select Overlining 85c37bcbf4SLi Feng Wang effectsPageOverline.select(1); 86c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Overline isn't the first item", effectsPageOverline.getSelText(), effectsPageOverline.getItemText(1)); 87c37bcbf4SLi Feng Wang effectsPageOverlineColor.select(1); 88c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Overline_Color isn't the first item", effectsPageOverlineColor.getSelText(), effectsPageOverlineColor.getItemText(1)); 89c37bcbf4SLi Feng Wang 90c37bcbf4SLi Feng Wang // select Strikethrough 91c37bcbf4SLi Feng Wang effectsPageStrikeout.select(1); 92c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Strikeout isn't the first item", effectsPageStrikeout.getSelText(), effectsPageStrikeout.getItemText(1)); 93c37bcbf4SLi Feng Wang 94c37bcbf4SLi Feng Wang // select Underlining 95c37bcbf4SLi Feng Wang effectsPageUnderline.select(1); 96c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Underline isn't the first item", effectsPageUnderline.getSelText(), effectsPageUnderline.getItemText(1)); 97c37bcbf4SLi Feng Wang effectsPageUnderlineColor.select(1); 98c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Underline_Color isn't the first item", effectsPageUnderlineColor.getSelText(), effectsPageUnderlineColor.getItemText(1)); 99c37bcbf4SLi Feng Wang 100c37bcbf4SLi Feng Wang // select individual workds 101c37bcbf4SLi Feng Wang effectsPageInvidiualWords.check(); 102c37bcbf4SLi Feng Wang assertTrue("EffectsPage_InvidiualWords isn't checked", effectsPageInvidiualWords.isChecked()); 103c37bcbf4SLi Feng Wang 104c37bcbf4SLi Feng Wang // select Emphasis Mark 105c37bcbf4SLi Feng Wang // EffectsPage_Emphasis.select(1); 106c37bcbf4SLi Feng Wang // assertEquals(EffectsPage_Emphasis.getSelText(), "Dot"); 107c37bcbf4SLi Feng Wang // EffectsPage_Position.select(1); 108c37bcbf4SLi Feng Wang // assertEquals(EffectsPage_Position.getSelText(), "Below text"); 109c37bcbf4SLi Feng Wang effectsPage.ok(); 110c37bcbf4SLi Feng Wang 111c37bcbf4SLi Feng Wang } 112c37bcbf4SLi Feng Wang } 113