| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
from uitest.framework import UITestCase |
| 11 |
from libreoffice.uno.propertyvalue import mkPropertyValues |
| 12 |
from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file |
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
class tdf122449(UITestCase): |
| 17 |
|
| 18 |
def test_tdf122449_crash_edit_index_entry(self): |
| 19 |
with self.ui_test.load_file(get_url_for_data_file("tdf122449.odt")): |
| 20 |
xWriterDoc = self.xUITest.getTopFocusWindow() |
| 21 |
xWriterEdit = xWriterDoc.getChild("writer_edit") |
| 22 |
|
| 23 |
with self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog", close_button="close") as xDialog: |
| 24 |
|
| 25 |
searchterm = xDialog.getChild("searchterm") |
| 26 |
searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"Autocorrection"})) |
| 27 |
xsearch = xDialog.getChild("search") |
| 28 |
xsearch.executeAction("CLICK", tuple()) |
| 29 |
xsearch.executeAction("CLICK", tuple()) |
| 30 |
self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "6") |
| 31 |
xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "HOME"})) |
| 32 |
|
| 33 |
with self.ui_test.execute_dialog_through_command(".uno:IndexEntryDialog", close_button="close"): |
| 34 |
pass |
| 35 |
|
| 36 |
|
| 37 |
with self.ui_test.execute_dialog_through_command(".uno:GotoPage") as xDialog: |
| 38 |
xPageText = xDialog.getChild("page") |
| 39 |
xPageText.executeAction("TYPE", mkPropertyValues({"TEXT":"2"})) |
| 40 |
|
| 41 |
self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2") |
| 42 |
|
| 43 |
|