| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
from uitest.framework import UITestCase |
| 10 |
from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file |
| 11 |
from uitest.uihelper.common import select_pos |
| 12 |
|
| 13 |
class tdf146605(UITestCase): |
| 14 |
|
| 15 |
def test_tdf146605(self): |
| 16 |
|
| 17 |
with self.ui_test.load_file(get_url_for_data_file("tdf146605.odt")) as document: |
| 18 |
|
| 19 |
xWriterDoc = self.xUITest.getTopFocusWindow() |
| 20 |
xWriterEdit = xWriterDoc.getChild("writer_edit") |
| 21 |
|
| 22 |
self.assertEqual(1, len(document.TextSections)) |
| 23 |
self.assertTrue(document.TextSections.Section1.IsVisible) |
| 24 |
self.assertFalse(document.TextSections.Section1.FootnoteIsCollectAtTextEnd) |
| 25 |
self.assertFalse(document.TextSections.Section1.EndnoteIsCollectAtTextEnd) |
| 26 |
self.assertEqual("2", get_state_as_dict(xWriterEdit)["Pages"]) |
| 27 |
|
| 28 |
with self.ui_test.execute_dialog_through_command(".uno:EditRegion") as xDialog: |
| 29 |
xTree = xDialog.getChild("tree") |
| 30 |
self.assertEqual("1", get_state_as_dict(xTree)['Children']) |
| 31 |
self.assertEqual("Section1", get_state_as_dict(xTree.getChild('0'))['Text']) |
| 32 |
self.assertEqual("Section1", get_state_as_dict(xDialog.getChild('curname'))['Text']) |
| 33 |
|
| 34 |
xOptions = xDialog.getChild("options") |
| 35 |
with self.ui_test.execute_blocking_action( |
| 36 |
xOptions.executeAction, args=('CLICK', ())) as xOptDialog: |
| 37 |
xTabs = xOptDialog.getChild("tabcontrol") |
| 38 |
select_pos(xTabs, "3") |
| 39 |
|
| 40 |
xTextEnd = xOptDialog.getChild("endntattextend") |
| 41 |
xNum = xOptDialog.getChild("endntnum") |
| 42 |
|
| 43 |
self.assertEqual("true", get_state_as_dict(xTextEnd)['Enabled']) |
| 44 |
self.assertEqual("false", get_state_as_dict(xTextEnd)['Selected']) |
| 45 |
self.assertEqual("false", get_state_as_dict(xNum)['Enabled']) |
| 46 |
|
| 47 |
xTextEnd.executeAction('CLICK', tuple()) |
| 48 |
|
| 49 |
self.assertEqual("true", get_state_as_dict(xTextEnd)['Enabled']) |
| 50 |
self.assertEqual("true", get_state_as_dict(xTextEnd)['Selected']) |
| 51 |
self.assertEqual("true", get_state_as_dict(xNum)['Enabled']) |
| 52 |
|
| 53 |
self.assertEqual(1, len(document.TextSections)) |
| 54 |
self.assertTrue(document.TextSections.Section1.IsVisible) |
| 55 |
self.assertFalse(document.TextSections.Section1.FootnoteIsCollectAtTextEnd) |
| 56 |
self.assertTrue(document.TextSections.Section1.EndnoteIsCollectAtTextEnd) |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
self.assertEqual("1", get_state_as_dict(xWriterEdit)["Pages"]) |
| 61 |
|
| 62 |
|