summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-09-22 17:04:28 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-09-22 23:20:58 +0200
commit2dd6c7e5d59126e28bf478439c25f9f4cbc3422c (patch)
tree3e60e36d1ba5dbed62c49c6d763dd01adb189840 /sc
parent0a4c883a7e0dd3ba66d8cc86c6f77bd3578a0a92 (diff)
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@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/autofilter/colorfilter.py37
-rw-r--r--sc/qa/uitest/data/autofilter/tdf142579_cond_format.odsbin0 -> 9541 bytes
2 files changed, 37 insertions, 0 deletions
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
--- /dev/null
+++ b/sc/qa/uitest/data/autofilter/tdf142579_cond_format.ods
Binary files differ