sc/qa/uitest/calc_tests/columns.py | 286 +++--- sc/qa/uitest/calc_tests/formatCells.py | 171 +-- sc/qa/uitest/calc_tests/rows.py | 216 ++-- sc/qa/uitest/calc_tests7/tdf137397.py | 26 sc/qa/uitest/calc_tests9/tdf126673.py | 30 sc/qa/uitest/calc_tests9/tdf137446.py | 36 sc/qa/uitest/chart/chartArea.py | 268 ++--- sc/qa/uitest/chart/chartDataLabels.py | 40 sc/qa/uitest/chart/chartGrid.py | 274 +++--- sc/qa/uitest/chart/chartLegend.py | 38 sc/qa/uitest/chart/chartTitles.py | 38 sc/qa/uitest/chart/chartWall.py | 246 ++--- sc/qa/uitest/chart/chartXAxis.py | 438 ++++----- sc/qa/uitest/chart/chartYAxis.py | 442 ++++----- sc/qa/uitest/chart/formatDataSeries.py | 148 +-- sc/qa/uitest/chart/tdf93506_trendline.py | 820 +++++++++--------- sc/qa/uitest/chart2/tdf133630.py | 58 - sc/qa/uitest/textToColumns/tdf89907.py | 80 - sd/qa/uitest/impress_tests/tdf119246.py | 52 - sd/qa/uitest/impress_tests/tdf134734.py | 3 sd/qa/uitest/impress_tests/tdf137729.py | 4 sd/qa/uitest/impress_tests/tdf152295.py | 65 - sd/qa/uitest/impress_tests/textColumnsDialog.py | 53 - sd/qa/uitest/impress_tests2/tdf139511.py | 34 sd/qa/uitest/impress_tests2/tdf82616.py | 66 - sw/qa/uitest/chapterNumbering/chapterNumbering.py | 110 +- sw/qa/uitest/sidebar/tdf133189.py | 28 sw/qa/uitest/sidebar/tdf135590.py | 73 - sw/qa/uitest/sidebar/tdf99711.py | 25 sw/qa/uitest/table/tableProperties.py | 342 +++---- sw/qa/uitest/table/tdf134881_colProportionalAdjust.py | 46 - sw/qa/uitest/writer_tests2/formatBulletsNumbering.py | 138 +-- sw/qa/uitest/writer_tests2/formatParagraph.py | 250 ++--- sw/qa/uitest/writer_tests3/lineNumbering.py | 102 +- sw/qa/uitest/writer_tests3/pageDialog.py | 27 sw/qa/uitest/writer_tests4/tdf138546.py | 28 sw/qa/uitest/writer_tests5/columns.py | 46 - sw/qa/uitest/writer_tests6/tdf128431.py | 36 sw/qa/uitest/writer_tests7/forms.py | 58 - sw/qa/uitest/writer_tests7/tdf132169.py | 33 uitest/impress_tests/drawinglayer.py | 137 +-- uitest/uitest/uihelper/common.py | 10 42 files changed, 2711 insertions(+), 2710 deletions(-)
New commits: commit 7355c2ee8a9f0811d1cd3d37fc9dac2ad5f95774 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Feb 6 13:52:58 2023 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Feb 7 09:33:40 2023 +0000 uitest: reset value when changing the measurement unit Otherwise, changing it in one test might affect other tests Use @contextmanager decorator to change it back to default 'Inch' at the end of the test even if the test hits an assert Change-Id: I1e7b35019cd19b490aa619c0a866bb9f93820950 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146583 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/qa/uitest/calc_tests/columns.py b/sc/qa/uitest/calc_tests/columns.py index 6813471d71fe..ed594510f175 100644 --- a/sc/qa/uitest/calc_tests/columns.py +++ b/sc/qa/uitest/calc_tests/columns.py @@ -14,97 +14,97 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class CalcColumns(UITestCase): def test_column_width(self): with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") - - #select A1 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - #column width - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - xdefault = xDialog.getChild("default") - self.assertEqual(get_state_as_dict(xdefault)["Selected"], "true") #default selected - - # tdf#144247: Without the fix in place, this test would have failed with - # AssertionError: '2.26 cm' != '2.2578 cm' - self.assertEqual("2.26 cm", get_state_as_dict(xvalue)["Text"]) - xvalue.executeAction("UP", tuple()) - self.assertEqual("2.30 cm", get_state_as_dict(xvalue)["Text"]) - self.assertEqual(get_state_as_dict(xdefault)["Selected"], "false") #default not selected - xdefault.executeAction("CLICK", tuple()) #click default - self.assertEqual("2.26 cm", get_state_as_dict(xvalue)["Text"]) - - #write your own value - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) - # Click Ok - #verify - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth", close_button="cancel") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + #select A1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + #column width + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + xdefault = xDialog.getChild("default") + self.assertEqual(get_state_as_dict(xdefault)["Selected"], "true") #default selected + + # tdf#144247: Without the fix in place, this test would have failed with + # AssertionError: '2.26 cm' != '2.2578 cm' + self.assertEqual("2.26 cm", get_state_as_dict(xvalue)["Text"]) + xvalue.executeAction("UP", tuple()) + self.assertEqual("2.30 cm", get_state_as_dict(xvalue)["Text"]) + self.assertEqual(get_state_as_dict(xdefault)["Selected"], "false") #default not selected + xdefault.executeAction("CLICK", tuple()) #click default + self.assertEqual("2.26 cm", get_state_as_dict(xvalue)["Text"]) + + #write your own value + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) + # Click Ok + #verify + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth", close_button="cancel") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") def test_column_width_two_columns(self): with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1", "EXTEND":"1"})) + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1", "EXTEND":"1"})) - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - #write your own value - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) - # Click Ok - #verify - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + #write your own value + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) + # Click Ok + #verify + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") def test_column_width_copy(self): with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") - - #select A1 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - #column width - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) - # Click Ok - #select column 1 - self.xUITest.executeCommand(".uno:SelectColumn") - #copy - self.xUITest.executeCommand(".uno:Copy") - #select C1 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) - #paste - self.xUITest.executeCommand(".uno:Paste") - #verify - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + #select A1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + #column width + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) + # Click Ok + #select column 1 + self.xUITest.executeCommand(".uno:SelectColumn") + #copy + self.xUITest.executeCommand(".uno:Copy") + #select C1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) + #paste + self.xUITest.executeCommand(".uno:Paste") + #verify + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") def test_column_hide_show(self): @@ -155,73 +155,73 @@ class CalcColumns(UITestCase): def test_tdf117522_column_width_insert_left(self): with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") - - #select C1 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) - #column width - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) - # Click Ok - #select D1 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"})) - #column width - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"2 cm"})) - # Click Ok - #select E1 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"})) - #column width - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"3 cm"})) - # Click Ok - #select columns C-E - gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:E1"})) - self.xUITest.executeCommand(".uno:SelectColumn") - #Insert Columns Left - self.xUITest.executeCommand(".uno:InsertColumnsBefore") - #verify - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") - - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"})) - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.00 cm") - - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"})) - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.00 cm") - - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "F1"})) - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") - - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "G1"})) - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.00 cm") - - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "H1"})) - with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.00 cm") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + #select C1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) + #column width + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) + # Click Ok + #select D1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"})) + #column width + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"2 cm"})) + # Click Ok + #select E1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"})) + #column width + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"3 cm"})) + # Click Ok + #select columns C-E + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:E1"})) + self.xUITest.executeCommand(".uno:SelectColumn") + #Insert Columns Left + self.xUITest.executeCommand(".uno:InsertColumnsBefore") + #verify + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"})) + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.00 cm") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"})) + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.00 cm") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "F1"})) + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "G1"})) + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.00 cm") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "H1"})) + with self.ui_test.execute_dialog_through_command(".uno:ColumnWidth") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.00 cm") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests/formatCells.py b/sc/qa/uitest/calc_tests/formatCells.py index 16fb19c8cc18..e00f6d0fe01a 100644 --- a/sc/qa/uitest/calc_tests/formatCells.py +++ b/sc/qa/uitest/calc_tests/formatCells.py @@ -246,108 +246,109 @@ class formatCell(UITestCase): def test_minimal_border_width(self): #borderpage.ui, tdf#137790 with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") #set points pt measurement - change_measurement_unit(self, "Point") + with change_measurement_unit(self, "Point"): - #select cell A1 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - #format - cell - with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog: - xTabs = xDialog.getChild("tabcontrol") - select_pos(xTabs, "5") #tab Borders + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + #select cell A1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + #format - cell + with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog: + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "5") #tab Borders - linewidthmf = xDialog.getChild("linewidthmf") - xLineSet = xDialog.getChild('lineset') + linewidthmf = xDialog.getChild("linewidthmf") + xLineSet = xDialog.getChild('lineset') - # check line-width for default solid line - self.assertEqual('0', get_state_as_dict(xLineSet)['SelectedItemPos']) - widthVal = get_state_as_dict(linewidthmf)["Text"] - self.assertEqual(widthVal, '0.75 pt') + # check line-width for default solid line + self.assertEqual('0', get_state_as_dict(xLineSet)['SelectedItemPos']) + widthVal = get_state_as_dict(linewidthmf)["Text"] + self.assertEqual(widthVal, '0.75 pt') - # set line style to "double" (minimal width is taken) - xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": '16'})) - widthVal = get_state_as_dict(linewidthmf)["Text"] - # minimum predefined width is Medium (1.50 pt) - self.assertEqual(widthVal, '1.50 pt') + # set line style to "double" (minimal width is taken) + xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": '16'})) + widthVal = get_state_as_dict(linewidthmf)["Text"] + # minimum predefined width is Medium (1.50 pt) + self.assertEqual(widthVal, '1.50 pt') - # set line style to "solid" - xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": "1"})) - widthVal = get_state_as_dict(linewidthmf)["Text"] - self.assertEqual(widthVal, '1.50 pt') + # set line style to "solid" + xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": "1"})) + widthVal = get_state_as_dict(linewidthmf)["Text"] + self.assertEqual(widthVal, '1.50 pt') - # make custom line width - linewidthmf.executeAction("UP", tuple()) - linewidthmf.executeAction("UP", tuple()) - linewidthmf.executeAction("UP", tuple()) - widthVal = get_state_as_dict(linewidthmf)["Text"] - self.assertEqual(widthVal, '2.25 pt') + # make custom line width + linewidthmf.executeAction("UP", tuple()) + linewidthmf.executeAction("UP", tuple()) + linewidthmf.executeAction("UP", tuple()) + widthVal = get_state_as_dict(linewidthmf)["Text"] + self.assertEqual(widthVal, '2.25 pt') - # set line style to "double" (minimal width is not taken) - xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": "8"})) - widthVal = get_state_as_dict(linewidthmf)["Text"] - self.assertEqual(widthVal, '2.25 pt') + # set line style to "double" (minimal width is not taken) + xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": "8"})) + widthVal = get_state_as_dict(linewidthmf)["Text"] + self.assertEqual(widthVal, '2.25 pt') def test_format_cell_borders_tab(self): #borderpage.ui with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") #set points pt measurement - change_measurement_unit(self, "Point") - - #select cell A1 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - #format - cell - with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog: - xTabs = xDialog.getChild("tabcontrol") - select_pos(xTabs, "5") #tab Borders - xsync = xDialog.getChild("sync") - xleftmf = xDialog.getChild("leftmf") - xrightmf = xDialog.getChild("rightmf") - xtopmf = xDialog.getChild("topmf") - xbottommf = xDialog.getChild("bottommf") - - xsync.executeAction("CLICK", tuple()) #uncheck Synchronize - xleftmf.executeAction("UP", tuple()) - xrightmf.executeAction("UP", tuple()) - xrightmf.executeAction("UP", tuple()) - xtopmf.executeAction("UP", tuple()) - xtopmf.executeAction("UP", tuple()) - xtopmf.executeAction("UP", tuple()) - xbottommf.executeAction("UP", tuple()) - xbottommf.executeAction("UP", tuple()) - xbottommf.executeAction("UP", tuple()) - xbottommf.executeAction("UP", tuple()) - - leftVal = get_state_as_dict(xleftmf)["Text"] - rightVal = get_state_as_dict(xrightmf)["Text"] - topVal = get_state_as_dict(xtopmf)["Text"] - bottomVal = get_state_as_dict(xbottommf)["Text"] - - - # Verify select cell A1 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - #format - cell - with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog: - xTabs = xDialog.getChild("tabcontrol") - select_pos(xTabs, "5") #tab Borders - xsync = xDialog.getChild("sync") - xleftmf = xDialog.getChild("leftmf") - xrightmf = xDialog.getChild("rightmf") - xtopmf = xDialog.getChild("topmf") - xbottommf = xDialog.getChild("bottommf") - - self.assertEqual(get_state_as_dict(xsync)["Selected"], "false") - self.assertEqual(get_state_as_dict(xleftmf)["Text"] == leftVal, True) - self.assertEqual(get_state_as_dict(xrightmf)["Text"] == rightVal, True) - self.assertEqual(get_state_as_dict(xtopmf)["Text"] == topVal, True) - self.assertEqual(get_state_as_dict(xbottommf)["Text"] == bottomVal, True) + with change_measurement_unit(self, "Point"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + #select cell A1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + #format - cell + with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog: + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "5") #tab Borders + xsync = xDialog.getChild("sync") + xleftmf = xDialog.getChild("leftmf") + xrightmf = xDialog.getChild("rightmf") + xtopmf = xDialog.getChild("topmf") + xbottommf = xDialog.getChild("bottommf") + + xsync.executeAction("CLICK", tuple()) #uncheck Synchronize + xleftmf.executeAction("UP", tuple()) + xrightmf.executeAction("UP", tuple()) + xrightmf.executeAction("UP", tuple()) + xtopmf.executeAction("UP", tuple()) + xtopmf.executeAction("UP", tuple()) + xtopmf.executeAction("UP", tuple()) + xbottommf.executeAction("UP", tuple()) + xbottommf.executeAction("UP", tuple()) + xbottommf.executeAction("UP", tuple()) + xbottommf.executeAction("UP", tuple()) + + leftVal = get_state_as_dict(xleftmf)["Text"] + rightVal = get_state_as_dict(xrightmf)["Text"] + topVal = get_state_as_dict(xtopmf)["Text"] + bottomVal = get_state_as_dict(xbottommf)["Text"] + + + # Verify select cell A1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + #format - cell + with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog: + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "5") #tab Borders + xsync = xDialog.getChild("sync") + xleftmf = xDialog.getChild("leftmf") + xrightmf = xDialog.getChild("rightmf") + xtopmf = xDialog.getChild("topmf") + xbottommf = xDialog.getChild("bottommf") + + self.assertEqual(get_state_as_dict(xsync)["Selected"], "false") + self.assertEqual(get_state_as_dict(xleftmf)["Text"] == leftVal, True) + self.assertEqual(get_state_as_dict(xrightmf)["Text"] == rightVal, True) + self.assertEqual(get_state_as_dict(xtopmf)["Text"] == topVal, True) + self.assertEqual(get_state_as_dict(xbottommf)["Text"] == bottomVal, True) diff --git a/sc/qa/uitest/calc_tests/rows.py b/sc/qa/uitest/calc_tests/rows.py index fe65f72365cd..a9e34c67347b 100644 --- a/sc/qa/uitest/calc_tests/rows.py +++ b/sc/qa/uitest/calc_tests/rows.py @@ -14,99 +14,101 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class CalcRows(UITestCase): def test_row_height(self): with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") - - #select A1 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - #row height - with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: - xvalue = xDialog.getChild("value") - xdefault = xDialog.getChild("default") - self.assertEqual(get_state_as_dict(xdefault)["Selected"], "true") #default selected - - # tdf#144247: Without the fix in place, this test would have failed with - # AssertionError: '0.45 cm' != '0.4516 cm' - self.assertEqual("0.45 cm", get_state_as_dict(xvalue)["Text"]) - xvalue.executeAction("UP", tuple()) - self.assertEqual("0.50 cm", get_state_as_dict(xvalue)["Text"]) - - self.assertEqual(get_state_as_dict(xdefault)["Selected"], "false") #default not selected - xdefault.executeAction("CLICK", tuple()) #click default - self.assertEqual("0.45 cm", get_state_as_dict(xvalue)["Text"]) - - #write your own value - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) - # Click Ok - #verify - with self.ui_test.execute_dialog_through_command(".uno:RowHeight", close_button="cancel") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + #select A1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + #row height + with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: + xvalue = xDialog.getChild("value") + xdefault = xDialog.getChild("default") + self.assertEqual(get_state_as_dict(xdefault)["Selected"], "true") #default selected + + # tdf#144247: Without the fix in place, this test would have failed with + # AssertionError: '0.45 cm' != '0.4516 cm' + self.assertEqual("0.45 cm", get_state_as_dict(xvalue)["Text"]) + xvalue.executeAction("UP", tuple()) + self.assertEqual("0.50 cm", get_state_as_dict(xvalue)["Text"]) + + self.assertEqual(get_state_as_dict(xdefault)["Selected"], "false") #default not selected + xdefault.executeAction("CLICK", tuple()) #click default + self.assertEqual("0.45 cm", get_state_as_dict(xvalue)["Text"]) + + #write your own value + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) + # Click Ok + #verify + with self.ui_test.execute_dialog_through_command(".uno:RowHeight", close_button="cancel") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") def test_row_height_two_rows(self): with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3", "EXTEND":"1"})) - with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: - xvalue = xDialog.getChild("value") - #write your own value - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) - # Click Ok - #verify - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3", "EXTEND":"1"})) - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) - with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: + xvalue = xDialog.getChild("value") + #write your own value + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) + # Click Ok + #verify + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) + with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") def test_tdf89140_row_height_copy(self): #Bug 89140 - Calc row paste doesn't keep row height with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") - - #select A1 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - #row height - with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: - xvalue = xDialog.getChild("value") - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) - # Click Ok - #select row 1 - self.xUITest.executeCommand(".uno:SelectRow") - #copy - self.xUITest.executeCommand(".uno:Copy") - #select A3 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) - #paste - self.xUITest.executeCommand(".uno:Paste") - #verify - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) - with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + + #select A1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + #row height + with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: + xvalue = xDialog.getChild("value") + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) + # Click Ok + #select row 1 + self.xUITest.executeCommand(".uno:SelectRow") + #copy + self.xUITest.executeCommand(".uno:Copy") + #select A3 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) + #paste + self.xUITest.executeCommand(".uno:Paste") + #verify + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) + with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") def test_row_hide_show(self): @@ -157,36 +159,36 @@ class CalcRows(UITestCase): def test_row_height_insert_below(self): with self.ui_test.create_doc_in_start_center("calc"): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - - change_measurement_unit(self, "Centimeter") - - #select A3 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) - #row height - with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: - xvalue = xDialog.getChild("value") - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) - xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) - xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) - # Click Ok - #select row 3 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) - self.xUITest.executeCommand(".uno:SelectRow") - #insert rows below - self.xUITest.executeCommand(".uno:InsertRowsAfter") - - #verify - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) - with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A4"})) - with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + #select A3 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) + #row height + with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: + xvalue = xDialog.getChild("value") + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"})) + # Click Ok + #select row 3 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) + self.xUITest.executeCommand(".uno:SelectRow") + #insert rows below + self.xUITest.executeCommand(".uno:InsertRowsAfter") + + #verify + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"})) + with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A4"})) + with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog: + xvalue = xDialog.getChild("value") + self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.00 cm") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests7/tdf137397.py b/sc/qa/uitest/calc_tests7/tdf137397.py index c98a706d20ed..f1d84bf37a63 100644 --- a/sc/qa/uitest/calc_tests7/tdf137397.py +++ b/sc/qa/uitest/calc_tests7/tdf137397.py @@ -17,25 +17,25 @@ class tdf137397(UITestCase): with self.ui_test.load_file(get_url_for_data_file("tdf137397.ods")): - change_measurement_unit(self, 'Centimeter') + with change_measurement_unit(self, 'Centimeter'): - xCalcDoc = self.xUITest.getTopFocusWindow() - xGridWin = xCalcDoc.getChild("grid_window") + xCalcDoc = self.xUITest.getTopFocusWindow() + xGridWin = xCalcDoc.getChild("grid_window") - xGridWin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Shape"})) + xGridWin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Shape"})) - self.xUITest.executeCommand(".uno:Sidebar") - xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "TextPropertyPanel"})) + self.xUITest.executeCommand(".uno:Sidebar") + xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "TextPropertyPanel"})) - xChild = self.ui_test.wait_until_child_is_available('selectwidth') - self.assertEqual(get_state_as_dict(xChild)['Text'], '6.00 cm') + xChild = self.ui_test.wait_until_child_is_available('selectwidth') + self.assertEqual(get_state_as_dict(xChild)['Text'], '6.00 cm') - # Without the fix in place, this test would have failed with - # AssertionError: '-14,585,309.84 cm' != '2.00 cm' - xChild = self.ui_test.wait_until_child_is_available('selectheight') - self.assertEqual(get_state_as_dict(xChild)['Text'], '2.00 cm') + # Without the fix in place, this test would have failed with + # AssertionError: '-14,585,309.84 cm' != '2.00 cm' + xChild = self.ui_test.wait_until_child_is_available('selectheight') + self.assertEqual(get_state_as_dict(xChild)['Text'], '2.00 cm') - self.xUITest.executeCommand(".uno:Sidebar") + self.xUITest.executeCommand(".uno:Sidebar") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests9/tdf126673.py b/sc/qa/uitest/calc_tests9/tdf126673.py index 7d60d5195b32..d06730f93ebc 100644 --- a/sc/qa/uitest/calc_tests9/tdf126673.py +++ b/sc/qa/uitest/calc_tests9/tdf126673.py @@ -17,23 +17,23 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class tdf126673(UITestCase): def test_tdf126673_auto_fit_row_height(self): with self.ui_test.load_file(get_url_for_data_file("tdf126673.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") - #select A2 - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) - #optimal row height - with self.ui_test.execute_dialog_through_command(".uno:SetOptimalRowHeight") as xDialog: - xvalue = xDialog.getChild("value") - self.assertEqual("0.00 cm", get_state_as_dict(xvalue)["Text"]) + #select A2 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) + #optimal row height + with self.ui_test.execute_dialog_through_command(".uno:SetOptimalRowHeight") as xDialog: + 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") - self.assertEqual("1.24 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") + self.assertEqual("1.24 cm", get_state_as_dict(xvalue)["Text"]) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests9/tdf137446.py b/sc/qa/uitest/calc_tests9/tdf137446.py index e6aa046678fc..94bb7c0c97c4 100644 --- a/sc/qa/uitest/calc_tests9/tdf137446.py +++ b/sc/qa/uitest/calc_tests9/tdf137446.py @@ -16,36 +16,36 @@ class tdf137446(UITestCase): def test_tdf137446(self): with self.ui_test.load_file(get_url_for_data_file("tdf137446.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "lineObject"})) + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "lineObject"})) - with self.ui_test.execute_dialog_through_command(".uno:TransformDialog") as xDialog: + with self.ui_test.execute_dialog_through_command(".uno:TransformDialog") as xDialog: - self.assertEqual('10', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value']) - self.assertEqual('0', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value']) - self.assertEqual('5.51', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value']) - self.assertEqual('2.55', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value']) - self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value']) + self.assertEqual('10', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value']) + self.assertEqual('0', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value']) + self.assertEqual('5.51', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value']) + self.assertEqual('2.55', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value']) + self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value']) - xDialog.getChild('MTR_FLD_WIDTH').executeAction("UP", tuple()) + xDialog.getChild('MTR_FLD_WIDTH').executeAction("UP", tuple()) - with self.ui_test.execute_dialog_through_command(".uno:TransformDialog") as xDialog: + with self.ui_test.execute_dialog_through_command(".uno:TransformDialog") as xDialog: - self.assertEqual('10.1', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value']) - self.assertEqual('0', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value']) - self.assertEqual('5.51', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value']) - self.assertEqual('2.55', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value']) + self.assertEqual('10.1', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value']) + self.assertEqual('0', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value']) + self.assertEqual('5.51', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value']) + self.assertEqual('2.55', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value']) - # Without the fix in place, this test would have failed with AssertionError: '0' != '180' - self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value']) + # Without the fix in place, this test would have failed with AssertionError: '0' != '180' + self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value']) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/chartArea.py b/sc/qa/uitest/chart/chartArea.py index 44040f8e835f..520ab8e83a2d 100644 --- a/sc/qa/uitest/chart/chartArea.py +++ b/sc/qa/uitest/chart/chartArea.py @@ -17,139 +17,139 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class chartArea(UITestCase): def test_chart_area_dialog(self): with self.ui_test.load_file(get_url_for_data_file("chartArea.ods")) as calc_doc: - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - - change_measurement_unit(self, "Centimeter") - - xArea = calc_doc.Sheets[0].Charts[0].getEmbeddedObject().Area - self.assertEqual(xArea.LineWidth, 0) - self.assertEqual(xArea.LineTransparence, 0) - self.assertEqual(hex(xArea.FillColor), '0xffffff') - self.assertEqual(xArea.FillTransparence, 0) - - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: - #Click on tab "Borders". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) - - - self.assertEqual(xArea.LineWidth, 100) - self.assertEqual(xArea.LineTransparence, 5) - self.assertEqual(hex(xArea.FillColor), '0xffffff') - self.assertEqual(xArea.FillTransparence, 0) - - #reopen and verify tab "Borders". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - - #Click on tab "Area" - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - btncolor = xDialog.getChild("btncolor") - btncolor.executeAction("CLICK", tuple()) - - rCustom = xDialog.getChild("R_custom") - gCustom = xDialog.getChild("G_custom") - bCustom = xDialog.getChild("B_custom") - - rCustom.executeAction("CLEAR", tuple()) - rCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"35"})) - rCustom.executeAction("UP", tuple()) - rCustom.executeAction("DOWN", tuple()) #without this save data doesn't works - self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") - gCustom.executeAction("CLEAR", tuple()) - gCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"169"})) - gCustom.executeAction("UP", tuple()) - gCustom.executeAction("DOWN", tuple()) #without this save data doesn't works - bCustom.executeAction("CLEAR", tuple()) - bCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"211"})) - bCustom.executeAction("UP", tuple()) - bCustom.executeAction("DOWN", tuple()) #without this save data doesn't works - - self.assertEqual(xArea.LineWidth, 100) - self.assertEqual(xArea.LineTransparence, 5) - self.assertEqual(hex(xArea.FillColor), '0x23a9d3') - self.assertEqual(xArea.FillTransparence, 0) - - #reopen and verify tab "Area". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "1") - - rCustom = xDialog.getChild("R_custom") - gCustom = xDialog.getChild("G_custom") - bCustom = xDialog.getChild("B_custom") - - self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") - self.assertEqual(get_state_as_dict(gCustom)["Text"], "169") - self.assertEqual(get_state_as_dict(bCustom)["Text"], "211") - - #change tab "Transparency" - select_pos(tabcontrol, "2") - transparency = xDialog.getChild("RBT_TRANS_LINEAR") - transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% - - transparency.executeAction("CLICK", tuple()) - transparencyPercent.executeAction("UP", tuple()) - - - self.assertEqual(xArea.LineWidth, 100) - self.assertEqual(xArea.LineTransparence, 5) - self.assertEqual(hex(xArea.FillColor), '0x23a9d3') - self.assertEqual(xArea.FillTransparence, 51) - - #reopen and verify tab "Transparency" - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "2") - - transparency = xDialog.getChild("RBT_TRANS_LINEAR") - transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% - - self.assertEqual(get_state_as_dict(transparency)["Checked"], "true") - self.assertEqual(get_state_as_dict(transparencyPercent)["Text"], "51%") - - - self.assertEqual(xArea.LineWidth, 100) - self.assertEqual(xArea.LineTransparence, 5) - self.assertEqual(hex(xArea.FillColor), '0x23a9d3') - self.assertEqual(xArea.FillTransparence, 51) + + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + xArea = calc_doc.Sheets[0].Charts[0].getEmbeddedObject().Area + self.assertEqual(xArea.LineWidth, 0) + self.assertEqual(xArea.LineTransparence, 0) + self.assertEqual(hex(xArea.FillColor), '0xffffff') + self.assertEqual(xArea.FillTransparence, 0) + + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: + #Click on tab "Borders". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) + + + self.assertEqual(xArea.LineWidth, 100) + self.assertEqual(xArea.LineTransparence, 5) + self.assertEqual(hex(xArea.FillColor), '0xffffff') + self.assertEqual(xArea.FillTransparence, 0) + + #reopen and verify tab "Borders". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + + #Click on tab "Area" + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + btncolor = xDialog.getChild("btncolor") + btncolor.executeAction("CLICK", tuple()) + + rCustom = xDialog.getChild("R_custom") + gCustom = xDialog.getChild("G_custom") + bCustom = xDialog.getChild("B_custom") + + rCustom.executeAction("CLEAR", tuple()) + rCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"35"})) + rCustom.executeAction("UP", tuple()) + rCustom.executeAction("DOWN", tuple()) #without this save data doesn't works + self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") + gCustom.executeAction("CLEAR", tuple()) + gCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"169"})) + gCustom.executeAction("UP", tuple()) + gCustom.executeAction("DOWN", tuple()) #without this save data doesn't works + bCustom.executeAction("CLEAR", tuple()) + bCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"211"})) + bCustom.executeAction("UP", tuple()) + bCustom.executeAction("DOWN", tuple()) #without this save data doesn't works + + self.assertEqual(xArea.LineWidth, 100) + self.assertEqual(xArea.LineTransparence, 5) + self.assertEqual(hex(xArea.FillColor), '0x23a9d3') + self.assertEqual(xArea.FillTransparence, 0) + + #reopen and verify tab "Area". + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "1") + + rCustom = xDialog.getChild("R_custom") + gCustom = xDialog.getChild("G_custom") + bCustom = xDialog.getChild("B_custom") + + self.assertEqual(get_state_as_dict(rCustom)["Text"], "35") + self.assertEqual(get_state_as_dict(gCustom)["Text"], "169") + self.assertEqual(get_state_as_dict(bCustom)["Text"], "211") + + #change tab "Transparency" + select_pos(tabcontrol, "2") + transparency = xDialog.getChild("RBT_TRANS_LINEAR") + transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% + + transparency.executeAction("CLICK", tuple()) + transparencyPercent.executeAction("UP", tuple()) + + + self.assertEqual(xArea.LineWidth, 100) + self.assertEqual(xArea.LineTransparence, 5) + self.assertEqual(hex(xArea.FillColor), '0x23a9d3') + self.assertEqual(xArea.FillTransparence, 51) + + #reopen and verify tab "Transparency" + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"})) as xDialog: + + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "2") + + transparency = xDialog.getChild("RBT_TRANS_LINEAR") + transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51% + + self.assertEqual(get_state_as_dict(transparency)["Checked"], "true") + self.assertEqual(get_state_as_dict(transparencyPercent)["Text"], "51%") + + + self.assertEqual(xArea.LineWidth, 100) + self.assertEqual(xArea.LineTransparence, 5) + self.assertEqual(hex(xArea.FillColor), '0x23a9d3') + self.assertEqual(xArea.FillTransparence, 51) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/chartDataLabels.py b/sc/qa/uitest/chart/chartDataLabels.py index a6e00e599c47..b20180353472 100644 --- a/sc/qa/uitest/chart/chartDataLabels.py +++ b/sc/qa/uitest/chart/chartDataLabels.py @@ -256,35 +256,35 @@ class chartDataLabels(UITestCase): def test_tdf136573(self): with self.ui_test.load_file(get_url_for_data_file("dataLabels.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") - # Select the first label - xDataLabel = xChartMain.getChild("CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0") - xDataLabel.executeAction("SELECT", tuple()) + # Select the first label + xDataLabel = xChartMain.getChild("CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0") + xDataLabel.executeAction("SELECT", tuple()) - with self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + with self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - self.assertEqual("0.74", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("2.82", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + self.assertEqual("0.74", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("2.82", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) - # Use OK button in order to test tdf#137165 + # Use OK button in order to test tdf#137165 - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) - with self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + with self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - # Check the position has changed after moving the label using the arrows keys - self.assertEqual("0.64", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("2.72", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + # Check the position has changed after moving the label using the arrows keys + self.assertEqual("0.64", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("2.72", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/chartGrid.py b/sc/qa/uitest/chart/chartGrid.py index c54e03637ee7..bd017248adeb 100644 --- a/sc/qa/uitest/chart/chartGrid.py +++ b/sc/qa/uitest/chart/chartGrid.py @@ -17,184 +17,184 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class chartGrid(UITestCase): def test_tdf98390_chart_grid_dialog(self): with self.ui_test.load_file(get_url_for_data_file("tdf98390.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") - - #X Axis Major Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"})) as xDialog: - #tab "Line". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + #X Axis Major Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"})) as xDialog: + #tab "Line". + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) - #reopen and verify X Axis Major Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"})) as xDialog: + #reopen and verify X Axis Major Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - #Y Axis Major Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"})) as xDialog: + #Y Axis Major Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) - #reopen and verify Y Axis Major Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"})) as xDialog: + #reopen and verify Y Axis Major Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - #Y Axis Minor Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"})) as xDialog: + #Y Axis Minor Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) - #reopen and verify Y Axis Minor Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"})) as xDialog: + #reopen and verify Y Axis Minor Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - #X Axis Minor Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: + #X Axis Minor Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) - #reopen and verify X Axis Minor Grid - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: + #reopen and verify X Axis Minor Grid + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") - #All Grids - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridAll"})) as xDialog: + #All Grids + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridAll"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) + xWidth.executeAction("UP", tuple()) + transparency.executeAction("UP", tuple()) - #reopen and verify X Axis Minor Grid (changed in All Grids) - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: + #reopen and verify X Axis Minor Grid (changed in All Grids) + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"})) as xDialog: - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "0") + xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") + transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.20 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "10%") + self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.20 cm") + self.assertEqual(get_state_as_dict(transparency)["Text"], "10%") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/chartLegend.py b/sc/qa/uitest/chart/chartLegend.py index 45938e23017d..a1cf40f44e2f 100644 --- a/sc/qa/uitest/chart/chartLegend.py +++ b/sc/qa/uitest/chart/chartLegend.py @@ -73,31 +73,31 @@ class chartLegend(UITestCase): def test_legends_move_with_arrows_keys(self): with self.ui_test.load_file(get_url_for_data_file("dataLabels.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") - # Select the legends - xLegends = xChartMain.getChild("CID/D=0:Legend=") - xLegends.executeAction("SELECT", tuple()) + # Select the legends + xLegends = xChartMain.getChild("CID/D=0:Legend=") + xLegends.executeAction("SELECT", tuple()) - with self.ui_test.execute_dialog_through_action(xLegends, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - self.assertEqual("4.61", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("1.54", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + with self.ui_test.execute_dialog_through_action(xLegends, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + self.assertEqual("4.61", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("1.54", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) - # Check the position has changed after moving the label using the arrows keys - with self.ui_test.execute_dialog_through_action(xLegends, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - self.assertEqual("4.51", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("1.44", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + # Check the position has changed after moving the label using the arrows keys + with self.ui_test.execute_dialog_through_action(xLegends, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + self.assertEqual("4.51", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("1.44", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) def test_Tdf147394(self): diff --git a/sc/qa/uitest/chart/chartTitles.py b/sc/qa/uitest/chart/chartTitles.py index cd1955b670e4..793b634922a6 100644 --- a/sc/qa/uitest/chart/chartTitles.py +++ b/sc/qa/uitest/chart/chartTitles.py @@ -86,34 +86,34 @@ class chartTitles(UITestCase): def test_title_move_with_arrows_keys(self): with self.ui_test.load_file(get_url_for_data_file("chartArea.ods")): - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - change_measurement_unit(self, "Centimeter") + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") - # Select the title - xTitle = xChartMain.getChild("CID/Title=") - xTitle.executeAction("SELECT", tuple()) + # Select the title + xTitle = xChartMain.getChild("CID/Title=") + xTitle.executeAction("SELECT", tuple()) - with self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + with self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - self.assertEqual("3.52", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("0.3", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + self.assertEqual("3.52", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("0.3", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) - xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"})) + xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"})) - with self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: + with self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"})) as xDialog: - # Check the position has changed after moving the title using the arrows keys - self.assertEqual("3.42", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) - self.assertEqual("0.2", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) + # Check the position has changed after moving the title using the arrows keys + self.assertEqual("3.42", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value']) + self.assertEqual("0.2", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value']) # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/chart/chartWall.py b/sc/qa/uitest/chart/chartWall.py index 4ca6d240d465..8afacc0c54ba 100644 --- a/sc/qa/uitest/chart/chartWall.py +++ b/sc/qa/uitest/chart/chartWall.py @@ -17,154 +17,154 @@ from libreoffice.uno.propertyvalue import mkPropertyValues class chartWall(UITestCase): def test_chart_wall_dialog(self): with self.ui_test.load_file(get_url_for_data_file("tdf122398.ods")) as calc_doc: - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - - change_measurement_unit(self, "Centimeter") - - xWall = calc_doc.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().Wall - self.assertEqual(xWall.LineWidth, 0) - self.assertEqual(xWall.LineTransparence, 0) - self.assertEqual(hex(xWall.FillColor), '0xe6e6e6') - self.assertEqual(xWall.FillTransparence, 0) - - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"})) as xDialog: - #Click on tab "Borders". - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - xWidth.executeAction("UP", tuple()) - transparency.executeAction("UP", tuple()) - - - self.assertEqual(xWall.LineWidth, 100) - self.assertEqual(xWall.LineTransparence, 5) - self.assertEqual(hex(xWall.FillColor), '0xe6e6e6') - self.assertEqual(xWall.FillTransparence, 0) - - #reopen and verify tab "Borders". - gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) - gridwin.executeAction("ACTIVATE", tuple()) - xChartMainTop = self.xUITest.getTopFocusWindow() - xChartMain = xChartMainTop.getChild("chart_window") - xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") - with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"})) as xDialog: - - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, "0") - xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH") - transparency = xDialog.getChild("MTR_LINE_TRANSPARENT") - - self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm") - self.assertEqual(get_state_as_dict(transparency)["Text"], "5%") + + with change_measurement_unit(self, "Centimeter"): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + xWall = calc_doc.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().Wall + self.assertEqual(xWall.LineWidth, 0) + self.assertEqual(xWall.LineTransparence, 0) + self.assertEqual(hex(xWall.FillColor), '0xe6e6e6') + self.assertEqual(xWall.FillTransparence, 0) + + gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"})) + gridwin.executeAction("ACTIVATE", tuple()) + xChartMainTop = self.xUITest.getTopFocusWindow() + xChartMain = xChartMainTop.getChild("chart_window") + xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0") + with self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"})) as xDialog: + #Click on tab "Borders". ... etc. - the rest is truncated