sw/qa/uitest/writer_tests5/tdf150151.py |   45 ++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

New commits:
commit 3dec8709c1cba25b62492354fe75e6a41a6dfe40
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Aug 15 12:26:57 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Aug 16 07:53:29 2022 +0200

    tdf#150151: sw: Add UItest
    
    Change-Id: I59da074531d4545ea80096db2b00376b632eddbc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138295
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/qa/uitest/writer_tests5/tdf150151.py 
b/sw/qa/uitest/writer_tests5/tdf150151.py
new file mode 100644
index 000000000000..3b7bd21f5e71
--- /dev/null
+++ b/sw/qa/uitest/writer_tests5/tdf150151.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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import type_text
+
+class Tdf150151(UITestCase):
+
+    def test_tdf150151(self):
+
+        sText = "Šđčćž ŠĐČĆŽ !”#$%&/()=?*,.-;:_  ° ~ˇ^˘°˛`˙’˝”¸"
+
+        with self.ui_test.create_doc_in_start_center("writer") as document:
+            xWriterDoc = self.xUITest.getTopFocusWindow()
+            xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+            type_text(xWriterEdit, sText)
+
+            self.xUITest.executeCommand(".uno:SelectAll")
+
+            self.xUITest.executeCommand(".uno:Copy")
+
+        with self.ui_test.load_empty_file("impress") as document:
+
+            xDoc = self.xUITest.getTopFocusWindow()
+            xEditWin = xDoc.getChild("impress_win")
+
+            xEditWin.executeAction("SELECT", 
mkPropertyValues({"OBJECT":"Unnamed Drawinglayer object 1"}))
+            self.assertEqual("com.sun.star.drawing.SvxShapeCollection", 
document.CurrentSelection.getImplementationName())
+
+            self.xUITest.executeCommand(".uno:Text")
+            self.xUITest.executeCommand(".uno:Paste")
+
+            # Without the fix in place, this test would have failed with
+            # AssertionError: 'Šđčćž ŠĐČĆŽ !”#$%&/()=?*,.-;:_  ° ~ˇ^˘°˛`˙’˝”¸' 
!= 'Š  !#$%&/()=?*,.-;:_   ~^`'
+            self.assertEqual(sText, document.DrawPages[0].getByIndex(1).String)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:

Reply via email to