Line 0
Link Here
|
|
|
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 testcase.gui.sd.table; |
23 |
|
24 |
import static testlib.gui.AppUtil.*; |
25 |
import static testlib.gui.UIMap.*; |
26 |
import static org.junit.Assert.*; |
27 |
import static org.openoffice.test.common.Testspace.getPath; |
28 |
import static org.openoffice.test.vcl.Tester.sleep; |
29 |
|
30 |
import org.junit.After; |
31 |
import org.junit.Before; |
32 |
import org.junit.Rule; |
33 |
import org.junit.Test; |
34 |
import org.openoffice.test.common.FileUtil; |
35 |
import org.openoffice.test.common.SystemUtil; |
36 |
import org.openoffice.test.vcl.widgets.VclDialog; |
37 |
|
38 |
import testlib.gui.Log; |
39 |
|
40 |
public class ChangeTableBackgroundProperty { |
41 |
@Rule |
42 |
public Log LOG = new Log(); |
43 |
|
44 |
@Before |
45 |
public void setUp() throws Exception { |
46 |
app.start(); |
47 |
} |
48 |
|
49 |
@After |
50 |
public void tearDown() throws Exception { |
51 |
app.close(); |
52 |
} |
53 |
|
54 |
/** |
55 |
* Open the Table Background property dialog in Presentation |
56 |
* |
57 |
* @throws Exception |
58 |
*/ |
59 |
|
60 |
@Test |
61 |
public void OpenTableBackgroundPropertyDialog() throws Exception { |
62 |
|
63 |
// Create a new presentation document |
64 |
app.dispatch("private:factory/simpress?slot=6686"); |
65 |
PresentationWizard.ok(); |
66 |
|
67 |
// Insert a table |
68 |
app.dispatch(".uno:InsertTable", 3); |
69 |
InsertTable.ok(); |
70 |
|
71 |
// Verify if the table toolbar is active |
72 |
assertTrue(Table_Toolbar.exists(3)); |
73 |
|
74 |
// open Table Properties Dialog |
75 |
app.dispatch(".uno:TableDialog", 3); |
76 |
Area_Area_page.select(); |
77 |
// select Color |
78 |
Area_Fill_Type.select(1); |
79 |
assertEquals("actual should be same with expected",Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(1)); |
80 |
Area_Fill_Color.select(2); |
81 |
//Area_Fill_Color.getItemCount(); |
82 |
assertEquals("actual should be same with expected",Area_Fill_Color.getSelText(), Area_Fill_Color.getItemText(2)); |
83 |
Area_Area_page.ok(); |
84 |
|
85 |
// open Table Properties Dialog |
86 |
app.dispatch(".uno:TableDialog", 3); |
87 |
Area_Area_page.select(); |
88 |
// select Gradient |
89 |
Area_Fill_Type.select(2); |
90 |
assertEquals("actual should be same with expected",Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(2)); |
91 |
Area_Fill_Gradient.select(2); |
92 |
assertEquals("actual should be same with expected",Area_Fill_Gradient.getSelText(), Area_Fill_Gradient.getItemText(2)); |
93 |
Area_Area_page.ok(); |
94 |
|
95 |
|
96 |
// open Table Properties Dialog |
97 |
app.dispatch(".uno:TableDialog", 3); |
98 |
Area_Area_page.select(); |
99 |
// select Hatching |
100 |
Area_Fill_Type.select(3); |
101 |
assertEquals("actual should be same with expected",Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(3)); |
102 |
Area_Fill_Hatching.select(2); |
103 |
assertEquals("actual should be same with expected",Area_Fill_Hatching.getSelText(), Area_Fill_Hatching.getItemText(2)); |
104 |
Area_Area_page.ok(); |
105 |
|
106 |
// open Table Properties Dialog |
107 |
app.dispatch(".uno:TableDialog", 3); |
108 |
Area_Area_page.select(); |
109 |
// select Bitmap |
110 |
Area_Fill_Type.select(4); |
111 |
assertEquals("actual should be same with expected",Area_Fill_Type.getSelText(), Area_Fill_Type.getItemText(4)); |
112 |
Area_Fill_Bitmap.select(2); |
113 |
assertEquals("actual should be same with expected",Area_Fill_Bitmap.getSelText(), Area_Fill_Bitmap.getItemText(2)); |
114 |
Area_Area_page.ok(); |
115 |
|
116 |
} |
117 |
|
118 |
} |