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/.
10 from uitest
.framework
import UITestCase
11 from uitest
.uihelper
.common
import get_url_for_data_file
, get_state_as_dict
12 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
14 class tdf124412(UITestCase
):
16 def test_tdf124412(self
):
18 with self
.ui_test
.load_file(get_url_for_data_file("tdf124412.ods")):
20 xTopWindow
= self
.xUITest
.getTopFocusWindow()
21 gridwin
= xTopWindow
.getChild("grid_window")
23 gridwin
.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A13"}))
25 with self
.ui_test
.execute_modeless_dialog_through_command(".uno:ConditionalFormatDialog") as xCondFormatDlg
:
26 xCondition1
= xCondFormatDlg
.getChild("Condition 1")
27 xCondition2
= xCondFormatDlg
.getChild("Condition 2")
29 # This is empty because the entry is selected
30 self
.assertEqual("", get_state_as_dict(xCondition1
)["DisplayText"])
32 # Without the fix in place, this test would have failed with
33 # AssertionError: 'Date is last month' != 'Date is today'
34 self
.assertEqual("Date is last month", get_state_as_dict(xCondition2
)["DisplayText"])
36 # vim: set shiftwidth=4 softtabstop=4 expandtab: