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
, type_text
13 class SpinFieldTest(UITestCase
):
17 with self
.ui_test
.create_doc_in_start_center("calc"):
19 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg
:
21 xDecimalPlaces
= xCellsDlg
.getChild("leadzerosed")
22 xDecimalPlaces
.executeAction("UP", tuple())
24 decimal_places_state
= get_state_as_dict(xDecimalPlaces
)
25 assert(decimal_places_state
["Text"] == "2")
31 with self
.ui_test
.create_doc_in_start_center("calc"):
33 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg
:
35 xDecimalPlaces
= xCellsDlg
.getChild("leadzerosed")
36 xDecimalPlaces
.executeAction("UP", tuple())
37 xDecimalPlaces
.executeAction("UP", tuple())
39 decimal_places_state
= get_state_as_dict(xDecimalPlaces
)
40 assert(decimal_places_state
["Text"] == "3")
42 xDecimalPlaces
.executeAction("DOWN", tuple())
44 decimal_places_state
= get_state_as_dict(xDecimalPlaces
)
45 assert(decimal_places_state
["Text"] == "2")
51 with self
.ui_test
.create_doc_in_start_center("calc"):
53 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xCellsDlg
:
55 xDecimalPlaces
= xCellsDlg
.getChild("leadzerosed")
56 type_text(xDecimalPlaces
, "4")
58 decimal_places_state
= get_state_as_dict(xDecimalPlaces
)
59 assert(decimal_places_state
["Text"] == "41")
63 # vim: set shiftwidth=4 softtabstop=4 expandtab: