| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
from uitest.framework import UITestCase |
| 11 |
from uitest.uihelper.common import type_text |
| 12 |
from uitest.uihelper.common import select_pos |
| 13 |
from uitest.uihelper.common import get_state_as_dict |
| 14 |
from libreoffice.uno.propertyvalue import mkPropertyValues |
| 15 |
|
| 16 |
class tdf115871(UITestCase): |
| 17 |
|
| 18 |
def test_tdf115871_reset_outline_list_options_parent(self): |
| 19 |
|
| 20 |
with self.ui_test.create_doc_in_start_center("writer"): |
| 21 |
|
| 22 |
|
| 23 |
with self.ui_test.execute_dialog_through_command(".uno:StyleNewByExample") as xDialog: |
| 24 |
xStyleName = xDialog.getChild("stylename") |
| 25 |
type_text(xStyleName, "Custom Heading 1") |
| 26 |
|
| 27 |
|
| 28 |
with self.ui_test.execute_dialog_through_command(".uno:EditStyle") as xDialog: |
| 29 |
xTabs = xDialog.getChild("tabcontrol") |
| 30 |
select_pos(xTabs, "0") |
| 31 |
xLinkedWith = xTabs.getChild("linkedwith") |
| 32 |
xLinkedWith.executeAction("SELECT", mkPropertyValues({"TEXT": "Heading 1"})) |
| 33 |
self.assertEqual(get_state_as_dict(xLinkedWith)["SelectEntryText"], "Heading 1") |
| 34 |
|
| 35 |
|
| 36 |
with self.ui_test.execute_dialog_through_command(".uno:EditStyle") as xDialog: |
| 37 |
xTabs = xDialog.getChild("tabcontrol") |
| 38 |
select_pos(xTabs, "13") |
| 39 |
|
| 40 |
|
| 41 |
xOutlineLevel = xTabs.getChild("comboLB_OUTLINE_LEVEL") |
| 42 |
xOutlineLevel.executeAction("SELECT", mkPropertyValues({"TEXT": "Level 5"})) |
| 43 |
self.assertEqual(get_state_as_dict(xOutlineLevel)["SelectEntryText"], "Level 5") |
| 44 |
|
| 45 |
|
| 46 |
xListStyle = xTabs.getChild("comboLB_NUMBER_STYLE") |
| 47 |
xListStyle.executeAction("SELECT", mkPropertyValues({"TEXT": "Numbering 123"})) |
| 48 |
self.assertEqual(get_state_as_dict(xListStyle)["SelectEntryText"], "Numbering 123") |
| 49 |
|
| 50 |
|
| 51 |
xRestartAtParagraph = xTabs.getChild("checkCB_RESTART_PARACOUNT") |
| 52 |
xRestartAtParagraph.executeAction("CLICK", tuple()) |
| 53 |
self.assertEqual(get_state_as_dict(xRestartAtParagraph)["Selected"], "true") |
| 54 |
xStartWith = xTabs.getChild("spinNF_RESTART_PARA") |
| 55 |
xStartWith.executeAction("UP", tuple()) |
| 56 |
self.assertEqual(get_state_as_dict(xStartWith)["Text"], "2") |
| 57 |
|
| 58 |
|
| 59 |
with self.ui_test.execute_dialog_through_command(".uno:EditStyle") as xDialog: |
| 60 |
xTabs = xDialog.getChild("tabcontrol") |
| 61 |
select_pos(xTabs, "13") |
| 62 |
|
| 63 |
xStandardButton = xDialog.getChild("standard") |
| 64 |
xStandardButton.executeAction("CLICK", tuple()) |
| 65 |
|
| 66 |
xOutlineLevel = xTabs.getChild("comboLB_OUTLINE_LEVEL") |
| 67 |
|
| 68 |
|
| 69 |
self.assertEqual(get_state_as_dict(xOutlineLevel)["SelectEntryText"], "Level 1") |
| 70 |
|
| 71 |
xListStyle = xTabs.getChild("comboLB_NUMBER_STYLE") |
| 72 |
|
| 73 |
|
| 74 |
self.assertEqual(get_state_as_dict(xListStyle)["SelectEntryText"], "Heading Numbering") |
| 75 |
|
| 76 |
xRestartAtParagraph = xTabs.getChild("checkCB_RESTART_PARACOUNT") |
| 77 |
|
| 78 |
|
| 79 |
self.assertEqual(get_state_as_dict(xRestartAtParagraph)["Selected"], "false") |
| 80 |
self.assertEqual(get_state_as_dict(xListStyle)["SelectEntryText"], "Heading Numbering") |
| 81 |
|
| 82 |
xStartWith = xTabs.getChild("spinNF_RESTART_PARA") |
| 83 |
|
| 84 |
|
| 85 |
self.assertEqual(get_state_as_dict(xStartWith)["Text"], "1") |
| 86 |
|
| 87 |
|