diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-02-12 12:16:29 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-02-12 14:10:44 +0100 |
commit | cca29491a338cb7d43c373107bb73822e1d4e4a4 (patch) | |
tree | 6ed77fa0f4c4e6c0de1412dac36db47320be80c0 | |
parent | 5dadcd1ea9e63bcbc0a5d4c4cd95d7d8b37edef9 (diff) |
tdf#158440: sc: Add UItest
Based on https://gerrit.libreoffice.org/c/core/+/163021/comments/ff5eb7d3_2426919e
Change-Id: I579dce86775599dc215395b93b15bc9a2f510cb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163243
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sc/qa/uitest/autofilter2/tdf158440.py | 52 | ||||
-rw-r--r-- | sc/qa/uitest/data/autofilter/tdf158440.ods | bin | 0 -> 20601 bytes |
2 files changed, 52 insertions, 0 deletions
diff --git a/sc/qa/uitest/autofilter2/tdf158440.py b/sc/qa/uitest/autofilter2/tdf158440.py new file mode 100644 index 000000000000..df0b17c6706e --- /dev/null +++ b/sc/qa/uitest/autofilter2/tdf158440.py @@ -0,0 +1,52 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# 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 +from libreoffice.uno.propertyvalue import mkPropertyValues +from libreoffice.calc.document import get_cell_by_position + +class tdf158440(UITestCase): + + def test_tdf158440(self): + + with self.ui_test.load_file(get_url_for_data_file("tdf158440.ods")) as calc_doc: + + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) + xFloatWindow = self.xUITest.getFloatWindow() + xAll = xFloatWindow.getChild("toggle_all") + xAll.executeAction("CLICK", tuple()) + + xCheckListMenu = xFloatWindow.getChild("FilterDropDown") + xList = xCheckListMenu.getChild("check_list_box") + self.assertEqual(529, len(xList.getChildren())) + + xFirstEntry = xList.getChild("1") + xFirstEntry.executeAction("CLICK", tuple()) + + xOkBtn = xFloatWindow.getChild("ok") + xOkBtn.executeAction("CLICK", tuple()) + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + + gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"})) + + self.assertEqual("111", get_state_as_dict(gridwin)["CurrentRow"]) + self.assertEqual("0", get_state_as_dict(gridwin)["CurrentColumn"]) + + gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"})) + + # Without the fix in place, this test would have failed with + # AssertionError: '535' != '111' + self.assertEqual("535", get_state_as_dict(gridwin)["CurrentRow"]) + self.assertEqual("0", get_state_as_dict(gridwin)["CurrentColumn"]) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/data/autofilter/tdf158440.ods b/sc/qa/uitest/data/autofilter/tdf158440.ods Binary files differnew file mode 100644 index 000000000000..128b876a6526 --- /dev/null +++ b/sc/qa/uitest/data/autofilter/tdf158440.ods |