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/.
7 from uitest
.framework
import UITestCase
8 from uitest
.uihelper
.common
import get_state_as_dict
9 from uitest
.uihelper
.common
import select_pos
10 from uitest
.uihelper
.calc
import enter_text_to_cell
11 from libreoffice
.calc
.document
import get_cell_by_position
12 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
14 class tdf45020(UITestCase
):
15 def test_tdf45020_hide_rows_select(self
):
16 calc_doc
= self
.ui_test
.create_doc_in_start_center("calc")
17 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
18 gridwin
= xCalcDoc
.getChild("grid_window")
19 document
= self
.ui_test
.get_component()
20 #in cell A1-A4: apple pear melon mango
21 enter_text_to_cell(gridwin
, "A1", "apple")
22 enter_text_to_cell(gridwin
, "A1", "pear")
23 enter_text_to_cell(gridwin
, "A1", "melon")
24 enter_text_to_cell(gridwin
, "A1", "mango")
26 gridwin
.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A3"}))
28 self
.ui_test
._xUITest
.executeCommand(".uno:HideRow")
30 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
32 gridwin
.executeAction("TYPE", mkPropertyValues({"KEYCODE":"SHIFT+DOWN"}))
33 #verify A1:A4 selected
34 gridWinState
= get_state_as_dict(gridwin
)
35 self
.assertEqual(gridWinState
["MarkedArea"], "Sheet1.A1:Sheet1.A4")
37 self
.ui_test
.close_doc()
38 # vim: set shiftwidth=4 softtabstop=4 expandtab: