104bad30fSLiu Zhe /**************************************************************
204bad30fSLiu Zhe  *
304bad30fSLiu Zhe  * Licensed to the Apache Software Foundation (ASF) under one
404bad30fSLiu Zhe  * or more contributor license agreements.  See the NOTICE file
504bad30fSLiu Zhe  * distributed with this work for additional information
604bad30fSLiu Zhe  * regarding copyright ownership.  The ASF licenses this file
704bad30fSLiu Zhe  * to you under the Apache License, Version 2.0 (the
804bad30fSLiu Zhe  * "License"); you may not use this file except in compliance
904bad30fSLiu Zhe  * with the License.  You may obtain a copy of the License at
1004bad30fSLiu Zhe  *
1104bad30fSLiu Zhe  *   http://www.apache.org/licenses/LICENSE-2.0
1204bad30fSLiu Zhe  *
1304bad30fSLiu Zhe  * Unless required by applicable law or agreed to in writing,
1404bad30fSLiu Zhe  * software distributed under the License is distributed on an
1504bad30fSLiu Zhe  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1604bad30fSLiu Zhe  * KIND, either express or implied.  See the License for the
1704bad30fSLiu Zhe  * specific language governing permissions and limitations
1804bad30fSLiu Zhe  * under the License.
1904bad30fSLiu Zhe  *
2004bad30fSLiu Zhe  *************************************************************/
2104bad30fSLiu Zhe 
2204bad30fSLiu Zhe /**
2304bad30fSLiu Zhe  *
2404bad30fSLiu Zhe  */
2580a6f5c5SLiu Zhe package fvt.gui.sc.chart;
2695269d92SLiu Zhe 
2722a14f28SLiu Zhe import static org.junit.Assert.*;
2895269d92SLiu Zhe import static testlib.gui.UIMap.*;
2904bad30fSLiu Zhe 
3004bad30fSLiu Zhe import org.junit.After;
3104bad30fSLiu Zhe import org.junit.Before;
3204bad30fSLiu Zhe import org.junit.Rule;
3304bad30fSLiu Zhe import org.junit.Test;
3422a14f28SLiu Zhe import org.openoffice.test.common.Logger;
3504bad30fSLiu Zhe 
36424494b0SLi Feng Wang import testlib.gui.AppTool;
37424494b0SLi Feng Wang 
3804bad30fSLiu Zhe /**
3904bad30fSLiu Zhe  * Test the setting about chart dialog in spreadsheet
4004bad30fSLiu Zhe  */
4104bad30fSLiu Zhe public class ChartDialogSetting {
42*fd348426SLi Feng Wang 	@Rule
43*fd348426SLi Feng Wang 	public Logger log = Logger.getLogger(this);
4404bad30fSLiu Zhe 
4504bad30fSLiu Zhe 	@Before
setUp()4604bad30fSLiu Zhe 	public void setUp() throws Exception {
474d3496b1SLiu Zhe 		app.start(true);
48424494b0SLi Feng Wang 		AppTool.newSpreadsheet();
493816404dSLiu Zhe 		app.dispatch(".uno:InsertObjectChart");
5004bad30fSLiu Zhe 	}
5104bad30fSLiu Zhe 
5204bad30fSLiu Zhe 	@After
tearDown()5304bad30fSLiu Zhe 	public void tearDown() throws Exception {
54424494b0SLi Feng Wang 		app.stop();
5522a14f28SLiu Zhe 
5604bad30fSLiu Zhe 	}
5704bad30fSLiu Zhe 
5804bad30fSLiu Zhe 	/**
5904bad30fSLiu Zhe 	 * Test cancel and back button in chart wizard dialog
6004bad30fSLiu Zhe 	 *
6104bad30fSLiu Zhe 	 * @throws java.lang.Exception
6204bad30fSLiu Zhe 	 */
6304bad30fSLiu Zhe 	@Test
testChartDialogCancelBack()6404bad30fSLiu Zhe 	public void testChartDialogCancelBack() {
65b4d2d410SLiu Zhe 		wizardNextButton.click();
66424494b0SLi Feng Wang 		assertTrue("Range Choose Tab is disable",chartRangeChooseTabPage.isEnabled());
67b4d2d410SLiu Zhe 		wizardBackButton.click();
68424494b0SLi Feng Wang 		assertTrue("Type Choose Tab is disable",chartTypeChooseTabPage.isEnabled());
69b4d2d410SLiu Zhe 		chartWizard.cancel();
70424494b0SLi Feng Wang 		assertFalse("Chart wizard not exist", chartWizard.exists());
7104bad30fSLiu Zhe 	}
7204bad30fSLiu Zhe }
73