summaryrefslogtreecommitdiffstats
path: root/sw/qa/uitest/writer_tests3
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /sw/qa/uitest/writer_tests3
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sw/qa/uitest/writer_tests3')
-rw-r--r--sw/qa/uitest/writer_tests3/autoredactDialog.py153
-rw-r--r--sw/qa/uitest/writer_tests3/customizeDialog.py129
-rw-r--r--sw/qa/uitest/writer_tests3/goToPage.py39
-rw-r--r--sw/qa/uitest/writer_tests3/hyperlinkdialog.py151
-rw-r--r--sw/qa/uitest/writer_tests3/insertEndnote.py36
-rw-r--r--sw/qa/uitest/writer_tests3/insertEnvelope.py38
-rw-r--r--sw/qa/uitest/writer_tests3/insertFootEndnote.py62
-rw-r--r--sw/qa/uitest/writer_tests3/insertQrCodeGen.py36
-rw-r--r--sw/qa/uitest/writer_tests3/insertSignatureLine.py43
-rw-r--r--sw/qa/uitest/writer_tests3/lineNumbering.py89
-rw-r--r--sw/qa/uitest/writer_tests3/pageDialog.py219
-rw-r--r--sw/qa/uitest/writer_tests3/save_readonly_with_password.py95
-rw-r--r--sw/qa/uitest/writer_tests3/sort.py60
-rw-r--r--sw/qa/uitest/writer_tests3/specialCharacter.py97
-rwxr-xr-xsw/qa/uitest/writer_tests3/tdf124088.py33
-rw-r--r--sw/qa/uitest/writer_tests3/tdf79236.py118
16 files changed, 1398 insertions, 0 deletions
diff --git a/sw/qa/uitest/writer_tests3/autoredactDialog.py b/sw/qa/uitest/writer_tests3/autoredactDialog.py
new file mode 100644
index 0000000000..8acc33e461
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/autoredactDialog.py
@@ -0,0 +1,153 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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
+from uitest.uihelper.common import type_text
+from uitest.uihelper.common import select_pos
+import re
+
+class AutoRedactDialog(UITestCase):
+
+ add_target_counter = 0
+
+ def getText(self, xObj):
+ return get_state_as_dict(xObj)["Text"]
+
+ def parseTargetContent(self, xObj):
+ return re.split(r'\t+', self.getText(xObj))
+
+ def clearTargetsbox(self, xDialog):
+ xTargetsListbox = xDialog.getChild("targets")
+ xDeleteBtn = xDialog.getChild("delete")
+
+ child_count = len(xTargetsListbox.getChildren())
+
+ if child_count < 1:
+ return
+
+ for i in range(0, child_count):
+ child = xTargetsListbox.getChild(0)
+ child.executeAction("SELECT", tuple())
+ xDeleteBtn.executeAction("CLICK", tuple())
+
+ # Verify
+ self.assertEqual(len(xTargetsListbox.getChildren()), 0)
+
+ def test_add_target(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ with self.ui_test.execute_dialog_through_command(".uno:AutoRedactDoc", close_button="cancel") as xDialog:
+ xAddBtn = xDialog.getChild("add")
+
+ # Make sure we are starting with an empty targets list
+ self.clearTargetsbox(xDialog)
+
+ # Names need to be distinct
+ # ["target name", "target content"],
+ targets_list = [
+ ["target1", "content1"],
+ ["target2", "content2"],
+ ["target3", "content3"],
+ ]
+
+ for i in range(0, len(targets_list)):
+ self.add_target_counter = i
+ with self.ui_test.execute_blocking_action(xAddBtn.executeAction, args=('CLICK', ()), close_button="close") as dialog:
+ xNewNameTxt=dialog.getChild("name")
+ xNewContentTxt=dialog.getChild("content")
+ xTypeList = dialog.getChild("type") #0: Text, 1: Regex, 2: Predefined
+
+ select_pos(xTypeList, "0") #Text
+ self.assertEqual(int(get_state_as_dict(xTypeList)["SelectEntryPos"]), 0)
+
+ type_text(xNewNameTxt, targets_list[self.add_target_counter][0])
+ type_text(xNewContentTxt, targets_list[self.add_target_counter][1])
+
+ # Make sure targets are added successfully
+ xTargetsListbox = xDialog.getChild("targets")
+ targets_box_state_dict = get_state_as_dict(xTargetsListbox)
+ self.assertEqual(int(targets_box_state_dict["Children"]), len(targets_list))
+
+ # Make sure targets are added with correct names and contents
+ for i in range(0, len(targets_list)):
+ child = xTargetsListbox.getChild(i)
+ child_text = self.parseTargetContent(child)
+ self.assertEqual(child_text[0], targets_list[i][0]) #name
+ self.assertEqual(child_text[2], targets_list[i][1]) #content
+
+ # Now let's make sure the dialog remembers last state
+ with self.ui_test.execute_dialog_through_command(".uno:AutoRedactDoc", close_button="cancel") as xDialog:
+ xTargetsListbox = xDialog.getChild("targets")
+ targets_box_state_dict = get_state_as_dict(xTargetsListbox)
+ self.assertEqual(int(targets_box_state_dict["Children"]), len(targets_list))
+
+ # Make sure targets are remembered with correct names and contents
+ for i in range(0, len(targets_list)):
+ child = xTargetsListbox.getChild(i)
+ child_text = self.parseTargetContent(child)
+ self.assertEqual(child_text[0], targets_list[i][0]) #name
+ self.assertEqual(child_text[2], targets_list[i][1]) #content
+
+
+
+ def test_edit_target(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ with self.ui_test.execute_dialog_through_command(".uno:AutoRedactDoc", close_button="cancel") as xDialog:
+ xAddBtn = xDialog.getChild("add")
+ xEditBtn = xDialog.getChild("edit")
+
+ # Make sure we are starting with an empty targets list
+ self.clearTargetsbox(xDialog)
+
+ # We first need to add a target so that we can edit it
+ with self.ui_test.execute_blocking_action(xAddBtn.executeAction, args=('CLICK', ()), close_button="close") as dialog:
+ xNewNameTxt=dialog.getChild("name")
+ xNewContentTxt=dialog.getChild("content")
+ xTypeList = dialog.getChild("type") #0: Text, 1: Regex, 2: Predefined
+
+ select_pos(xTypeList, "0") #Text
+ self.assertEqual(int(get_state_as_dict(xTypeList)["SelectEntryPos"]), 0)
+
+ type_text(xNewNameTxt, "TestTarget")
+ type_text(xNewContentTxt, "TestContent")
+
+ # Make sure target is added successfully
+ xTargetsListbox = xDialog.getChild("targets")
+ targets_box_state_dict = get_state_as_dict(xTargetsListbox)
+ self.assertEqual(int(targets_box_state_dict["Children"]), 1)
+
+ # Select the added target
+ target_entry = xTargetsListbox.getChild(0)
+ target_entry.executeAction("SELECT", tuple())
+
+ # Now edit the target
+ with self.ui_test.execute_blocking_action(xEditBtn.executeAction, args=('CLICK', ()), close_button="close") as dialog:
+ xNameTxt=dialog.getChild("name")
+ xContentTxt=dialog.getChild("content")
+
+ xNameTxt.executeAction("CLEAR", tuple())
+ xContentTxt.executeAction("CLEAR", tuple())
+
+ type_text(xNameTxt, "TestTargetEdited")
+ type_text(xContentTxt, "TestContentEdited")
+
+ # Make sure target is still there
+ xTargetsListbox = xDialog.getChild("targets")
+ targets_box_state_dict = get_state_as_dict(xTargetsListbox)
+ self.assertEqual(int(targets_box_state_dict["Children"]), 1)
+
+ # Make sure target has the new values
+ target_entry = xTargetsListbox.getChild(0)
+ target_text = self.parseTargetContent(target_entry)
+ self.assertEqual(target_text[0], "TestTargetEdited") #name
+ self.assertEqual(target_text[2], "TestContentEdited") #content
+
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/customizeDialog.py b/sw/qa/uitest/writer_tests3/customizeDialog.py
new file mode 100644
index 0000000000..c7b1a68e81
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/customizeDialog.py
@@ -0,0 +1,129 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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/.
+#
+
+import time
+
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import select_pos
+
+class ConfigureDialog(UITestCase):
+
+ def test_search_filter(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ with self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog", close_button="cancel") as xDialog:
+
+ xfunc = xDialog.getChild("functions")
+ xSearch = xDialog.getChild("searchEntry")
+
+ initialEntryCount = get_state_as_dict(xfunc)["Children"]
+ self.assertTrue(initialEntryCount != 0)
+
+ xSearch.executeAction("TYPE", mkPropertyValues({"TEXT":"format"}))
+
+ # Wait for the search/filter op to be completed
+ timeout = time.time() + 1
+ while time.time() < timeout:
+ filteredEntryCount = get_state_as_dict(xfunc)["Children"]
+ if filteredEntryCount != initialEntryCount:
+ break
+ time.sleep(0.1)
+
+ self.assertTrue(filteredEntryCount < initialEntryCount)
+
+ xSearch.executeAction("CLEAR", tuple())
+
+ # Wait for the search/filter op to be completed
+ timeout = time.time() + 1
+ while time.time() < timeout:
+ finalEntryCount = get_state_as_dict(xfunc)["Children"]
+ if finalEntryCount != filteredEntryCount:
+ break
+ time.sleep(0.1)
+
+ self.assertEqual(initialEntryCount, finalEntryCount)
+
+ def test_category_listbox(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ with self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog", close_button="cancel") as xDialog:
+
+ xFunc = xDialog.getChild("functions")
+ xCategory = xDialog.getChild("commandcategorylist")
+
+ initialEntryCount = get_state_as_dict(xFunc)["Children"]
+ self.assertTrue(initialEntryCount != 0)
+
+ select_pos(xCategory, "1")
+ filteredEntryCount = get_state_as_dict(xFunc)["Children"]
+ self.assertTrue(filteredEntryCount < initialEntryCount)
+
+ select_pos(xCategory, "0")
+ finalEntryCount = get_state_as_dict(xFunc)["Children"]
+ self.assertEqual(initialEntryCount, finalEntryCount)
+
+ def test_tdf133862(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ self.xUITest.executeCommand(".uno:InsertObjectStarMath")
+
+ # Without the fix in place, calling customize dialog after inserting
+ # a formula object would crash
+ with self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog", close_button="cancel"):
+ pass
+
+ def test_gear_button_menu(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog", close_button="cancel") as xDialog:
+
+ # Open the New Menu Dialog with id = 0
+ xmenugearbtn=xDialog.getChild("menugearbtn")
+ with self.ui_test.execute_blocking_action(
+ xmenugearbtn.executeAction, args=("OPENFROMLIST", mkPropertyValues({"POS": "0"})), close_button="cancel"):
+ pass
+
+ # Open the Rename Menu Dialog with id = 2
+ with self.ui_test.execute_blocking_action(
+ xmenugearbtn.executeAction, args=("OPENFROMLIST", mkPropertyValues({"POS": "2"})), close_button="cancel"):
+ pass
+
+ def test_add_remove_items(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:ConfigureDialog") as xDialog:
+ xTab = xDialog.getChild("tabcontrol")
+ select_pos(xTab, "0")
+
+ xFunctions = xDialog.getChild("functions")
+ xMenuContents = xDialog.getChild("menucontents")
+ xAddBtn = xDialog.getChild("add")
+ xRemoveBtn = xDialog.getChild("remove")
+
+ self.assertEqual("1", get_state_as_dict(xFunctions)['SelectionCount'])
+ sSelectEntryText = get_state_as_dict(xFunctions)['SelectEntryText']
+ nChildrenCount = int(get_state_as_dict(xMenuContents)['Children'])
+
+ self.assertEqual('true',get_state_as_dict(xAddBtn)['Enabled'])
+ self.assertEqual('false',get_state_as_dict(xRemoveBtn)['Enabled'])
+
+ xAddBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(nChildrenCount + 1, int(get_state_as_dict(xMenuContents)['Children']))
+ self.assertEqual(sSelectEntryText, get_state_as_dict(xMenuContents)['SelectEntryText'])
+
+ self.assertEqual('false',get_state_as_dict(xAddBtn)['Enabled'])
+ self.assertEqual('true',get_state_as_dict(xRemoveBtn)['Enabled'])
+
+ xRemoveBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(nChildrenCount, int(get_state_as_dict(xMenuContents)['Children']))
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/goToPage.py b/sw/qa/uitest/writer_tests3/goToPage.py
new file mode 100644
index 0000000000..812402f89c
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/goToPage.py
@@ -0,0 +1,39 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+
+class GoToPage_dialog(UITestCase):
+
+ def test_go_to_page(self):
+ with self.ui_test.load_file(get_url_for_data_file("3pages.odt")):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ with self.ui_test.execute_dialog_through_command(".uno:GotoPage") as xDialog:
+ xPageText = xDialog.getChild("page")
+ xPageText.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
+
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "2")
+
+ with self.ui_test.execute_dialog_through_command(".uno:GotoPage") as xDialog:
+ xPageText = xDialog.getChild("page")
+ xPageText.executeAction("TYPE", mkPropertyValues({"TEXT":"3a"}))
+
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "3")
+
+ # check cancel button
+ with self.ui_test.execute_dialog_through_command(".uno:GotoPage", close_button="cancel"):
+ pass
+
+ self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "3")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
diff --git a/sw/qa/uitest/writer_tests3/hyperlinkdialog.py b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py
new file mode 100644
index 0000000000..531b5f42a8
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/hyperlinkdialog.py
@@ -0,0 +1,151 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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
+import os
+import re
+from uitest.uihelper.common import get_state_as_dict, select_pos
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+#test Hyperlink dialog
+class HyperlinkDialog(UITestCase):
+
+ def test_hyperlink_dialog_vertical_tab(self):
+
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog", close_button="cancel") as xDialog:
+
+ # Test the vertical tab
+ xtab=xDialog.getChild("tabcontrol")
+ self.assertEqual(get_state_as_dict(xtab)["PageCount"], "4")
+
+ select_pos(xtab, "0")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~Internet")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "0")
+
+ select_pos(xtab, "1")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~Mail")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "1")
+
+ select_pos(xtab, "2")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~Document")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "2")
+
+ select_pos(xtab, "3")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPageTitel"], "~New Document")
+ self.assertEqual(get_state_as_dict(xtab)["CurrPagePos"], "3")
+
+
+
+ def test_insert_hyperlink(self):
+
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xMainWindow = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog") as xDialog:
+
+ # insert link
+ xtab=xDialog.getChild("tabcontrol")
+ select_pos(xtab, "0")
+
+ xtarget = xDialog.getChild("target")
+ xtarget.executeAction("TYPE", mkPropertyValues({"TEXT": "http://www.libreoffice.org/"}))
+ self.assertEqual(get_state_as_dict(xtarget)["Text"], "http://www.libreoffice.org/")
+
+ xindication = xDialog.getChild("indication")
+ xindication.executeAction("TYPE", mkPropertyValues({"TEXT": "link"}))
+ self.assertEqual(get_state_as_dict(xindication)["Text"], "link")
+
+
+ # Check that the link is added
+ xMainWindow = self.xUITest.getTopFocusWindow()
+ xedit = xMainWindow.getChild("writer_edit")
+ xedit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "4"}))
+ self.assertEqual(get_state_as_dict(xedit)["SelectedText"], "link")
+
+
+ def test_insert_hyperlink_without_scheme(self):
+
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xMainWindow = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog") as xDialog:
+
+ # insert link
+ xtab=xDialog.getChild("tabcontrol")
+ select_pos(xtab, "0")
+
+ xtarget = xDialog.getChild("target")
+ xtarget.executeAction("TYPE", mkPropertyValues({"TEXT": "www.libreoffice.org:80"}))
+
+ # Check that the link is added with http scheme
+ xMainWindow = self.xUITest.getTopFocusWindow()
+ xedit = xMainWindow.getChild("writer_edit")
+ xedit.executeAction("SELECT", mkPropertyValues({"START_POS": "0", "END_POS": "29"}))
+ self.assertEqual(get_state_as_dict(xedit)["SelectedText"], "http://www.libreoffice.org:80")
+
+ def test_tdf90496(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ with self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog", close_button="cancel") as xDialog:
+ # Select a random tab to check the preselection in the hyperlink dialog
+ xTab = xDialog.getChild("tabcontrol")
+ select_pos(xTab, "1")
+
+ with self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog", close_button="cancel") as xDialog:
+ xTab = xDialog.getChild("tabcontrol")
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '1' != '0'
+ # i.e. the last used tab in the hyperlink dialog was not remembered
+ self.assertEqual("1", get_state_as_dict(xTab)["CurrPagePos"])
+
+ def test_tdf146576_propose_clipboard_content(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ # Insert a sample URL
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"TEXT": "www.libreoffice.org"}))
+
+ # Copy URL and open the hyperlink dialog
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:Copy")
+ with self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog", close_button="cancel") as xDialog:
+ xTab = xDialog.getChild("tabcontrol")
+ select_pos(xTab, "0")
+ # Check if the content of the clipboard is proposed as URL in the hyperlink dialog
+ xTarget = xDialog.getChild("target")
+ self.assertEqual(get_state_as_dict(xTarget)["Text"].lower(), "http://www.libreoffice.org/")
+
+ def test_tdf141166(self):
+ # Skip this test for --with-help=html and --with-help=online, as that would fail with a
+ # DialogNotExecutedException("did not execute a dialog for a blocking action") thrown from
+ # the below execute_blocking_action call (and would leave behind the relevant HTML page
+ # opened in the user's default browser):
+ if os.getenv('ENABLE_HTMLHELP') == 'TRUE':
+ return
+ # Skip this test for --enable-xmlhelp, as that would fail with a
+ # "uno.com.sun.star.uno.RuntimeException: Could not find child with id: cancel" thrown from
+ # the below execute_blocking_action call, as it would open the "LibreOffice Help" window
+ # instead of the apparently expected "LibreOffice Help Not Installed" dialog that has a
+ # "Cancel" button:
+ if re.compile(r'XMLHELP\b').search(os.getenv('BUILD_TYPE')):
+ return
+
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:HyperlinkDialog", close_button="") as xDialog:
+ xHelp = xDialog.getChild("help")
+ xHelp.executeAction('FOCUS', tuple())
+
+ # Without the fix in place, this test would have crashed here
+ with self.ui_test.execute_blocking_action(xHelp.executeAction,
+ args=("CLICK", tuple()), close_button="cancel"):
+ pass
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/insertEndnote.py b/sw/qa/uitest/writer_tests3/insertEndnote.py
new file mode 100644
index 0000000000..46226499d4
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/insertEndnote.py
@@ -0,0 +1,36 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 type_text
+
+class insertEndnote(UITestCase):
+
+ def test_insert_endnote(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ self.xUITest.executeCommand(".uno:InsertEndnote")
+
+ type_text(xWriterEdit, "LibreOffice")
+
+ self.assertEqual(document.Endnotes[0].String, "LibreOffice")
+ self.assertEqual(document.Endnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Endnotes[0].String, "")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Endnotes.getCount(), 0)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Endnotes[0].String, "")
+ self.assertEqual(document.Endnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Endnotes[0].String, "LibreOffice")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/insertEnvelope.py b/sw/qa/uitest/writer_tests3/insertEnvelope.py
new file mode 100644
index 0000000000..eddce821b4
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/insertEnvelope.py
@@ -0,0 +1,38 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+
+#envaddresspage.ui
+
+class WriterInsertEnvelope(UITestCase):
+
+ def test_insert_envelope(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ with self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope", close_button="user") as xDialog:
+ xAddrTxt= xDialog.getChild("addredit")
+ xSenderTxt = xDialog.getChild("senderedit")
+
+ xAddrTxt.executeAction("SELECT", mkPropertyValues({"FROM": "1", "TO": "200"}))
+ xAddrTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xAddrTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"Address"}))
+
+ xSenderTxt.executeAction("SELECT", mkPropertyValues({"FROM": "1", "TO": "200"}))
+ xSenderTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSenderTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"Sender"}))
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope", close_button="cancel") as xDialog:
+ xAddrTxt= xDialog.getChild("addredit")
+ xSenderTxt = xDialog.getChild("senderedit")
+ self.assertEqual(get_state_as_dict(xAddrTxt)["Text"], "Address")
+ self.assertEqual(get_state_as_dict(xSenderTxt)["Text"], "Sender")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/insertFootEndnote.py b/sw/qa/uitest/writer_tests3/insertFootEndnote.py
new file mode 100644
index 0000000000..d9ca31f36e
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/insertFootEndnote.py
@@ -0,0 +1,62 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+
+class insertFootEndnote(UITestCase):
+
+ def test_insert_foot_endnote(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+
+#Automatic - Footnote
+ with self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog"):
+ pass
+
+ self.assertEqual(document.Footnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Footnotes.getCount(), 0)
+#Automatic - Endnote
+ with self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog") as xDialog:
+ xEndnote = xDialog.getChild("endnote")
+ xEndnote.executeAction("CLICK", tuple())
+
+ self.assertEqual(document.Endnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Endnotes.getCount(), 0)
+#Character - Footnote
+ with self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog") as xDialog:
+ xChar = xDialog.getChild("character")
+ xChar.executeAction("CLICK", tuple())
+ xCharentry = xDialog.getChild("characterentry")
+ xCharentry.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
+
+ self.assertEqual(document.Footnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Footnotes.getCount(), 0)
+
+#Character - Endnote
+ with self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog") as xDialog:
+ xChar = xDialog.getChild("character")
+ xChar.executeAction("CLICK", tuple())
+ xCharentry = xDialog.getChild("characterentry")
+ xCharentry.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
+
+ xEndnote = xDialog.getChild("endnote")
+ xEndnote.executeAction("CLICK", tuple())
+
+ self.assertEqual(document.Endnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Endnotes.getCount(), 0)
+
+#Cancel button
+ with self.ui_test.execute_dialog_through_command(".uno:InsertFootnoteDialog", close_button="cancel"):
+ pass
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/insertQrCodeGen.py b/sw/qa/uitest/writer_tests3/insertQrCodeGen.py
new file mode 100644
index 0000000000..241d87eccd
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/insertQrCodeGen.py
@@ -0,0 +1,36 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 type_text
+
+class insertQrCode(UITestCase):
+
+ def test_insert_qr_code(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertQrCode") as xDialog:
+
+ # Get elements in the Dialog Box
+ xURL = xDialog.getChild("edit_text")
+ xECC_Low = xDialog.getChild("button_low") #How radio button input is written in text.
+ xBorder = xDialog.getChild("edit_margin")
+
+ type_text(xURL, "www.libreoffice.org") #set the QR code
+ xECC_Low.executeAction("CLICK", tuple())
+ xBorder.executeAction("UP", tuple())
+ xBorder.executeAction("DOWN", tuple())
+
+ # check the QR code in the document
+ element = document.DrawPage.getByIndex(0)
+ self.assertEqual(element.BarCodeProperties.Payload, "www.libreoffice.org")
+ self.assertEqual(element.BarCodeProperties.ErrorCorrection, 1)
+ self.assertEqual(element.BarCodeProperties.Border, 1)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/insertSignatureLine.py b/sw/qa/uitest/writer_tests3/insertSignatureLine.py
new file mode 100644
index 0000000000..03e87daf2f
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/insertSignatureLine.py
@@ -0,0 +1,43 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+
+class insertSignatureLine(UITestCase):
+
+ def test_insert_signature_line(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+
+ # set the signature line
+ with self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine") as xDialog:
+
+ xName = xDialog.getChild("edit_name")
+ xTitle = xDialog.getChild("edit_title")
+ xEmail = xDialog.getChild("edit_email")
+ xComment = xDialog.getChild("checkbox_can_add_comments")
+ xInstructions = xDialog.getChild("edit_instructions")
+
+ xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
+ xTitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Title"}))
+ xEmail.executeAction("TYPE", mkPropertyValues({"TEXT":"Email"}))
+ xComment.executeAction("CLICK", tuple())
+ xInstructions.executeAction("TYPE", mkPropertyValues({"TEXT":"Instructions"}))
+
+ #check the signature Line in the document
+ element = document.DrawPage.getByIndex(0)
+ self.assertEqual(element.SignatureLineSuggestedSignerName, "Name")
+ self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(element.SignatureLineSuggestedSignerEmail, "Email")
+ self.assertEqual(element.SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(element.SignatureLineCanAddComment, False)
+ self.assertEqual(element.SignatureLineShowSignDate, True)
+ self.assertEqual(element.SignatureLineSigningInstructions, "Instructions")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/lineNumbering.py b/sw/qa/uitest/writer_tests3/lineNumbering.py
new file mode 100644
index 0000000000..8a505cc8d1
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/lineNumbering.py
@@ -0,0 +1,89 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import select_by_text
+from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import change_measurement_unit
+
+class WriterLineNumbering(UITestCase):
+
+ def test_line_numbering_dialog(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with change_measurement_unit(self, "Centimeter"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:LineNumberingDialog") as xDialog:
+ xshownumbering = xDialog.getChild("shownumbering")
+ xstyledropdown = xDialog.getChild("styledropdown")
+ xformatdropdown = xDialog.getChild("formatdropdown")
+ xpositiondropdown = xDialog.getChild("positiondropdown")
+ xspacingspin = xDialog.getChild("spacingspin")
+ xintervalspin = xDialog.getChild("intervalspin")
+ xtextentry = xDialog.getChild("textentry")
+ xlinesspin = xDialog.getChild("linesspin")
+ xblanklines = xDialog.getChild("blanklines")
+ xlinesintextframes = xDialog.getChild("linesintextframes")
+ xshowfooterheadernumbering = xDialog.getChild("showfooterheadernumbering")
+ xrestarteverynewpage = xDialog.getChild("restarteverynewpage")
+
+ xshownumbering.executeAction("CLICK", tuple())
+ select_by_text(xstyledropdown, "Bullets")
+ select_by_text(xformatdropdown, "A, B, C, ...")
+ select_by_text(xpositiondropdown, "Right")
+ xspacingspin.executeAction("UP", tuple())
+ xintervalspin.executeAction("UP", tuple())
+ xtextentry.executeAction("TYPE", mkPropertyValues({"TEXT":";"}))
+ xlinesspin.executeAction("UP", tuple())
+ xblanklines.executeAction("CLICK", tuple())
+ xlinesintextframes.executeAction("CLICK", tuple())
+ xshowfooterheadernumbering.executeAction("CLICK", tuple())
+ xrestarteverynewpage.executeAction("CLICK", tuple())
+
+ with self.ui_test.execute_dialog_through_command(".uno:LineNumberingDialog", close_button="cancel") as xDialog:
+ xshownumbering = xDialog.getChild("shownumbering")
+ xstyledropdown = xDialog.getChild("styledropdown")
+ xformatdropdown = xDialog.getChild("formatdropdown")
+ xpositiondropdown = xDialog.getChild("positiondropdown")
+ xspacingspin = xDialog.getChild("spacingspin")
+ xintervalspin = xDialog.getChild("intervalspin")
+ xtextentry = xDialog.getChild("textentry")
+ xlinesspin = xDialog.getChild("linesspin")
+ xblanklines = xDialog.getChild("blanklines")
+ xlinesintextframes = xDialog.getChild("linesintextframes")
+ xshowfooterheadernumbering = xDialog.getChild("showfooterheadernumbering")
+ xrestarteverynewpage = xDialog.getChild("restarteverynewpage")
+
+ self.assertEqual(get_state_as_dict(xshownumbering)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xstyledropdown)["SelectEntryText"], "Bullets")
+ self.assertEqual(get_state_as_dict(xformatdropdown)["SelectEntryText"], "A, B, C, ...")
+ self.assertEqual(get_state_as_dict(xpositiondropdown)["SelectEntryText"], "Right")
+ self.assertEqual(get_state_as_dict(xspacingspin)["Text"], "0.60 cm")
+ self.assertEqual(get_state_as_dict(xintervalspin)["Text"], "6")
+ self.assertEqual(get_state_as_dict(xtextentry)["Text"], ";")
+ self.assertEqual(get_state_as_dict(xlinesspin)["Text"], "4")
+ self.assertEqual(get_state_as_dict(xblanklines)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xlinesintextframes)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xshowfooterheadernumbering)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xrestarteverynewpage)["Selected"], "true")
+
+ def test_tdf86185(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:LineNumberingDialog", close_button="cancel") as xDialog:
+ xshownumbering = xDialog.getChild("shownumbering")
+ xformatdropdown = xDialog.getChild("formatdropdown")
+
+ xshownumbering.executeAction("CLICK", tuple())
+ itemFormat = ["1, 2, 3, ...", "A, B, C, ...", "a, b, c, ...", "I, II, III, ...", "i, ii, iii, ...", "A, .., AA, .., AAA, ..."]
+ for i in range(6):
+ select_by_text(xformatdropdown, itemFormat[i])
+ self.assertEqual(get_state_as_dict(xformatdropdown)["SelectEntryText"], itemFormat[i])
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/pageDialog.py b/sw/qa/uitest/writer_tests3/pageDialog.py
new file mode 100644
index 0000000000..7e95e08d85
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/pageDialog.py
@@ -0,0 +1,219 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 select_pos, get_state_as_dict
+from uitest.uihelper.common import change_measurement_unit
+from com.sun.star.awt.GradientStyle import LINEAR
+from com.sun.star.drawing.HatchStyle import SINGLE
+from com.sun.star.drawing.BitmapMode import REPEAT
+from com.sun.star.drawing.RectanglePoint import MIDDLE_MIDDLE
+
+
+class WriterPageDialog(UITestCase):
+
+ def click_button(self, dialog, button):
+ xButton = dialog.getChild(button)
+ xButton.executeAction("CLICK", tuple())
+
+ def check_default_area(self, btn):
+ document = self.ui_test.get_component()
+ if btn == 'btnnone':
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.BackColor, -1)
+ elif btn == 'btncolor':
+ self.assertEqual(
+ hex(document.StyleFamilies.PageStyles.Standard.BackColor), '0x729fcf')
+ self.assertEqual(
+ hex(document.StyleFamilies.PageStyles.Standard.FillColor), '0x729fcf')
+ self.assertEqual(
+ hex(document.StyleFamilies.PageStyles.Standard.FillColor), '0x729fcf')
+ elif btn == 'btngradient':
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillGradient.Style, LINEAR)
+ self.assertEqual(
+ hex(document.StyleFamilies.PageStyles.Standard.FillGradient.StartColor), '0xdde8cb')
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillGradient.Angle, 300)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillGradient.Border, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillGradient.XOffset, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillGradient.YOffset, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillGradient.StartIntensity, 100)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillGradient.EndIntensity, 100)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillGradientName, 'Pastel Bouquet')
+ elif btn == 'btnhatch':
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillHatch.Style, SINGLE )
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillHatch.Color, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillHatch.Distance, 102)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillHatch.Angle, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillHatchName, 'Black 0 Degrees')
+ elif btn == 'btnbitmap':
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapMode, REPEAT)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapPositionOffsetX, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapPositionOffsetY, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapRectanglePoint, MIDDLE_MIDDLE)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapStretch, False)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapTile, True)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapOffsetX, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapOffsetY, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapLogicalSize, True)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapSizeX, 1000)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapSizeY, 1000)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapName, 'Painted White')
+ elif btn == 'btnpattern':
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapMode, REPEAT)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapPositionOffsetX, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapPositionOffsetY, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapRectanglePoint, MIDDLE_MIDDLE)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapStretch, False)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapTile, True)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapOffsetX, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapOffsetY, 0)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapLogicalSize, True)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapSizeX, 1000)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapSizeY, 1000)
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.FillBitmapName, '5 Percent')
+
+ def test_area_tab(self):
+
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with change_measurement_unit(self, "Centimeter"):
+
+ buttons = ['btnbitmap', 'btncolor', 'btngradient', 'btnhatch', 'btnpattern']
+ for index, button in enumerate(buttons):
+
+ with self.ui_test.execute_dialog_through_command(".uno:PageDialog") as xDialog:
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "2")
+ self.click_button(xDialog, button)
+
+ self.check_default_area(button)
+
+ with self.ui_test.execute_dialog_through_command(".uno:PageDialog") as xDialog:
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "2")
+
+ self.click_button(xDialog, 'btnnone')
+
+ self.check_default_area('btnnone')
+
+
+ def test_paper_format(self):
+
+ lPaperFormat = ["A6", "A5", "A4", "A3", "B6 (ISO)", "B5 (ISO)", "B4 (ISO)", "Letter",
+ "Legal", "Long Bond", "Tabloid", "B6 (JIS)", "B5 (JIS)", "B4 (JIS)", "16 Kai",
+ "32 Kai", "Big 32 Kai", "User", "DL Envelope", "C6 Envelope", "C6/5 Envelope",
+ "C5 Envelope", "C4 Envelope", "#6¾ Envelope", "#7¾ (Monarch) Envelope",
+ "#9 Envelope", "#10 Envelope", "#11 Envelope", "#12 Envelope", "Japanese Postcard"]
+
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ for i in range(30):
+ with self.subTest(i=i):
+ with self.ui_test.execute_dialog_through_command(".uno:PageDialog") as xDialog:
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+ xFormatList = xDialog.getChild("comboPageFormat")
+ select_pos(xFormatList, str(i))
+
+ self.assertEqual(
+ get_state_as_dict(xFormatList)["SelectEntryText"], lPaperFormat[i])
+
+
+ def test_orientation(self):
+
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.IsLandscape, False)
+
+ with self.ui_test.execute_dialog_through_command(".uno:PageDialog") as xDialog:
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+ self.click_button(xDialog, 'radiobuttonLandscape')
+
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.IsLandscape, True)
+
+ with self.ui_test.execute_dialog_through_command(".uno:PageDialog") as xDialog:
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+ self.click_button(xDialog, 'radiobuttonPortrait')
+
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.IsLandscape, False)
+
+
+ def test_text_direction(self):
+
+ lTextDirection = ['Left-to-right (horizontal)', 'Right-to-left (horizontal)',
+ 'Right-to-left (vertical)', 'Left-to-right (vertical)']
+
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+
+ for i in range(4):
+ with self.subTest(i=i):
+ with self.ui_test.execute_dialog_through_command(".uno:PageDialog") as xDialog:
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ xTextDirectionList = xDialog.getChild("comboTextFlowBox")
+ select_pos(xTextDirectionList, str(i))
+
+ self.assertEqual(
+ get_state_as_dict(xTextDirectionList)["SelectEntryText"], lTextDirection[i])
+
+ self.assertEqual(
+ document.StyleFamilies.PageStyles.Standard.WritingMode, i)
+
+
+ def test_cancel_button_page_dialog(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:PageDialog", close_button="cancel"):
+ pass
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/save_readonly_with_password.py b/sw/qa/uitest/writer_tests3/save_readonly_with_password.py
new file mode 100644
index 0000000000..f14b74046d
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/save_readonly_with_password.py
@@ -0,0 +1,95 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from org.libreoffice.unotest import systemPathToFileUrl
+from uitest.uihelper.common import select_by_text
+from tempfile import TemporaryDirectory
+import os.path
+
+
+class save_readonly_with_password(UITestCase):
+
+ #Bug 144374 - Writer: FILESAVE to DOCX as read-only with additional password protection for editing not working
+ def test_save_to_docx(self):
+ with TemporaryDirectory() as tempdir:
+ xFilePath = os.path.join(tempdir, "tdf144374-tmp.docx")
+
+ with self.ui_test.create_doc_in_start_center("writer"):
+ # Save the document
+ with self.ui_test.execute_dialog_through_command(".uno:Save", close_button="") as xSaveDialog:
+ xFileName = xSaveDialog.getChild("file_name")
+ xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": xFilePath}))
+ xFileTypeCombo = xSaveDialog.getChild("file_type")
+ select_by_text(xFileTypeCombo, "Word 2010–365 Document (.docx)")
+ xPasswordCheckButton = xSaveDialog.getChild("password")
+ xPasswordCheckButton.executeAction("CLICK", tuple())
+ xOpen = xSaveDialog.getChild("open")
+
+ with self.ui_test.execute_dialog_through_action(xOpen, "CLICK", close_button="") as xPasswordDialog:
+ xReadonly = xPasswordDialog.getChild("readonly")
+ xReadonly.executeAction("CLICK", tuple())
+ xNewPassword = xPasswordDialog.getChild("newpassroEntry")
+ xNewPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "password"}))
+ xConfirmPassword = xPasswordDialog.getChild("confirmropassEntry")
+ xConfirmPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "password"}))
+
+ xOk = xPasswordDialog.getChild("ok")
+ # DOCX confirmation dialog is displayed
+ with self.ui_test.execute_dialog_through_action(xOk, "CLICK", close_button="save"):
+ pass
+
+ with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document:
+
+ self.assertTrue(document.isReadonly())
+
+ #Without the fix in place, this dialog wouldn't have been displayed
+ with self.ui_test.execute_dialog_through_command(".uno:EditDoc") as xDialog:
+ xPassword = xDialog.getChild("newpassEntry")
+ xPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "password"}))
+
+ self.assertFalse(document.isReadonly())
+
+ def test_save_to_odt(self):
+
+ with TemporaryDirectory() as tempdir:
+ xFilePath = os.path.join(tempdir, "readonly_with_password_tmp.odt")
+
+ with self.ui_test.create_doc_in_start_center("writer"):
+ # Save the document
+ with self.ui_test.execute_dialog_through_command(".uno:Save", close_button="") as xSaveDialog:
+ xFileName = xSaveDialog.getChild("file_name")
+ xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": xFilePath}))
+ xPasswordCheckButton = xSaveDialog.getChild("password")
+ xPasswordCheckButton.executeAction("CLICK", tuple())
+ xOpen = xSaveDialog.getChild("open")
+
+ with self.ui_test.execute_dialog_through_action(xOpen, "CLICK") as xPasswordDialog:
+ xReadonly = xPasswordDialog.getChild("readonly")
+ xReadonly.executeAction("CLICK", tuple())
+ xNewPassword = xPasswordDialog.getChild("newpassroEntry")
+ xNewPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "password"}))
+ xConfirmPassword = xPasswordDialog.getChild("confirmropassEntry")
+ xConfirmPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "password"}))
+
+ with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document:
+
+ self.assertTrue(document.isReadonly())
+
+ with self.ui_test.execute_dialog_through_command(".uno:EditDoc") as xDialog:
+ xPassword = xDialog.getChild("newpassEntry")
+ xPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "password"}))
+
+ self.assertFalse(document.isReadonly())
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/sort.py b/sw/qa/uitest/writer_tests3/sort.py
new file mode 100644
index 0000000000..e34588afa6
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/sort.py
@@ -0,0 +1,60 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import select_by_text
+from uitest.uihelper.common import type_text
+
+class WriterSort(UITestCase):
+
+ def test_sort(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ type_text(xWriterEdit, "a")
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ type_text(xWriterEdit, "c")
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ type_text(xWriterEdit, "v")
+
+ self.xUITest.executeCommand(".uno:SelectAll") #select whole text
+ #Tools - Sort
+ with self.ui_test.execute_dialog_through_command(".uno:SortDialog") as xDialog:
+ xDown = xDialog.getChild("down1")
+ xDown.executeAction("CLICK", tuple())
+ #check
+ self.assertEqual(document.Text.String[0:1], "v")
+
+
+ def test_sort_numerical(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ type_text(xWriterEdit, "1;2;3")
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ type_text(xWriterEdit, "2;8;3")
+
+ self.xUITest.executeCommand(".uno:SelectAll") #select whole text
+ #Tools - Sort
+ with self.ui_test.execute_dialog_through_command(".uno:SortDialog") as xDialog:
+ xDown = xDialog.getChild("down1")
+ xtypelb1 = xDialog.getChild("typelb1")
+ xcharacter = xDialog.getChild("character")
+ xseparator = xDialog.getChild("separator")
+ xDown.executeAction("CLICK", tuple())
+ select_by_text(xtypelb1, "Numerical")
+ xcharacter.executeAction("CLICK", tuple())
+ xseparator.executeAction("TYPE", mkPropertyValues({"TEXT":";"}))
+ #check
+ self.assertEqual(document.Text.String[0:5], "2;8;3")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/specialCharacter.py b/sw/qa/uitest/writer_tests3/specialCharacter.py
new file mode 100644
index 0000000000..02a105835c
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/specialCharacter.py
@@ -0,0 +1,97 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import select_pos
+
+# specialcharacters.ui
+class specialCharacter(UITestCase):
+
+ def test_tdf56363(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ # Insert a font including a font feature into the font name combobox
+ xFontName = xWriterDoc.getChild("fontnamecombobox")
+ fontName = get_state_as_dict(xFontName)["Text"]
+ xFontName.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
+ xFontName.executeAction("TYPE", mkPropertyValues({"TEXT": fontName + ":smcp"}))
+ xFontName.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+
+ # Open special character dialog and check selected font name
+ with self.ui_test.execute_dialog_through_command(".uno:InsertSymbol", close_button="cancel") as xDialog:
+ xComboFont = xDialog.getChild("fontlb")
+ # Without the fix in place, no font would be selected
+ self.assertEqual(get_state_as_dict(xComboFont)["Text"], fontName)
+
+ def test_special_character(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertSymbol", close_button="cancel") as xDialog:
+ xCharSet = xDialog.getChild("showcharset") # default charset
+
+ xCharSet.executeAction("SELECT", mkPropertyValues({"COLUMN": "1", "ROW": "4"})) # digit 4 selected
+
+ xHexText = xDialog.getChild("hexvalue")
+ xDecText = xDialog.getChild("decimalvalue")
+
+ self.assertEqual(get_state_as_dict(xHexText)["Text"], "34") # check the values Hex and decimal
+ self.assertEqual(get_state_as_dict(xDecText)["Text"], "52")
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertSymbol", close_button="cancel") as xDialog:
+
+ xComboFont = xDialog.getChild("fontlb")
+ select_pos(xComboFont, "0") # select font
+ xComboFont2 = xDialog.getChild("subsetlb")
+ select_pos(xComboFont2, "0") # select font subset
+
+ xSearchText = xDialog.getChild("search") # test search textBox
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "d"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "i"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "g"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "i"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": " "}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "f"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "o"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "u"}))
+ xSearchText.executeAction("TYPE", mkPropertyValues({"TEXT": "r"}))
+
+ # works locally and linux_gcc_release_64, but fails at linux_clang_dbgutil_64.
+ # Markus: Actually after a round of debugging I think the problem is actually that the test depends on the used font.
+ # Therefore, if the font is not available or not selected by default the test fails.
+ # xCharSet = xDialog.getChild("searchcharset") #another charset -> search charset
+ # xCharSet.executeAction("SELECT", mkPropertyValues({"COLUMN": "0", "ROW": "0"})) #digit 4 selected, we have only one result;
+ # sleep(1) #try sleep here
+ # xCharSet.executeAction("SELECT", mkPropertyValues({"COLUMN": "0", "ROW": "0"})) #try it twice, because it works at local,but fail on gerrit
+ ##gerrit:self.assertEqual(get_state_as_dict(xHexText)["Text"], "34") # check the values for digit 4; AssertionError: '1' != '34'
+
+ # xHexText = xDialog.getChild("hexvalue")
+ # xDecText = xDialog.getChild("decimalvalue")
+ # self.assertEqual(get_state_as_dict(xHexText)["Text"], "34") # check the values for digit 4
+ # self.assertEqual(get_state_as_dict(xDecText)["Text"], "52")
+
+ # xAddFavBtn = xDialog.getChild("favbtn")
+ # xAddFavBtn.executeAction("CLICK", tuple()) # Add to favorites button
+
+ # xInsrBtn = xDialog.getChild("insert")
+ # xInsrBtn.executeAction("CLICK", tuple()) # Insert to document
+
+ # self.assertEqual(document.Text.String[0:1], "4") # check inserted character
+
+ # self.xUITest.executeCommand(".uno:Undo")
+ # self.xUITest.executeCommand(".uno:Redo") #undo, redo
+
+ # self.assertEqual(document.Text.String[0:1], "4") # check inserted character after undo, redo
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/tdf124088.py b/sw/qa/uitest/writer_tests3/tdf124088.py
new file mode 100755
index 0000000000..6ff65dad76
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/tdf124088.py
@@ -0,0 +1,33 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 type_text, get_state_as_dict
+
+class tdf124088(UITestCase):
+
+ def test_tdf124088_propose_autotext(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ # Insert a random text greater than 25 characters and select it
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ type_text(xWriterEdit, "This is a sample paragraph")
+ self.xUITest.executeCommand(".uno:SelectAll")
+
+ # Open auto text dialog and check proposed text
+ with self.ui_test.execute_dialog_through_command(".uno:EditGlossary") as xEditGlossaryDlg:
+ xName = xEditGlossaryDlg.getChild("name")
+ self.assertEqual(get_state_as_dict(xName)["Text"], "This is a sample")
+ # Click on a group entry, proposed auto text should remain
+ xCategory = xEditGlossaryDlg.getChild("category")
+ xMyAutoText = xCategory.getChild("2")
+ xMyAutoText.executeAction("SELECT", tuple())
+ self.assertEqual(get_state_as_dict(xName)["Text"], "This is a sample")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests3/tdf79236.py b/sw/qa/uitest/writer_tests3/tdf79236.py
new file mode 100644
index 0000000000..d7b59da19f
--- /dev/null
+++ b/sw/qa/uitest/writer_tests3/tdf79236.py
@@ -0,0 +1,118 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# 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 type_text
+
+class tdf79236(UITestCase):
+
+ def test_paragraph(self):
+
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ type_text(xWriterEdit, "Test for tdf79236")
+
+
+ self.xUITest.executeCommand(".uno:SelectAll")
+
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 0)
+
+ self.assertEqual(document.CurrentSelection.getByIndex(0).String, "Test for tdf79236")
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xParagraphDlg:
+
+
+
+ xLeftSpnBtn = xParagraphDlg.getChild("spinED_LEFTINDENT")
+ for _ in range(0,20):
+ xLeftSpnBtn.executeAction("UP", tuple())
+
+ xRightSpnBtn = xParagraphDlg.getChild("spinED_RIGHTINDENT")
+ for _ in range(0,20):
+ xRightSpnBtn.executeAction("UP", tuple())
+
+
+ xLineSpnBtn = xParagraphDlg.getChild("spinED_FLINEINDENT")
+ for _ in range(0,20):
+ xLineSpnBtn.executeAction("UP", tuple())
+
+
+ xBottomSpnBtn = xParagraphDlg.getChild("spinED_BOTTOMDIST")
+ for _ in range(0,20):
+ xBottomSpnBtn.executeAction("UP", tuple())
+
+ xTopSpnBtn = xParagraphDlg.getChild("spinED_TOPDIST")
+ for _ in range(0,20):
+ xTopSpnBtn.executeAction("UP", tuple())
+
+
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 1016)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 1016)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 1016)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 1016)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 1016)
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xParagraphDlg:
+
+
+ xLeftSpnBtn = xParagraphDlg.getChild("spinED_LEFTINDENT")
+ for _ in range(0,20):
+ xLeftSpnBtn.executeAction("DOWN", tuple())
+
+ xRightSpnBtn = xParagraphDlg.getChild("spinED_RIGHTINDENT")
+ for _ in range(0,20):
+ xRightSpnBtn.executeAction("DOWN", tuple())
+
+
+ xLineSpnBtn = xParagraphDlg.getChild("spinED_FLINEINDENT")
+ for _ in range(0,20):
+ xLineSpnBtn.executeAction("DOWN", tuple())
+
+ xBottomSpnBtn = xParagraphDlg.getChild("spinED_BOTTOMDIST")
+ for _ in range(0,20):
+ xBottomSpnBtn.executeAction("DOWN", tuple())
+
+ xTopSpnBtn = xParagraphDlg.getChild("spinED_TOPDIST")
+ for _ in range(0,20):
+ xTopSpnBtn.executeAction("DOWN", tuple())
+
+
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 0)
+
+ self.xUITest.executeCommand(".uno:Undo")
+
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 1016)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 1016)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 1016)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 1016)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 1016)
+
+ self.xUITest.executeCommand(".uno:Undo")
+
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaLeftMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaRightMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaTopMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaBottomMargin, 0)
+ self.assertEqual(document.CurrentSelection.getByIndex(0).ParaFirstLineIndent, 0)
+
+ self.assertEqual(document.CurrentSelection.getByIndex(0).String, "Test for tdf79236")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: