[Libreoffice-commits] core.git: sw/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 9 16:30:29 UTC 2020
sw/qa/uitest/writer_tests/data/tdf132596.docx |binary
sw/qa/uitest/writer_tests7/tdf132596.py | 49 ++++++++++++++++++++++++++
2 files changed, 49 insertions(+)
New commits:
commit 2ea830c2877f30cf3ac6f261a399c414dd9968c8
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Jun 9 11:21:10 2020 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Jun 9 18:29:53 2020 +0200
tdf#132596: sw: Add UItest
Change-Id: I899de72a02a7501917b13346d304338bb4548ea8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95902
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sw/qa/uitest/writer_tests/data/tdf132596.docx b/sw/qa/uitest/writer_tests/data/tdf132596.docx
new file mode 100644
index 000000000000..f19213ae1391
Binary files /dev/null and b/sw/qa/uitest/writer_tests/data/tdf132596.docx differ
diff --git a/sw/qa/uitest/writer_tests7/tdf132596.py b/sw/qa/uitest/writer_tests7/tdf132596.py
new file mode 100644
index 000000000000..6cfbf5e94be2
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf132596.py
@@ -0,0 +1,49 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+from uitest.path import get_srcdir_url
+
+def get_url_for_data_file(file_name):
+ return get_srcdir_url() + "/sw/qa/uitest/writer_tests/data/" + file_name
+
+class tdf132596(UITestCase):
+
+ def test_tdf132596(self):
+ writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf132596.docx"))
+
+ document = self.ui_test.get_component()
+ self.assertEqual(2, document.CurrentController.PageCount)
+
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:Copy")
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xList = xDialog.getChild('list')
+
+ for childName in xList.getChildren():
+ xChild = xList.getChild(childName)
+ if get_state_as_dict(xChild)['Text'] == "Rich text formatting (RTF)":
+ break
+
+ xChild.executeAction("SELECT", tuple())
+ self.assertEqual(get_state_as_dict(xList)['SelectEntryText'], "Rich text formatting (RTF)")
+
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ self.xUITest.executeCommand(".uno:Undo")
+ # Without the fix in place, it would have crashed here
+
+ self.assertEqual(2, document.CurrentController.PageCount)
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
+
More information about the Libreoffice-commits
mailing list