summaryrefslogtreecommitdiffstats
path: root/cui/qa/uitest/dialogs/pastedlg.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /cui/qa/uitest/dialogs/pastedlg.py
parentInitial commit. (diff)
downloadlibreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.tar.xz
libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cui/qa/uitest/dialogs/pastedlg.py')
-rw-r--r--cui/qa/uitest/dialogs/pastedlg.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/cui/qa/uitest/dialogs/pastedlg.py b/cui/qa/uitest/dialogs/pastedlg.py
new file mode 100644
index 000000000..50a39d232
--- /dev/null
+++ b/cui/qa/uitest/dialogs/pastedlg.py
@@ -0,0 +1,43 @@
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
+
+
+# Test for SvPasteObjectDialog.
+class Test(UITestCase):
+
+ def testGetFormat(self):
+ # Copy a string in Impress.
+ with self.ui_test.create_doc_in_start_center("impress"):
+ template = self.xUITest.getTopFocusWindow()
+ self.ui_test.close_dialog_through_button(template.getChild("close"))
+ doc = self.xUITest.getTopFocusWindow()
+ editWin = doc.getChild("impress_win")
+ # Select the title shape.
+ editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+ editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:Copy")
+
+ # Now use paste special to see what formats are offered.
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial", close_button="cancel") as pasteSpecial:
+ formats = pasteSpecial.getChild("list")
+ entryCount = int(get_state_as_dict(formats)["Children"])
+ items = []
+ for index in range(entryCount):
+ entry = formats.getChild(str(index))
+ entry.executeAction("SELECT", tuple())
+ items.append(get_state_as_dict(formats)["SelectEntryText"])
+
+ # Make sure there is no RTF vs Richtext duplication.
+ self.assertTrue("Rich text formatting (RTF)" in items)
+ self.assertFalse("Rich text formatting (Richtext)" in items)
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: