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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Thu Feb 11 11:04:41 UTC 2021


 sc/qa/uitest/conditional_format/tdf104026.py |   48 +++++++++++++++++++++++++++
 sc/qa/uitest/data/tdf104026.ods              |binary
 2 files changed, 48 insertions(+)

New commits:
commit a7c41f93421ddb2b48e38960b669c4e4f5413efb
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Thu Feb 11 10:07:09 2021 +0100
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Feb 11 12:03:58 2021 +0100

    tdf#104026: sc: Add UItest
    
    Change-Id: Id423fd75de75a70a7bd48e6104d870b63d2c744e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110753
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/uitest/conditional_format/tdf104026.py b/sc/qa/uitest/conditional_format/tdf104026.py
new file mode 100644
index 000000000000..5aa6a1ff8b6f
--- /dev/null
+++ b/sc/qa/uitest/conditional_format/tdf104026.py
@@ -0,0 +1,48 @@
+# -*- 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
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+
+class Tdf104026(UITestCase):
+
+  def execute_conditional_format_manager_dialog(self, nCount):
+
+    self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
+    xCondFormatMgr = self.xUITest.getTopFocusWindow()
+
+    aExpectedResults = ['A2\tCell value != $Sheet1.$B2', 'A3\tCell value != $Sheet1.$B3',
+        'A4\tCell value != $Sheet1.$B4', 'A5\tCell value != $Sheet1.$B5',
+        'A6\tCell value != $Sheet1.$B6', 'A7\tCell value != $Sheet1.$B7']
+
+    xList = xCondFormatMgr.getChild("CONTAINER")
+    self.assertEqual(nCount, len(xList.getChildren()))
+
+    for i in range(nCount):
+        self.assertEqual(aExpectedResults[i], get_state_as_dict(xList.getChild(str(i)))['Text'])
+
+    xOKBtn = xCondFormatMgr.getChild("ok")
+    self.ui_test.close_dialog_through_button(xOKBtn)
+
+  def test_tdf104026(self):
+    self.ui_test.load_file(get_url_for_data_file("tdf104026.ods"))
+
+    self.execute_conditional_format_manager_dialog(6)
+
+    xCalcDoc = self.xUITest.getTopFocusWindow()
+    gridwin = xCalcDoc.getChild("grid_window")
+    gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+
+    self.xUITest.executeCommand(".uno:DeleteRows")
+
+    # Without the fix in place, this test would have failed with
+    # AssertionError: 'A2\tCell value != $Sheet1.$B2' != 'A2\tCell value != $Sheet1.$B#REF!'
+    self.execute_conditional_format_manager_dialog(5)
+
+    self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/tdf104026.ods b/sc/qa/uitest/data/tdf104026.ods
new file mode 100644
index 000000000000..3d6611fb753c
Binary files /dev/null and b/sc/qa/uitest/data/tdf104026.ods differ


More information about the Libreoffice-commits mailing list