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 { 36fd348426SLi Feng Wang 37fd348426SLi Feng Wang @Rule 38fd348426SLi Feng Wang public Logger log = Logger.getLogger(this); 3934c440bcSLiu Zhe 4034c440bcSLiu Zhe @Before setUp()4134c440bcSLiu Zhe public void setUp() throws Exception { 4234c440bcSLiu Zhe app.start(); 4334c440bcSLiu Zhe } 4434c440bcSLiu Zhe 4534c440bcSLiu Zhe @After tearDown()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 testTableFontEffectPropertyDialog()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 73*35ff5cfcSHerbert Dürr final int nBlackIndex = 12; // according to standard.soc as of #i121520# 74*35ff5cfcSHerbert Dürr effectsPageColor.select( nBlackIndex); 75c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Color isn't black", effectsPageColor.getSelText(), "Black"); 7622a14f28SLiu Zhe 7734c440bcSLiu Zhe // select Relief 78b4d2d410SLiu Zhe effectsPageRelief.select(0); 79c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Relief isn't no", effectsPageRelief.getSelText(), "(Without)"); 80b4d2d410SLiu Zhe effectsPageOutline.check(); 81c37bcbf4SLi Feng Wang assertTrue("EffectsPage_Outline isn't checked", effectsPageOutline.isChecked()); 82b4d2d410SLiu Zhe effectsPageShadow.check(); 83c37bcbf4SLi Feng Wang assertTrue("EffectsPage_Shadow isn't checked", effectsPageShadow.isChecked()); 8422a14f28SLiu Zhe 8534c440bcSLiu Zhe // select Overlining 86b4d2d410SLiu Zhe effectsPageOverline.select(1); 87c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Overline isn't the first item", effectsPageOverline.getSelText(), effectsPageOverline.getItemText(1)); 88b4d2d410SLiu Zhe effectsPageOverlineColor.select(1); 89c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Overline_Color isn't the first item", effectsPageOverlineColor.getSelText(), effectsPageOverlineColor.getItemText(1)); 9022a14f28SLiu Zhe 9134c440bcSLiu Zhe // select Strikethrough 92b4d2d410SLiu Zhe effectsPageStrikeout.select(1); 93c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Strikeout isn't the first item", effectsPageStrikeout.getSelText(), effectsPageStrikeout.getItemText(1)); 9422a14f28SLiu Zhe 9534c440bcSLiu Zhe // select Underlining 96b4d2d410SLiu Zhe effectsPageUnderline.select(1); 97c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Underline isn't the first item", effectsPageUnderline.getSelText(), effectsPageUnderline.getItemText(1)); 98b4d2d410SLiu Zhe effectsPageUnderlineColor.select(1); 99c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Underline_Color isn't the first item", effectsPageUnderlineColor.getSelText(), effectsPageUnderlineColor.getItemText(1)); 10022a14f28SLiu Zhe 10134c440bcSLiu Zhe // select individual workds 102b4d2d410SLiu Zhe effectsPageInvidiualWords.check(); 103c37bcbf4SLi Feng Wang assertTrue("EffectsPage_InvidiualWords isn't checked", effectsPageInvidiualWords.isChecked()); 10422a14f28SLiu Zhe 10534c440bcSLiu Zhe // select Emphasis Mark 10622a14f28SLiu Zhe // EffectsPage_Emphasis.select(1); 10722a14f28SLiu Zhe // assertEquals(EffectsPage_Emphasis.getSelText(), "Dot"); 10822a14f28SLiu Zhe // EffectsPage_Position.select(1); 10922a14f28SLiu Zhe // assertEquals(EffectsPage_Position.getSelText(), "Below text"); 110b4d2d410SLiu Zhe effectsPage.ok(); 11122a14f28SLiu Zhe 11234c440bcSLiu Zhe } 11334c440bcSLiu Zhe } 114