ValidityDialogDefaultValue.java (80a6f5c5) ValidityDialogDefaultValue.java (424494b0)
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

--- 16 unchanged lines hidden (view full) ---

25import static testlib.gui.UIMap.*;
26
27import org.junit.After;
28import org.junit.Before;
29import org.junit.Rule;
30import org.junit.Test;
31import org.openoffice.test.common.Logger;
32
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

--- 16 unchanged lines hidden (view full) ---

25import static testlib.gui.UIMap.*;
26
27import org.junit.After;
28import org.junit.Before;
29import org.junit.Rule;
30import org.junit.Test;
31import org.openoffice.test.common.Logger;
32
33import testlib.gui.AppTool;
34
33public class ValidityDialogDefaultValue {
34
35public class ValidityDialogDefaultValue {
36
35 @Rule
36 public Logger log = Logger.getLogger(this);
37
38 @Before
39 public void setUp() throws Exception {
40 app.start(true);
37 @Before
38 public void setUp() throws Exception {
39 app.start(true);
41
42 // New a spreadsheet, open Validity dialog
43 app.dispatch("private:factory/scalc");
40 AppTool.newSpreadsheet();
44 app.dispatch(".uno:Validation");
45 }
46
47 @After
48 public void tearDown() throws Exception {
41 app.dispatch(".uno:Validation");
42 }
43
44 @After
45 public void tearDown() throws Exception {
49
46 app.stop();
50 }
51
52 /**
53 * test Data -> Validity - UI(Criteria: Cell range).
54 */
55 @Test
56 public void testValidityUICellRange() {
57
58 scValidityCriteriaTabpage.select();
47 }
48
49 /**
50 * test Data -> Validity - UI(Criteria: Cell range).
51 */
52 @Test
53 public void testValidityUICellRange() {
54
55 scValidityCriteriaTabpage.select();
59 scValidityCriteriaAllowList.select(5); // "Cell range"
56 scValidityCriteriaAllowList.select(5);
60
57
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());
58 assertEquals("Wrong default value of AllowBlankCells in Validity",true, scValidityAllowBlankCells.isChecked());
59 assertEquals("Wrong default value of ShowSelectionList in Validity",true, scValidityShowSelectionList.isChecked());
60 assertEquals("Wrong default value of Sort Entries Ascending in Validity",false, scValiditySortEntriesAscending.isChecked());
61 assertEquals("Wrong default value of AllowBlankCells in Validity",true, scValidityAllowBlankCells.isEnabled());
62 assertEquals("Wrong default value of Sort Entries Ascending in Validity",true, scValiditySortEntriesAscending.isEnabled());
63 assertEquals("Wrong default value of SourcePicker in Validity",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();
64 }
65
66 /**
67 * test Data -> Validity - UI(Error Alert: Default status)
68 */
69 @Test
70 public void testValidityUIErrorAlert() {
71
72 scValidityErrorAlertTabPage.select();
77 assertEquals(true, scValidityErrorAlertActionList.isEnabled());
78 // assertEquals("Stop",SC_ValidityErrorAlertActionList.getSelText()); //
73 assertEquals("Error Alert Action list is disable",true, scValidityErrorAlertActionList.isEnabled());
74 // assertEquals("Stop",SC_ValidityErrorAlertActionList.getSelText());
79 // Do not test this. Do it in GVT.
75 // 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());
76 assertEquals("Error Message Title is disable",true, scValidityErrorMessageTitle.isEnabled());
77 assertEquals("Have default error message title","", scValidityErrorMessageTitle.getText());
78 assertEquals("Error message is disable",true, scValidityErrorMessage.isEnabled());
79 assertEquals("Have default error message","", scValidityErrorMessage.getText());
84 scValidityErrorAlertActionList.select(3); // "Macro"
80 scValidityErrorAlertActionList.select(3); // "Macro"
85 assertEquals(true, scValidityErrorBrowseButton.isEnabled());
81 assertEquals("error browse button is disable",true, scValidityErrorBrowseButton.isEnabled());
86 }
87
88}
82 }
83
84}