summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-09-21 13:41:07 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-09-21 15:31:37 +0200
commite2e1da3cc89942443832ea018ced68eb41e3d75a (patch)
tree89988c1ebf6fa3c71221bbe6ab090967af624213 /sc
parent1d4f198f176cfb5816b76ad67b6c0df39419f0cb (diff)
tdf#142580, tdf#143103: sc: Add UItest
Change-Id: I188716de98e6a9ea1c2b97c6341d578120a242b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122388 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/autofilter/colorfilter.py60
-rw-r--r--sc/qa/uitest/data/autofilter/tdf142580.xlsxbin0 -> 11347 bytes
2 files changed, 60 insertions, 0 deletions
diff --git a/sc/qa/uitest/autofilter/colorfilter.py b/sc/qa/uitest/autofilter/colorfilter.py
new file mode 100644
index 000000000000..a9d0d5d950aa
--- /dev/null
+++ b/sc/qa/uitest/autofilter/colorfilter.py
@@ -0,0 +1,60 @@
+# -*- 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 uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, select_pos
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from libreoffice.calc.document import is_row_hidden
+
+class ColorFilterTest(UITestCase):
+
+ def test_tdf142580(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf142580.xlsx")) as doc:
+
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A9"}))
+
+ # Green Text Color rows are displayed
+ self.assertFalse(is_row_hidden(doc, 0))
+ self.assertFalse(is_row_hidden(doc, 1))
+ self.assertFalse(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.assertTrue(is_row_hidden(doc, 6))
+ self.assertTrue(is_row_hidden(doc, 7))
+ self.assertTrue(is_row_hidden(doc, 8))
+
+ with self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter") as xDialog:
+ xField1 = xDialog.getChild("field1")
+ xCond1 = xDialog.getChild("cond1")
+
+ # tdf#143103: Without the fix in place, this test would have failed with
+ # AssertionError: 'Text color' != ''
+ self.assertEqual("Text color", get_state_as_dict(xField1)['DisplayText'])
+ self.assertEqual("Text color", get_state_as_dict(xCond1)['DisplayText'])
+
+ xColor1 = xDialog.getChild("color1")
+
+ # tdf#142580: Without the fix in place, this test would have failed with
+ # AssertionError: '3' != '1'
+ self.assertEqual('3', get_state_as_dict(xColor1)["EntryCount"])
+
+ # Select Orange Text Color
+ select_pos(xColor1, "2")
+
+ self.assertFalse(is_row_hidden(doc, 0))
+ self.assertTrue(is_row_hidden(doc, 1))
+ self.assertTrue(is_row_hidden(doc, 2))
+ self.assertTrue(is_row_hidden(doc, 3))
+ self.assertFalse(is_row_hidden(doc, 4))
+ self.assertFalse(is_row_hidden(doc, 5))
+ self.assertFalse(is_row_hidden(doc, 6))
+ self.assertTrue(is_row_hidden(doc, 7))
+ self.assertTrue(is_row_hidden(doc, 8))
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/data/autofilter/tdf142580.xlsx b/sc/qa/uitest/data/autofilter/tdf142580.xlsx
new file mode 100644
index 000000000000..9dd8710fbee6
--- /dev/null
+++ b/sc/qa/uitest/data/autofilter/tdf142580.xlsx
Binary files differ