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
13 class exchangeDB(UITestCase
):
15 def test_exchange_database(self
):
17 with self
.ui_test
.create_doc_in_start_center("writer"):
19 with self
.ui_test
.execute_dialog_through_command(".uno:ChangeDatabaseField", close_button
="close"):
23 def test_exchange_database2(self
):
25 with self
.ui_test
.create_doc_in_start_center("writer"):
27 with self
.ui_test
.execute_dialog_through_command(".uno:ChangeDatabaseField") as xExDBDlg
:
28 xTreelist
= xExDBDlg
.getChild("availablelb")
30 xLabeldb
= xExDBDlg
.getChild("dbnameft")
31 self
.assertEqual(get_state_as_dict(xLabeldb
)["Text"], "[None]")
33 xTreeEntry
= xTreelist
.getChild('0') #Available Databases
34 xTreeEntry
.executeAction("EXPAND", tuple()) #Click on the Bibliography
35 xTreeEntry
.executeAction("COLLAPSE", tuple())
36 xTreeEntry
.executeAction("EXPAND", tuple())
37 xTreeEntry2
= xTreeEntry
.getChild('0') #Available Databases
38 xTreeEntry2
.executeAction("SELECT", tuple()) #Click on the biblio
40 with self
.ui_test
.execute_dialog_through_command(".uno:ChangeDatabaseField", close_button
="close") as xExDBDlg
:
41 xLabeldb
= xExDBDlg
.getChild("dbnameft")
42 self
.assertEqual(get_state_as_dict(xLabeldb
)["Text"], "Bibliography.biblio")
45 # vim: set shiftwidth=4 softtabstop=4 expandtab: