| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
from uitest.framework import UITestCase |
| 10 |
from libreoffice.uno.propertyvalue import mkPropertyValues |
| 11 |
from uitest.uihelper.common import get_state_as_dict |
| 12 |
|
| 13 |
class tdf140863(UITestCase): |
| 14 |
|
| 15 |
def test_tdf140863(self): |
| 16 |
|
| 17 |
with self.ui_test.create_doc_in_start_center("writer") as document: |
| 18 |
|
| 19 |
|
| 20 |
with self.ui_test.execute_dialog_through_command(".uno:InsertSection"): |
| 21 |
pass |
| 22 |
|
| 23 |
xWriterDoc = self.xUITest.getTopFocusWindow() |
| 24 |
xWriterEdit = xWriterDoc.getChild("writer_edit") |
| 25 |
|
| 26 |
|
| 27 |
xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) |
| 28 |
self.xUITest.executeCommand(".uno:InsertPagebreak") |
| 29 |
self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2") |
| 30 |
|
| 31 |
self.assertEqual(1, len(document.TextSections)) |
| 32 |
self.assertTrue(document.TextSections.Section1.IsVisible) |
| 33 |
|
| 34 |
|
| 35 |
with self.ui_test.execute_dialog_through_command(".uno:EditRegion") as xDialog: |
| 36 |
xHide = xDialog.getChild('hide') |
| 37 |
self.assertEqual('false', get_state_as_dict(xHide)['Selected']) |
| 38 |
|
| 39 |
xHide.executeAction('CLICK', tuple()) |
| 40 |
|
| 41 |
|
| 42 |
self.assertEqual(1, len(document.TextSections)) |
| 43 |
self.assertFalse(document.TextSections.Section1.IsVisible) |
| 44 |
self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "1") |
| 45 |
|
| 46 |
with self.ui_test.execute_dialog_through_command(".uno:EditRegion") as xDialog: |
| 47 |
xHide = xDialog.getChild('hide') |
| 48 |
self.assertEqual('true', get_state_as_dict(xHide)['Selected']) |
| 49 |
|
| 50 |
xHide.executeAction('CLICK', tuple()) |
| 51 |
|
| 52 |
self.assertEqual(1, len(document.TextSections)) |
| 53 |
self.assertTrue(document.TextSections.Section1.IsVisible) |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2") |
| 58 |
|
| 59 |
|
| 60 |
|