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