xref: /AOO41X/test/testgui/source/fvt/gui/AOOTest.java (revision 80a6f5c575dba650469ea4eacf1c8652e4eec583)
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;
23 
24 import static org.junit.Assert.*;
25 import static testlib.gui.AppTool.*;
26 import static testlib.gui.UIMap.*;
27 
28 import org.junit.After;
29 import org.junit.Before;
30 import org.junit.Rule;
31 import org.junit.Test;
32 import org.openoffice.test.common.Logger;
33 
34 import testlib.gui.SCTool;
35 
36 /**
37  * If AOO is not installed in the default directory, please specify the system
38  * property in your command line. <br/>
39  * -Dopenoffice.home=
40  * "Your OpenOffice installation directory which contains soffice.bin"
41  *
42  */
43 public class AOOTest {
44 
45     /**
46      * Add Log to enable the following capabilities. 1. Take a screenshot when
47      * failure occurs. 2. Log any detail information.
48      */
49     @Rule
50     public Logger log = Logger.getLogger(this);
51 
52     /**
53      * Do some setup task before running test
54      *
55      * @throws Exception
56      */
57     @Before
setUp()58     public void setUp() throws Exception {
59         // Start OpenOffice with a clean user profile
60         app.start(true);
61     }
62 
63     /**
64      * Clean task after testing
65      *
66      * @throws Exception
67      */
68     @After
tearDown()69     public void tearDown() throws Exception {
70 
71     }
72 
73     /**
74      * Implement test steps
75      */
76     @Test
testHello()77     public void testHello() {
78         startcenter.menuItem("File->New->Spreadsheet").select();
79         calc.waitForExistence(10, 3);
80         typeKeys("Hello");
81         assertEquals("Assert", "Hello", SCTool.getCellInput("A1"));
82     }
83 
84 }
85