| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
from libreoffice.uno.propertyvalue import mkPropertyValues |
| 10 |
|
| 11 |
from uitest.framework import UITestCase |
| 12 |
from uitest.uihelper.common import get_url_for_data_file |
| 13 |
from uitest.uihelper.common import select_pos, get_state_as_dict |
| 14 |
|
| 15 |
|
| 16 |
class tdf125969(UITestCase): |
| 17 |
|
| 18 |
number_of_images = 0 |
| 19 |
|
| 20 |
def test_tdf125969(self): |
| 21 |
with self.ui_test.load_file(get_url_for_data_file("paragraphAreaFill.odt")): |
| 22 |
xWriterDoc = self.xUITest.getTopFocusWindow() |
| 23 |
xWriterEdit = xWriterDoc.getChild("writer_edit") |
| 24 |
|
| 25 |
self.xUITest.executeCommand(".uno:Sidebar") |
| 26 |
xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "PageStylesPanel"})) |
| 27 |
|
| 28 |
|
| 29 |
backgroundType = xWriterEdit.getChild('bgselect') |
| 30 |
self.ui_test.wait_until_property_is_updated(backgroundType, "SelectEntryText", "Bitmap") |
| 31 |
|
| 32 |
imageCollection = xWriterEdit.getChild("lbbitmap") |
| 33 |
number_of_images = int(get_state_as_dict(imageCollection)["EntryCount"]) |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog: |
| 40 |
tabcontrol = xDialog.getChild("tabcontrol") |
| 41 |
select_pos(tabcontrol, "8") |
| 42 |
|
| 43 |
|
| 44 |
self.ui_test.wait_until_property_is_updated(imageCollection, "EntryCount", str(number_of_images + 1)) |
| 45 |
self.assertEqual(number_of_images + 1, int(get_state_as_dict(imageCollection)["EntryCount"])) |
| 46 |
self.assertEqual("Painted White", get_state_as_dict(imageCollection)["SelectEntryText"]) |
| 47 |
|
| 48 |
|
| 49 |
with self.ui_test.load_empty_file("writer"): |
| 50 |
xWriterDoc = self.xUITest.getTopFocusWindow() |
| 51 |
xWriterEdit = xWriterDoc.getChild("writer_edit") |
| 52 |
|
| 53 |
|
| 54 |
with self.ui_test.execute_dialog_through_command(".uno:PageDialog", close_button="ok") as xDialog: |
| 55 |
tabcontrol = xDialog.getChild("tabcontrol") |
| 56 |
select_pos(tabcontrol, "2") |
| 57 |
xButton = xDialog.getChild('btnbitmap') |
| 58 |
xButton.executeAction("CLICK", tuple()) |
| 59 |
|
| 60 |
backgroundType = xWriterEdit.getChild('bgselect') |
| 61 |
imageCollection = xWriterEdit.getChild("lbbitmap") |
| 62 |
self.ui_test.wait_until_property_is_updated(backgroundType, "SelectEntryText", "Bitmap") |
| 63 |
|
| 64 |
|
| 65 |
self.assertEqual(number_of_images, int(get_state_as_dict(imageCollection)["EntryCount"])) |
| 66 |
|
| 67 |
self.xUITest.executeCommand(".uno:Sidebar") |
| 68 |
|