[Libreoffice-commits] core.git: sw/qa

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Mon Jan 18 11:02:40 UTC 2021


 sw/qa/uitest/writer_dialogs/openDialogs.py |    2 -
 sw/qa/uitest/writer_tests2/pasteSpecial.py |   41 +++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletion(-)

New commits:
commit 991b3b3945790bb2699493e6645b4a3228f8a195
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Jan 18 10:16:44 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Jan 18 12:02:00 2021 +0100

    uitest: sw: Add test for paste special dialog
    
    Change-Id: I470731d4e8c40077d63e8ed49d30f946ab9ab8b2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109533
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/uitest/writer_dialogs/openDialogs.py b/sw/qa/uitest/writer_dialogs/openDialogs.py
index 343c2aec8f60..07f127830404 100644
--- a/sw/qa/uitest/writer_dialogs/openDialogs.py
+++ b/sw/qa/uitest/writer_dialogs/openDialogs.py
@@ -24,7 +24,7 @@ dialogs = [
     # {"command": ".uno:SetDocumentProperties", "closeButton": "cancel"},
         # tested in sw/qa/uitest/writer_tests2/documentProperties.py
     # {"command": ".uno:PasteSpecial", "closeButton": "cancel"},
-        # would need to copy first something into the clipboard
+        # tested in sw/qa/uitest/writer_tests2/pasteSpecial.py
     # {"command": ".uno:SearchDialog", "closeButton": "close"},
         # tested in sw/qa/uitest/findReplace/findReplace.py
     # {"command": ".uno:GotoPage", "closeButton": "cancel"},
diff --git a/sw/qa/uitest/writer_tests2/pasteSpecial.py b/sw/qa/uitest/writer_tests2/pasteSpecial.py
new file mode 100644
index 000000000000..2af43215d99d
--- /dev/null
+++ b/sw/qa/uitest/writer_tests2/pasteSpecial.py
@@ -0,0 +1,41 @@
+# -*- 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 uitest.uihelper.common import type_text
+
+class PasteSpecial(UITestCase):
+
+   def test_pasteSpecial(self):
+        self.ui_test.create_doc_in_start_center("writer")
+        document = self.ui_test.get_component()
+        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")
+
+            self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+            xDialog = self.xUITest.getTopFocusWindow()
+
+            xList = xDialog.getChild('list')
+            xChild = xList.getChild(str(i))
+
+            xChild.executeAction("SELECT", tuple())
+
+            xOkBtn = xDialog.getChild("ok")
+            self.ui_test.close_dialog_through_button(xOkBtn)
+
+            self.xUITest.executeCommand(".uno:Undo")
+
+            self.assertEqual(document.Text.String, "test")
+
+        self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list