1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 from uitest
.framework
import UITestCase
10 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
11 from libreoffice
.calc
.document
import is_row_hidden
12 from uitest
.uihelper
.common
import get_state_as_dict
, get_url_for_data_file
14 class tdf92767(UITestCase
):
16 def test_tdf92767(self
):
17 with self
.ui_test
.load_file(get_url_for_data_file("tdf92767.ods")) as calc_doc
:
18 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
19 gridwin
= xCalcDoc
.getChild("grid_window")
22 self
.assertFalse(is_row_hidden(calc_doc
, i
))
24 gridwin
.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
25 xFloatWindow
= self
.xUITest
.getFloatWindow()
26 xTreeList
= xFloatWindow
.getChild("check_tree_box")
27 xFirstEntry
= xTreeList
.getChild("0")
28 self
.assertEqual('2015', get_state_as_dict(xFirstEntry
)["Text"])
29 self
.assertEqual('7', get_state_as_dict(xFirstEntry
)["Children"])
31 # Deselect all the options but the last one
33 xChild
= xFirstEntry
.getChild(str(i
))
34 xChild
.executeAction("CLICK", tuple())
35 self
.assertEqual('false', get_state_as_dict(xChild
)['IsChecked'])
37 xLastChild
= xFirstEntry
.getChild('6')
38 self
.assertEqual('true', get_state_as_dict(xLastChild
)['IsChecked'])
39 self
.assertEqual('July', get_state_as_dict(xLastChild
)['Text'])
41 xOkBtn
= xFloatWindow
.getChild("ok")
42 xOkBtn
.executeAction("CLICK", tuple())
45 self
.assertTrue(is_row_hidden(calc_doc
, i
))
47 # Without the fix in place, this test would have failed here
48 self
.assertFalse(is_row_hidden(calc_doc
, 23))
49 self
.assertFalse(is_row_hidden(calc_doc
, 24))
50 self
.assertFalse(is_row_hidden(calc_doc
, 25))
52 # vim: set shiftwidth=4 softtabstop=4 expandtab: