summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-09-21 13:59:26 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-09-21 15:31:53 +0200
commit4ba0460e3cf3ce33794090968fd4c906422bbd25 (patch)
tree618edacc8780839764dc2a759258582d9a1e932d /sc
parente2e1da3cc89942443832ea018ced68eb41e3d75a (diff)
tdf#142579, tdf#143103: sc: Add UItest
Change-Id: I2bc3eabeeb23534d985649c4191798ca9281b7e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122389 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/autofilter/colorfilter.py43
-rw-r--r--sc/qa/uitest/data/autofilter/tdf142579.xlsxbin0 -> 11151 bytes
2 files changed, 43 insertions, 0 deletions
diff --git a/sc/qa/uitest/autofilter/colorfilter.py b/sc/qa/uitest/autofilter/colorfilter.py
index a9d0d5d950aa..65a4ca5a483c 100644
--- a/sc/qa/uitest/autofilter/colorfilter.py
+++ b/sc/qa/uitest/autofilter/colorfilter.py
@@ -57,4 +57,47 @@ class ColorFilterTest(UITestCase):
self.assertTrue(is_row_hidden(doc, 7))
self.assertTrue(is_row_hidden(doc, 8))
+ def test_tdf142579(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf142579.xlsx")) as doc:
+
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A8"}))
+
+ # Blue Background Color rows are displayed
+ self.assertFalse(is_row_hidden(doc, 0))
+ self.assertFalse(is_row_hidden(doc, 1))
+ self.assertTrue(is_row_hidden(doc, 2))
+ self.assertTrue(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))
+
+ 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: 'aaa' != ''
+ self.assertEqual("aaa", get_state_as_dict(xField1)['DisplayText'])
+ 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: '7' != '3'
+ self.assertEqual('7', get_state_as_dict(xColor1)["EntryCount"])
+
+ # Select Red Background Color
+ select_pos(xColor1, "3")
+
+ 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.assertTrue(is_row_hidden(doc, 4))
+ self.assertTrue(is_row_hidden(doc, 5))
+ self.assertTrue(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.xlsx b/sc/qa/uitest/data/autofilter/tdf142579.xlsx
new file mode 100644
index 000000000000..1fc53eba952f
--- /dev/null
+++ b/sc/qa/uitest/data/autofilter/tdf142579.xlsx
Binary files differ