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
.calc
.document
import get_cell_by_position
11 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
12 from uitest
.uihelper
.common
import get_url_for_data_file
14 class tdf133855(UITestCase
):
16 def test_tdf133855(self
):
18 with self
.ui_test
.load_file(get_url_for_data_file("tdf133855.ods")) as calc_doc
:
19 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
21 results
= ['A', 'B', 'C', 'D', 'E', 'F']
23 # Conditional formatted dropdown list
24 for i
in range(len(results
)):
25 gridwin
= xCalcDoc
.getChild("grid_window")
26 gridwin
.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "6", "ROW": "5"}))
28 #Select the TreeList UI Object
29 xWin
= self
.xUITest
.getTopFocusWindow()
30 xlist
= xWin
.getChild("list")
32 xListItem
= xlist
.getChild( str(i
) )
33 xListItem
.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
34 self
.assertEqual(get_cell_by_position(calc_doc
, 0, 6, 5).getString(), results
[i
])
36 # normal dropdown list
37 for i
in range(len(results
)):
38 gridwin
= xCalcDoc
.getChild("grid_window")
39 gridwin
.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "6", "ROW": "6"}))
41 #Select the TreeList UI Object
42 xWin
= self
.xUITest
.getTopFocusWindow()
43 xlist
= xWin
.getChild("list")
45 xListItem
= xlist
.getChild( str(i
) )
46 xListItem
.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
47 self
.assertEqual(get_cell_by_position(calc_doc
, 0, 6, 6).getString(), results
[i
])
49 # vim: set shiftwidth=4 softtabstop=4 expandtab: