summaryrefslogtreecommitdiffstats
path: root/sw/qa/uitest/writer_tests2
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sw/qa/uitest/writer_tests2/asianPhoneticGuide.py38
-rw-r--r--sw/qa/uitest/writer_tests2/bookmark.py94
-rw-r--r--sw/qa/uitest/writer_tests2/deleteAllComments.py50
-rw-r--r--sw/qa/uitest/writer_tests2/deleteFootnotes.py46
-rw-r--r--sw/qa/uitest/writer_tests2/documentProperties.py123
-rw-r--r--sw/qa/uitest/writer_tests2/exchangeDatabase.py45
-rw-r--r--sw/qa/uitest/writer_tests2/fontworks.py38
-rw-r--r--sw/qa/uitest/writer_tests2/formatBulletsNumbering.py270
-rw-r--r--sw/qa/uitest/writer_tests2/formatCharacter.py246
-rw-r--r--sw/qa/uitest/writer_tests2/formatParagraph.py541
-rw-r--r--sw/qa/uitest/writer_tests2/horizontalLine.py35
-rw-r--r--sw/qa/uitest/writer_tests2/insertFootnote.py36
-rw-r--r--sw/qa/uitest/writer_tests2/pasteSpecial.py39
-rw-r--r--sw/qa/uitest/writer_tests2/tdf116474.py47
-rw-r--r--sw/qa/uitest/writer_tests2/tdf146375.py76
15 files changed, 1724 insertions, 0 deletions
diff --git a/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py b/sw/qa/uitest/writer_tests2/asianPhoneticGuide.py
new file mode 100644
index 000000000..7302dd89e
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/asianPhoneticGuide.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 select_by_text
+
+class asianPhoneticGuide(UITestCase):
+
+ def test_asian_phonetic_guide(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_modeless_dialog_through_command(".uno:RubyDialog", close_button="close") as xDialog:
+
+ xLeft1ED = xDialog.getChild("Left1ED")
+ xRight1ED = xDialog.getChild("Right1ED")
+ xadjustlb = xDialog.getChild("adjustlb")
+ xpositionlb = xDialog.getChild("positionlb")
+ xstylelb = xDialog.getChild("stylelb")
+
+ xLeft1ED.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
+ xRight1ED.executeAction("TYPE", mkPropertyValues({"TEXT":"w"}))
+ select_by_text(xadjustlb, "Right")
+ select_by_text(xpositionlb, "Right")
+ select_by_text(xstylelb, "Quotation")
+
+ xApplyBtn = xDialog.getChild("ok")
+ xApplyBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(document.Text.String[0:1], "a")
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/bookmark.py b/sw/qa/uitest/writer_tests2/bookmark.py
new file mode 100644
index 000000000..62cf57735
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/bookmark.py
@@ -0,0 +1,94 @@
+# -*- 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, type_text
+from libreoffice.uno.propertyvalue import mkPropertyValues
+#test bookmark dialog
+class bookmarkDialog(UITestCase):
+
+ def test_bookmark_dialog(self):
+
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertBookmark", close_button="insert"):
+ pass
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertBookmark", close_button="insert") as xBookDlg:
+ xBmk = xBookDlg.getChild("bookmarks")
+ self.assertEqual(get_state_as_dict(xBmk)["VisibleCount"], "1") #check for 1st bookmark exist
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertBookmark", close_button="close"):
+ pass
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertBookmark", close_button="close") as xBookDlg:
+ xBmk = xBookDlg.getChild("bookmarks")
+ self.assertEqual(get_state_as_dict(xBmk)["VisibleCount"], "2") #check for 2 bookmarks
+
+#now delete one bookmark
+ with self.ui_test.execute_dialog_through_command(".uno:InsertBookmark", close_button="close") as xBookDlg:
+ xBmk = xBookDlg.getChild("bookmarks")
+ xSecondListEntry = xBmk.getChild("1") # select second bookmark
+ xSecondListEntry.executeAction("SELECT", tuple())
+ xDelBtn = xBookDlg.getChild("delete")
+ xDelBtn.executeAction("CLICK", tuple()) # delete one bookmark
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertBookmark", close_button="close") as xBookDlg:
+ xBmk2 = xBookDlg.getChild("bookmarks")
+ self.assertEqual(get_state_as_dict(xBmk2)["VisibleCount"], "1") #check for 1 bookmark
+
+
+ def test_bookmark_dialog_rename(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertBookmark", close_button="insert"):
+ pass
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertBookmark", close_button="close") as xBookDlg:
+ xBmk = xBookDlg.getChild("bookmarks")
+ xFirstListEntry = xBmk.getChild("0") # select first bookmark
+ xFirstListEntry.executeAction("SELECT", tuple())
+ xRenameBtn = xBookDlg.getChild("rename")
+
+ with self.ui_test.execute_blocking_action(xRenameBtn.executeAction, args=('CLICK', ())) as dialog:
+ xNewNameTxt=dialog.getChild("entry")
+ xNewNameTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"newname"}))
+
+ x1stListEntry = xBmk.getChild("O") # select first bookmark - name "newname"
+ x1stListEntry.executeAction("SELECT", tuple())
+
+ self.assertEqual(get_state_as_dict(x1stListEntry)["Text"], "1\tnewname\t\tNo\t") #check the new name "newname"
+
+
+
+ def test_bookmark_dialog_goto(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertBookmark", close_button="insert"):
+ pass
+
+ type_text(xWriterEdit, "Test for bookmark")
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ type_text(xWriterEdit, "Test2 for bookmark")
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertBookmark", close_button="insert"):
+ pass
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertBookmark", close_button="close") as xBookDlg:
+ xBmk = xBookDlg.getChild("bookmarks")
+ xFirstListEntry = xBmk.getChild("0") # select first bookmark
+ xFirstListEntry.executeAction("SELECT", tuple())
+ xGoToBtn = xBookDlg.getChild("goto")
+ xGoToBtn.executeAction("CLICK", tuple()) # goto 1st bookmark
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/deleteAllComments.py b/sw/qa/uitest/writer_tests2/deleteAllComments.py
new file mode 100644
index 000000000..e655a2f8a
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/deleteAllComments.py
@@ -0,0 +1,50 @@
+# -*- 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 DeleteAllComments(UITestCase):
+
+ def test_comments_delete(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 LibreOffice")
+
+
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:InsertAnnotation")
+ cursor = document.getCurrentController().getViewCursor()
+ type_text(xWriterEdit, "EEEEE")
+ self.xUITest.executeCommand(".uno:InsertAnnotation")
+ self.xUITest.executeCommand(".uno:DeleteAllNotes")
+ self.assertEqual(document.Text.String[0:4], "Test")
+
+
+ def test_comment_trackchanges(self):
+#tdf111524
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ type_text(xWriterEdit, "foo")
+
+
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:InsertAnnotation")
+ self.xUITest.executeCommand(".uno:TrackChanges")
+ self.xUITest.executeCommand(".uno:DeleteAllNotes")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/deleteFootnotes.py b/sw/qa/uitest/writer_tests2/deleteFootnotes.py
new file mode 100644
index 000000000..162cc7d3e
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/deleteFootnotes.py
@@ -0,0 +1,46 @@
+# -*- 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
+from libreoffice.uno.propertyvalue import mkPropertyValues
+import time
+
+
+class tdf150457(UITestCase):
+
+ def test_delete_footnotes(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")
+ self.xUITest.executeCommand(".uno:InsertFootnote")
+ type_text(xWriterEdit, "abc")
+ self.assertEqual(document.Footnotes[0].String, "abc")
+ self.assertEqual(document.Footnotes.getCount(), 1)
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "PAGEUP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ type_text(xWriterEdit, "d")
+
+ self.xUITest.executeCommand(".uno:InsertFootnote")
+ type_text(xWriterEdit, "def")
+ self.assertEqual(document.Footnotes[1].String, "def")
+ self.assertEqual(document.Footnotes.getCount(), 2)
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "HOME"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "SHIFT+DOWN"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "PAGEUP"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"}))
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/documentProperties.py b/sw/qa/uitest/writer_tests2/documentProperties.py
new file mode 100644
index 000000000..5b1eeb583
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/documentProperties.py
@@ -0,0 +1,123 @@
+# -*- 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
+
+class documentProperties(UITestCase):
+
+ def assert_custom_properties(self, dialog, bIsFirstItemVisible):
+ for i in range(6):
+ aExpected = 'false'
+ if bIsFirstItemVisible and i == 0:
+ aExpected = 'true'
+ xNameBox = dialog.getChild("namebox" + str(i + 1))
+ xTypeBox = dialog.getChild("typebox" + str(i + 1))
+ xValueEdit = dialog.getChild("valueedit" + str(i + 1))
+ xRemoveBtn = dialog.getChild("remove" + str(i + 1))
+ self.assertEqual(aExpected, get_state_as_dict(xNameBox)['ReallyVisible'])
+ self.assertEqual(aExpected, get_state_as_dict(xTypeBox)['ReallyVisible'])
+ self.assertEqual(aExpected, get_state_as_dict(xValueEdit)['ReallyVisible'])
+ self.assertEqual(aExpected, get_state_as_dict(xRemoveBtn)['ReallyVisible'])
+
+ def test_open_documentProperties_writer(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ with self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties") as xDialog:
+ xResetBtn = xDialog.getChild("reset")
+ xResetBtn.executeAction("CLICK", tuple())
+
+ xUserDataCheckbox = xDialog.getChild("userdatacb") # apply user data
+ xUserDataCheckbox.executeAction("CLICK", tuple())
+ xThumbSaveCheckbox = xDialog.getChild("thumbnailsavecb") # save preview image with document
+ xThumbSaveCheckbox.executeAction("CLICK", tuple())
+
+#digital signature
+ xDigSignBtn = xDialog.getChild("signature")
+
+ with self.ui_test.execute_blocking_action(xDigSignBtn.executeAction, args=('CLICK', ()), close_button="no"):
+ pass
+
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1") #tab Description
+
+ xTitleText = xDialog.getChild("title")
+ xTitleText.executeAction("TYPE", mkPropertyValues({"TEXT":"Title text"}))
+ xSubjectText = xDialog.getChild("subject")
+ xSubjectText.executeAction("TYPE", mkPropertyValues({"TEXT":"Subject text"}))
+ xKeywordsText = xDialog.getChild("keywords")
+ xKeywordsText.executeAction("TYPE", mkPropertyValues({"TEXT":"Keywords text"}))
+ xCommentsText = xDialog.getChild("comments")
+ xCommentsText.executeAction("TYPE", mkPropertyValues({"TEXT":"Comments text"}))
+
+
+#Font tab
+ select_pos(xTabs, "4") #tab Fonts
+ xFontEmbedCheckbox = xDialog.getChild("embedFonts")
+ xFontEmbedCheckbox.executeAction("CLICK", tuple())
+
+#Security tab
+ select_pos(xTabs, "3") #tab Security
+ xReadOnlyCheckbox = xDialog.getChild("readonly")
+ xReadOnlyCheckbox.executeAction("CLICK", tuple())
+ xRecordChangesCheckbox = xDialog.getChild("recordchanges")
+ xRecordChangesCheckbox.executeAction("CLICK", tuple())
+ xProtectBtn = xDialog.getChild("protect")
+
+ with self.ui_test.execute_blocking_action(xProtectBtn.executeAction, args=('CLICK', ())) as dialog:
+ xPasswordText = dialog.getChild("pass1ed")
+ xPasswordText.executeAction("TYPE", mkPropertyValues({"TEXT":"password"}))
+ xConfirmText = dialog.getChild("confirm1ed")
+ xConfirmText.executeAction("TYPE", mkPropertyValues({"TEXT":"password"}))
+
+ select_pos(xTabs, "2") #tab Custom properties
+
+ self.assert_custom_properties(xDialog, False)
+
+ xAddBtn = xDialog.getChild("add")
+ xAddBtn.executeAction("CLICK", tuple())
+
+ self.assert_custom_properties(xDialog, True)
+
+ xRemoveBtn = xDialog.getChild("remove1")
+ xRemoveBtn.executeAction("CLICK", tuple())
+
+ self.assert_custom_properties(xDialog, False)
+
+ select_pos(xTabs, "5") #tab Statistics
+ xUpdateBtn = xDialog.getChild("update")
+ xUpdateBtn.executeAction("CLICK", tuple())
+
+#now open the dialog again and read the properties
+ with self.ui_test.execute_dialog_through_command(".uno:SetDocumentProperties", close_button="cancel") as xDialog:
+ xTitleText = xDialog.getChild("title")
+ xSubjectText = xDialog.getChild("subject")
+ xKeywordsText = xDialog.getChild("keywords")
+ xCommentsText = xDialog.getChild("comments")
+ xReadOnlyCheckbox = xDialog.getChild("readonly")
+ xRecordChangesCheckbox = xDialog.getChild("recordchanges")
+ xFontEmbedCheckbox = xDialog.getChild("embedFonts")
+ xUserDataCheckbox = xDialog.getChild("userdatacb")
+ xThumbSaveCheckbox = xDialog.getChild("thumbnailsavecb")
+ self.assertEqual(get_state_as_dict(xTitleText)["Text"], "Title text")
+ self.assertEqual(get_state_as_dict(xSubjectText)["Text"], "Subject text")
+ self.assertEqual(get_state_as_dict(xKeywordsText)["Text"], "Keywords text")
+ self.assertEqual(get_state_as_dict(xReadOnlyCheckbox)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xRecordChangesCheckbox)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xReadOnlyCheckbox)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xFontEmbedCheckbox)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xUserDataCheckbox)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xThumbSaveCheckbox)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xCommentsText)["Text"], "Comments text")
+ xResetBtn = xDialog.getChild("reset")
+ xResetBtn.executeAction("CLICK", tuple())
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/exchangeDatabase.py b/sw/qa/uitest/writer_tests2/exchangeDatabase.py
new file mode 100644
index 000000000..f234dc3a2
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/exchangeDatabase.py
@@ -0,0 +1,45 @@
+# -*- 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
+
+class exchangeDB(UITestCase):
+
+ def test_exchange_database(self):
+
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField", close_button="close"):
+ pass
+
+
+ def test_exchange_database2(self):
+
+ with self.ui_test.create_doc_in_start_center("writer"):
+
+ with self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField") as xExDBDlg:
+ xTreelist = xExDBDlg.getChild("availablelb")
+
+ xLabeldb = xExDBDlg.getChild("dbnameft")
+ self.assertEqual(get_state_as_dict(xLabeldb)["Text"], "[None]")
+
+ xTreeEntry = xTreelist.getChild('0') #Available Databases
+ xTreeEntry.executeAction("EXPAND", tuple()) #Click on the Bibliography
+ xTreeEntry.executeAction("COLLAPSE", tuple())
+ xTreeEntry.executeAction("EXPAND", tuple())
+ xTreeEntry2 = xTreeEntry.getChild('0') #Available Databases
+ xTreeEntry2.executeAction("SELECT", tuple()) #Click on the biblio
+
+ with self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField", close_button="close") as xExDBDlg:
+ xLabeldb = xExDBDlg.getChild("dbnameft")
+ self.assertEqual(get_state_as_dict(xLabeldb)["Text"], "Bibliography.biblio")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/fontworks.py b/sw/qa/uitest/writer_tests2/fontworks.py
new file mode 100644
index 000000000..a70fc297b
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/fontworks.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 uitest.uihelper.common import get_state_as_dict
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+#test FontWorks dialog
+class fontWorksDialog(UITestCase):
+
+ def test_fontwork_selector(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontworkGalleryFloater", close_button="cancel") as xDialog:
+ FontWorkSelector = xDialog.getChild("ctlFavoriteswin")
+ # Select element with id (3)
+ element3 = FontWorkSelector.getChild("2")
+ element3.executeAction("SELECT", mkPropertyValues({}))
+ self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemPos"], "2")
+ self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemId"], "3")
+ self.assertEqual(get_state_as_dict(FontWorkSelector)["VisibleCount"], "36")
+
+ # Select element with id (7)
+ element7 = FontWorkSelector.getChild("6")
+ element7.executeAction("SELECT", mkPropertyValues({}))
+ self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemPos"], "6")
+ self.assertEqual(get_state_as_dict(FontWorkSelector)["SelectedItemId"], "7")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
new file mode 100644
index 000000000..4892dde49
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
@@ -0,0 +1,270 @@
+# -*- 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import select_by_text
+from uitest.uihelper.common import change_measurement_unit
+
+class formatBulletsNumbering(UITestCase):
+
+ def test_bullets_and_numbering_dialog_tab_position(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ change_measurement_unit(self, "Millimeter")
+
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xalignedatmf = xDialog.getChild("alignedatmf")
+ xnum2alignlb = xDialog.getChild("num2alignlb")
+ xatmf = xDialog.getChild("atmf")
+ xindentatmf = xDialog.getChild("indentatmf")
+
+ xalignedatmf.executeAction("UP", tuple())
+ select_by_text(xnum2alignlb, "Centered")
+ xatmf.executeAction("UP", tuple())
+ xindentatmf.executeAction("UP", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xalignedatmf = xDialog.getChild("alignedatmf")
+ xnum2alignlb = xDialog.getChild("num2alignlb")
+ xatmf = xDialog.getChild("atmf")
+ xindentatmf = xDialog.getChild("indentatmf")
+
+ self.assertEqual(get_state_as_dict(xalignedatmf)["Text"], "6.5 mm")
+ self.assertEqual(get_state_as_dict(xnum2alignlb)["SelectEntryText"], "Centered")
+ self.assertEqual(get_state_as_dict(xatmf)["Text"], "12.8 mm")
+ self.assertEqual(get_state_as_dict(xindentatmf)["Text"], "12.8 mm")
+
+
+
+ def test_bullets_and_numbering_dialog_tab_position2(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
+ select_by_text(xnumfollowedbylb, "Space")
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xnumfollowedbylb = xDialog.getChild("numfollowedbylb")
+ self.assertEqual(get_state_as_dict(xnumfollowedbylb)["SelectEntryText"], "Space")
+
+
+
+ def test_bullets_and_numbering_dialog_tab_customize(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+ xnumfmtlb = xDialog.getChild("numfmtlb")
+ xstartat = xDialog.getChild("startat")
+ xcharstyle = xDialog.getChild("charstyle")
+ xprefix = xDialog.getChild("prefix")
+ xsuffix = xDialog.getChild("suffix")
+ xallsame = xDialog.getChild("allsame")
+
+ select_by_text(xnumfmtlb, "A, B, C, ...")
+ xstartat.executeAction("UP", tuple())
+ select_by_text(xcharstyle, "Bullets")
+ xprefix.executeAction("TYPE", mkPropertyValues({"TEXT":"o"}))
+ xsuffix.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xsuffix.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
+ xallsame.executeAction("CLICK", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+ xnumfmtlb = xDialog.getChild("numfmtlb")
+ xstartat = xDialog.getChild("startat")
+ xcharstyle = xDialog.getChild("charstyle")
+ xprefix = xDialog.getChild("prefix")
+ xsuffix = xDialog.getChild("suffix")
+ xallsame = xDialog.getChild("allsame")
+
+ self.assertEqual(get_state_as_dict(xnumfmtlb)["SelectEntryText"], "A, B, C, ...")
+ self.assertEqual(get_state_as_dict(xstartat)["Text"], "2")
+ self.assertEqual(get_state_as_dict(xcharstyle)["SelectEntryText"], "Bullets")
+ self.assertEqual(get_state_as_dict(xprefix)["Text"], "o")
+ self.assertEqual(get_state_as_dict(xsuffix)["Text"], "a")
+ self.assertEqual(get_state_as_dict(xallsame)["Selected"], "true")
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="user") as xDialog:
+ pass
+
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+ xnumfmtlb = xDialog.getChild("numfmtlb")
+ xstartat = xDialog.getChild("startat")
+ xcharstyle = xDialog.getChild("charstyle")
+ xprefix = xDialog.getChild("prefix")
+ xsuffix = xDialog.getChild("suffix")
+ xallsame = xDialog.getChild("allsame")
+
+ self.assertEqual(get_state_as_dict(xnumfmtlb)["SelectEntryText"], "1, 2, 3, ...")
+ self.assertEqual(get_state_as_dict(xstartat)["Text"], "1")
+ self.assertEqual(get_state_as_dict(xcharstyle)["SelectEntryText"], "None")
+ self.assertEqual(get_state_as_dict(xprefix)["Text"], "")
+ self.assertEqual(get_state_as_dict(xsuffix)["Text"], ".")
+ self.assertEqual(get_state_as_dict(xallsame)["Selected"], "false")
+
+
+
+ def test_bullets_and_numbering_tab_move(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ change_measurement_unit(self, "Millimeter")
+
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) #TAB to move indent right
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue2 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+ self.assertEqual(indentValue < indentValue2 , True)
+
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"}))
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue3 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+ self.assertEqual(indentValue == indentValue3 , True)
+
+
+ def test_bullets_and_numbering_button_move(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ change_measurement_unit(self, "Millimeter")
+
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+
+
+ self.xUITest.executeCommand(".uno:DecrementSubLevels")
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue2 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+ self.assertEqual(indentValue < indentValue2 , True)
+
+ self.xUITest.executeCommand(".uno:IncrementLevel")
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xindentatmf = xDialog.getChild("indentatmf")
+ indentValue3 = get_state_as_dict(xindentatmf)["Text"][0:len(get_state_as_dict(xindentatmf)["Text"])-3]
+ self.assertEqual(indentValue == indentValue3 , True)
+
+
+ def test_bullets_and_numbering_selection(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ # Test Bullet Page
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog") as xDialog:
+
+ # Select the BulletPage's Selector
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xBulletPage = xDialog.getChild("PickBulletPage")
+ xselector = xBulletPage.getChild("valueset")
+ self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8")
+ # Select element num 3
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "3"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "2")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "3")
+ self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Solid diamond bullets")
+ # Select element num 7
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "7"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "6")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "7")
+ self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Cross mark bullets")
+
+
+ # Test other Pages
+ with self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog") as xDialog:
+ # Select the NumberingPage's Selector
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ xNumberingPage = xDialog.getChild("PickNumberingPage")
+ xselector = xNumberingPage.getChild("valueset")
+ self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8")
+ # Select element num 5
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "5"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "4")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "5")
+ self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Uppercase letter A) B) C)")
+ # Select element num 8
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "8"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "7")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "8")
+ self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Lowercase Roman number i. ii. iii.")
+
+ # Select the OutlinePage's Selector
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+ xOutlinePage = xDialog.getChild("PickOutlinePage")
+ xselector = xOutlinePage.getChild("valueset")
+ self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "8")
+ # Select element num 1
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "0")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "1")
+ self.assertEqual(get_state_as_dict(xselector)["ItemText"], "Numeric, numeric, lowercase letters, solid small circular bullet")
+
+ # Select the GraphicPage's Selector
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
+ xGraphicPage = xDialog.getChild("PickGraphicPage")
+ xselector = xGraphicPage.getChild("valueset")
+ self.assertEqual(get_state_as_dict(xselector)["ItemsCount"], "92")
+ # Select element num 22
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "22"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "21")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "22")
+ # Select element num 73
+ xselector.executeAction("CHOOSE", mkPropertyValues({"POS": "73"}))
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "72")
+ self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "73")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/formatCharacter.py b/sw/qa/uitest/writer_tests2/formatCharacter.py
new file mode 100644
index 000000000..196313368
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/formatCharacter.py
@@ -0,0 +1,246 @@
+# -*- 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import select_by_text
+
+class formatCharacter(UITestCase):
+
+ def test_format_character_tab_font(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+
+ # xNoteBook = xDialog.getChild("nbWestern") //western notebook is always active
+ xSizeFont = xDialog.getChild("cbWestSize")
+ xLangFont = xDialog.getChild("cbWestLanguage")
+ xSizeFont.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSizeFont.executeAction("TYPE", mkPropertyValues({"TEXT":"18"}))
+ #set font size 18
+ select_pos(xLangFont, "0")
+
+ xNoteBook = xDialog.getChild("nbCJKCTL")
+ select_pos(xNoteBook, "0")
+ xSizeFontEast = xDialog.getChild("cbCJKSize")
+ xLangFontEast = xDialog.getChild("cbCJKLanguage")
+ xSizeFontEast.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSizeFontEast.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
+ select_pos(xLangFontEast, "0")
+
+ select_pos(xNoteBook, "1")
+ xSizeFontCTL = xDialog.getChild("cbCTLSize")
+ xLangFontCTL = xDialog.getChild("cbCTLLanguage")
+ xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
+ select_pos(xLangFontCTL, "0")
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog", close_button="cancel") as xDialog:
+ xSizeFont = xDialog.getChild("cbWestSize")
+ self.assertEqual(get_state_as_dict(xSizeFont)["Text"], "18 pt")
+ xLangFont = xDialog.getChild("cbWestLanguage")
+ self.assertEqual(get_state_as_dict(xLangFont)["Text"], "[None]")
+
+ xNoteBook = xDialog.getChild("nbCJKCTL")
+ select_pos(xNoteBook, "0")
+ xSizeFontEast = xDialog.getChild("cbCJKSize")
+ self.assertEqual(get_state_as_dict(xSizeFontEast)["Text"], "18 pt")
+ xLangFontEast = xDialog.getChild("cbCJKLanguage")
+ self.assertEqual(get_state_as_dict(xLangFontEast)["Text"], "[None]")
+
+ select_pos(xNoteBook, "1")
+ xSizeFontCTL = xDialog.getChild("cbCTLSize")
+ self.assertEqual(get_state_as_dict(xSizeFontCTL)["Text"], "18 pt")
+ xLangFontCTL = xDialog.getChild("cbCTLLanguage")
+ self.assertEqual(get_state_as_dict(xLangFontCTL)["Text"], "[None]")
+
+
+
+ def test_format_character_tab_font_effects(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ xEffects = xDialog.getChild("effectslb")
+ xRelief = xDialog.getChild("relieflb")
+ xHidden = xDialog.getChild("hiddencb")
+ xOverline = xDialog.getChild("overlinelb")
+ xStrikeout = xDialog.getChild("strikeoutlb")
+ xUnderline = xDialog.getChild("underlinelb")
+ xEmphasis = xDialog.getChild("emphasislb")
+ xPosition = xDialog.getChild("positionlb")
+
+ select_pos(xEffects, "1")
+ select_pos(xRelief, "1")
+ xHidden.executeAction("CLICK", tuple())
+ select_pos(xOverline, "1")
+ select_pos(xStrikeout, "1")
+ select_pos(xUnderline, "1")
+ select_pos(xEmphasis, "1")
+ select_pos(xPosition, "1")
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ xEffects = xDialog.getChild("effectslb")
+ xRelief = xDialog.getChild("relieflb")
+ xHidden = xDialog.getChild("hiddencb")
+ xOverline = xDialog.getChild("overlinelb")
+ xStrikeout = xDialog.getChild("strikeoutlb")
+ xUnderline = xDialog.getChild("underlinelb")
+ xEmphasis = xDialog.getChild("emphasislb")
+ xPosition = xDialog.getChild("positionlb")
+
+ self.assertEqual(get_state_as_dict(xEffects)["SelectEntryText"], "UPPERCASE")
+ self.assertEqual(get_state_as_dict(xRelief)["SelectEntryText"], "Embossed")
+ self.assertEqual(get_state_as_dict(xHidden)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xOverline)["SelectEntryText"], "Single")
+ self.assertEqual(get_state_as_dict(xStrikeout)["SelectEntryText"], "Single")
+ self.assertEqual(get_state_as_dict(xUnderline)["SelectEntryText"], "Single")
+ self.assertEqual(get_state_as_dict(xEmphasis)["SelectEntryText"], "Dot")
+ self.assertEqual(get_state_as_dict(xPosition)["SelectEntryText"], "Below text")
+
+
+
+ def test_format_character_tab_hyperlink(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+
+ xURL = xDialog.getChild("urled")
+ xURL.executeAction("TYPE", mkPropertyValues({"TEXT":"libreoffice.org"}))
+ xTexted = xDialog.getChild("texted")
+ xTexted.executeAction("TYPE", mkPropertyValues({"TEXT":"LibreOffice"}))
+ xName = xDialog.getChild("nameed")
+ xName.executeAction("TYPE", mkPropertyValues({"TEXT":"hyperlink"}))
+
+ xVisited = xDialog.getChild("visitedlb")
+ select_by_text(xVisited, "Bullets")
+ xUnVisited = xDialog.getChild("unvisitedlb")
+ select_by_text(xUnVisited, "Bullets")
+
+
+ self.xUITest.executeCommand(".uno:GoLeft")
+ self.assertEqual(document.Text.String[0:11], "LibreOffice")
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xURL = xDialog.getChild("urled")
+ xTexted = xDialog.getChild("texted")
+ xName = xDialog.getChild("nameed")
+ xVisited = xDialog.getChild("visitedlb")
+ xUnVisited = xDialog.getChild("unvisitedlb")
+
+ self.assertEqual(get_state_as_dict(xURL)["Text"], "http://libreoffice.org/")
+ self.assertEqual(get_state_as_dict(xTexted)["Text"], "LibreOffice")
+ self.assertEqual(get_state_as_dict(xName)["Text"], "hyperlink")
+ self.assertEqual(get_state_as_dict(xVisited)["SelectEntryText"], "Bullets")
+ self.assertEqual(get_state_as_dict(xUnVisited)["SelectEntryText"], "Bullets")
+
+
+ def test_format_character_tab_asian_layout(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
+
+ xTwolines = xDialog.getChild("twolines")
+ xTwolines.executeAction("CLICK", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
+ xTwolines = xDialog.getChild("twolines")
+
+ self.assertEqual(get_state_as_dict(xTwolines)["Selected"], "true")
+
+ def test_format_character_tab_position(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+
+ xSuperscript = xDialog.getChild("superscript")
+ xRelFontSize = xDialog.getChild("fontsizesb")
+ x90deg = xDialog.getChild("90deg")
+ xScalewidth = xDialog.getChild("scalewidthsb")
+ xKerning = xDialog.getChild("kerningsb")
+ xPairKerning = xDialog.getChild("pairkerning")
+ xFitToLine = xDialog.getChild("fittoline")
+
+ xSuperscript.executeAction("CLICK", tuple())
+ xRelFontSize.executeAction("UP", tuple())
+ x90deg.executeAction("CLICK", tuple())
+ xScalewidth.executeAction("UP", tuple())
+ xKerning.executeAction("UP", tuple())
+ xPairKerning.executeAction("CLICK", tuple())
+ xFitToLine.executeAction("CLICK", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+ xSuperscript = xDialog.getChild("superscript")
+ xRelFontSize = xDialog.getChild("fontsizesb")
+ x90deg = xDialog.getChild("90deg")
+ xScalewidth = xDialog.getChild("scalewidthsb")
+ xKerning = xDialog.getChild("kerningsb")
+ xPairKerning = xDialog.getChild("pairkerning")
+ xFitToLine = xDialog.getChild("fittoline")
+
+ self.assertEqual(get_state_as_dict(xSuperscript)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(x90deg)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xScalewidth)["Text"], "100%")
+ self.assertEqual(get_state_as_dict(xKerning)["Text"], "0.1 pt")
+ self.assertEqual(get_state_as_dict(xPairKerning)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xFitToLine)["Selected"], "true")
+
+
+
+ def test_format_character_tab_position_scalewidthsb(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+
+ xScalewidth = xDialog.getChild("scalewidthsb")
+ xScalewidth.executeAction("UP", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:FontDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+ xScalewidth = xDialog.getChild("scalewidthsb")
+ self.assertEqual(get_state_as_dict(xScalewidth)["Text"], "101%")
+
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/formatParagraph.py b/sw/qa/uitest/writer_tests2/formatParagraph.py
new file mode 100644
index 000000000..14882dc6b
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/formatParagraph.py
@@ -0,0 +1,541 @@
+# -*- 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import select_by_text
+from uitest.uihelper.common import change_measurement_unit
+
+class formatParagraph(UITestCase):
+
+ def test_format_paragraph_tab_indents_spacing(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+
+ xBeforeText = xDialog.getChild("spinED_LEFTINDENT")
+ xAfterText = xDialog.getChild("spinED_RIGHTINDENT")
+ xFirstLine = xDialog.getChild("spinED_FLINEINDENT")
+ xAutomaticChk = xDialog.getChild("checkCB_AUTO")
+ xAbovePar = xDialog.getChild("spinED_TOPDIST")
+ xBelowPar = xDialog.getChild("spinED_BOTTOMDIST")
+ xChkspace = xDialog.getChild("checkCB_CONTEXTUALSPACING")
+ xLineSpacing = xDialog.getChild("comboLB_LINEDIST")
+ xActivate = xDialog.getChild("checkCB_REGISTER")
+
+ xBeforeText.executeAction("UP", tuple())
+ xAfterText.executeAction("UP", tuple())
+ xFirstLine.executeAction("UP", tuple())
+ xAutomaticChk.executeAction("CLICK", tuple())
+ xAbovePar.executeAction("UP", tuple())
+ xBelowPar.executeAction("UP", tuple())
+ xChkspace.executeAction("CLICK", tuple())
+ select_by_text(xLineSpacing, "Double")
+ xActivate.executeAction("CLICK", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xBeforeText = xDialog.getChild("spinED_LEFTINDENT")
+ xAfterText = xDialog.getChild("spinED_RIGHTINDENT")
+ xFirstLine = xDialog.getChild("spinED_FLINEINDENT")
+ xAutomaticChk = xDialog.getChild("checkCB_AUTO")
+ xAbovePar = xDialog.getChild("spinED_TOPDIST")
+ xBelowPar = xDialog.getChild("spinED_BOTTOMDIST")
+ xChkspace = xDialog.getChild("checkCB_CONTEXTUALSPACING")
+ xLineSpacing = xDialog.getChild("comboLB_LINEDIST")
+ xActivate = xDialog.getChild("checkCB_REGISTER")
+
+ self.assertEqual(get_state_as_dict(xBeforeText)["Text"], "0.50 ch")
+ self.assertEqual(get_state_as_dict(xAfterText)["Text"], "0.50 ch")
+ self.assertEqual(get_state_as_dict(xFirstLine)["Text"], "0.50 ch")
+ self.assertEqual(get_state_as_dict(xAutomaticChk)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xAbovePar)["Text"], "0.50 line")
+ self.assertEqual(get_state_as_dict(xBelowPar)["Text"], "0.50 line")
+ self.assertEqual(get_state_as_dict(xChkspace)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xLineSpacing)["SelectEntryText"], "Double")
+ self.assertEqual(get_state_as_dict(xActivate)["Selected"], "true")
+
+
+
+ def test_format_paragraph_tab_alignment(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ xTextDirection = xDialog.getChild("comboLB_TEXTDIRECTION")
+ xAlignment = xDialog.getChild("comboLB_VERTALIGN")
+ xSnapToText = xDialog.getChild("checkCB_SNAP")
+ xJustified = xDialog.getChild("radioBTN_JUSTIFYALIGN")
+ xLastLine = xDialog.getChild("comboLB_LASTLINE")
+ xExpandChk = xDialog.getChild("checkCB_EXPAND")
+
+ select_by_text(xTextDirection, "Left-to-right (LTR)")
+ select_by_text(xAlignment, "Top")
+ xSnapToText.executeAction("CLICK", tuple())
+ xJustified.executeAction("CLICK", tuple())
+ select_by_text(xLastLine, "Justified")
+ xExpandChk.executeAction("CLICK", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ xTextDirection = xDialog.getChild("comboLB_TEXTDIRECTION")
+ xAlignment = xDialog.getChild("comboLB_VERTALIGN")
+ xSnapToText = xDialog.getChild("checkCB_SNAP")
+ xJustified = xDialog.getChild("radioBTN_JUSTIFYALIGN")
+ xLastLine = xDialog.getChild("comboLB_LASTLINE")
+ xExpandChk = xDialog.getChild("checkCB_EXPAND")
+
+ self.assertEqual(get_state_as_dict(xTextDirection)["SelectEntryText"], "Left-to-right (LTR)")
+ self.assertEqual(get_state_as_dict(xAlignment)["SelectEntryText"], "Top")
+ self.assertEqual(get_state_as_dict(xSnapToText)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xJustified)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xLastLine)["SelectEntryText"], "Justified")
+ self.assertEqual(get_state_as_dict(xExpandChk)["Selected"], "true")
+
+
+
+ def test_format_paragraph_tab_text_flow(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+
+ xAutomaticaly = xDialog.getChild("checkAuto")
+ xEnd = xDialog.getChild("spinLineEnd")
+ xBegin = xDialog.getChild("spinLineBegin")
+ xMax = xDialog.getChild("spinMaxNum")
+ xIns = xDialog.getChild("checkInsert")
+ xType = xDialog.getChild("comboBreakType")
+ xPosition = xDialog.getChild("comboBreakPosition")
+ xspinOrphan = xDialog.getChild("spinOrphan")
+ xspinWidow = xDialog.getChild("spinWidow")
+ xcheckWidow = xDialog.getChild("checkWidow")
+ xcheckOrphan = xDialog.getChild("checkOrphan")
+ xcheckSplitPara = xDialog.getChild("checkSplitPara")
+ xcheckKeepPara = xDialog.getChild("checkKeepPara")
+
+ xAutomaticaly.executeAction("CLICK", tuple())
+ xEnd.executeAction("UP", tuple())
+ xBegin.executeAction("UP", tuple())
+ xMax.executeAction("UP", tuple())
+ xIns.executeAction("CLICK", tuple())
+ select_by_text(xType, "Column")
+ select_by_text(xPosition, "After")
+ xspinOrphan.executeAction("UP", tuple())
+ xspinWidow.executeAction("UP", tuple())
+ xcheckWidow.executeAction("CLICK", tuple())
+ xcheckOrphan.executeAction("CLICK", tuple())
+ xcheckSplitPara.executeAction("CLICK", tuple())
+ xcheckKeepPara.executeAction("CLICK", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+
+ xAutomaticaly = xDialog.getChild("checkAuto")
+ xEnd = xDialog.getChild("spinLineEnd")
+ xBegin = xDialog.getChild("spinLineBegin")
+ xMax = xDialog.getChild("spinMaxNum")
+ xIns = xDialog.getChild("checkInsert")
+ xType = xDialog.getChild("comboBreakType")
+ xPosition = xDialog.getChild("comboBreakPosition")
+ xspinOrphan = xDialog.getChild("spinOrphan")
+ xspinWidow = xDialog.getChild("spinWidow")
+ xcheckWidow = xDialog.getChild("checkWidow")
+ xcheckOrphan = xDialog.getChild("checkOrphan")
+ xcheckSplitPara = xDialog.getChild("checkSplitPara")
+ xcheckKeepPara = xDialog.getChild("checkKeepPara")
+
+ self.assertEqual(get_state_as_dict(xAutomaticaly)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xEnd)["Text"], "3")
+ self.assertEqual(get_state_as_dict(xBegin)["Text"], "3")
+ self.assertEqual(get_state_as_dict(xMax)["Text"], "1")
+ self.assertEqual(get_state_as_dict(xIns)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xType)["SelectEntryText"], "Column")
+ self.assertEqual(get_state_as_dict(xPosition)["SelectEntryText"], "After")
+ self.assertEqual(get_state_as_dict(xspinOrphan)["Text"], "2")
+ self.assertEqual(get_state_as_dict(xspinWidow)["Text"], "2")
+ self.assertEqual(get_state_as_dict(xcheckWidow)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xcheckOrphan)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xcheckSplitPara)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xcheckKeepPara)["Selected"], "true")
+
+
+
+ def test_format_paragraph_tab_asian_typography(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
+
+ xcheckForbidList = xDialog.getChild("checkForbidList")
+ xcheckHangPunct = xDialog.getChild("checkHangPunct")
+ xcheckApplySpacing = xDialog.getChild("checkApplySpacing")
+
+ xcheckForbidList.executeAction("CLICK", tuple())
+ xcheckHangPunct.executeAction("CLICK", tuple())
+ xcheckApplySpacing.executeAction("CLICK", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
+
+ xcheckForbidList = xDialog.getChild("checkForbidList")
+ xcheckHangPunct = xDialog.getChild("checkHangPunct")
+ xcheckApplySpacing = xDialog.getChild("checkApplySpacing")
+
+ self.assertEqual(get_state_as_dict(xcheckForbidList)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xcheckHangPunct)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xcheckApplySpacing)["Selected"], "false")
+
+
+
+ def test_format_paragraph_tab_outline_numbering(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+
+ xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
+ xNumbering = xDialog.getChild("comboLB_NUMBER_STYLE")
+ xPara = xDialog.getChild("checkCB_RESTART_PARACOUNT")
+ xParaSpin = xDialog.getChild("spinNF_RESTART_PARA")
+
+ select_by_text(xOutline, "Level 1")
+ select_by_text(xNumbering, "Bullet •")
+ xPara.executeAction("CLICK", tuple())
+ xParaSpin.executeAction("UP", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+
+ xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
+ xNumbering = xDialog.getChild("comboLB_NUMBER_STYLE")
+ xPara = xDialog.getChild("checkCB_RESTART_PARACOUNT")
+ xParaSpin = xDialog.getChild("spinNF_RESTART_PARA")
+
+ self.assertEqual(get_state_as_dict(xOutline)["SelectEntryText"], "Level 1")
+ self.assertEqual(get_state_as_dict(xNumbering)["SelectEntryText"], "Bullet •")
+ self.assertEqual(get_state_as_dict(xPara)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xParaSpin)["Text"], "2")
+
+
+
+ def test_format_paragraph_tab_tabs(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ change_measurement_unit(self, "Centimeter")
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xDecimal = xDialog.getChild("radiobuttonBTN_TABTYPE_DECIMAL")
+ xDecimalTxt = xDialog.getChild("entryED_TABTYPE_DECCHAR")
+ xFill = xDialog.getChild("radiobuttonBTN_FILLCHAR_OTHER")
+ xFillTxt = xDialog.getChild("entryED_FILLCHAR_OTHER")
+ xNewButtn = xDialog.getChild("buttonBTN_NEW")
+ xED_TABPOS = xDialog.getChild("ED_TABPOS")
+
+ xDecimal.executeAction("CLICK", tuple())
+ xDecimalTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xDecimalTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"i"}))
+ xFill.executeAction("CLICK", tuple())
+ xFillTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xFillTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"p"}))
+ xED_TABPOS.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xED_TABPOS.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ xNewButtn.executeAction("CLICK", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xDecimal = xDialog.getChild("radiobuttonBTN_TABTYPE_DECIMAL")
+ xDecimalTxt = xDialog.getChild("entryED_TABTYPE_DECCHAR")
+ xFill = xDialog.getChild("radiobuttonBTN_FILLCHAR_OTHER")
+ xFillTxt = xDialog.getChild("entryED_FILLCHAR_OTHER")
+ xNewButtn = xDialog.getChild("buttonBTN_NEW")
+ xED_TABPOS = xDialog.getChild("ED_TABPOS")
+
+ self.assertEqual(get_state_as_dict(xDecimal)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xDecimalTxt)["Text"], "i")
+ self.assertEqual(get_state_as_dict(xFill)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xFillTxt)["Text"], "p")
+ self.assertEqual(get_state_as_dict(xED_TABPOS)["Text"], "1.00 cm")
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xCentered = xDialog.getChild("radiobuttonBTN_TABTYPE_CENTER")
+ xUnderscore = xDialog.getChild("radiobuttonBTN_FILLCHAR_UNDERSCORE")
+ xNewButtn = xDialog.getChild("buttonBTN_NEW")
+
+ xCentered.executeAction("CLICK", tuple())
+ xUnderscore.executeAction("CLICK", tuple())
+ xNewButtn.executeAction("CLICK", tuple())
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xCentered = xDialog.getChild("radiobuttonBTN_TABTYPE_CENTER")
+ xUnderscore = xDialog.getChild("radiobuttonBTN_FILLCHAR_UNDERSCORE")
+ self.assertEqual(get_state_as_dict(xCentered)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xUnderscore)["Checked"], "true")
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xRight = xDialog.getChild("radiobuttonST_RIGHTTAB_ASIAN")
+ xDashLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_DASHLINE")
+ xNewButtn = xDialog.getChild("buttonBTN_NEW")
+
+ xRight.executeAction("CLICK", tuple())
+ xDashLine.executeAction("CLICK", tuple())
+ xNewButtn.executeAction("CLICK", tuple())
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xRight = xDialog.getChild("radiobuttonST_RIGHTTAB_ASIAN")
+ xDashLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_DASHLINE")
+ self.assertEqual(get_state_as_dict(xRight)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xDashLine)["Checked"], "true")
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xLeft = xDialog.getChild("radiobuttonST_LEFTTAB_ASIAN")
+ xPointsLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_POINTS")
+ xNewButtn = xDialog.getChild("buttonBTN_NEW")
+
+ xLeft.executeAction("CLICK", tuple())
+ xPointsLine.executeAction("CLICK", tuple())
+ xNewButtn.executeAction("CLICK", tuple())
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xLeft = xDialog.getChild("radiobuttonST_LEFTTAB_ASIAN")
+ xPointsLine = xDialog.getChild("radiobuttonBTN_FILLCHAR_POINTS")
+ self.assertEqual(get_state_as_dict(xLeft)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xPointsLine)["Checked"], "true")
+
+
+
+ def test_format_paragraph_tab_drop_caps(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "6")
+
+ xDisplay = xDialog.getChild("checkCB_SWITCH")
+ xWholeWord = xDialog.getChild("checkCB_WORD")
+ xLines = xDialog.getChild("spinFLD_LINES")
+ xSpaceToText = xDialog.getChild("spinFLD_DISTANCE")
+ xText = xDialog.getChild("entryEDT_TEXT")
+ xCharStyle = xDialog.getChild("comboBOX_TEMPLATE")
+
+ xDisplay.executeAction("CLICK", tuple())
+ xWholeWord.executeAction("CLICK", tuple())
+ xLines.executeAction("UP", tuple())
+ xSpaceToText.executeAction("UP", tuple())
+ xText.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
+ select_by_text(xCharStyle, "Definition")
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "6")
+
+ xDisplay = xDialog.getChild("checkCB_SWITCH")
+ xWholeWord = xDialog.getChild("checkCB_WORD")
+ xLines = xDialog.getChild("spinFLD_LINES")
+ xSpaceToText = xDialog.getChild("spinFLD_DISTANCE")
+ xText = xDialog.getChild("entryEDT_TEXT")
+ xCharStyle = xDialog.getChild("comboBOX_TEMPLATE")
+
+ self.assertEqual(get_state_as_dict(xDisplay)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xWholeWord)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xText)["Text"], "A")
+ self.assertEqual(get_state_as_dict(xCharStyle)["SelectEntryText"], "Definition")
+
+
+
+ def test_format_paragraph_tab_borders(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ change_measurement_unit(self, "Centimeter")
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "7")
+
+ xStyle = xDialog.getChild("linestylelb")
+ xwidth = xDialog.getChild("linewidthmf")
+ xSync = xDialog.getChild("sync")
+ xLeft = xDialog.getChild("leftmf")
+ xRight = xDialog.getChild("rightmf")
+ xTop = xDialog.getChild("topmf")
+ xBottom = xDialog.getChild("bottommf")
+ xMerge = xDialog.getChild("mergewithnext")
+
+ xwidth.executeAction("UP", tuple())
+ xSync.executeAction("CLICK", tuple())
+ xLeft.executeAction("UP", tuple())
+ xLeft.executeAction("UP", tuple())
+ xRight.executeAction("UP", tuple())
+ xTop.executeAction("UP", tuple())
+ xBottom.executeAction("UP", tuple())
+ xMerge.executeAction("CLICK", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "7")
+
+ xStyle = xDialog.getChild("linestylelb")
+ xwidth = xDialog.getChild("linewidthmf")
+ xSync = xDialog.getChild("sync")
+ xLeft = xDialog.getChild("leftmf")
+ xRight = xDialog.getChild("rightmf")
+ xTop = xDialog.getChild("topmf")
+ xBottom = xDialog.getChild("bottommf")
+ xMerge = xDialog.getChild("mergewithnext")
+
+ self.assertEqual(get_state_as_dict(xSync)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xMerge)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xLeft)["Text"], "0.20 cm")
+ self.assertEqual(get_state_as_dict(xRight)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTop)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xBottom)["Text"], "0.10 cm")
+
+
+ def test_format_paragraph_area(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "8")
+
+ xColor = xDialog.getChild("btncolor")
+ xGradient = xDialog.getChild("btngradient")
+ xBitmap = xDialog.getChild("btnbitmap")
+ xPattern = xDialog.getChild("btnpattern")
+ xHatch = xDialog.getChild("btnhatch")
+
+ xColor.executeAction("CLICK", tuple())
+ xGradient.executeAction("CLICK", tuple())
+ xBitmap.executeAction("CLICK", tuple())
+ xPattern.executeAction("CLICK", tuple())
+ xHatch.executeAction("CLICK", tuple())
+
+ def test_format_paragraph_transparency(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "9")
+
+ xTran = xDialog.getChild("RBT_TRANS_LINEAR")
+ xTranText = xDialog.getChild("MTR_TRANSPARENT")
+
+ xTran.executeAction("CLICK", tuple())
+ xTranText.executeAction("UP", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "9")
+
+ xTran = xDialog.getChild("RBT_TRANS_LINEAR")
+ xTranText = xDialog.getChild("MTR_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xTran)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xTranText)["Text"], "51%")
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "9")
+
+ xGradient = xDialog.getChild("RBT_TRANS_GRADIENT")
+ xType = xDialog.getChild("LB_TRGR_GRADIENT_TYPES")
+ xAngle = xDialog.getChild("MTR_TRGR_ANGLE")
+ xBorder = xDialog.getChild("MTR_TRGR_BORDER")
+ xStart = xDialog.getChild("MTR_TRGR_START_VALUE")
+ xEnd = xDialog.getChild("MTR_TRGR_END_VALUE")
+
+ xGradient.executeAction("CLICK", tuple())
+ select_by_text(xType, "Axial")
+ xAngle.executeAction("UP", tuple())
+ xBorder.executeAction("UP", tuple())
+ xStart.executeAction("UP", tuple())
+ xEnd.executeAction("UP", tuple())
+
+
+ with self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog", close_button="cancel") as xDialog:
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "9")
+
+ xGradient = xDialog.getChild("RBT_TRANS_GRADIENT")
+ xType = xDialog.getChild("LB_TRGR_GRADIENT_TYPES")
+ xAngle = xDialog.getChild("MTR_TRGR_ANGLE")
+ xBorder = xDialog.getChild("MTR_TRGR_BORDER")
+ xStart = xDialog.getChild("MTR_TRGR_START_VALUE")
+ xEnd = xDialog.getChild("MTR_TRGR_END_VALUE")
+
+ self.assertEqual(get_state_as_dict(xGradient)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xType)["SelectEntryText"], "Axial")
+ self.assertEqual(get_state_as_dict(xAngle)["Text"], "1°")
+ self.assertEqual(get_state_as_dict(xBorder)["Text"], "1%")
+ self.assertEqual(get_state_as_dict(xStart)["Text"], "1%")
+ self.assertEqual(get_state_as_dict(xEnd)["Text"], "1%")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/horizontalLine.py b/sw/qa/uitest/writer_tests2/horizontalLine.py
new file mode 100644
index 000000000..cecd517f0
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/horizontalLine.py
@@ -0,0 +1,35 @@
+# -*- 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, type_text
+
+class WriterInsertHorizontalLine(UITestCase):
+
+ def test_insert_horizontal_line(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+ type_text(xWriterEdit, "Test horizontal line") #write the text
+
+ self.xUITest.executeCommand(".uno:StyleApply?Style:string=Horizontal%20Line&FamilyName:string=ParagraphStyles") #insert horizontal line
+
+ with self.ui_test.execute_dialog_through_command(".uno:EditStyle", close_button="cancel") as xDialog:
+ xStyleNametxt = xDialog.getChild("name")
+ self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name
+
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Redo")
+
+ with self.ui_test.execute_dialog_through_command(".uno:EditStyle", close_button="cancel") as xDialog:
+ xStyleNametxt = xDialog.getChild("name")
+ self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/insertFootnote.py b/sw/qa/uitest/writer_tests2/insertFootnote.py
new file mode 100644
index 000000000..176794684
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/insertFootnote.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 insertFootnote(UITestCase):
+
+ def test_insert_footnote(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:InsertFootnote")
+
+ type_text(xWriterEdit, "LibreOffice")
+ self.assertEqual(document.Footnotes[0].String, "LibreOffice")
+ self.assertEqual(document.Footnotes.getCount(), 1)
+
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Footnotes[0].String, "")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Footnotes.getCount(), 0)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Footnotes[0].String, "")
+ self.assertEqual(document.Footnotes.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Footnotes[0].String, "LibreOffice")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/pasteSpecial.py b/sw/qa/uitest/writer_tests2/pasteSpecial.py
new file mode 100644
index 000000000..abbc067ef
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/pasteSpecial.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 uitest.uihelper.common import type_text
+
+class PasteSpecial(UITestCase):
+
+ def test_pasteSpecial(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 i in range(5):
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:Copy")
+
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ xList = xDialog.getChild('list')
+ xChild = xList.getChild(str(i))
+
+ xChild.executeAction("SELECT", tuple())
+
+
+ self.xUITest.executeCommand(".uno:Undo")
+
+ self.assertEqual(document.Text.String, "test")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/tdf116474.py b/sw/qa/uitest/writer_tests2/tdf116474.py
new file mode 100644
index 000000000..dca0e790a
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/tdf116474.py
@@ -0,0 +1,47 @@
+# -*- 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_url_for_data_file
+
+#Bug 116474 - Undo/redo: The redo of adding caption to an image isn't working: no image
+
+class tdf116474(UITestCase):
+
+ def test_tdf116474_insert_caption_undo(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ text = document.getText()
+ cursor = text.createTextCursor()
+ textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject')
+ provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider')
+ graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice.jpg")}))
+ textGraphic.Graphic = graphic
+ text.insertTextContent(cursor, textGraphic, False)
+ #select image
+ document.getCurrentController().select(document.getDrawPage()[0])
+
+ with self.ui_test.execute_dialog_through_command(".uno:InsertCaptionDialog") as xDialogCaption:
+
+ xCapt = xDialogCaption.getChild("caption_edit")
+ xCapt.executeAction("TYPE", mkPropertyValues({"TEXT":"Caption"}))
+
+
+ xFrame = document.TextFrames[0]
+ self.assertEqual(document.TextFrames[0].Text.String, "Figure 1: Caption")
+ self.assertEqual(document.GraphicObjects.getCount(), 1) #nr. of images
+ #Undo, redo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Redo")
+ #Verify
+ self.assertEqual(document.TextFrames[0].Text.String, "Figure 1: Caption")
+ self.assertEqual(document.GraphicObjects.getCount(), 1) #nr. of images
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/qa/uitest/writer_tests2/tdf146375.py b/sw/qa/uitest/writer_tests2/tdf146375.py
new file mode 100644
index 000000000..e22e6c4d3
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/tdf146375.py
@@ -0,0 +1,76 @@
+# -*- 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, select_by_text
+from libreoffice.uno.propertyvalue import mkPropertyValues
+import random
+import string
+
+class Tdf146375(UITestCase):
+
+ def test_tdf146375(self):
+ with self.ui_test.create_doc_in_start_center("writer") as document:
+
+ count = 0
+ # Use a random name
+ categoryName = ''.join(random.choice(string.ascii_lowercase) for i in range(15))
+ renamedCategory = categoryName + "-renamed"
+
+ with self.ui_test.execute_dialog_through_command(".uno:NewDoc", close_button="close") as xDialog:
+ xFilterFolder = xDialog.getChild("filter_folder")
+ self.assertEqual("All Categories", get_state_as_dict(xFilterFolder)["SelectEntryText"])
+ count = int(get_state_as_dict(xFilterFolder)["EntryCount"])
+
+ xActionMenu = xDialog.getChild("action_menu")
+
+ # Create a new category
+ with self.ui_test.execute_blocking_action(
+ xActionMenu.executeAction, args=('OPENFROMLIST', mkPropertyValues({"POS": "0"}))) as xNameDialog:
+ xEntry = xNameDialog.getChild("entry")
+ xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xEntry.executeAction("TYPE", mkPropertyValues({"TEXT": categoryName}))
+
+ self.assertEqual(count + 1, int(get_state_as_dict(xFilterFolder)["EntryCount"]))
+
+ select_by_text(xFilterFolder, categoryName)
+ self.assertEqual(categoryName, get_state_as_dict(xFilterFolder)["SelectEntryText"])
+
+ # Rename the category
+ with self.ui_test.execute_blocking_action(
+ xActionMenu.executeAction, args=('OPENFROMLIST', mkPropertyValues({"POS": "1"}))) as xNameDialog:
+ xEntry = xNameDialog.getChild("entry")
+ xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xEntry.executeAction("TYPE", mkPropertyValues({"TEXT": renamedCategory}))
+
+ self.assertEqual(count + 1, int(get_state_as_dict(xFilterFolder)["EntryCount"]))
+ self.assertEqual(renamedCategory, get_state_as_dict(xFilterFolder)["SelectEntryText"])
+
+ with self.ui_test.execute_dialog_through_command(".uno:NewDoc", close_button="close") as xDialog:
+ xFilterFolder = xDialog.getChild("filter_folder")
+ self.assertEqual(count + 1, int(get_state_as_dict(xFilterFolder)["EntryCount"]))
+
+ select_by_text(xFilterFolder, renamedCategory)
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'zwpyzgwuwleanap-renamed' != 'All Categories'
+ self.assertEqual(renamedCategory, get_state_as_dict(xFilterFolder)["SelectEntryText"])
+
+ xActionMenu = xDialog.getChild("action_menu")
+
+ # Delete the category
+ with self.ui_test.execute_blocking_action(
+ xActionMenu.executeAction, args=('OPENFROMLIST', mkPropertyValues({"POS": "2"})), close_button="yes") as xNameDialog:
+ pass
+
+ self.assertEqual(count, int(get_state_as_dict(xFilterFolder)["EntryCount"]))
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: