tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / sw / qa / uitest / chapterNumbering / tdf140528.py
blob5bc25962bd9d0d98663c90f9122c26d99c6327e7
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 from uitest.framework import UITestCase
11 from libreoffice.uno.propertyvalue import mkPropertyValues
12 from uitest.uihelper.common import get_state_as_dict
13 from uitest.uihelper.common import select_pos
15 class Tdf140528(UITestCase):
17 def test_tdf140528(self):
18 with self.ui_test.create_doc_in_start_center("writer"):
20 with self.ui_test.execute_dialog_through_command(".uno:ChapterNumberingDialog") as xDialog:
22 xTab = xDialog.getChild("tabcontrol")
23 select_pos(xTab, "0")
25 xFormat = xDialog.getChild("format")
27 with self.ui_test.execute_blocking_action(xFormat.executeAction, args=('OPENFROMLIST', mkPropertyValues({"POS": "10"}))) as dialog:
28 xEntry = dialog.getChild("entry")
29 self.assertEqual("Untitled 1", get_state_as_dict(xEntry)['Text'])
31 xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
32 xEntry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
33 xEntry.executeAction("TYPE", mkPropertyValues({"TEXT" : "newFormat"}))
35 self.assertEqual("saveas", get_state_as_dict(xFormat)['CurrentItem'])
37 # Go to Position tab
38 select_pos(xTab, "1")
40 # Go back to Numbering tab
41 select_pos(xTab, "0")
43 xFormat.executeAction('OPENFROMLIST', mkPropertyValues({"POS": "0"}))
44 self.assertEqual("form1", get_state_as_dict(xFormat)['CurrentItem'])
46 # Without the fix in place, this test would have crashed here
47 select_pos(xTab, "1")
51 # vim: set shiftwidth=4 softtabstop=4 expandtab: