xref: /trunk/test/testgui/source/fvt/gui/sc/validity/ValidityDialogDefaultValue.java (revision 3309286857f19787ae62bd793a98b5af4edd2ad3)
180a6f5c5SLiu Zhe /**************************************************************
280a6f5c5SLiu Zhe  *
380a6f5c5SLiu Zhe  * Licensed to the Apache Software Foundation (ASF) under one
480a6f5c5SLiu Zhe  * or more contributor license agreements.  See the NOTICE file
580a6f5c5SLiu Zhe  * distributed with this work for additional information
680a6f5c5SLiu Zhe  * regarding copyright ownership.  The ASF licenses this file
780a6f5c5SLiu Zhe  * to you under the Apache License, Version 2.0 (the
880a6f5c5SLiu Zhe  * "License"); you may not use this file except in compliance
980a6f5c5SLiu Zhe  * with the License.  You may obtain a copy of the License at
1080a6f5c5SLiu Zhe  *
1180a6f5c5SLiu Zhe  *   http://www.apache.org/licenses/LICENSE-2.0
1280a6f5c5SLiu Zhe  *
1380a6f5c5SLiu Zhe  * Unless required by applicable law or agreed to in writing,
1480a6f5c5SLiu Zhe  * software distributed under the License is distributed on an
1580a6f5c5SLiu Zhe  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1680a6f5c5SLiu Zhe  * KIND, either express or implied.  See the License for the
1780a6f5c5SLiu Zhe  * specific language governing permissions and limitations
1880a6f5c5SLiu Zhe  * under the License.
1980a6f5c5SLiu Zhe  *
2080a6f5c5SLiu Zhe  *************************************************************/
2180a6f5c5SLiu Zhe 
2280a6f5c5SLiu Zhe package fvt.gui.sc.validity;
2380a6f5c5SLiu Zhe 
2480a6f5c5SLiu Zhe import static org.junit.Assert.*;
2580a6f5c5SLiu Zhe import static testlib.gui.UIMap.*;
2680a6f5c5SLiu Zhe 
2780a6f5c5SLiu Zhe import org.junit.After;
2880a6f5c5SLiu Zhe import org.junit.Before;
2980a6f5c5SLiu Zhe import org.junit.Rule;
3080a6f5c5SLiu Zhe import org.junit.Test;
3180a6f5c5SLiu Zhe import org.openoffice.test.common.Logger;
3280a6f5c5SLiu Zhe 
33424494b0SLi Feng Wang import testlib.gui.AppTool;
3480a6f5c5SLiu Zhe 
35424494b0SLi Feng Wang public class ValidityDialogDefaultValue {
3680a6f5c5SLiu Zhe 
37*fd348426SLi Feng Wang     @Rule
38*fd348426SLi Feng Wang     public Logger log = Logger.getLogger(this);
39*fd348426SLi Feng Wang 
4080a6f5c5SLiu Zhe     @Before
setUp()4180a6f5c5SLiu Zhe     public void setUp() throws Exception {
4280a6f5c5SLiu Zhe         app.start(true);
43424494b0SLi Feng Wang         AppTool.newSpreadsheet();
4480a6f5c5SLiu Zhe         app.dispatch(".uno:Validation");
4580a6f5c5SLiu Zhe     }
4680a6f5c5SLiu Zhe 
4780a6f5c5SLiu Zhe     @After
tearDown()4880a6f5c5SLiu Zhe     public void tearDown() throws Exception {
49424494b0SLi Feng Wang         app.stop();
5080a6f5c5SLiu Zhe     }
5180a6f5c5SLiu Zhe 
5280a6f5c5SLiu Zhe     /**
5380a6f5c5SLiu Zhe      * test Data -> Validity - UI(Criteria: Cell range).
5480a6f5c5SLiu Zhe      */
5580a6f5c5SLiu Zhe     @Test
testValidityUICellRange()5680a6f5c5SLiu Zhe     public void testValidityUICellRange() {
5780a6f5c5SLiu Zhe 
5880a6f5c5SLiu Zhe         scValidityCriteriaTabpage.select();
59424494b0SLi Feng Wang         scValidityCriteriaAllowList.select(5);
6080a6f5c5SLiu Zhe 
61424494b0SLi Feng Wang         assertEquals("Wrong default value of AllowBlankCells in Validity",true, scValidityAllowBlankCells.isChecked());
62424494b0SLi Feng Wang         assertEquals("Wrong default value of ShowSelectionList in Validity",true, scValidityShowSelectionList.isChecked());
63424494b0SLi Feng Wang         assertEquals("Wrong default value of Sort Entries Ascending in Validity",false, scValiditySortEntriesAscending.isChecked());
64424494b0SLi Feng Wang         assertEquals("Wrong default value of AllowBlankCells in Validity",true, scValidityAllowBlankCells.isEnabled());
65424494b0SLi Feng Wang         assertEquals("Wrong default value of Sort Entries Ascending in Validity",true, scValiditySortEntriesAscending.isEnabled());
66424494b0SLi Feng Wang         assertEquals("Wrong default value of SourcePicker in Validity",true, scValiditySourcePicker.isEnabled());
6780a6f5c5SLiu Zhe     }
6880a6f5c5SLiu Zhe 
6980a6f5c5SLiu Zhe     /**
7080a6f5c5SLiu Zhe      * test Data -> Validity - UI(Error Alert: Default status)
7180a6f5c5SLiu Zhe      */
7280a6f5c5SLiu Zhe     @Test
testValidityUIErrorAlert()7380a6f5c5SLiu Zhe     public void testValidityUIErrorAlert() {
7480a6f5c5SLiu Zhe 
7580a6f5c5SLiu Zhe         scValidityErrorAlertTabPage.select();
76424494b0SLi Feng Wang         assertEquals("Error Alert Action list is disable",true, scValidityErrorAlertActionList.isEnabled());
77424494b0SLi Feng Wang         // assertEquals("Stop",SC_ValidityErrorAlertActionList.getSelText());
7880a6f5c5SLiu Zhe         // Do not test this. Do it in GVT.
79424494b0SLi Feng Wang         assertEquals("Error Message Title is disable",true, scValidityErrorMessageTitle.isEnabled());
80424494b0SLi Feng Wang         assertEquals("Have default error message title","", scValidityErrorMessageTitle.getText());
81424494b0SLi Feng Wang         assertEquals("Error message is disable",true, scValidityErrorMessage.isEnabled());
82424494b0SLi Feng Wang         assertEquals("Have default error message","", scValidityErrorMessage.getText());
8380a6f5c5SLiu Zhe         scValidityErrorAlertActionList.select(3); // "Macro"
84424494b0SLi Feng Wang         assertEquals("error browse button is disable",true, scValidityErrorBrowseButton.isEnabled());
8580a6f5c5SLiu Zhe     }
8680a6f5c5SLiu Zhe 
8780a6f5c5SLiu Zhe }
88