xref: /aoo41x/test/testgui/source/fvt/gui/AOOTest.java (revision 80a6f5c5)
1f859da79SLiu Zhe /**************************************************************
2f859da79SLiu Zhe  *
3f859da79SLiu Zhe  * Licensed to the Apache Software Foundation (ASF) under one
4f859da79SLiu Zhe  * or more contributor license agreements.  See the NOTICE file
5f859da79SLiu Zhe  * distributed with this work for additional information
6f859da79SLiu Zhe  * regarding copyright ownership.  The ASF licenses this file
7f859da79SLiu Zhe  * to you under the Apache License, Version 2.0 (the
8f859da79SLiu Zhe  * "License"); you may not use this file except in compliance
9f859da79SLiu Zhe  * with the License.  You may obtain a copy of the License at
10f859da79SLiu Zhe  *
11f859da79SLiu Zhe  *   http://www.apache.org/licenses/LICENSE-2.0
12f859da79SLiu Zhe  *
13f859da79SLiu Zhe  * Unless required by applicable law or agreed to in writing,
14f859da79SLiu Zhe  * software distributed under the License is distributed on an
15f859da79SLiu Zhe  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f859da79SLiu Zhe  * KIND, either express or implied.  See the License for the
17f859da79SLiu Zhe  * specific language governing permissions and limitations
18f859da79SLiu Zhe  * under the License.
19f859da79SLiu Zhe  *
20f859da79SLiu Zhe  *************************************************************/
21f859da79SLiu Zhe 
22*80a6f5c5SLiu Zhe package fvt.gui;
23f859da79SLiu Zhe 
24f859da79SLiu Zhe import static org.junit.Assert.*;
25b4d2d410SLiu Zhe import static testlib.gui.AppTool.*;
26f859da79SLiu Zhe import static testlib.gui.UIMap.*;
27f859da79SLiu Zhe 
28f859da79SLiu Zhe import org.junit.After;
29f859da79SLiu Zhe import org.junit.Before;
30f859da79SLiu Zhe import org.junit.Rule;
31f859da79SLiu Zhe import org.junit.Test;
3222a14f28SLiu Zhe import org.openoffice.test.common.Logger;
33f859da79SLiu Zhe 
34b4d2d410SLiu Zhe import testlib.gui.SCTool;
35f859da79SLiu Zhe 
36f859da79SLiu Zhe /**
3722a14f28SLiu Zhe  * If AOO is not installed in the default directory, please specify the system
3822a14f28SLiu Zhe  * property in your command line. <br/>
3922a14f28SLiu Zhe  * -Dopenoffice.home=
4022a14f28SLiu Zhe  * "Your OpenOffice installation directory which contains soffice.bin"
4122a14f28SLiu Zhe  *
42f859da79SLiu Zhe  */
43f859da79SLiu Zhe public class AOOTest {
44f859da79SLiu Zhe 
45f859da79SLiu Zhe 	/**
4622a14f28SLiu Zhe 	 * Add Log to enable the following capabilities. 1. Take a screenshot when
4722a14f28SLiu Zhe 	 * failure occurs. 2. Log any detail information.
48f859da79SLiu Zhe 	 */
49f859da79SLiu Zhe 	@Rule
5022a14f28SLiu Zhe 	public Logger log = Logger.getLogger(this);
51f859da79SLiu Zhe 
52f859da79SLiu Zhe 	/**
53f859da79SLiu Zhe 	 * Do some setup task before running test
5422a14f28SLiu Zhe 	 *
55f859da79SLiu Zhe 	 * @throws Exception
56f859da79SLiu Zhe 	 */
57f859da79SLiu Zhe 	@Before
setUp()58f859da79SLiu Zhe 	public void setUp() throws Exception {
5922a14f28SLiu Zhe 		// Start OpenOffice with a clean user profile
6022a14f28SLiu Zhe 		app.start(true);
61f859da79SLiu Zhe 	}
62f859da79SLiu Zhe 
63f859da79SLiu Zhe 	/**
64f859da79SLiu Zhe 	 * Clean task after testing
6522a14f28SLiu Zhe 	 *
66f859da79SLiu Zhe 	 * @throws Exception
67f859da79SLiu Zhe 	 */
68f859da79SLiu Zhe 	@After
tearDown()69f859da79SLiu Zhe 	public void tearDown() throws Exception {
7022a14f28SLiu Zhe 
71f859da79SLiu Zhe 	}
7222a14f28SLiu Zhe 
73f859da79SLiu Zhe 	/**
7422a14f28SLiu Zhe 	 * Implement test steps
75f859da79SLiu Zhe 	 */
76f859da79SLiu Zhe 	@Test
testHello()77f859da79SLiu Zhe 	public void testHello() {
78f859da79SLiu Zhe 		startcenter.menuItem("File->New->Spreadsheet").select();
79f859da79SLiu Zhe 		calc.waitForExistence(10, 3);
80f859da79SLiu Zhe 		typeKeys("Hello");
81b4d2d410SLiu Zhe 		assertEquals("Assert", "Hello", SCTool.getCellInput("A1"));
82f859da79SLiu Zhe 	}
83f859da79SLiu Zhe 
84f859da79SLiu Zhe }
85