1*b1cdbd2cSJim Jagielski /************************************************************** 2*b1cdbd2cSJim Jagielski * 3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one 4*b1cdbd2cSJim Jagielski * or more contributor license agreements. See the NOTICE file 5*b1cdbd2cSJim Jagielski * distributed with this work for additional information 6*b1cdbd2cSJim Jagielski * regarding copyright ownership. The ASF licenses this file 7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the 8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance 9*b1cdbd2cSJim Jagielski * with the License. You may obtain a copy of the License at 10*b1cdbd2cSJim Jagielski * 11*b1cdbd2cSJim Jagielski * http://www.apache.org/licenses/LICENSE-2.0 12*b1cdbd2cSJim Jagielski * 13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing, 14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an 15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*b1cdbd2cSJim Jagielski * KIND, either express or implied. See the License for the 17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations 18*b1cdbd2cSJim Jagielski * under the License. 19*b1cdbd2cSJim Jagielski * 20*b1cdbd2cSJim Jagielski *************************************************************/ 21*b1cdbd2cSJim Jagielski 22*b1cdbd2cSJim Jagielski package fvt.gui.sd.table; 23*b1cdbd2cSJim Jagielski 24*b1cdbd2cSJim Jagielski import static org.junit.Assert.*; 25*b1cdbd2cSJim Jagielski import static testlib.gui.UIMap.*; 26*b1cdbd2cSJim Jagielski 27*b1cdbd2cSJim Jagielski import org.junit.After; 28*b1cdbd2cSJim Jagielski import org.junit.Before; 29*b1cdbd2cSJim Jagielski import org.junit.Rule; 30*b1cdbd2cSJim Jagielski import org.junit.Test; 31*b1cdbd2cSJim Jagielski import org.openoffice.test.common.Logger; 32*b1cdbd2cSJim Jagielski 33*b1cdbd2cSJim Jagielski import testlib.gui.AppTool; 34*b1cdbd2cSJim Jagielski 35*b1cdbd2cSJim Jagielski public class TableFontEffectsProperty { 36*b1cdbd2cSJim Jagielski 37*b1cdbd2cSJim Jagielski @Rule 38*b1cdbd2cSJim Jagielski public Logger log = Logger.getLogger(this); 39*b1cdbd2cSJim Jagielski 40*b1cdbd2cSJim Jagielski @Before setUp()41*b1cdbd2cSJim Jagielski public void setUp() throws Exception { 42*b1cdbd2cSJim Jagielski app.start(); 43*b1cdbd2cSJim Jagielski } 44*b1cdbd2cSJim Jagielski 45*b1cdbd2cSJim Jagielski @After tearDown()46*b1cdbd2cSJim Jagielski public void tearDown() throws Exception { 47*b1cdbd2cSJim Jagielski app.stop(); 48*b1cdbd2cSJim Jagielski } 49*b1cdbd2cSJim Jagielski 50*b1cdbd2cSJim Jagielski /** 51*b1cdbd2cSJim Jagielski * Test the Font Effect property dialog in Presentation 52*b1cdbd2cSJim Jagielski * 53*b1cdbd2cSJim Jagielski * @throws Exception 54*b1cdbd2cSJim Jagielski */ 55*b1cdbd2cSJim Jagielski 56*b1cdbd2cSJim Jagielski @Test testTableFontEffectPropertyDialog()57*b1cdbd2cSJim Jagielski public void testTableFontEffectPropertyDialog() throws Exception { 58*b1cdbd2cSJim Jagielski 59*b1cdbd2cSJim Jagielski // Create a new presentation document 60*b1cdbd2cSJim Jagielski AppTool.newPresentation(); 61*b1cdbd2cSJim Jagielski 62*b1cdbd2cSJim Jagielski // Insert a table 63*b1cdbd2cSJim Jagielski app.dispatch(".uno:InsertTable", 3); 64*b1cdbd2cSJim Jagielski insertTable.ok(); 65*b1cdbd2cSJim Jagielski 66*b1cdbd2cSJim Jagielski // Verify if the table toolbar is active 67*b1cdbd2cSJim Jagielski assertTrue("Table Toolbar exist", tableToolbar.exists(3)); 68*b1cdbd2cSJim Jagielski 69*b1cdbd2cSJim Jagielski // open Table Properties Dialog 70*b1cdbd2cSJim Jagielski app.dispatch(".uno:TableDialog", 3); 71*b1cdbd2cSJim Jagielski effectsPage.select(); 72*b1cdbd2cSJim Jagielski // select Font color 73*b1cdbd2cSJim Jagielski final int nBlackIndex = 12; // according to standard.soc as of #i121520# 74*b1cdbd2cSJim Jagielski effectsPageColor.select( nBlackIndex); 75*b1cdbd2cSJim Jagielski assertEquals("EffectsPage_Color isn't black", effectsPageColor.getSelText(), "Black"); 76*b1cdbd2cSJim Jagielski 77*b1cdbd2cSJim Jagielski // select Relief 78*b1cdbd2cSJim Jagielski effectsPageRelief.select(0); 79*b1cdbd2cSJim Jagielski assertEquals("EffectsPage_Relief isn't no", effectsPageRelief.getSelText(), "(Without)"); 80*b1cdbd2cSJim Jagielski effectsPageOutline.check(); 81*b1cdbd2cSJim Jagielski assertTrue("EffectsPage_Outline isn't checked", effectsPageOutline.isChecked()); 82*b1cdbd2cSJim Jagielski effectsPageShadow.check(); 83*b1cdbd2cSJim Jagielski assertTrue("EffectsPage_Shadow isn't checked", effectsPageShadow.isChecked()); 84*b1cdbd2cSJim Jagielski 85*b1cdbd2cSJim Jagielski // select Overlining 86*b1cdbd2cSJim Jagielski effectsPageOverline.select(1); 87*b1cdbd2cSJim Jagielski assertEquals("EffectsPage_Overline isn't the first item", effectsPageOverline.getSelText(), effectsPageOverline.getItemText(1)); 88*b1cdbd2cSJim Jagielski effectsPageOverlineColor.select(1); 89*b1cdbd2cSJim Jagielski assertEquals("EffectsPage_Overline_Color isn't the first item", effectsPageOverlineColor.getSelText(), effectsPageOverlineColor.getItemText(1)); 90*b1cdbd2cSJim Jagielski 91*b1cdbd2cSJim Jagielski // select Strikethrough 92*b1cdbd2cSJim Jagielski effectsPageStrikeout.select(1); 93*b1cdbd2cSJim Jagielski assertEquals("EffectsPage_Strikeout isn't the first item", effectsPageStrikeout.getSelText(), effectsPageStrikeout.getItemText(1)); 94*b1cdbd2cSJim Jagielski 95*b1cdbd2cSJim Jagielski // select Underlining 96*b1cdbd2cSJim Jagielski effectsPageUnderline.select(1); 97*b1cdbd2cSJim Jagielski assertEquals("EffectsPage_Underline isn't the first item", effectsPageUnderline.getSelText(), effectsPageUnderline.getItemText(1)); 98*b1cdbd2cSJim Jagielski effectsPageUnderlineColor.select(1); 99*b1cdbd2cSJim Jagielski assertEquals("EffectsPage_Underline_Color isn't the first item", effectsPageUnderlineColor.getSelText(), effectsPageUnderlineColor.getItemText(1)); 100*b1cdbd2cSJim Jagielski 101*b1cdbd2cSJim Jagielski // select individual workds 102*b1cdbd2cSJim Jagielski effectsPageInvidiualWords.check(); 103*b1cdbd2cSJim Jagielski assertTrue("EffectsPage_InvidiualWords isn't checked", effectsPageInvidiualWords.isChecked()); 104*b1cdbd2cSJim Jagielski 105*b1cdbd2cSJim Jagielski // select Emphasis Mark 106*b1cdbd2cSJim Jagielski // EffectsPage_Emphasis.select(1); 107*b1cdbd2cSJim Jagielski // assertEquals(EffectsPage_Emphasis.getSelText(), "Dot"); 108*b1cdbd2cSJim Jagielski // EffectsPage_Position.select(1); 109*b1cdbd2cSJim Jagielski // assertEquals(EffectsPage_Position.getSelText(), "Below text"); 110*b1cdbd2cSJim Jagielski effectsPage.ok(); 111*b1cdbd2cSJim Jagielski 112*b1cdbd2cSJim Jagielski } 113*b1cdbd2cSJim Jagielski } 114