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")
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'])
40 # Go back to Numbering tab
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
51 # vim: set shiftwidth=4 softtabstop=4 expandtab: