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
10 from uitest
.framework
import UITestCase
11 from uitest
.uihelper
.common
import type_text
, select_pos
13 class CreateRangeNameTest(UITestCase
):
15 def test_create_range_name(self
):
17 self
.ui_test
.create_doc_in_start_center("calc")
19 self
.ui_test
.execute_modeless_dialog_through_command(".uno:AddName")
21 xAddNameDlg
= self
.xUITest
.getTopFocusWindow()
23 xEdit
= xAddNameDlg
.getChild("edit")
24 type_text(xEdit
, "simpleRangeName")
26 xAddBtn
= xAddNameDlg
.getChild("add")
27 self
.ui_test
.close_dialog_through_button(xAddBtn
)
29 self
.ui_test
.close_doc()
31 def test_create_local_range_name(self
):
33 self
.ui_test
.create_doc_in_start_center("calc")
35 self
.ui_test
.execute_modeless_dialog_through_command(".uno:AddName")
37 xAddNameDlg
= self
.xUITest
.getTopFocusWindow()
39 xEdit
= xAddNameDlg
.getChild("edit")
40 type_text(xEdit
, "simpleRangeName")
42 xScope
= xAddNameDlg
.getChild("scope")
43 select_pos(xScope
, "1")
45 xAddBtn
= xAddNameDlg
.getChild("add")
46 self
.ui_test
.close_dialog_through_button(xAddBtn
)
48 self
.ui_test
.close_doc()
50 # vim: set shiftwidth=4 softtabstop=4 expandtab: