tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sw / qa / uitest / fieldDialog / tdf135377.py
blobdedc2f95a40e52403c6bc828ba6bb6eaed25eac2
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 Tdf135377(UITestCase):
17 def test_tdf135377(self):
19 with self.ui_test.create_doc_in_start_center("writer"):
21 with self.ui_test.execute_modeless_dialog_through_command(".uno:InsertField", close_button="cancel") as xDialog:
22 xTab = xDialog.getChild("tabcontrol")
23 select_pos(xTab, "4")
25 xType = xDialog.getChild("type-var")
26 xType.getChild('8').executeAction("SELECT", tuple())
27 self.assertEqual("User Field", get_state_as_dict(xType)['SelectEntryText'])
29 xName = xDialog.getChild("name-var")
30 xName.executeAction("TYPE", mkPropertyValues({"TEXT": "AA"}))
32 xValue = xDialog.getChild("value-var")
33 xValue.executeAction("TYPE", mkPropertyValues({"TEXT": "BB"}))
35 xNumFormat = xDialog.getChild("numformat-var")
37 # Without the fix in place, this test would have failed with
38 # AssertionError: 'General' != ''
39 self.assertEqual("General", get_state_as_dict(xNumFormat)['SelectEntryText'])
41 xApplyBtn = xDialog.getChild("apply")
42 xApplyBtn.executeAction("CLICK", ())
44 self.assertEqual("AA", get_state_as_dict(xDialog.getChild("select-var"))["SelectEntryText"])
46 # vim: set shiftwidth=4 softtabstop=4 expandtab: