Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / uitest / calc_tests / autofilter.py
blob431043b02f03e244f55294c14feef450451224bf
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 from uitest.framework import UITestCase
9 from uitest.path import get_srcdir_url
11 from libreoffice.uno.propertyvalue import mkPropertyValues
13 import time
15 def get_url_for_data_file(file_name):
16 return get_srcdir_url() + "/uitest/calc_tests/data/" + file_name
18 class AutofilterTest(UITestCase):
20 def test_launch_autofilter(self):
21 doc = self.ui_test.load_file(get_url_for_data_file("autofilter.ods"))
23 xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
24 xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "1"}))
26 time.sleep(1)
28 self.ui_test.close_doc()
30 def test_hierarchy(self):
31 doc = self.ui_test.load_file(get_url_for_data_file("autofilter.ods"))
33 xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
34 xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
36 xFloatWindow = self.xUITest.getFloatWindow()
37 xCheckListMenu = xFloatWindow.getChild("check_list_menu")
39 xTreeList = xCheckListMenu.getChild("check_list_box")
40 xFirstEntry = xTreeList.getChild("0")
42 xFirstEntry.executeAction("CLICK", tuple())
44 xOkBtn = xFloatWindow.getChild("ok")
45 xOkBtn.executeAction("CLICK", tuple())
47 self.ui_test.close_doc()
49 # vim: set shiftwidth=4 softtabstop=4 expandtab: