1*80a6f5c5SLiu Zhe /************************************************************** 2*80a6f5c5SLiu Zhe * 3*80a6f5c5SLiu Zhe * Licensed to the Apache Software Foundation (ASF) under one 4*80a6f5c5SLiu Zhe * or more contributor license agreements. See the NOTICE file 5*80a6f5c5SLiu Zhe * distributed with this work for additional information 6*80a6f5c5SLiu Zhe * regarding copyright ownership. The ASF licenses this file 7*80a6f5c5SLiu Zhe * to you under the Apache License, Version 2.0 (the 8*80a6f5c5SLiu Zhe * "License"); you may not use this file except in compliance 9*80a6f5c5SLiu Zhe * with the License. You may obtain a copy of the License at 10*80a6f5c5SLiu Zhe * 11*80a6f5c5SLiu Zhe * http://www.apache.org/licenses/LICENSE-2.0 12*80a6f5c5SLiu Zhe * 13*80a6f5c5SLiu Zhe * Unless required by applicable law or agreed to in writing, 14*80a6f5c5SLiu Zhe * software distributed under the License is distributed on an 15*80a6f5c5SLiu Zhe * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*80a6f5c5SLiu Zhe * KIND, either express or implied. See the License for the 17*80a6f5c5SLiu Zhe * specific language governing permissions and limitations 18*80a6f5c5SLiu Zhe * under the License. 19*80a6f5c5SLiu Zhe * 20*80a6f5c5SLiu Zhe *************************************************************/ 21*80a6f5c5SLiu Zhe 22*80a6f5c5SLiu Zhe package fvt.gui.sc.validity; 23*80a6f5c5SLiu Zhe 24*80a6f5c5SLiu Zhe import static org.junit.Assert.*; 25*80a6f5c5SLiu Zhe import static testlib.gui.UIMap.*; 26*80a6f5c5SLiu Zhe 27*80a6f5c5SLiu Zhe import org.junit.After; 28*80a6f5c5SLiu Zhe import org.junit.Before; 29*80a6f5c5SLiu Zhe import org.junit.Rule; 30*80a6f5c5SLiu Zhe import org.junit.Test; 31*80a6f5c5SLiu Zhe import org.openoffice.test.common.Logger; 32*80a6f5c5SLiu Zhe 33*80a6f5c5SLiu Zhe public class ValidityDialogDefaultValue { 34*80a6f5c5SLiu Zhe 35*80a6f5c5SLiu Zhe @Rule 36*80a6f5c5SLiu Zhe public Logger log = Logger.getLogger(this); 37*80a6f5c5SLiu Zhe 38*80a6f5c5SLiu Zhe @Before 39*80a6f5c5SLiu Zhe public void setUp() throws Exception { 40*80a6f5c5SLiu Zhe app.start(true); 41*80a6f5c5SLiu Zhe 42*80a6f5c5SLiu Zhe // New a spreadsheet, open Validity dialog 43*80a6f5c5SLiu Zhe app.dispatch("private:factory/scalc"); 44*80a6f5c5SLiu Zhe app.dispatch(".uno:Validation"); 45*80a6f5c5SLiu Zhe } 46*80a6f5c5SLiu Zhe 47*80a6f5c5SLiu Zhe @After 48*80a6f5c5SLiu Zhe public void tearDown() throws Exception { 49*80a6f5c5SLiu Zhe 50*80a6f5c5SLiu Zhe } 51*80a6f5c5SLiu Zhe 52*80a6f5c5SLiu Zhe /** 53*80a6f5c5SLiu Zhe * test Data -> Validity - UI(Criteria: Cell range). 54*80a6f5c5SLiu Zhe */ 55*80a6f5c5SLiu Zhe @Test 56*80a6f5c5SLiu Zhe public void testValidityUICellRange() { 57*80a6f5c5SLiu Zhe 58*80a6f5c5SLiu Zhe scValidityCriteriaTabpage.select(); 59*80a6f5c5SLiu Zhe scValidityCriteriaAllowList.select(5); // "Cell range" 60*80a6f5c5SLiu Zhe 61*80a6f5c5SLiu Zhe assertEquals(true, scValidityAllowBlankCells.isChecked()); 62*80a6f5c5SLiu Zhe assertEquals(true, scValidityShowSelectionList.isChecked()); 63*80a6f5c5SLiu Zhe assertEquals(false, scValiditySortEntriesAscending.isChecked()); 64*80a6f5c5SLiu Zhe assertEquals(true, scValidityAllowBlankCells.isEnabled()); 65*80a6f5c5SLiu Zhe assertEquals(true, scValiditySortEntriesAscending.isEnabled()); 66*80a6f5c5SLiu Zhe assertEquals(true, scValiditySortEntriesAscending.isEnabled()); 67*80a6f5c5SLiu Zhe assertEquals(true, scValiditySourcePicker.isEnabled()); 68*80a6f5c5SLiu Zhe } 69*80a6f5c5SLiu Zhe 70*80a6f5c5SLiu Zhe /** 71*80a6f5c5SLiu Zhe * test Data -> Validity - UI(Error Alert: Default status) 72*80a6f5c5SLiu Zhe */ 73*80a6f5c5SLiu Zhe @Test 74*80a6f5c5SLiu Zhe public void testValidityUIErrorAlert() { 75*80a6f5c5SLiu Zhe 76*80a6f5c5SLiu Zhe scValidityErrorAlertTabPage.select(); 77*80a6f5c5SLiu Zhe assertEquals(true, scValidityErrorAlertActionList.isEnabled()); 78*80a6f5c5SLiu Zhe // assertEquals("Stop",SC_ValidityErrorAlertActionList.getSelText()); // 79*80a6f5c5SLiu Zhe // Do not test this. Do it in GVT. 80*80a6f5c5SLiu Zhe assertEquals(true, scValidityErrorMessageTitle.isEnabled()); 81*80a6f5c5SLiu Zhe assertEquals("", scValidityErrorMessageTitle.getText()); 82*80a6f5c5SLiu Zhe assertEquals(true, scValidityErrorMessage.isEnabled()); 83*80a6f5c5SLiu Zhe assertEquals("", scValidityErrorMessage.getText()); 84*80a6f5c5SLiu Zhe scValidityErrorAlertActionList.select(3); // "Macro" 85*80a6f5c5SLiu Zhe assertEquals(true, scValidityErrorBrowseButton.isEnabled()); 86*80a6f5c5SLiu Zhe } 87*80a6f5c5SLiu Zhe 88*80a6f5c5SLiu Zhe } 89