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

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 22 21:21:34 UTC 2021


 sc/qa/uitest/autofilter/colorfilter.py                 |   37 +++++++++++++++++
 sc/qa/uitest/data/autofilter/tdf142579_cond_format.ods |binary
 2 files changed, 37 insertions(+)

New commits:
commit 2dd6c7e5d59126e28bf478439c25f9f4cbc3422c
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Sep 22 17:04:28 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Sep 22 23:20:58 2021 +0200

    tdf#142579: sc: Add UItest for cond. format background colors
    
    Change-Id: I81845c062783d59f1e3b9c612da938de42f2a50a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122463
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/qa/uitest/autofilter/colorfilter.py b/sc/qa/uitest/autofilter/colorfilter.py
index 65a4ca5a483c..0e4fe939c4d6 100644
--- a/sc/qa/uitest/autofilter/colorfilter.py
+++ b/sc/qa/uitest/autofilter/colorfilter.py
@@ -100,4 +100,41 @@ class ColorFilterTest(UITestCase):
             self.assertTrue(is_row_hidden(doc, 6))
             self.assertFalse(is_row_hidden(doc, 7))
 
+    def test_tdf142579_conditional_format(self):
+        with self.ui_test.load_file(get_url_for_data_file("tdf142579_cond_format.ods")) as doc:
+
+            xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+            xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A9"}))
+
+            for i in range(8):
+                self.assertFalse(is_row_hidden(doc, i))
+
+            with self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter") as xDialog:
+                xField1 = xDialog.getChild("field1")
+                xCond1 = xDialog.getChild("cond1")
+
+                self.assertEqual("Another", get_state_as_dict(xField1)['DisplayText'])
+
+                props = {"TEXT": "Background color"}
+                actionProps = mkPropertyValues(props)
+                xCond1.executeAction("SELECT", actionProps)
+                self.assertEqual("Background color", get_state_as_dict(xCond1)['DisplayText'])
+
+                xColor1 = xDialog.getChild("color1")
+
+                # tdf#142579: Without the fix in place, this test would have failed with
+                # AssertionError: '2' != '1'
+                self.assertEqual('2', get_state_as_dict(xColor1)["EntryCount"])
+
+                select_pos(xColor1, "0")
+
+            self.assertFalse(is_row_hidden(doc, 0))
+            self.assertFalse(is_row_hidden(doc, 1))
+            self.assertTrue(is_row_hidden(doc, 2))
+            self.assertFalse(is_row_hidden(doc, 3))
+            self.assertTrue(is_row_hidden(doc, 4))
+            self.assertTrue(is_row_hidden(doc, 5))
+            self.assertFalse(is_row_hidden(doc, 6))
+            self.assertFalse(is_row_hidden(doc, 7))
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/autofilter/tdf142579_cond_format.ods b/sc/qa/uitest/data/autofilter/tdf142579_cond_format.ods
new file mode 100644
index 000000000000..04b5f3f30066
Binary files /dev/null and b/sc/qa/uitest/data/autofilter/tdf142579_cond_format.ods differ


More information about the Libreoffice-commits mailing list