1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
9 from uitest
.uihelper
.common
import get_state_as_dict
11 from uitest
.framework
import UITestCase
13 class GridWinTest(UITestCase
):
15 def test_select_object(self
):
17 self
.ui_test
.create_doc_in_start_center("calc")
18 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
19 xGridWindow
= xCalcDoc
.getChild("grid_window")
21 selectProps
= mkPropertyValues({"CELL": "B10"})
22 xGridWindow
.executeAction("SELECT", selectProps
)
24 xGridWindow
.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
26 xGridWindow
.executeAction("ACTIVATE", tuple())
28 xGridWindow
.executeAction("DESELECT", tuple())
30 self
.ui_test
.close_doc()
32 def test_select_sheet(self
):
34 self
.ui_test
.create_doc_in_start_center("calc")
35 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
36 xGridWindow
= xCalcDoc
.getChild("grid_window")
39 self
.ui_test
.execute_dialog_through_command(".uno:Insert")
40 current_dialog
= self
.xUITest
.getTopFocusWindow()
42 xOkButton
= current_dialog
.getChild("ok")
43 self
.ui_test
.close_dialog_through_button(xOkButton
)
45 xGridWindow
.executeAction("SELECT", mkPropertyValues({"TABLE": "2"}))
46 self
.assertEqual(get_state_as_dict(xGridWindow
)["SelectedTable"], "2")
48 # vim: set shiftwidth=4 softtabstop=4 expandtab: