summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-11-16 12:39:04 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2020-11-16 15:35:49 +0100
commit90307f1cb30dd1d2e0ec5f19104cbf1515616537 (patch)
treeb7c4d1288cd6c5f445d32d66aa35978b0e03b671 /sc/qa
parent956da380f9c450adad651987ed17b4302b8acbae (diff)
uitest: autofilter: add test for different searches
Motivated by https://bugs.documentfoundation.org/show_bug.cgi?id=122419#c21 Change-Id: I2086ed604c50b513019c7023ad4c01df9c5edb4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105925 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/uitest/autofilter/autofilter.py66
1 files changed, 66 insertions, 0 deletions
diff --git a/sc/qa/uitest/autofilter/autofilter.py b/sc/qa/uitest/autofilter/autofilter.py
index a97a9fe1f3db..78a5887a6c4c 100644
--- a/sc/qa/uitest/autofilter/autofilter.py
+++ b/sc/qa/uitest/autofilter/autofilter.py
@@ -9,6 +9,7 @@ from uitest.framework import UITestCase
from uitest.uihelper.common import get_state_as_dict
from libreoffice.uno.propertyvalue import mkPropertyValues
from libreoffice.calc.document import get_row
+from uitest.uihelper.calc import enter_text_to_cell
import org.libreoffice.unotest
import pathlib
@@ -140,4 +141,69 @@ class AutofilterTest(UITestCase):
self.ui_test.close_doc()
+ def test_differentSearches(self):
+ self.ui_test.create_doc_in_start_center("calc")
+ document = self.ui_test.get_component()
+ calcDoc = self.xUITest.getTopFocusWindow()
+
+ xGridWindow = calcDoc.getChild("grid_window")
+ enter_text_to_cell(xGridWindow, "A1", "X")
+ enter_text_to_cell(xGridWindow, "A2", "11")
+ enter_text_to_cell(xGridWindow, "A3", "22")
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
+
+ self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
+
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+
+ xFloatWindow = self.xUITest.getFloatWindow()
+
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+
+ xList = xCheckListMenu.getChild("check_list_box")
+
+ self.assertEqual(2, len(xList.getChildren()))
+ self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text'])
+ self.assertEqual("22", get_state_as_dict(xList.getChild('1'))['Text'])
+
+ xSearchEdit = xFloatWindow.getChild("search_edit")
+ xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "11"}))
+
+ self.assertEqual(1, len(xList.getChildren()))
+ self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text'])
+
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.assertFalse(is_row_hidden(document, 0))
+ self.assertFalse(is_row_hidden(document, 1))
+ self.assertTrue(is_row_hidden(document, 2))
+
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+
+ xFloatWindow = self.xUITest.getFloatWindow()
+
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+
+ xList = xCheckListMenu.getChild("check_list_box")
+
+ self.assertEqual(2, len(xList.getChildren()))
+ self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text'])
+ self.assertEqual("22", get_state_as_dict(xList.getChild('1'))['Text'])
+
+ xSearchEdit = xFloatWindow.getChild("search_edit")
+ xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "22"}))
+
+ self.assertEqual(1, len(xList.getChildren()))
+ self.assertEqual("22", get_state_as_dict(xList.getChild('0'))['Text'])
+
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+
+ self.assertFalse(is_row_hidden(document, 0))
+ self.assertTrue(is_row_hidden(document, 1))
+ self.assertFalse(is_row_hidden(document, 2))
+
+ self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab: