134c440bcSLiu Zhe /************************************************************** 234c440bcSLiu Zhe * 334c440bcSLiu Zhe * Licensed to the Apache Software Foundation (ASF) under one 434c440bcSLiu Zhe * or more contributor license agreements. See the NOTICE file 534c440bcSLiu Zhe * distributed with this work for additional information 634c440bcSLiu Zhe * regarding copyright ownership. The ASF licenses this file 734c440bcSLiu Zhe * to you under the Apache License, Version 2.0 (the 834c440bcSLiu Zhe * "License"); you may not use this file except in compliance 934c440bcSLiu Zhe * with the License. You may obtain a copy of the License at 1034c440bcSLiu Zhe * 1134c440bcSLiu Zhe * http://www.apache.org/licenses/LICENSE-2.0 1234c440bcSLiu Zhe * 1334c440bcSLiu Zhe * Unless required by applicable law or agreed to in writing, 1434c440bcSLiu Zhe * software distributed under the License is distributed on an 1534c440bcSLiu Zhe * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1634c440bcSLiu Zhe * KIND, either express or implied. See the License for the 1734c440bcSLiu Zhe * specific language governing permissions and limitations 1834c440bcSLiu Zhe * under the License. 1934c440bcSLiu Zhe * 2034c440bcSLiu Zhe *************************************************************/ 2134c440bcSLiu Zhe 2280a6f5c5SLiu Zhe package fvt.gui.sd.table; 2334c440bcSLiu Zhe 2422a14f28SLiu Zhe import static org.junit.Assert.*; 2534c440bcSLiu Zhe import static testlib.gui.UIMap.*; 2634c440bcSLiu Zhe 2734c440bcSLiu Zhe import org.junit.After; 2834c440bcSLiu Zhe import org.junit.Before; 2934c440bcSLiu Zhe import org.junit.Rule; 3034c440bcSLiu Zhe import org.junit.Test; 3122a14f28SLiu Zhe import org.openoffice.test.common.Logger; 3234c440bcSLiu Zhe 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); 3934c440bcSLiu Zhe 4034c440bcSLiu Zhe @Before 4134c440bcSLiu Zhe public void setUp() throws Exception { 4234c440bcSLiu Zhe app.start(); 4334c440bcSLiu Zhe } 4434c440bcSLiu Zhe 4534c440bcSLiu Zhe @After 4634c440bcSLiu Zhe public void tearDown() throws Exception { 47c37bcbf4SLi Feng Wang app.stop(); 4834c440bcSLiu Zhe } 4934c440bcSLiu Zhe 5034c440bcSLiu Zhe /** 51c37bcbf4SLi Feng Wang * Test the Font Effect property dialog in Presentation 5234c440bcSLiu Zhe * 5334c440bcSLiu Zhe * @throws Exception 5434c440bcSLiu Zhe */ 5534c440bcSLiu Zhe 5634c440bcSLiu Zhe @Test 57c37bcbf4SLi Feng Wang public void testTableFontEffectPropertyDialog() throws Exception { 5834c440bcSLiu Zhe 5934c440bcSLiu Zhe // Create a new presentation document 60c37bcbf4SLi Feng Wang AppTool.newPresentation(); 6134c440bcSLiu Zhe 6234c440bcSLiu Zhe // Insert a table 6334c440bcSLiu Zhe app.dispatch(".uno:InsertTable", 3); 64b4d2d410SLiu Zhe insertTable.ok(); 6534c440bcSLiu Zhe 6634c440bcSLiu Zhe // Verify if the table toolbar is active 67b4d2d410SLiu Zhe assertTrue("Table Toolbar exist", tableToolbar.exists(3)); 6834c440bcSLiu Zhe 6934c440bcSLiu Zhe // open Table Properties Dialog 7034c440bcSLiu Zhe app.dispatch(".uno:TableDialog", 3); 71b4d2d410SLiu Zhe effectsPage.select(); 7234c440bcSLiu Zhe // select Font color 73b4d2d410SLiu Zhe effectsPageColor.select(1); 74c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Color isn't black", effectsPageColor.getSelText(), "Black"); 7522a14f28SLiu Zhe 7634c440bcSLiu Zhe // select Relief 77b4d2d410SLiu Zhe effectsPageRelief.select(0); 78c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Relief isn't no", effectsPageRelief.getSelText(), "(Without)"); 79b4d2d410SLiu Zhe effectsPageOutline.check(); 80c37bcbf4SLi Feng Wang assertTrue("EffectsPage_Outline isn't checked", effectsPageOutline.isChecked()); 81b4d2d410SLiu Zhe effectsPageShadow.check(); 82c37bcbf4SLi Feng Wang assertTrue("EffectsPage_Shadow isn't checked", effectsPageShadow.isChecked()); 8322a14f28SLiu Zhe 8434c440bcSLiu Zhe // select Overlining 85b4d2d410SLiu Zhe effectsPageOverline.select(1); 86c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Overline isn't the first item", effectsPageOverline.getSelText(), effectsPageOverline.getItemText(1)); 87b4d2d410SLiu Zhe effectsPageOverlineColor.select(1); 88c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Overline_Color isn't the first item", effectsPageOverlineColor.getSelText(), effectsPageOverlineColor.getItemText(1)); 8922a14f28SLiu Zhe 9034c440bcSLiu Zhe // select Strikethrough 91b4d2d410SLiu Zhe effectsPageStrikeout.select(1); 92c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Strikeout isn't the first item", effectsPageStrikeout.getSelText(), effectsPageStrikeout.getItemText(1)); 9322a14f28SLiu Zhe 9434c440bcSLiu Zhe // select Underlining 95b4d2d410SLiu Zhe effectsPageUnderline.select(1); 96c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Underline isn't the first item", effectsPageUnderline.getSelText(), effectsPageUnderline.getItemText(1)); 97b4d2d410SLiu Zhe effectsPageUnderlineColor.select(1); 98c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Underline_Color isn't the first item", effectsPageUnderlineColor.getSelText(), effectsPageUnderlineColor.getItemText(1)); 9922a14f28SLiu Zhe 10034c440bcSLiu Zhe // select individual workds 101b4d2d410SLiu Zhe effectsPageInvidiualWords.check(); 102c37bcbf4SLi Feng Wang assertTrue("EffectsPage_InvidiualWords isn't checked", effectsPageInvidiualWords.isChecked()); 10322a14f28SLiu Zhe 10434c440bcSLiu Zhe // select Emphasis Mark 10522a14f28SLiu Zhe // EffectsPage_Emphasis.select(1); 10622a14f28SLiu Zhe // assertEquals(EffectsPage_Emphasis.getSelText(), "Dot"); 10722a14f28SLiu Zhe // EffectsPage_Position.select(1); 10822a14f28SLiu Zhe // assertEquals(EffectsPage_Position.getSelText(), "Below text"); 109b4d2d410SLiu Zhe effectsPage.ok(); 11022a14f28SLiu Zhe 11134c440bcSLiu Zhe } 11234c440bcSLiu Zhe } 113