tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sw / qa / uitest / fieldDialog / tdf148551.py
blob7a052aeff5c5880cc78d350d80409b9560309f53
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 uitest.uihelper.common import get_state_as_dict
12 from uitest.uihelper.common import select_pos
14 class Tdf148551(UITestCase):
16 def test_tdf148551(self):
18 with self.ui_test.create_doc_in_start_center("writer") as document:
20 with self.ui_test.execute_modeless_dialog_through_command(".uno:InsertField", close_button="cancel") as xDialog:
21 xTab = xDialog.getChild("tabcontrol")
22 select_pos(xTab, "0")
24 xDoc = xDialog.getChild("type-doc")
25 xDoc.getChild('7').executeAction("SELECT", tuple())
26 self.assertEqual("Statistics", get_state_as_dict(xDoc)['SelectEntryText'])
28 xSelect = xDialog.getChild("select-doc")
29 self.assertEqual("Pages", get_state_as_dict(xSelect)['SelectEntryText'])
31 xFormat = xDialog.getChild("format-doc")
32 self.assertEqual("As Page Style", get_state_as_dict(xFormat)['SelectEntryText'])
34 xOk = xDialog.getChild("ok")
35 xOk.executeAction("CLICK", tuple())
37 # Without the fix in place, this test would have failed with
38 # AssertionError: '1' != 'A'
39 self.assertEqual("1", document.Text.createEnumeration().nextElement().String)
41 # vim: set shiftwidth=4 softtabstop=4 expandtab: