| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
from uitest.framework import UITestCase |
| 10 |
from uitest.uihelper.common import get_url_for_data_file |
| 11 |
from libreoffice.uno.propertyvalue import mkPropertyValues |
| 12 |
from com.sun.star.awt import MouseButton |
| 13 |
from com.sun.star.awt import MouseEvent |
| 14 |
|
| 15 |
class tdf132714(UITestCase): |
| 16 |
def test_tdf132714(self): |
| 17 |
with self.ui_test.load_file(get_url_for_data_file("tdf132714.odt")): |
| 18 |
|
| 19 |
|
| 20 |
self.xUITest.executeCommand(".uno:GoDown") |
| 21 |
self.xUITest.executeCommand(".uno:GoDown") |
| 22 |
self.xUITest.executeCommand(".uno:GoDown") |
| 23 |
|
| 24 |
self.xUITest.executeCommand(".uno:DeleteRows") |
| 25 |
|
| 26 |
def test_delete_table(self): |
| 27 |
with self.ui_test.load_file(get_url_for_data_file("tdf132714.odt")) as document: |
| 28 |
|
| 29 |
|
| 30 |
self.xUITest.executeCommand(".uno:GoDown") |
| 31 |
self.xUITest.executeCommand(".uno:GoDown") |
| 32 |
|
| 33 |
self.xUITest.executeCommand(".uno:DeleteTable") |
| 34 |
|
| 35 |
|
| 36 |
self.assertEqual(1, len(document.EmbeddedObjects)) |
| 37 |
document.CurrentController.select(document.getEmbeddedObjects()[0]) |
| 38 |
self.assertEqual("SwXTextEmbeddedObject", document.CurrentSelection.getImplementationName()) |
| 39 |
|
| 40 |
xChartMainTop = self.xUITest.getTopFocusWindow() |
| 41 |
xWriterEdit = xChartMainTop.getChild("writer_edit") |
| 42 |
|
| 43 |
xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"})) |
| 44 |
|
| 45 |
|
| 46 |
xFrame = document.getCurrentController().getFrame() |
| 47 |
self.assertIsNotNone(xFrame) |
| 48 |
xWindow = xFrame.getContainerWindow() |
| 49 |
self.assertIsNotNone(xWindow) |
| 50 |
|
| 51 |
xMouseEvent = MouseEvent() |
| 52 |
xMouseEvent.Modifiers = 0 |
| 53 |
xMouseEvent.Buttons = MouseButton.LEFT |
| 54 |
xMouseEvent.X = 1000 |
| 55 |
xMouseEvent.Y = 400 |
| 56 |
xMouseEvent.ClickCount = 1 |
| 57 |
xMouseEvent.PopupTrigger = False |
| 58 |
xMouseEvent.Source = xWindow |
| 59 |
|
| 60 |
|
| 61 |
xToolkitRobot = xWindow.getToolkit() |
| 62 |
self.assertIsNotNone(xToolkitRobot) |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
xToolkitRobot.mouseMove(xMouseEvent) |
| 68 |
|
| 69 |
def test_data_ranges(self): |
| 70 |
with self.ui_test.load_file(get_url_for_data_file("tdf132714.odt")) as document: |
| 71 |
|
| 72 |
|
| 73 |
self.xUITest.executeCommand(".uno:GoDown") |
| 74 |
self.xUITest.executeCommand(".uno:GoDown") |
| 75 |
|
| 76 |
self.xUITest.executeCommand(".uno:DeleteTable") |
| 77 |
|
| 78 |
|
| 79 |
self.assertEqual(1, len(document.EmbeddedObjects)) |
| 80 |
document.CurrentController.select(document.EmbeddedObjects[0]) |
| 81 |
self.assertEqual("SwXTextEmbeddedObject", document.CurrentSelection.getImplementationName()) |
| 82 |
|
| 83 |
xChartMainTop = self.xUITest.getTopFocusWindow() |
| 84 |
xWriterEdit = xChartMainTop.getChild("writer_edit") |
| 85 |
|
| 86 |
xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"})) |
| 87 |
|
| 88 |
|
| 89 |
xChartMain = xChartMainTop.getChild("chart_window") |
| 90 |
xSeriesObj = xChartMain.getChild("CID/Page=") |
| 91 |
|
| 92 |
|
| 93 |
with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DataRanges"})): |
| 94 |
pass |
| 95 |
|
| 96 |
|
| 97 |
|