sw/qa/uitest/styleInspector/tdf137513.py | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+)
New commits: commit 62ee3d791d63cb693109b063b73dff5e81356d90 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Feb 3 21:47:01 2021 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Feb 4 00:08:31 2021 +0100 tdf#137513: sw: Add UItest Change-Id: I21251337252688e1bc605587656a4c3e0631e594 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110393 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/uitest/styleInspector/tdf137513.py b/sw/qa/uitest/styleInspector/tdf137513.py new file mode 100644 index 000000000000..2d4fb4d8b348 --- /dev/null +++ b/sw/qa/uitest/styleInspector/tdf137513.py @@ -0,0 +1,58 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from uitest.framework import UITestCase +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict, type_text + +class tdf137513(UITestCase): + + def test_tdf137513(self): + self.ui_test.create_doc_in_start_center("writer") + + self.xUITest.executeCommand(".uno:InsertTable?Columns:short=2&Rows:short=2") + + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + type_text(xWriterEdit, "test") + + self.xUITest.executeCommand(".uno:SelectAll") + + self.xUITest.executeCommand(".uno:Bold") + + self.xUITest.executeCommand(".uno:Sidebar") + xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "InspectorTextPanel"})) + + xListBox = xWriterEdit.getChild('listbox_fonts') + + # The cursor is on text inside the table with direct formatting + self.assertEqual(2, len(xListBox.getChild('0').getChildren())) + self.assertEqual("Default Paragraph Style", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text']) + self.assertEqual("Table Contents", get_state_as_dict(xListBox.getChild('0').getChild('1'))['Text']) + self.assertEqual(136, len(xListBox.getChild('0').getChild('0').getChildren())) + + xTableContent = xListBox.getChild('0').getChild('1') + self.assertEqual(5, len(xTableContent.getChildren())) + self.assertEqual("Follow Style\tTable Contents", get_state_as_dict(xTableContent.getChild('0'))['Text']) + self.assertEqual("Para Line Number Count\tFalse", get_state_as_dict(xTableContent.getChild('1'))['Text']) + self.assertEqual("Para Line Number Start Value\t0", get_state_as_dict(xTableContent.getChild('2'))['Text']) + self.assertEqual("Para Orphans\t0", get_state_as_dict(xTableContent.getChild('3'))['Text']) + self.assertEqual("Para Widows\t0", get_state_as_dict(xTableContent.getChild('4'))['Text']) + + xParDirFormatting = xListBox.getChild('1') + + # Without the fix in place, this test would have failed here with + # AssertionError: 3 != 0 + self.assertEqual(3, len(xParDirFormatting.getChildren())) + self.assertEqual("Char Weight\tbold", get_state_as_dict(xParDirFormatting.getChild('0'))['Text']) + self.assertEqual("Char Weight Asian\tbold", get_state_as_dict(xParDirFormatting.getChild('1'))['Text']) + self.assertEqual("Char Weight Complex\tbold", get_state_as_dict(xParDirFormatting.getChild('2'))['Text']) + self.assertEqual(0, len(xListBox.getChild('2').getChildren())) + self.assertEqual(0, len(xListBox.getChild('3').getChildren())) + + self.xUITest.executeCommand(".uno:Sidebar") + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits