sc/qa/uitest/calc_dialogs/openDialogs.py | 6 ++++-- sc/qa/uitest/calc_tests9/tdf126673.py | 7 +++---- sc/qa/uitest/textToColumns/tdf89907.py | 8 +++++++- 3 files changed, 14 insertions(+), 7 deletions(-)
New commits: commit de4c17e7a7af37196dd36bb62967b557f9aa84f7 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Nov 17 13:14:35 2021 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Nov 17 17:44:39 2021 +0100 uitest: sc: use existing tests to test SetOptimalColumnWidth... ... and SetOptimalRowHeight dialogs Change-Id: Ibdee348d84a8b96d8f698e7fc6db89eb24422f5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125392 Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/uitest/calc_dialogs/openDialogs.py b/sc/qa/uitest/calc_dialogs/openDialogs.py index a816b177341a..1370449d5c9d 100644 --- a/sc/qa/uitest/calc_dialogs/openDialogs.py +++ b/sc/qa/uitest/calc_dialogs/openDialogs.py @@ -46,10 +46,12 @@ dialogs = [ # tested in sc/qa/uitest/calc_tests/formatCells.py # {"command": ".uno:RowHeight", "closeButton": "cancel"}, # tested in sc/qa/uitest/calc_tests/rows.py - {"command": ".uno:SetOptimalRowHeight", "closeButton": "cancel"}, + # {"command": ".uno:SetOptimalRowHeight", "closeButton": "cancel"}, + # tested in sc/qa/uitest/calc_tests9/tdf126673.py # {"command": ".uno:ColumnWidth", "closeButton": "cancel"}, # tested in sc/qa/uitest/calc_tests/columns.py - {"command": ".uno:SetOptimalColumnWidth", "closeButton": "cancel"}, + # {"command": ".uno:SetOptimalColumnWidth", "closeButton": "cancel"}, + # tested in sc/qa/uitest/textToColumns/tdf89907.py # {"command": ".uno:PageFormatDialog", "closeButton": "cancel"}, # tested in sc/qa/uitest/pageFormat/tdf123508.py {"command": ".uno:EditPrintArea", "closeButton": "cancel", "skipTestOK": True}, diff --git a/sc/qa/uitest/calc_tests9/tdf126673.py b/sc/qa/uitest/calc_tests9/tdf126673.py index a303949d0f1a..bcc2c49b69a0 100644 --- a/sc/qa/uitest/calc_tests9/tdf126673.py +++ b/sc/qa/uitest/calc_tests9/tdf126673.py @@ -26,15 +26,14 @@ class tdf126673(UITestCase): gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) #optimal row height with self.ui_test.execute_dialog_through_command(".uno:SetOptimalRowHeight") as xDialog: - pass + xvalue = xDialog.getChild("value") + self.assertEqual("0.00 cm", get_state_as_dict(xvalue)["Text"]) #select A2 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) #row height with self.ui_test.execute_dialog_through_command(".uno:RowHeight", close_button="cancel") as xDialog: xvalue = xDialog.getChild("value") - heightStrOrig = get_state_as_dict(xvalue)["Text"] - heightVal = heightStrOrig[:4] #default 0.45 cm, - self.assertEqual(heightVal > '0.45', True) #new value is bigger then default + self.assertEqual("1.2365 cm", get_state_as_dict(xvalue)["Text"]) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/textToColumns/tdf89907.py b/sc/qa/uitest/textToColumns/tdf89907.py index b046b758a9d8..1270db408bb2 100644 --- a/sc/qa/uitest/textToColumns/tdf89907.py +++ b/sc/qa/uitest/textToColumns/tdf89907.py @@ -9,6 +9,7 @@ from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.calc import enter_text_to_cell from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import change_measurement_unit #Bug 89907 - Text to columns only affects first line when width is auto set class tdf89907(UITestCase): @@ -17,6 +18,8 @@ class tdf89907(UITestCase): xCalcDoc = self.xUITest.getTopFocusWindow() gridwin = xCalcDoc.getChild("grid_window") + change_measurement_unit(self, "Centimeter") + #Add data enter_text_to_cell(gridwin, "A1", "afasdfs.fdfasd.fsadf.fasd") enter_text_to_cell(gridwin, "A2", "3242.43242.3242.2342") @@ -26,7 +29,10 @@ class tdf89907(UITestCase): gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) self.xUITest.executeCommand(".uno:SelectColumn") #Optimal Width - self.xUITest.executeCommand(".uno:SetOptimalColumnWidthDirect") + with self.ui_test.execute_dialog_through_command(".uno:SetOptimalColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual("0.20 cm", get_state_as_dict(xvalue)["Text"]) + # Data - Text to Columns with self.ui_test.execute_dialog_through_command(".uno:TextToColumns") as xDialog: xother = xDialog.getChild("other")