# -*- 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.calc import enter_text_to_cell from uitest.uihelper.common import select_by_text, select_pos from uitest.uihelper.common import get_url_for_data_file
from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues
class Subtotals(UITestCase):
def test_tdf114720(self): with self.ui_test.create_doc_in_start_center("calc") as document:
XcalcDoc = self.xUITest.getTopFocusWindow()
gridwin = XcalcDoc.getChild("grid_window")
# check cancel button with self.ui_test.execute_dialog_through_command(".uno:DataSubTotals", close_button="cancel"): pass
def test_tdf88792(self): with self.ui_test.load_file(get_url_for_data_file("tdf88792.ods")) as calc_doc:
XcalcDoc = self.xUITest.getTopFocusWindow()
gridwin = XcalcDoc.getChild("grid_window")
# go to cell A1
gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) # Select from the menu bar Data # Select option subtotal # Subtotal dialog displays with self.ui_test.execute_dialog_through_command(".uno:DataSubTotals") as xDialog: # Select group by: Category
xGroupBy = xDialog.getChild("group_by1")
select_by_text(xGroupBy, "Category") # Select calculate subtotals for the months - selected by default # Select tab options
xTabs = xDialog.getChild("tabcontrol")
select_pos(xTabs, "3") # select option include formats
xformats = xDialog.getChild("formats")
xformats.executeAction("CLICK", tuple()) # apply with OK
def test_tdf88735(self): with self.ui_test.load_file(get_url_for_data_file("tdf88735.ods")) as calc_doc: # 1 select all cells
self.xUITest.executeCommand(".uno:SelectAll")#use uno command Menu Edit->Select All # 2 invoke sub-total menu and select none with self.ui_test.execute_dialog_through_command(".uno:DataSubTotals") as xDialog:
xGroupBy = xDialog.getChild("group_by1")
select_by_text(xGroupBy, "- none -") # 2 invoke sort menu and... crash with self.ui_test.execute_dialog_through_command(".uno:DataSort", close_button="cancel"): pass
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.