sc/qa/uitest/autofilter2/tdf101165.py | 20 ++++++++++++++++++++ sc/qa/uitest/autofilter2/tdf140754.py | 14 ++++++++++++++ 2 files changed, 34 insertions(+)
New commits: commit fbc2e86a97c6499537f6054e7eabf1c96d3d975f Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Sep 26 13:05:29 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Sep 26 14:38:01 2022 +0200 uitest: sc: check 'all' button in autofilter Change-Id: I9a64701446512178cc8deda64f94c293d939ec3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140592 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/uitest/autofilter2/tdf101165.py b/sc/qa/uitest/autofilter2/tdf101165.py index 1cfe32e3aef8..65a1060a5369 100644 --- a/sc/qa/uitest/autofilter2/tdf101165.py +++ b/sc/qa/uitest/autofilter2/tdf101165.py @@ -10,6 +10,7 @@ from uitest.framework import UITestCase from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_url_for_data_file +from uitest.uihelper.common import get_state_as_dict #Bug 101165 - Crashing on a filter selection, every time @@ -24,6 +25,25 @@ class tdf101165(UITestCase): xAll = xFloatWindow.getChild("toggle_all") xAll.executeAction("CLICK", tuple()) + xCheckListMenu = xFloatWindow.getChild("FilterDropDown") + xTreeList = xCheckListMenu.getChild("check_tree_box") + self.assertEqual(3, len(xTreeList.getChildren())) + for i in range(3): + xChild = xTreeList.getChild(str(i)) + self.assertEqual("false", get_state_as_dict(xChild)["IsChecked"]) + + if i == 0 : + self.assertEqual(2, len(xChild.getChildren())) + for j in range(2): + self.assertEqual("false", get_state_as_dict(xChild.getChild(str(j)))["IsChecked"]) + elif i == 1: + self.assertEqual(6, len(xChild.getChildren())) + for j in range(6): + self.assertEqual("false", get_state_as_dict(xChild.getChild(str(j)))["IsChecked"]) + else: + self.assertEqual(0, len(xChild.getChildren())) + + self.assertEqual(get_cell_by_position(calc_doc, 1, 0, 1).getValue(), 6494) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/autofilter2/tdf140754.py b/sc/qa/uitest/autofilter2/tdf140754.py index 10ffcd5ec75a..1d298f832e3f 100644 --- a/sc/qa/uitest/autofilter2/tdf140754.py +++ b/sc/qa/uitest/autofilter2/tdf140754.py @@ -49,6 +49,13 @@ class tdf140754(UITestCase): # since tdf#117267, we are showing the hidden filter rows as inactive elements (25 active + 140 inactive) self.assertEqual(165, len(xList.getChildren())) + for i in range(165): + xChild = xList.getChild(str(i)) + if i < 25: + self.assertEqual("true", get_state_as_dict(xChild)["IsChecked"]) + else: + self.assertEqual("false", get_state_as_dict(xChild)["IsChecked"]) + # Without the fix in place, this test would have crashed here xOkBtn = xFloatWindow.getChild("ok") xOkBtn.executeAction("CLICK", tuple()) @@ -69,6 +76,13 @@ class tdf140754(UITestCase): # since tdf#117267, we are showing the hidden filter rows as inactive elements (10 active + 35 inactive) self.assertEqual(45, len(xList.getChildren())) + for i in range(45): + xChild = xList.getChild(str(i)) + if i < 10: + self.assertEqual("true", get_state_as_dict(xChild)["IsChecked"]) + else: + self.assertEqual("false", get_state_as_dict(xChild)["IsChecked"]) + xOkBtn = xFloatWindow.getChild("ok") xOkBtn.executeAction("CLICK", tuple())