Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/sc/qa/uitest/conditional_format/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 2 kB image not shown  

Quelle  tdf96453.py   Sprache: Python

 
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

from uitest.framework import UITestCase
from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
from libreoffice.calc.document import get_sheet_from_doc
from libreoffice.calc.conditional_format import get_conditional_format_from_sheet

class ConditionalFormatDlgTest(UITestCase):

    def test_tdf96453(self):

        with self.ui_test.load_file(get_url_for_data_file("tdf96453.ods")) as calc_doc:

            sheet = get_sheet_from_doc(calc_doc, 0)
            conditional_format_list = get_conditional_format_from_sheet(sheet)
            self.assertEqual(conditional_format_list.getLength(), 2)

            with self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog", close_button=""as xCondFormatMgr:


                # check that we have exactly two conditional formats in the beginning
                xList = xCondFormatMgr.getChild("CONTAINER")
                list_state = get_state_as_dict(xList)
                self.assertEqual(list_state['Children'], '2')

                # remove one conditional format
                xRemoveBtn = xCondFormatMgr.getChild("remove")
                xRemoveBtn.executeAction("CLICK", tuple())

                # check that the table only shows one
                # but the document still contains two
                list_state = get_state_as_dict(xList)
                self.assertEqual(list_state['Children'], '1')

                self.assertEqual(conditional_format_list.getLength(), 2)

                # add a new conditional format through the add button
                xAddBtn = xCondFormatMgr.getChild("add")
                with self.ui_test.execute_dialog_through_action(xAddBtn, "CLICK", event_name = "ModelessDialogVisible"):
                    pass

                # we need to get a pointer again as the old window has been deleted
                xCondFormatMgr = self.xUITest.getTopFocusWindow()

                # check again that we now have 2 and not 3 entries in the list
                # and still only 2 conditional formats in the document
                xList = xCondFormatMgr.getChild("CONTAINER")
                list_state = get_state_as_dict(xList)
                self.assertEqual(list_state['Children'], '2')

                self.assertEqual(conditional_format_list.getLength(), 2)

                # close the conditional format manager
                xCancelBtn = xCondFormatMgr.getChild("cancel")
                self.ui_test.close_dialog_through_button(xCancelBtn)

# vim: set shiftwidth=4 softtabstop=4 expandtab:

Messung V0.5
C=93 H=99 G=95

¤ Dauer der Verarbeitung: 0.17 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.