[Libreoffice-commits] core.git: sc/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Sep 16 19:09:50 UTC 2018


 sc/qa/uitest/calc_tests/data/tdf105544.ods   |binary
 sc/qa/uitest/conditional_format/tdf105544.py |   61 +++++++++++++++++++++++++++
 sc/qa/uitest/conditional_format/tdf118206.py |   10 +---
 3 files changed, 64 insertions(+), 7 deletions(-)

New commits:
commit ae0d1f3af9ae129c3a7d98a544e0c9b0c30659c7
Author:     Zdeněk Crhonek <zcrhonek at gmail.com>
AuthorDate: Sun Sep 16 19:27:35 2018 +0200
Commit:     Zdenek Crhonek <zcrhonek at gmail.com>
CommitDate: Sun Sep 16 21:09:26 2018 +0200

    uitest for bug tdf#105544
    
    Change-Id: I913a46d371cb537acbb29d3a4da8223d1fa98a55
    Reviewed-on: https://gerrit.libreoffice.org/60554
    Tested-by: Jenkins
    Reviewed-by: Zdenek Crhonek <zcrhonek at gmail.com>

diff --git a/sc/qa/uitest/calc_tests/data/tdf105544.ods b/sc/qa/uitest/calc_tests/data/tdf105544.ods
new file mode 100644
index 000000000000..52a1a618c8c4
Binary files /dev/null and b/sc/qa/uitest/calc_tests/data/tdf105544.ods differ
diff --git a/sc/qa/uitest/conditional_format/tdf105544.py b/sc/qa/uitest/conditional_format/tdf105544.py
new file mode 100644
index 000000000000..9b48353fabd3
--- /dev/null
+++ b/sc/qa/uitest/conditional_format/tdf105544.py
@@ -0,0 +1,61 @@
+# -*- 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 os
+from uitest.uihelper.common import get_state_as_dict
+from libreoffice.calc.document import get_sheet_from_doc
+from libreoffice.calc.conditional_format import get_conditional_format_from_sheet
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+import org.libreoffice.unotest
+import pathlib
+def get_url_for_data_file(file_name):
+    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+
+#Bug 105544 - Manage Conditional Formatting is not able to edit a condition
+class tdf105544(UITestCase):
+    def test_tdf105544_Manage_Conditional_Formatting_edit_condition(self):
+
+        calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf105544.ods"))
+        xCalcDoc = self.xUITest.getTopFocusWindow()
+        gridwin = xCalcDoc.getChild("grid_window")
+        document = self.ui_test.get_component()
+        #2. select B3. Format> conditional formating> manage
+        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
+        self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
+        xCondFormatMgr = self.xUITest.getTopFocusWindow()
+
+        # check that we have exactly four conditional formats in the beginning
+        xList = xCondFormatMgr.getChild("CONTAINER")
+        list_state = get_state_as_dict(xList)
+        self.assertEqual(list_state['Children'], '4')
+
+        #select B3:B37 range and click edit, then click yes
+        xList.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))  #2nd position in the list
+        xEditBtn = xCondFormatMgr.getChild("edit")
+        self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name = "ModelessDialogVisible")
+        xCondFormatDlg = self.xUITest.getTopFocusWindow()
+
+        xCondFormatOkBtn = xCondFormatDlg.getChild("ok")
+        self.ui_test.close_dialog_through_button(xCondFormatOkBtn)
+
+        # we need to get a pointer again as the old window has been deleted
+        xCondFormatMgr = self.xUITest.getTopFocusWindow()
+
+        # check again that we still have 4 entry in the list
+        xList = xCondFormatMgr.getChild("CONTAINER")
+        list_state = get_state_as_dict(xList)
+        self.assertEqual(list_state['Children'], '4')
+
+        # close the conditional format manager
+        xOKBtn = xCondFormatMgr.getChild("ok")
+        self.ui_test.close_dialog_through_button(xOKBtn)
+
+        self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/conditional_format/tdf118206.py b/sc/qa/uitest/conditional_format/tdf118206.py
index a0ca378458a0..015af9f7a177 100644
--- a/sc/qa/uitest/conditional_format/tdf118206.py
+++ b/sc/qa/uitest/conditional_format/tdf118206.py
@@ -11,14 +11,10 @@ from uitest.uihelper.calc import enter_text_to_cell
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.debug import sleep
-#import org.libreoffice.unotest
-#import pathlib
-#def get_url_for_data_file(file_name):
-#    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
-from uitest.path import get_srcdir_url
+import org.libreoffice.unotest
+import pathlib
 def get_url_for_data_file(file_name):
-    return get_srcdir_url() + "/sc/qa/uitest/calc_tests/data/" + file_name
+    return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
 
 #Bug 118206 - [GTK3] Calc hangs copying/cutting a conditional format column
 class tdf118206(UITestCase):


More information about the Libreoffice-commits mailing list