Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / cui / qa / uitest / dialogs / pastedlg.py
blob50a39d232fdc2c13f6e6fc4664b5bfe6ace61294
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from libreoffice.uno.propertyvalue import mkPropertyValues
8 from uitest.framework import UITestCase
9 from uitest.uihelper.common import get_state_as_dict
12 # Test for SvPasteObjectDialog.
13 class Test(UITestCase):
15 def testGetFormat(self):
16 # Copy a string in Impress.
17 with self.ui_test.create_doc_in_start_center("impress"):
18 template = self.xUITest.getTopFocusWindow()
19 self.ui_test.close_dialog_through_button(template.getChild("close"))
20 doc = self.xUITest.getTopFocusWindow()
21 editWin = doc.getChild("impress_win")
22 # Select the title shape.
23 editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
24 editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
25 self.xUITest.executeCommand(".uno:SelectAll")
26 self.xUITest.executeCommand(".uno:Copy")
28 # Now use paste special to see what formats are offered.
29 with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial", close_button="cancel") as pasteSpecial:
30 formats = pasteSpecial.getChild("list")
31 entryCount = int(get_state_as_dict(formats)["Children"])
32 items = []
33 for index in range(entryCount):
34 entry = formats.getChild(str(index))
35 entry.executeAction("SELECT", tuple())
36 items.append(get_state_as_dict(formats)["SelectEntryText"])
38 # Make sure there is no RTF vs Richtext duplication.
39 self.assertTrue("Rich text formatting (RTF)" in items)
40 self.assertFalse("Rich text formatting (Richtext)" in items)
43 # vim: set shiftwidth=4 softtabstop=4 expandtab: