[Libreoffice-commits] core.git: sw/qa
Zdeněk Crhonek
zcrhonek at gmail.com
Sat Apr 7 14:15:02 UTC 2018
sw/qa/uitest/writer_tests/exchangeDatabase.py | 58 ++++++++++++++++++++++++++
1 file changed, 58 insertions(+)
New commits:
commit 0659dc82598026f82d66c3f97057f3c00e998839
Author: Zdeněk Crhonek <zcrhonek at gmail.com>
Date: Sat Dec 23 09:56:55 2017 +0100
uitest - add test for writer/ Exchange Databases
Change-Id: I440965f6e981e172f06b91cef2eeb302461b76c4
Reviewed-on: https://gerrit.libreoffice.org/47013
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sw/qa/uitest/writer_tests/exchangeDatabase.py b/sw/qa/uitest/writer_tests/exchangeDatabase.py
new file mode 100644
index 000000000000..1697a1601add
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/exchangeDatabase.py
@@ -0,0 +1,58 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+from uitest.framework import UITestCase
+import time
+from uitest.uihelper.common import get_state_as_dict, type_text
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.debug import sleep
+
+class exchangeDB(UITestCase):
+
+ def test_exchange_database(self):
+
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField")
+ xExDBDlg = self.xUITest.getTopFocusWindow()
+ xCloseBtn = xExDBDlg.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
+
+ def test_exchange_database2(self):
+
+ self.ui_test.create_doc_in_start_center("writer")
+
+ self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField")
+ xExDBDlg = self.xUITest.getTopFocusWindow()
+ xTreelist = xExDBDlg.getChild("availablelb")
+
+ xLabeldb = xExDBDlg.getChild("dbnameft")
+ self.assertEqual(get_state_as_dict(xLabeldb)["Text"], "[None]")
+
+ xTreeEntry = xTreelist.getChild('0') #Available Databases
+ xTreeEntry.executeAction("EXPAND", tuple()) #Click on the Bibliography
+ xTreeEntry.executeAction("COLLAPSE", tuple())
+ xTreeEntry.executeAction("EXPAND", tuple())
+ xTreeEntry2 = xTreeEntry.getChild('0') #Available Databases
+ xTreeEntry2.executeAction("SELECT", tuple()) #Click on the biblio
+
+ xDefineBtn = xExDBDlg.getChild("define")
+ xDefineBtn.executeAction("CLICK", tuple())
+
+ self.ui_test.execute_dialog_through_command(".uno:ChangeDatabaseField")
+ xExDBDlg = self.xUITest.getTopFocusWindow()
+ xLabeldb = xExDBDlg.getChild("dbnameft")
+ self.assertEqual(get_state_as_dict(xLabeldb)["Text"], "Bibliography.biblio")
+
+ xCloseBtn = xExDBDlg.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file
More information about the Libreoffice-commits
mailing list