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 libreoffice
.uno
.propertyvalue
import mkPropertyValues
12 from uitest
.uihelper
.common
import get_state_as_dict
14 class renameSlide(UITestCase
):
16 def test_rename_slide(self
):
17 with self
.ui_test
.create_doc_in_start_center("impress"):
18 xTemplateDlg
= self
.xUITest
.getTopFocusWindow()
19 xCancelBtn
= xTemplateDlg
.getChild("close")
20 self
.ui_test
.close_dialog_through_button(xCancelBtn
)
22 with self
.ui_test
.execute_dialog_through_command(".uno:RenamePage") as xDialog
:
24 name_entry
= xDialog
.getChild("name_entry")
25 name_entry
.executeAction("TYPE", mkPropertyValues({"TEXT":"NewName"}))
29 with self
.ui_test
.execute_dialog_through_command(".uno:RenamePage") as xDialog
:
31 name_entry
= xDialog
.getChild("name_entry")
32 self
.assertEqual(get_state_as_dict(name_entry
)["Text"], "NewName")
34 self
.xUITest
.executeCommand(".uno:InsertPage")
36 with self
.ui_test
.execute_dialog_through_command(".uno:RenamePage", close_button
="cancel") as xDialog
:
38 xOKBtn
= xDialog
.getChild("ok")
39 self
.assertEqual("true", get_state_as_dict(xOKBtn
)['Enabled'])
41 name_entry
= xDialog
.getChild("name_entry")
42 name_entry
.executeAction("TYPE", mkPropertyValues({"TEXT":"NewName"}))
44 self
.assertEqual("false", get_state_as_dict(xOKBtn
)['Enabled'])
47 # vim: set shiftwidth=4 softtabstop=4 expandtab: