Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sw / qa / uitest / writer_tests / tdf113252.py
bloba0b285354e3e89cb2b34f2107192da9a88046656
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from uitest.framework import UITestCase
8 from libreoffice.uno.propertyvalue import mkPropertyValues
9 from uitest.uihelper.common import get_state_as_dict, type_text
10 import time
11 from uitest.debug import sleep
12 from uitest.uihelper.common import select_pos
13 #Bug 113252 - Basic Library Organizer is broken and closing dialogs crashes
15 class tdf113252(UITestCase):
17 def test_tdf113252_macro_dialog(self):
18 self.ui_test.create_doc_in_start_center("writer")
19 document = self.ui_test.get_component()
20 xWriterDoc = self.xUITest.getTopFocusWindow()
21 xWriterEdit = xWriterDoc.getChild("writer_edit")
23 #Start LibreOffice. Go to Tools > Macros > Organize Macros > Basic
24 self.ui_test.execute_dialog_through_command(".uno:MacroDialog")
25 xDialog = self.xUITest.getTopFocusWindow()
27 #Click Button Organizer
28 xorganize = xDialog.getChild("organize")
29 def handle_macro_dlg(dialog):
31 xTabs = dialog.getChild("tabcontrol")
32 select_pos(xTabs, "0")
33 select_pos(xTabs, "1")
34 select_pos(xTabs, "2")
35 #Click on its button Close
36 xCloseBtn = dialog.getChild("close")
37 xCloseBtn.executeAction("CLICK", tuple())
39 self.ui_test.execute_blocking_action(xorganize.executeAction, args=('CLICK', ()),
40 dialog_handler=handle_macro_dlg)
41 #Click button Close in the next dialog -> crash.
43 xClose = xDialog.getChild("close")
44 self.ui_test.close_dialog_through_button(xClose)
46 self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], "1")
48 self.ui_test.close_doc()
49 # vim: set shiftwidth=4 softtabstop=4 expandtab: