sc/qa/uitest/autofilter2/tdf95520.py |   49 +++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

New commits:
commit efdbe4179d151899c8a9a9de8f5bc1660700b27d
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue May 9 14:37:31 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue May 9 19:26:36 2023 +0200

    tdf#95520: sc: Add UItest
    
    Change-Id: Ia4e30a1e4dea3dbd9eb40c29c96e5ab3d700e54e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151578
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/qa/uitest/autofilter2/tdf95520.py 
b/sc/qa/uitest/autofilter2/tdf95520.py
new file mode 100644
index 000000000000..ec245912c5a2
--- /dev/null
+++ b/sc/qa/uitest/autofilter2/tdf95520.py
@@ -0,0 +1,49 @@
+# -*- 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_url_for_data_file
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from libreoffice.calc.document import get_cell_by_position
+
+class tdf95520(UITestCase):
+    def test_tdf95520(self):
+        # Reuse existing document
+        with self.ui_test.load_file(get_url_for_data_file("tdf144549.ods")) as 
doc:
+            calcDoc = self.xUITest.getTopFocusWindow()
+            xGridWin = calcDoc.getChild("grid_window")
+
+            xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": 
"", "COL": "1", "ROW": "0"}))
+            xFloatWindow = self.xUITest.getFloatWindow()
+            xMenu = xFloatWindow.getChild("menu")
+
+            # Sort by Color
+            xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+            xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+            xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+            # Choose Red
+            xSubFloatWindow = self.xUITest.getFloatWindow()
+            xSubMenu = xSubFloatWindow.getChild("textcolor")
+            xSubMenu.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"DOWN"}))
+            xSubMenu.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"RETURN"}))
+
+            self.assertEqual("Jan", get_cell_by_position(doc, 0, 0, 
1).getString())
+            self.assertEqual("Dez", get_cell_by_position(doc, 0, 0, 
2).getString())
+            self.assertEqual("Aug", get_cell_by_position(doc, 0, 0, 
3).getString())
+            self.assertEqual("Nov", get_cell_by_position(doc, 0, 0, 
4).getString())
+            self.assertEqual("Jun", get_cell_by_position(doc, 0, 0, 
5).getString())
+            self.assertEqual("Apr", get_cell_by_position(doc, 0, 0, 
6).getString())
+            self.assertEqual("Mai", get_cell_by_position(doc, 0, 0, 
7).getString())
+            self.assertEqual("Okt", get_cell_by_position(doc, 0, 0, 
8).getString())
+            self.assertEqual("Feb", get_cell_by_position(doc, 0, 0, 
9).getString())
+            self.assertEqual("Mär", get_cell_by_position(doc, 0, 0, 
10).getString())
+            self.assertEqual("Jul", get_cell_by_position(doc, 0, 0, 
11).getString())
+            self.assertEqual("Sep", get_cell_by_position(doc, 0, 0, 
12).getString())
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:

Reply via email to