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 33*c37bcbf4SLi Feng Wang import testlib.gui.AppTool; 34*c37bcbf4SLi Feng Wang 35*c37bcbf4SLi Feng Wang public class TableFontEffectsProperty { 3634c440bcSLiu Zhe 3734c440bcSLiu Zhe @Before 3834c440bcSLiu Zhe public void setUp() throws Exception { 3934c440bcSLiu Zhe app.start(); 4034c440bcSLiu Zhe } 4134c440bcSLiu Zhe 4234c440bcSLiu Zhe @After 4334c440bcSLiu Zhe public void tearDown() throws Exception { 44*c37bcbf4SLi Feng Wang app.stop(); 4534c440bcSLiu Zhe } 4634c440bcSLiu Zhe 4734c440bcSLiu Zhe /** 48*c37bcbf4SLi Feng Wang * Test the Font Effect property dialog in Presentation 4934c440bcSLiu Zhe * 5034c440bcSLiu Zhe * @throws Exception 5134c440bcSLiu Zhe */ 5234c440bcSLiu Zhe 5334c440bcSLiu Zhe @Test 54*c37bcbf4SLi Feng Wang public void testTableFontEffectPropertyDialog() throws Exception { 5534c440bcSLiu Zhe 5634c440bcSLiu Zhe // Create a new presentation document 57*c37bcbf4SLi Feng Wang AppTool.newPresentation(); 5834c440bcSLiu Zhe 5934c440bcSLiu Zhe // Insert a table 6034c440bcSLiu Zhe app.dispatch(".uno:InsertTable", 3); 61b4d2d410SLiu Zhe insertTable.ok(); 6234c440bcSLiu Zhe 6334c440bcSLiu Zhe // Verify if the table toolbar is active 64b4d2d410SLiu Zhe assertTrue("Table Toolbar exist", tableToolbar.exists(3)); 6534c440bcSLiu Zhe 6634c440bcSLiu Zhe // open Table Properties Dialog 6734c440bcSLiu Zhe app.dispatch(".uno:TableDialog", 3); 68b4d2d410SLiu Zhe effectsPage.select(); 6934c440bcSLiu Zhe // select Font color 70b4d2d410SLiu Zhe effectsPageColor.select(1); 71*c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Color isn't black", effectsPageColor.getSelText(), "Black"); 7222a14f28SLiu Zhe 7334c440bcSLiu Zhe // select Relief 74b4d2d410SLiu Zhe effectsPageRelief.select(0); 75*c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Relief isn't no", effectsPageRelief.getSelText(), "(Without)"); 76b4d2d410SLiu Zhe effectsPageOutline.check(); 77*c37bcbf4SLi Feng Wang assertTrue("EffectsPage_Outline isn't checked", effectsPageOutline.isChecked()); 78b4d2d410SLiu Zhe effectsPageShadow.check(); 79*c37bcbf4SLi Feng Wang assertTrue("EffectsPage_Shadow isn't checked", effectsPageShadow.isChecked()); 8022a14f28SLiu Zhe 8134c440bcSLiu Zhe // select Overlining 82b4d2d410SLiu Zhe effectsPageOverline.select(1); 83*c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Overline isn't the first item", effectsPageOverline.getSelText(), effectsPageOverline.getItemText(1)); 84b4d2d410SLiu Zhe effectsPageOverlineColor.select(1); 85*c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Overline_Color isn't the first item", effectsPageOverlineColor.getSelText(), effectsPageOverlineColor.getItemText(1)); 8622a14f28SLiu Zhe 8734c440bcSLiu Zhe // select Strikethrough 88b4d2d410SLiu Zhe effectsPageStrikeout.select(1); 89*c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Strikeout isn't the first item", effectsPageStrikeout.getSelText(), effectsPageStrikeout.getItemText(1)); 9022a14f28SLiu Zhe 9134c440bcSLiu Zhe // select Underlining 92b4d2d410SLiu Zhe effectsPageUnderline.select(1); 93*c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Underline isn't the first item", effectsPageUnderline.getSelText(), effectsPageUnderline.getItemText(1)); 94b4d2d410SLiu Zhe effectsPageUnderlineColor.select(1); 95*c37bcbf4SLi Feng Wang assertEquals("EffectsPage_Underline_Color isn't the first item", effectsPageUnderlineColor.getSelText(), effectsPageUnderlineColor.getItemText(1)); 9622a14f28SLiu Zhe 9734c440bcSLiu Zhe // select individual workds 98b4d2d410SLiu Zhe effectsPageInvidiualWords.check(); 99*c37bcbf4SLi Feng Wang assertTrue("EffectsPage_InvidiualWords isn't checked", effectsPageInvidiualWords.isChecked()); 10022a14f28SLiu Zhe 10134c440bcSLiu Zhe // select Emphasis Mark 10222a14f28SLiu Zhe // EffectsPage_Emphasis.select(1); 10322a14f28SLiu Zhe // assertEquals(EffectsPage_Emphasis.getSelText(), "Dot"); 10422a14f28SLiu Zhe // EffectsPage_Position.select(1); 10522a14f28SLiu Zhe // assertEquals(EffectsPage_Position.getSelText(), "Below text"); 106b4d2d410SLiu Zhe effectsPage.ok(); 10722a14f28SLiu Zhe 10834c440bcSLiu Zhe } 10934c440bcSLiu Zhe } 110