summaryrefslogtreecommitdiffstats
path: root/sw/qa/uitest/writer_tests7
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/uitest/writer_tests7')
-rw-r--r--sw/qa/uitest/writer_tests7/data/tdf127652.odtbin0 -> 26963 bytes
-rw-r--r--sw/qa/uitest/writer_tests7/data/tdf131936.docxbin0 -> 4326 bytes
-rw-r--r--sw/qa/uitest/writer_tests7/tdf127652.py56
-rw-r--r--sw/qa/uitest/writer_tests7/tdf131936.py32
-rw-r--r--sw/qa/uitest/writer_tests7/tdf132169.py68
-rw-r--r--sw/qa/uitest/writer_tests7/tdf133189.py93
-rw-r--r--sw/qa/uitest/writer_tests7/tdf99711.py55
7 files changed, 304 insertions, 0 deletions
diff --git a/sw/qa/uitest/writer_tests7/data/tdf127652.odt b/sw/qa/uitest/writer_tests7/data/tdf127652.odt
new file mode 100644
index 000000000..12b2b156b
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/data/tdf127652.odt
Binary files differ
diff --git a/sw/qa/uitest/writer_tests7/data/tdf131936.docx b/sw/qa/uitest/writer_tests7/data/tdf131936.docx
new file mode 100644
index 000000000..f993d6ee3
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/data/tdf131936.docx
Binary files differ
diff --git a/sw/qa/uitest/writer_tests7/tdf127652.py b/sw/qa/uitest/writer_tests7/tdf127652.py
new file mode 100644
index 000000000..b6e181c61
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf127652.py
@@ -0,0 +1,56 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+from uitest.path import get_srcdir_url
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+
+def get_url_for_data_file(file_name):
+ return get_srcdir_url() + "/sw/qa/uitest/writer_tests7/data/" + file_name
+
+class tdf127652 (UITestCase):
+
+ def test_mark_delete_undo_delete_tdf127652 (self):
+
+ self.ui_test.load_file(get_url_for_data_file("tdf127652.odt"))
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ # go to the start of page 4
+ xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "4"}))
+ xWriterEdit.executeAction("CLICK", tuple())
+
+ # mark a section that overlaps multiple pages
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+UP"}))
+
+ # delete the marked section
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"}))
+
+ # go to the start of page 4
+ xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "4"}))
+ xWriterEdit.executeAction("CLICK", tuple())
+
+ # move up to page 3
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+
+ # check that we are on the third page
+ # in the bug one issue was that the cursor was places in the wrong place
+ # moving up to the previous page would not work any more
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "3")
+ self.ui_test.close_doc()
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests7/tdf131936.py b/sw/qa/uitest/writer_tests7/tdf131936.py
new file mode 100644
index 000000000..5d2de2c3a
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf131936.py
@@ -0,0 +1,32 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.path import get_srcdir_url
+from uitest.config import DEFAULT_SLEEP
+import time
+
+def get_url_for_data_file(file_name):
+ return get_srcdir_url() + "/sw/qa/uitest/writer_tests7/data/" + file_name
+
+class tdf131936(UITestCase):
+
+ def test_tdf131936_saveas_docx_version(self):
+ self.ui_test.load_file(get_url_for_data_file("tdf131936.docx"))
+
+ self.ui_test.execute_dialog_through_command(".uno:SaveAs")
+ time.sleep(DEFAULT_SLEEP)
+ xDialog = self.xUITest.getTopFocusWindow()
+ xFileTypeCombo = xDialog.getChild("file_type")
+ state = get_state_as_dict(xFileTypeCombo)
+ self.assertEqual(state["SelectEntryText"], "Office Open XML Text (Transitional) (.docx)")
+
+ xCancel = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancel)
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests7/tdf132169.py b/sw/qa/uitest/writer_tests7/tdf132169.py
new file mode 100644
index 000000000..9c884e405
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf132169.py
@@ -0,0 +1,68 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.path import get_srcdir_url
+from uitest.uihelper.common import get_state_as_dict, type_text
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+def get_url_for_data_file(file_name):
+ return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name
+
+class tdf132169(UITestCase):
+ def test_tdf132169(self):
+
+ writer_doc = self.ui_test.load_file(get_url_for_data_file("shape.odt"))
+
+ #set measurement to points
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+ xPages = xDialogOpt.getChild("pages")
+ xWriterEntry = xPages.getChild('3')
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xWriterGeneralEntry = xWriterEntry.getChild('0')
+ xWriterGeneralEntry.executeAction("SELECT", tuple())
+ xMetric = xDialogOpt.getChild("metric")
+ props = {"TEXT": "Point"}
+ actionProps = mkPropertyValues(props)
+ xMetric.executeAction("SELECT", actionProps)
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ self.xUITest.executeCommand(".uno:JumpToNextFrame")
+
+ #wait until the toolbar is available
+ self.ui_test.wait_until_child_is_available(xWriterEdit, 'metricfield')
+ xLineMetric = xWriterEdit.getChild('metricfield')
+ self.assertEqual(get_state_as_dict(xLineMetric)["Text"], "0.0 pt")
+
+ #Check changing value from dialog also works
+ self.ui_test.execute_dialog_through_command(".uno:FormatLine")
+ xFormatLineDlg = self.xUITest.getTopFocusWindow()
+ xWidth = xFormatLineDlg.getChild('MTR_FLD_LINE_WIDTH')
+ type_text(xWidth, "4.0")
+ xOKBtn = xFormatLineDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.ui_test.wait_until_property_is_updated(xLineMetric, "Text", "4.0 pt")
+ self.assertEqual(get_state_as_dict(xLineMetric)["Text"], "4.0 pt")
+
+ xLineMetric.executeAction("UP", tuple())
+
+ document = self.ui_test.get_component()
+ drawPage = document.getDrawPages().getByIndex(0)
+ shape = drawPage.getByIndex(0)
+
+ #Without the fix in place, it would have been 310
+ self.assertEqual(shape.LineWidth, 176)
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+
diff --git a/sw/qa/uitest/writer_tests7/tdf133189.py b/sw/qa/uitest/writer_tests7/tdf133189.py
new file mode 100644
index 000000000..8b59fcceb
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf133189.py
@@ -0,0 +1,93 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict, select_pos
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+def change_metric_units(self, unit):
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+ xPages = xDialogOpt.getChild("pages")
+ xWriterEntry = xPages.getChild('3')
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xWriterGeneralEntry = xWriterEntry.getChild('0')
+ xWriterGeneralEntry.executeAction("SELECT", tuple())
+ xMetric = xDialogOpt.getChild("metric")
+ props = {"TEXT": unit}
+ actionProps = mkPropertyValues(props)
+ xMetric.executeAction("SELECT", actionProps)
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+class tdf133189(UITestCase):
+ def test_tdf133189(self):
+ writer_doc = self.ui_test.create_doc_in_start_center("writer")
+
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "PageStylesPanel"}))
+
+ xPaperSize = xWriterEdit.getChild('papersize')
+ xPaperWidth = xWriterEdit.getChild('paperwidth')
+ xPaperHeight = xWriterEdit.getChild('paperheight')
+ xPaperOrient = xWriterEdit.getChild('paperorientation')
+ xPaperMargin = xWriterEdit.getChild('marginLB')
+
+ #change measurement to Inches
+ change_metric_units(self, 'Inch')
+
+ self.ui_test.execute_dialog_through_command(".uno:PageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ xWidth = xDialog.getChild('spinWidth')
+ xHeight = xDialog.getChild('spinHeight')
+
+ props = {"VALUE": '8.0'}
+ actionProps = mkPropertyValues(props)
+
+ xWidth.executeAction("VALUE", actionProps)
+ xHeight.executeAction("VALUE", actionProps)
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.ui_test.wait_until_property_is_updated(xPaperMargin, "SelectEntryText", "Normal (0.75″)")
+ self.assertEqual(get_state_as_dict(xPaperMargin)['SelectEntryText'], "Normal (0.75″)")
+ self.ui_test.wait_until_property_is_updated(xPaperSize, "SelectEntryText", "User")
+ self.assertEqual(get_state_as_dict(xPaperSize)['SelectEntryText'], "User")
+ self.ui_test.wait_until_property_is_updated(xPaperOrient, "SelectEntryText", "Portrait")
+ self.assertEqual(get_state_as_dict(xPaperOrient)['SelectEntryText'], "Portrait")
+ self.ui_test.wait_until_property_is_updated(xPaperWidth, "Text", "8.00″")
+ self.assertEqual(get_state_as_dict(xPaperWidth)['Text'], "8.00″")
+ self.ui_test.wait_until_property_is_updated(xPaperHeight, "Text", "8.00″")
+ self.assertEqual(get_state_as_dict(xPaperHeight)['Text'], "8.00″")
+
+ #change measurement again to Centimeters
+ change_metric_units(self, 'Centimeter')
+
+ self.ui_test.wait_until_property_is_updated(xPaperMargin, "SelectEntryText", "Normal (1.90 cm)")
+ # tdf#129267
+ self.assertEqual(get_state_as_dict(xPaperMargin)['SelectEntryText'], "Normal (1.90 cm)")
+ self.ui_test.wait_until_property_is_updated(xPaperSize, "SelectEntryText", "User")
+ self.assertEqual(get_state_as_dict(xPaperSize)['SelectEntryText'], "User")
+ self.ui_test.wait_until_property_is_updated(xPaperOrient, "SelectEntryText", "Portrait")
+ self.assertEqual(get_state_as_dict(xPaperOrient)['SelectEntryText'], "Portrait")
+ self.ui_test.wait_until_property_is_updated(xPaperWidth, "Text", "20.32 cm")
+ self.assertEqual(get_state_as_dict(xPaperWidth)['Text'], "20.32 cm")
+ self.ui_test.wait_until_property_is_updated(xPaperHeight, "Text", "20.32 cm")
+ self.assertEqual(get_state_as_dict(xPaperHeight)['Text'], "20.32 cm")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+
diff --git a/sw/qa/uitest/writer_tests7/tdf99711.py b/sw/qa/uitest/writer_tests7/tdf99711.py
new file mode 100644
index 000000000..1a6b7f069
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf99711.py
@@ -0,0 +1,55 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from uitest.path import get_srcdir_url
+from uitest.uihelper.common import get_state_as_dict
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+def get_url_for_data_file(file_name):
+ return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name
+
+class tdf99711(UITestCase):
+ def test_tdf99711(self):
+
+ writer_doc = self.ui_test.load_file(get_url_for_data_file("shape.odt"))
+
+ #set measurement to millimeters
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+ xPages = xDialogOpt.getChild("pages")
+ xWriterEntry = xPages.getChild('3')
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xWriterGeneralEntry = xWriterEntry.getChild('0')
+ xWriterGeneralEntry.executeAction("SELECT", tuple())
+ xMetric = xDialogOpt.getChild("metric")
+ props = {"TEXT": "Millimeter"}
+ actionProps = mkPropertyValues(props)
+ xMetric.executeAction("SELECT", actionProps)
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ self.xUITest.executeCommand(".uno:JumpToNextFrame")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "TextPropertyPanel"}))
+
+ #wait until the sidebar is available
+ self.ui_test.wait_until_child_is_available(xWriterEdit, 'selectwidth')
+ self.assertEqual(get_state_as_dict(xWriterEdit.getChild('selectwidth'))['Text'], '10.00 mm')
+
+ self.ui_test.wait_until_child_is_available(xWriterEdit, 'selectheight')
+ self.assertEqual(get_state_as_dict(xWriterEdit.getChild('selectheight'))['Text'], '10.00 mm')
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+