Update git submodules
[LibreOffice.git] / sw / qa / uitest / writer_tests2 / formatParagraph.py
blobbfa6eff48dc9efdb7a02a256b60c5efe822bcb7a
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 from uitest.framework import UITestCase
11 from uitest.uihelper.common import get_state_as_dict
13 from libreoffice.uno.propertyvalue import mkPropertyValues
14 from uitest.uihelper.common import select_pos
15 from uitest.uihelper.common import select_by_text
16 from uitest.uihelper.common import change_measurement_unit
18 class formatParagraph(UITestCase):
20 def test_format_paragraph_tab_indents_spacing(self):
21 with self.ui_test.create_doc_in_start_center("writer"):
23 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
24 xTabs = xDialog.getChild("tabcontrol")
25 select_pos(xTabs, "0")
27 xBeforeText = xDialog.getChild("spinED_LEFTINDENT")
28 xAfterText = xDialog.getChild("spinED_RIGHTINDENT")
29 xFirstLine = xDialog.getChild("spinED_FLINEINDENT")
30 xAutomaticChk = xDialog.getChild("checkCB_AUTO")
31 xAbovePar = xDialog.getChild("spinED_TOPDIST")
32 xBelowPar = xDialog.getChild("spinED_BOTTOMDIST")
33 xChkspace = xDialog.getChild("checkCB_CONTEXTUALSPACING")
34 xLineSpacing = xDialog.getChild("comboLB_LINEDIST")
35 xActivate = xDialog.getChild("checkCB_REGISTER")
37 xBeforeText.executeAction("UP", tuple())
38 xAfterText.executeAction("UP", tuple())
39 xFirstLine.executeAction("UP", tuple())
40 xAutomaticChk.executeAction("CLICK", tuple())
41 xAbovePar.executeAction("UP", tuple())
42 xBelowPar.executeAction("UP", tuple())
43 xChkspace.executeAction("CLICK", tuple())
44 select_by_text(xLineSpacing, "Double")
45 xActivate.executeAction("CLICK", tuple())
48 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
49 xTabs = xDialog.getChild("tabcontrol")
50 select_pos(xTabs, "0")
51 xBeforeText = xDialog.getChild("spinED_LEFTINDENT")
52 xAfterText = xDialog.getChild("spinED_RIGHTINDENT")
53 xFirstLine = xDialog.getChild("spinED_FLINEINDENT")
54 xAutomaticChk = xDialog.getChild("checkCB_AUTO")
55 xAbovePar = xDialog.getChild("spinED_TOPDIST")
56 xBelowPar = xDialog.getChild("spinED_BOTTOMDIST")
57 xChkspace = xDialog.getChild("checkCB_CONTEXTUALSPACING")
58 xLineSpacing = xDialog.getChild("comboLB_LINEDIST")
59 xActivate = xDialog.getChild("checkCB_REGISTER")
61 self.assertEqual(get_state_as_dict(xBeforeText)["Text"], "0.02″")
62 self.assertEqual(get_state_as_dict(xAfterText)["Text"], "0.02″")
63 self.assertEqual(get_state_as_dict(xFirstLine)["Text"], "0.02″")
64 self.assertEqual(get_state_as_dict(xAutomaticChk)["Selected"], "true")
65 self.assertEqual(get_state_as_dict(xAbovePar)["Text"], "0.02″")
66 self.assertEqual(get_state_as_dict(xBelowPar)["Text"], "0.02″")
67 self.assertEqual(get_state_as_dict(xChkspace)["Selected"], "true")
68 self.assertEqual(get_state_as_dict(xLineSpacing)["SelectEntryText"], "Double")
69 self.assertEqual(get_state_as_dict(xActivate)["Selected"], "true")
73 def test_format_paragraph_tab_alignment(self):
74 with self.ui_test.create_doc_in_start_center("writer"):
76 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
77 xTabs = xDialog.getChild("tabcontrol")
78 select_pos(xTabs, "1")
80 xTextDirection = xDialog.getChild("comboLB_TEXTDIRECTION")
81 xAlignment = xDialog.getChild("comboLB_VERTALIGN")
82 xSnapToText = xDialog.getChild("checkCB_SNAP")
83 xJustified = xDialog.getChild("radioBTN_JUSTIFYALIGN")
84 xLastLine = xDialog.getChild("comboLB_LASTLINE")
85 xExpandChk = xDialog.getChild("checkCB_EXPAND")
87 select_by_text(xTextDirection, "Left-to-right (LTR)")
88 select_by_text(xAlignment, "Top")
89 xSnapToText.executeAction("CLICK", tuple())
90 xJustified.executeAction("CLICK", tuple())
91 select_by_text(xLastLine, "Justified")
92 xExpandChk.executeAction("CLICK", tuple())
95 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
96 xTabs = xDialog.getChild("tabcontrol")
97 select_pos(xTabs, "1")
99 xTextDirection = xDialog.getChild("comboLB_TEXTDIRECTION")
100 xAlignment = xDialog.getChild("comboLB_VERTALIGN")
101 xSnapToText = xDialog.getChild("checkCB_SNAP")
102 xJustified = xDialog.getChild("radioBTN_JUSTIFYALIGN")
103 xLastLine = xDialog.getChild("comboLB_LASTLINE")
104 xExpandChk = xDialog.getChild("checkCB_EXPAND")
106 self.assertEqual(get_state_as_dict(xTextDirection)["SelectEntryText"], "Left-to-right (LTR)")
107 self.assertEqual(get_state_as_dict(xAlignment)["SelectEntryText"], "Top")
108 self.assertEqual(get_state_as_dict(xSnapToText)["Selected"], "false")
109 self.assertEqual(get_state_as_dict(xJustified)["Checked"], "true")
110 self.assertEqual(get_state_as_dict(xLastLine)["SelectEntryText"], "Justified")
111 self.assertEqual(get_state_as_dict(xExpandChk)["Selected"], "true")
115 def test_format_paragraph_tab_text_flow(self):
116 with self.ui_test.create_doc_in_start_center("writer"):
118 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
119 xTabs = xDialog.getChild("tabcontrol")
120 select_pos(xTabs, "2")
122 xAutomaticaly = xDialog.getChild("checkAuto")
123 xEnd = xDialog.getChild("spinLineEnd")
124 xBegin = xDialog.getChild("spinLineBegin")
125 xMax = xDialog.getChild("spinMaxNum")
126 xIns = xDialog.getChild("checkInsert")
127 xType = xDialog.getChild("comboBreakType")
128 xPosition = xDialog.getChild("comboBreakPosition")
129 xspinOrphan = xDialog.getChild("spinOrphan")
130 xspinWidow = xDialog.getChild("spinWidow")
131 xcheckWidow = xDialog.getChild("checkWidow")
132 xcheckOrphan = xDialog.getChild("checkOrphan")
133 xcheckSplitPara = xDialog.getChild("checkSplitPara")
134 xcheckKeepPara = xDialog.getChild("checkKeepPara")
136 xAutomaticaly.executeAction("CLICK", tuple())
137 xEnd.executeAction("UP", tuple())
138 xBegin.executeAction("UP", tuple())
139 xMax.executeAction("UP", tuple())
140 xIns.executeAction("CLICK", tuple())
141 select_by_text(xType, "Column")
142 select_by_text(xPosition, "After")
143 xspinOrphan.executeAction("UP", tuple())
144 xspinWidow.executeAction("UP", tuple())
145 xcheckWidow.executeAction("CLICK", tuple())
146 xcheckOrphan.executeAction("CLICK", tuple())
147 xcheckSplitPara.executeAction("CLICK", tuple())
148 xcheckKeepPara.executeAction("CLICK", tuple())
151 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
152 xTabs = xDialog.getChild("tabcontrol")
153 select_pos(xTabs, "2")
155 xAutomaticaly = xDialog.getChild("checkAuto")
156 xEnd = xDialog.getChild("spinLineEnd")
157 xBegin = xDialog.getChild("spinLineBegin")
158 xMax = xDialog.getChild("spinMaxNum")
159 xIns = xDialog.getChild("checkInsert")
160 xType = xDialog.getChild("comboBreakType")
161 xPosition = xDialog.getChild("comboBreakPosition")
162 xspinOrphan = xDialog.getChild("spinOrphan")
163 xspinWidow = xDialog.getChild("spinWidow")
164 xcheckWidow = xDialog.getChild("checkWidow")
165 xcheckOrphan = xDialog.getChild("checkOrphan")
166 xcheckSplitPara = xDialog.getChild("checkSplitPara")
167 xcheckKeepPara = xDialog.getChild("checkKeepPara")
169 self.assertEqual(get_state_as_dict(xAutomaticaly)["Selected"], "true")
170 self.assertEqual(get_state_as_dict(xEnd)["Text"], "3")
171 self.assertEqual(get_state_as_dict(xBegin)["Text"], "3")
172 self.assertEqual(get_state_as_dict(xMax)["Text"], "1")
173 self.assertEqual(get_state_as_dict(xIns)["Selected"], "true")
174 self.assertEqual(get_state_as_dict(xType)["SelectEntryText"], "Column")
175 self.assertEqual(get_state_as_dict(xPosition)["SelectEntryText"], "After")
176 self.assertEqual(get_state_as_dict(xspinOrphan)["Text"], "2")
177 self.assertEqual(get_state_as_dict(xspinWidow)["Text"], "2")
178 self.assertEqual(get_state_as_dict(xcheckWidow)["Selected"], "false")
179 self.assertEqual(get_state_as_dict(xcheckOrphan)["Selected"], "false")
180 self.assertEqual(get_state_as_dict(xcheckSplitPara)["Selected"], "false")
181 self.assertEqual(get_state_as_dict(xcheckKeepPara)["Selected"], "true")
185 def test_format_paragraph_tab_asian_typography(self):
186 with self.ui_test.create_doc_in_start_center("writer"):
188 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
189 xTabs = xDialog.getChild("tabcontrol")
190 select_pos(xTabs, "3")
192 xcheckForbidList = xDialog.getChild("checkForbidList")
193 xcheckHangPunct = xDialog.getChild("checkHangPunct")
194 xcheckApplySpacing = xDialog.getChild("checkApplySpacing")
196 xcheckForbidList.executeAction("CLICK", tuple())
197 xcheckHangPunct.executeAction("CLICK", tuple())
198 xcheckApplySpacing.executeAction("CLICK", tuple())
201 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
202 xTabs = xDialog.getChild("tabcontrol")
203 select_pos(xTabs, "3")
205 xcheckForbidList = xDialog.getChild("checkForbidList")
206 xcheckHangPunct = xDialog.getChild("checkHangPunct")
207 xcheckApplySpacing = xDialog.getChild("checkApplySpacing")
209 self.assertEqual(get_state_as_dict(xcheckForbidList)["Selected"], "false")
210 self.assertEqual(get_state_as_dict(xcheckHangPunct)["Selected"], "false")
211 self.assertEqual(get_state_as_dict(xcheckApplySpacing)["Selected"], "false")
215 def test_format_paragraph_tab_outline_numbering(self):
216 with self.ui_test.create_doc_in_start_center("writer"):
218 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
219 xTabs = xDialog.getChild("tabcontrol")
220 select_pos(xTabs, "4")
222 xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
223 xNumbering = xDialog.getChild("comboLB_NUMBER_STYLE")
224 xPara = xDialog.getChild("checkCB_RESTART_PARACOUNT")
225 xParaSpin = xDialog.getChild("spinNF_RESTART_PARA")
227 select_by_text(xOutline, "Level 1")
228 select_by_text(xNumbering, "Bullet •")
229 xPara.executeAction("CLICK", tuple())
230 xParaSpin.executeAction("UP", tuple())
233 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
234 xTabs = xDialog.getChild("tabcontrol")
235 select_pos(xTabs, "4")
237 xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
238 xNumbering = xDialog.getChild("comboLB_NUMBER_STYLE")
239 xPara = xDialog.getChild("checkCB_RESTART_PARACOUNT")
240 xParaSpin = xDialog.getChild("spinNF_RESTART_PARA")
242 self.assertEqual(get_state_as_dict(xOutline)["SelectEntryText"], "Level 1")
243 self.assertEqual(get_state_as_dict(xNumbering)["SelectEntryText"], "Bullet •")
244 self.assertEqual(get_state_as_dict(xPara)["Selected"], "true")
245 self.assertEqual(get_state_as_dict(xParaSpin)["Text"], "2")
249 def test_format_paragraph_tab_tabs(self):
250 with self.ui_test.create_doc_in_start_center("writer"):
252 with change_measurement_unit(self, "Centimeter"):
254 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
255 xTabs = xDialog.getChild("tabcontrol")
256 select_pos(xTabs, "5")
258 xDecimal = xDialog.getChild("radiobuttonBTN_TABTYPE_DECIMAL")
259 xDecimalTxt = xDialog.getChild("entryED_TABTYPE_DECCHAR")
260 xFill = xDialog.getChild("radiobuttonBTN_FILLCHAR_OTHER")
261 xFillTxt = xDialog.getChild("entryED_FILLCHAR_OTHER")
262 xNewButtn = xDialog.getChild("buttonBTN_NEW")
263 xED_TABPOS = xDialog.getChild("ED_TABPOS")
265 xDecimal.executeAction("CLICK", tuple())
266 xDecimalTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
267 xDecimalTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"i"}))
268 xFill.executeAction("CLICK", tuple())
269 xFillTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
270 xFillTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"p"}))
271 xED_TABPOS.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
272 xED_TABPOS.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
273 xNewButtn.executeAction("CLICK", tuple())
276 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
277 xTabs = xDialog.getChild("tabcontrol")
278 select_pos(xTabs, "5")
280 xDecimal = xDialog.getChild("radiobuttonBTN_TABTYPE_DECIMAL")
281 xDecimalTxt = xDialog.getChild("entryED_TABTYPE_DECCHAR")
282 xFill = xDialog.getChild("radiobuttonBTN_FILLCHAR_OTHER")
283 xFillTxt = xDialog.getChild("entryED_FILLCHAR_OTHER")
284 xNewButtn = xDialog.getChild("buttonBTN_NEW")
285 xED_TABPOS = xDialog.getChild("ED_TABPOS")
287 self.assertEqual(get_state_as_dict(xDecimal)["Checked"], "true")
288 self.assertEqual(get_state_as_dict(xDecimalTxt)["Text"], "i")
289 self.assertEqual(get_state_as_dict(xFill)["Checked"], "true")
290 self.assertEqual(get_state_as_dict(xFillTxt)["Text"], "p")
291 self.assertEqual(get_state_as_dict(xED_TABPOS)["Text"], "1.00 cm")
294 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
295 xTabs = xDialog.getChild("tabcontrol")
296 select_pos(xTabs, "5")
298 xCentered = xDialog.getChild("radiobuttonBTN_TABTYPE_CENTER")
299 xUnderscore = xDialog.getChild("radiobuttonBTN_FILLCHAR_UNDERSCORE")
300 xNewButtn = xDialog.getChild("buttonBTN_NEW")
302 xCentered.executeAction("CLICK", tuple())
303 xUnderscore.executeAction("CLICK", tuple())
304 xNewButtn.executeAction("CLICK", tuple())
306 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
307 xTabs = xDialog.getChild("tabcontrol")
308 select_pos(xTabs, "5")
310 xCentered = xDialog.getChild("radiobuttonBTN_TABTYPE_CENTER")
311 xUnderscore = xDialog.getChild("radiobuttonBTN_FILLCHAR_UNDERSCORE")
312 self.assertEqual(get_state_as_dict(xCentered)["Checked"], "true")
313 self.assertEqual(get_state_as_dict(xUnderscore)["Checked"], "true")
316 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
317 xTabs = xDialog.getChild("tabcontrol")
318 select_pos(xTabs, "5")
320 xRight = xDialog.getChild("radiobuttonST_RIGHTTAB_ASIAN")
321 xDashLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_DASHLINE")
322 xNewButtn = xDialog.getChild("buttonBTN_NEW")
324 xRight.executeAction("CLICK", tuple())
325 xDashLine.executeAction("CLICK", tuple())
326 xNewButtn.executeAction("CLICK", tuple())
328 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
329 xTabs = xDialog.getChild("tabcontrol")
330 select_pos(xTabs, "5")
332 xRight = xDialog.getChild("radiobuttonST_RIGHTTAB_ASIAN")
333 xDashLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_DASHLINE")
334 self.assertEqual(get_state_as_dict(xRight)["Checked"], "true")
335 self.assertEqual(get_state_as_dict(xDashLine)["Checked"], "true")
338 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
339 xTabs = xDialog.getChild("tabcontrol")
340 select_pos(xTabs, "5")
342 xLeft = xDialog.getChild("radiobuttonST_LEFTTAB_ASIAN")
343 xPointsLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_POINTS")
344 xNewButtn = xDialog.getChild("buttonBTN_NEW")
346 xLeft.executeAction("CLICK", tuple())
347 xPointsLine.executeAction("CLICK", tuple())
348 xNewButtn.executeAction("CLICK", tuple())
350 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
351 xTabs = xDialog.getChild("tabcontrol")
352 select_pos(xTabs, "5")
354 xLeft = xDialog.getChild("radiobuttonST_LEFTTAB_ASIAN")
355 xPointsLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_POINTS")
356 self.assertEqual(get_state_as_dict(xLeft)["Checked"], "true")
357 self.assertEqual(get_state_as_dict(xPointsLine)["Checked"], "true")
361 def test_format_paragraph_tab_drop_caps(self):
362 with self.ui_test.create_doc_in_start_center("writer"):
364 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
365 xTabs = xDialog.getChild("tabcontrol")
366 select_pos(xTabs, "6")
368 xDisplay = xDialog.getChild("checkCB_SWITCH")
369 xWholeWord = xDialog.getChild("checkCB_WORD")
370 xLines = xDialog.getChild("spinFLD_LINES")
371 xSpaceToText = xDialog.getChild("spinFLD_DISTANCE")
372 xText = xDialog.getChild("entryEDT_TEXT")
373 xCharStyle = xDialog.getChild("comboBOX_TEMPLATE")
375 xDisplay.executeAction("CLICK", tuple())
376 xWholeWord.executeAction("CLICK", tuple())
377 xLines.executeAction("UP", tuple())
378 xSpaceToText.executeAction("UP", tuple())
379 xText.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
380 select_by_text(xCharStyle, "Definition")
382 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
383 xTabs = xDialog.getChild("tabcontrol")
384 select_pos(xTabs, "6")
386 xDisplay = xDialog.getChild("checkCB_SWITCH")
387 xWholeWord = xDialog.getChild("checkCB_WORD")
388 xLines = xDialog.getChild("spinFLD_LINES")
389 xSpaceToText = xDialog.getChild("spinFLD_DISTANCE")
390 xText = xDialog.getChild("entryEDT_TEXT")
391 xCharStyle = xDialog.getChild("comboBOX_TEMPLATE")
393 self.assertEqual(get_state_as_dict(xDisplay)["Selected"], "true")
394 self.assertEqual(get_state_as_dict(xWholeWord)["Selected"], "true")
395 self.assertEqual(get_state_as_dict(xText)["Text"], "A")
396 self.assertEqual(get_state_as_dict(xCharStyle)["SelectEntryText"], "Definition")
400 def test_format_paragraph_tab_borders(self):
401 with self.ui_test.create_doc_in_start_center("writer"):
403 with change_measurement_unit(self, "Centimeter"):
405 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
406 xTabs = xDialog.getChild("tabcontrol")
407 select_pos(xTabs, "7")
409 xwidth = xDialog.getChild("linewidthmf")
410 xSync = xDialog.getChild("sync")
411 xLeft = xDialog.getChild("leftmf")
412 xRight = xDialog.getChild("rightmf")
413 xTop = xDialog.getChild("topmf")
414 xBottom = xDialog.getChild("bottommf")
415 xMerge = xDialog.getChild("mergewithnext")
417 xwidth.executeAction("UP", tuple())
418 xSync.executeAction("CLICK", tuple())
419 xLeft.executeAction("UP", tuple())
420 xLeft.executeAction("UP", tuple())
421 xRight.executeAction("UP", tuple())
422 xTop.executeAction("UP", tuple())
423 xBottom.executeAction("UP", tuple())
424 xMerge.executeAction("CLICK", tuple())
427 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
428 xTabs = xDialog.getChild("tabcontrol")
429 select_pos(xTabs, "7")
431 xwidth = xDialog.getChild("linewidthmf")
432 xSync = xDialog.getChild("sync")
433 xLeft = xDialog.getChild("leftmf")
434 xRight = xDialog.getChild("rightmf")
435 xTop = xDialog.getChild("topmf")
436 xBottom = xDialog.getChild("bottommf")
437 xMerge = xDialog.getChild("mergewithnext")
439 self.assertEqual(get_state_as_dict(xSync)["Selected"], "false")
440 self.assertEqual(get_state_as_dict(xMerge)["Selected"], "false")
441 self.assertEqual(get_state_as_dict(xLeft)["Text"], "0.20 cm")
442 self.assertEqual(get_state_as_dict(xRight)["Text"], "0.10 cm")
443 self.assertEqual(get_state_as_dict(xTop)["Text"], "0.10 cm")
444 self.assertEqual(get_state_as_dict(xBottom)["Text"], "0.10 cm")
447 def test_format_paragraph_area(self):
448 with self.ui_test.create_doc_in_start_center("writer"):
450 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
451 xTabs = xDialog.getChild("tabcontrol")
452 select_pos(xTabs, "8")
454 xColor = xDialog.getChild("btncolor")
455 xGradient = xDialog.getChild("btngradient")
456 xBitmap = xDialog.getChild("btnbitmap")
457 xPattern = xDialog.getChild("btnpattern")
458 xHatch = xDialog.getChild("btnhatch")
460 xColor.executeAction("CLICK", tuple())
461 xGradient.executeAction("CLICK", tuple())
462 xBitmap.executeAction("CLICK", tuple())
463 xPattern.executeAction("CLICK", tuple())
464 xHatch.executeAction("CLICK", tuple())
466 def test_format_paragraph_transparency(self):
467 with self.ui_test.create_doc_in_start_center("writer"):
469 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
470 xTabs = xDialog.getChild("tabcontrol")
471 select_pos(xTabs, "9")
473 xTran = xDialog.getChild("RBT_TRANS_LINEAR")
474 xTranText = xDialog.getChild("MTR_TRANSPARENT")
476 xTran.executeAction("CLICK", tuple())
477 xTranText.executeAction("UP", tuple())
480 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
481 xTabs = xDialog.getChild("tabcontrol")
482 select_pos(xTabs, "9")
484 xTran = xDialog.getChild("RBT_TRANS_LINEAR")
485 xTranText = xDialog.getChild("MTR_TRANSPARENT")
487 self.assertEqual(get_state_as_dict(xTran)["Checked"], "true")
488 self.assertEqual(get_state_as_dict(xTranText)["Text"], "51%")
491 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
492 xTabs = xDialog.getChild("tabcontrol")
493 select_pos(xTabs, "9")
495 xGradient = xDialog.getChild("RBT_TRANS_GRADIENT")
496 xType = xDialog.getChild("LB_TRGR_GRADIENT_TYPES")
497 xAngle = xDialog.getChild("MTR_TRGR_ANGLE")
498 xBorder = xDialog.getChild("MTR_TRGR_BORDER")
499 xStart = xDialog.getChild("MTR_TRGR_START_VALUE")
500 xEnd = xDialog.getChild("MTR_TRGR_END_VALUE")
502 xGradient.executeAction("CLICK", tuple())
503 select_by_text(xType, "Axial")
504 xAngle.executeAction("UP", tuple())
505 xBorder.executeAction("UP", tuple())
506 xStart.executeAction("UP", tuple())
507 xEnd.executeAction("UP", tuple())
510 with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
511 xTabs = xDialog.getChild("tabcontrol")
512 select_pos(xTabs, "9")
514 xGradient = xDialog.getChild("RBT_TRANS_GRADIENT")
515 xType = xDialog.getChild("LB_TRGR_GRADIENT_TYPES")
516 xAngle = xDialog.getChild("MTR_TRGR_ANGLE")
517 xBorder = xDialog.getChild("MTR_TRGR_BORDER")
518 xStart = xDialog.getChild("MTR_TRGR_START_VALUE")
519 xEnd = xDialog.getChild("MTR_TRGR_END_VALUE")
521 self.assertEqual(get_state_as_dict(xGradient)["Checked"], "true")
522 self.assertEqual(get_state_as_dict(xType)["SelectEntryText"], "Axial")
523 self.assertEqual(get_state_as_dict(xAngle)["Text"], "1°")
524 self.assertEqual(get_state_as_dict(xBorder)["Text"], "1%")
525 self.assertEqual(get_state_as_dict(xStart)["Text"], "1%")
526 self.assertEqual(get_state_as_dict(xEnd)["Text"], "1%")
529 # vim: set shiftwidth=4 softtabstop=4 expandtab: