tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / qa / uitest / validity / tdf65686.py
blobfe1a0fbc6fa1316531dedc849071e44e5696e22f
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/.
9 from uitest.framework import UITestCase
10 from uitest.uihelper.common import get_state_as_dict
11 from uitest.uihelper.common import select_by_text, select_pos
13 from libreoffice.uno.propertyvalue import mkPropertyValues
16 # Bug 65686 - EDITING Data > Validity broken (for list entries at least)
17 class tdf65686(UITestCase):
18 def test_tdf65686_validity_list(self):
19 with self.ui_test.create_doc_in_start_center("calc"):
20 xCalcDoc = self.xUITest.getTopFocusWindow()
21 gridwin = xCalcDoc.getChild("grid_window")
22 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
23 #- Data > Validity
24 #- Select Allow List
25 #- Enter Entries Aap Noot Mies
26 #- OK
27 with self.ui_test.execute_dialog_through_command(".uno:Validation") as xDialog:
28 xTabs = xDialog.getChild("tabcontrol")
29 select_pos(xTabs, "0")
30 xallow = xDialog.getChild("allow")
31 minlist = xDialog.getChild("minlist")
33 select_by_text(xallow, "List")
34 minlist.executeAction("TYPE", mkPropertyValues({"TEXT":"Aap"}))
35 minlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
36 minlist.executeAction("TYPE", mkPropertyValues({"TEXT":"Noot"}))
37 minlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
38 minlist.executeAction("TYPE", mkPropertyValues({"TEXT":"Mies"}))
39 #- again open Data > Validity
40 #> there are empty lines in the list Entries
41 with self.ui_test.execute_dialog_through_command(".uno:Validation") as xDialog:
42 xallow = xDialog.getChild("allow")
43 minlist = xDialog.getChild("minlist")
45 self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "List")
46 self.assertEqual(get_state_as_dict(minlist)["Text"], "Aap\nNoot\nMies")
50 # vim: set shiftwidth=4 softtabstop=4 expandtab: