diff options
Diffstat (limited to 'sc/qa/uitest/calc_tests3')
-rw-r--r-- | sc/qa/uitest/calc_tests3/clearCells.py | 311 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/insertQrCodeGen.py | 81 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf57274.py | 51 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf62267.py | 60 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf63805.py | 67 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf64001.py | 40 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf65856.py | 105 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf68290.py | 38 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf69450.py | 63 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf69981.py | 93 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf71339.py | 35 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf73006.py | 43 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf77509.py | 65 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf79983.py | 71 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf80693.py | 58 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf81351.py | 82 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests3/tdf82398.py | 63 |
17 files changed, 1326 insertions, 0 deletions
diff --git a/sc/qa/uitest/calc_tests3/clearCells.py b/sc/qa/uitest/calc_tests3/clearCells.py new file mode 100644 index 000000000..162ac86e1 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/clearCells.py @@ -0,0 +1,311 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +from uitest.uihelper.common import select_pos +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.document import get_sheet_from_doc +from libreoffice.calc.conditional_format import get_conditional_format_from_sheet +from uitest.debug import sleep +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +#deletecontents.ui +#+ Bug 101904 - Delete Contents dialog -- won't delete cell content "Date & time" +class clearCells(UITestCase): + def test_clear_cells_text(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + enter_text_to_cell(gridwin, "A1", "aa") + enter_text_to_cell(gridwin, "A2", "1") + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"})) + self.ui_test.execute_dialog_through_command(".uno:Delete") + xDialog = self.xUITest.getTopFocusWindow() + xdeleteall = xDialog.getChild("deleteall") + xtext = xDialog.getChild("text") + xdatetime = xDialog.getChild("datetime") + xcomments = xDialog.getChild("comments") + xobjects = xDialog.getChild("objects") + xnumbers = xDialog.getChild("numbers") + xformulas = xDialog.getChild("formulas") + xformats = xDialog.getChild("formats") + + if (get_state_as_dict(xdeleteall)["Selected"]) == "true": + xdeleteall.executeAction("CLICK", tuple()) + if (get_state_as_dict(xtext)["Selected"]) == "false": + xtext.executeAction("CLICK", tuple()) + if (get_state_as_dict(xdatetime)["Selected"]) == "true": + xdatetime.executeAction("CLICK", tuple()) + if (get_state_as_dict(xcomments)["Selected"]) == "true": + xcomments.executeAction("CLICK", tuple()) + if (get_state_as_dict(xobjects)["Selected"]) == "true": + xobjects.executeAction("CLICK", tuple()) + if (get_state_as_dict(xnumbers)["Selected"]) == "true": + xnumbers.executeAction("CLICK", tuple()) + if (get_state_as_dict(xformulas)["Selected"]) == "true": + xformulas.executeAction("CLICK", tuple()) + if (get_state_as_dict(xformats)["Selected"]) == "true": + xformats.executeAction("CLICK", tuple()) + + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + #Verify + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 1) + + self.ui_test.close_doc() + + def test_clear_cells_date_tdf101904(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + enter_text_to_cell(gridwin, "A1", "01/01/2000") + enter_text_to_cell(gridwin, "A2", "1") + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"})) + self.ui_test.execute_dialog_through_command(".uno:Delete") + xDialog = self.xUITest.getTopFocusWindow() + xdeleteall = xDialog.getChild("deleteall") + xtext = xDialog.getChild("text") + xdatetime = xDialog.getChild("datetime") + xcomments = xDialog.getChild("comments") + xobjects = xDialog.getChild("objects") + xnumbers = xDialog.getChild("numbers") + xformulas = xDialog.getChild("formulas") + xformats = xDialog.getChild("formats") + + if (get_state_as_dict(xdeleteall)["Selected"]) == "true": + xdeleteall.executeAction("CLICK", tuple()) + if (get_state_as_dict(xtext)["Selected"]) == "true": + xtext.executeAction("CLICK", tuple()) + if (get_state_as_dict(xdatetime)["Selected"]) == "false": + xdatetime.executeAction("CLICK", tuple()) + if (get_state_as_dict(xcomments)["Selected"]) == "true": + xcomments.executeAction("CLICK", tuple()) + if (get_state_as_dict(xobjects)["Selected"]) == "true": + xobjects.executeAction("CLICK", tuple()) + if (get_state_as_dict(xnumbers)["Selected"]) == "true": + xnumbers.executeAction("CLICK", tuple()) + if (get_state_as_dict(xformulas)["Selected"]) == "true": + xformulas.executeAction("CLICK", tuple()) + if (get_state_as_dict(xformats)["Selected"]) == "true": + xformats.executeAction("CLICK", tuple()) + + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + #Verify + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 1) + + self.ui_test.close_doc() + + def test_clear_cells_number(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + enter_text_to_cell(gridwin, "A1", "aa") + enter_text_to_cell(gridwin, "A2", "1") + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"})) + self.ui_test.execute_dialog_through_command(".uno:Delete") + xDialog = self.xUITest.getTopFocusWindow() + xdeleteall = xDialog.getChild("deleteall") + xtext = xDialog.getChild("text") + xdatetime = xDialog.getChild("datetime") + xcomments = xDialog.getChild("comments") + xobjects = xDialog.getChild("objects") + xnumbers = xDialog.getChild("numbers") + xformulas = xDialog.getChild("formulas") + xformats = xDialog.getChild("formats") + + if (get_state_as_dict(xdeleteall)["Selected"]) == "true": + xdeleteall.executeAction("CLICK", tuple()) + if (get_state_as_dict(xtext)["Selected"]) == "true": + xtext.executeAction("CLICK", tuple()) + if (get_state_as_dict(xdatetime)["Selected"]) == "true": + xdatetime.executeAction("CLICK", tuple()) + if (get_state_as_dict(xcomments)["Selected"]) == "true": + xcomments.executeAction("CLICK", tuple()) + if (get_state_as_dict(xobjects)["Selected"]) == "true": + xobjects.executeAction("CLICK", tuple()) + if (get_state_as_dict(xnumbers)["Selected"]) == "false": + xnumbers.executeAction("CLICK", tuple()) + if (get_state_as_dict(xformulas)["Selected"]) == "true": + xformulas.executeAction("CLICK", tuple()) + if (get_state_as_dict(xformats)["Selected"]) == "true": + xformats.executeAction("CLICK", tuple()) + + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + #Verify + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "aa") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 0) + + self.ui_test.close_doc() + def test_clear_cells_formulas(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + enter_text_to_cell(gridwin, "A1", "1") + enter_text_to_cell(gridwin, "A2", "=A1+1") + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"})) + self.ui_test.execute_dialog_through_command(".uno:Delete") + xDialog = self.xUITest.getTopFocusWindow() + xdeleteall = xDialog.getChild("deleteall") + xtext = xDialog.getChild("text") + xdatetime = xDialog.getChild("datetime") + xcomments = xDialog.getChild("comments") + xobjects = xDialog.getChild("objects") + xnumbers = xDialog.getChild("numbers") + xformulas = xDialog.getChild("formulas") + xformats = xDialog.getChild("formats") + + if (get_state_as_dict(xdeleteall)["Selected"]) == "true": + xdeleteall.executeAction("CLICK", tuple()) + if (get_state_as_dict(xtext)["Selected"]) == "true": + xtext.executeAction("CLICK", tuple()) + if (get_state_as_dict(xdatetime)["Selected"]) == "true": + xdatetime.executeAction("CLICK", tuple()) + if (get_state_as_dict(xcomments)["Selected"]) == "true": + xcomments.executeAction("CLICK", tuple()) + if (get_state_as_dict(xobjects)["Selected"]) == "true": + xobjects.executeAction("CLICK", tuple()) + if (get_state_as_dict(xnumbers)["Selected"]) == "true": + xnumbers.executeAction("CLICK", tuple()) + if (get_state_as_dict(xformulas)["Selected"]) == "false": + xformulas.executeAction("CLICK", tuple()) + if (get_state_as_dict(xformats)["Selected"]) == "true": + xformats.executeAction("CLICK", tuple()) + + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + #Verify + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "1") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString() , "") + + self.ui_test.close_doc() + + def test_clear_cells_formats(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + enter_text_to_cell(gridwin, "A1", "aa") + enter_text_to_cell(gridwin, "A2", "1") + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"})) + self.xUITest.executeCommand(".uno:Bold") + self.ui_test.execute_dialog_through_command(".uno:Delete") + xDialog = self.xUITest.getTopFocusWindow() + xdeleteall = xDialog.getChild("deleteall") + xtext = xDialog.getChild("text") + xdatetime = xDialog.getChild("datetime") + xcomments = xDialog.getChild("comments") + xobjects = xDialog.getChild("objects") + xnumbers = xDialog.getChild("numbers") + xformulas = xDialog.getChild("formulas") + xformats = xDialog.getChild("formats") + + if (get_state_as_dict(xdeleteall)["Selected"]) == "true": + xdeleteall.executeAction("CLICK", tuple()) + if (get_state_as_dict(xtext)["Selected"]) == "true": + xtext.executeAction("CLICK", tuple()) + if (get_state_as_dict(xdatetime)["Selected"]) == "true": + xdatetime.executeAction("CLICK", tuple()) + if (get_state_as_dict(xcomments)["Selected"]) == "true": + xcomments.executeAction("CLICK", tuple()) + if (get_state_as_dict(xobjects)["Selected"]) == "true": + xobjects.executeAction("CLICK", tuple()) + if (get_state_as_dict(xnumbers)["Selected"]) == "true": + xnumbers.executeAction("CLICK", tuple()) + if (get_state_as_dict(xformulas)["Selected"]) == "true": + xformulas.executeAction("CLICK", tuple()) + if (get_state_as_dict(xformats)["Selected"]) == "false": + xformats.executeAction("CLICK", tuple()) + + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + #Verify + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") + xDialog = self.xUITest.getTopFocusWindow() + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "1") #tab Font + + xstylelb = xDialog.getChild("weststylelb-cjk") + print(get_state_as_dict(xstylelb)) + + + self.assertEqual(get_state_as_dict(xstylelb)["Text"], "Regular") + + xOK = xDialog.getChild("ok") + xOK.executeAction("CLICK", tuple()) + + self.ui_test.close_doc() + + def test_clear_cells_all(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + enter_text_to_cell(gridwin, "A1", "aa") + enter_text_to_cell(gridwin, "A2", "1") + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"})) + self.xUITest.executeCommand(".uno:Bold") + self.ui_test.execute_dialog_through_command(".uno:Delete") + xDialog = self.xUITest.getTopFocusWindow() + xdeleteall = xDialog.getChild("deleteall") + xtext = xDialog.getChild("text") + xdatetime = xDialog.getChild("datetime") + xcomments = xDialog.getChild("comments") + xobjects = xDialog.getChild("objects") + xnumbers = xDialog.getChild("numbers") + xformulas = xDialog.getChild("formulas") + xformats = xDialog.getChild("formats") + + if (get_state_as_dict(xdeleteall)["Selected"]) == "false": + xdeleteall.executeAction("CLICK", tuple()) + + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + #Verify + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString() , "") + + self.ui_test.close_doc() + + def test_cancel_clear_cells_all(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + enter_text_to_cell(gridwin, "A1", "aa") + enter_text_to_cell(gridwin, "A2", "1") + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"})) + self.ui_test.execute_dialog_through_command(".uno:Delete") + xDialog = self.xUITest.getTopFocusWindow() + xdeleteall = xDialog.getChild("deleteall") + + if (get_state_as_dict(xdeleteall)["Selected"]) == "false": + xdeleteall.executeAction("CLICK", tuple()) + + xCancelBtn = xDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + #Verify + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "aa") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString() , "1") + + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py new file mode 100644 index 000000000..831fe40ee --- /dev/null +++ b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py @@ -0,0 +1,81 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.common import get_state_as_dict, type_text +from com.sun.star.lang import IndexOutOfBoundsException + +class insertQrCode(UITestCase): + + def test_insert_qr_code_gen(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + # cancel the dialog without doing anything + self.ui_test.execute_dialog_through_command(".uno:InsertQrCode") + xDialog = self.xUITest.getTopFocusWindow() + + xURL = xDialog.getChild("edit_text") + type_text(xURL, "www.libreoffice.org") + + xCloseBtn = xDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(xCloseBtn) + with self.assertRaises(IndexOutOfBoundsException): + document.Sheets.getByIndex(0).DrawPage.getByIndex(0) + + # Reopen the dialog box + self.ui_test.execute_dialog_through_command(".uno:InsertQrCode") + xDialog = self.xUITest.getTopFocusWindow() + + # Get elements in the Dialog Box + xURL = xDialog.getChild("edit_text") + xECC_Low = xDialog.getChild("button_low") #How radio button input is written in text. + xBorder = xDialog.getChild("edit_border") + + type_text(xURL, "www.libreoffice.org") #set the QR code + xECC_Low.executeAction("CLICK", tuple()) + xBorder.executeAction("UP", tuple()) + xBorder.executeAction("DOWN", tuple()) + xOKBtn = xDialog.getChild("ok") + xOKBtn.executeAction("CLICK", tuple()) + + # check the QR code in the document + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org") + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1) + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Border, 1) + + self.ui_test.close_doc() + + def test_insert_qr_code_gen2(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + self.ui_test.execute_dialog_through_command(".uno:InsertQrCode") + xDialog = self.xUITest.getTopFocusWindow() + + xURL = xDialog.getChild("edit_text") + xECC_Low = xDialog.getChild("button_low") + xBorder = xDialog.getChild("edit_border") + + type_text(xURL, "www.libreoffice.org") #set the QR code + xECC_Low.executeAction("CLICK", tuple()) + xBorder.executeAction("UP", tuple()) + xBorder.executeAction("DOWN", tuple()) + xOKBtn = xDialog.getChild("ok") + xOKBtn.executeAction("CLICK", tuple()) + + #check the QR Code in the document + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org") + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1) + self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Border, 1) + + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests3/tdf57274.py b/sc/qa/uitest/calc_tests3/tdf57274.py new file mode 100644 index 000000000..a3c77109c --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf57274.py @@ -0,0 +1,51 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +import org.libreoffice.unotest +import os +import pathlib +from uitest.uihelper.common import get_state_as_dict +from libreoffice.calc.document import get_sheet_from_doc +from libreoffice.calc.conditional_format import get_conditional_format_from_sheet +from uitest.debug import sleep +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +#Bug: Paste Special Link Checkbox fails to insert cell references when the source cell is blank +def get_url_for_data_file(file_name): + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() + +class tdf57274(UITestCase): + + def test_tdf57274_tdf116385_row_only(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf57274.ods")) + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + #* Source Cells, range B6..E6 + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B6:E6"})) + self.xUITest.executeCommand(".uno:Copy") + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B11"})) + self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") + xDialog = self.xUITest.getTopFocusWindow() + #We paste here using Paste Special with 'Link' Checkbox activated + xLink = xDialog.getChild("link") + xLink.executeAction("CLICK", tuple()) + xOkBtn = xDialog.getChild("ok") + # self.ui_test.close_dialog_through_button(xOkBtn) + def handle_confirm_dlg(dialog): + xOKBtn = dialog.getChild("yes") + self.ui_test.close_dialog_through_button(xOKBtn) + + self.ui_test.execute_blocking_action(xOkBtn.executeAction, args=('CLICK', ()), + dialog_handler=handle_confirm_dlg) + #we would expect a reference to cell E6 here and a zero being displayed, but the cell is also simply blank. + self.assertEqual(get_cell_by_position(document, 0, 4, 10).getValue(), 0) + self.assertEqual(get_cell_by_position(document, 0, 4, 10).getFormula(), "=$Sheet1.$E$6") + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file diff --git a/sc/qa/uitest/calc_tests3/tdf62267.py b/sc/qa/uitest/calc_tests3/tdf62267.py new file mode 100644 index 000000000..3d1f0e0c8 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf62267.py @@ -0,0 +1,60 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +import org.libreoffice.unotest +import os +import pathlib +from uitest.uihelper.common import get_state_as_dict +from libreoffice.calc.document import get_sheet_from_doc +from libreoffice.calc.conditional_format import get_conditional_format_from_sheet +from uitest.debug import sleep +from libreoffice.uno.propertyvalue import mkPropertyValues + +#Bug 62267 - Conditional formatting lost after paste special of text, numbers and dates. +#If you have a cell with conditional formatting and you use paste special only inserting only text, +#numbers and dates the formatting is lost. Undo do not recover the conditional formatting. + +def get_url_for_data_file(file_name): + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() + +class tdf62267(UITestCase): + + def test_tdf62267(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf62267.ods")) + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + #* Copy A1, then paste special to C1; + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + self.xUITest.executeCommand(".uno:Copy") + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) + self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") + xDialog = self.xUITest.getTopFocusWindow() + #it's the default - text, numbers and dates + xOkBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOkBtn) + + #--> Cell formatting should stay as before + self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog") + + xCondFormatMgr = self.xUITest.getTopFocusWindow() + + # check that we have exactly 1 conditional format + xList = xCondFormatMgr.getChild("CONTAINER") + list_state = get_state_as_dict(xList) + self.assertEqual(list_state['Children'], '1') + + xTreeEntry = xList.getChild('0') + self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "A1\tCell value = 1") + + xCancelBtn = xCondFormatMgr.getChild("cancel") + self.ui_test.close_dialog_through_button(xCancelBtn) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests3/tdf63805.py b/sc/qa/uitest/calc_tests3/tdf63805.py new file mode 100644 index 000000000..bdc7f8775 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf63805.py @@ -0,0 +1,67 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +from uitest.uihelper.common import select_pos +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.document import get_sheet_from_doc +from libreoffice.calc.conditional_format import get_conditional_format_from_sheet +from uitest.debug import sleep +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +import org.libreoffice.unotest +import pathlib +#Bug 63805 - EDITING: 'Autofill - Date - Months' wrong if day of month exceeds max. days of month + +def get_url_for_data_file(file_name): + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() + +class tdf63805(UITestCase): + + def test_tdf63805_autofill_Date_Months(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf63805.ods")) + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + #1 - A1: 2012-10-31 + enter_text_to_cell(gridwin, "A1", "2012-10-31") + #2 - Select A1:A20 + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A20"})) + #3 - Edit -> fill -> Series -> Down - Date-Month-Increment=1 <ok> + self.ui_test.execute_dialog_through_command(".uno:FillSeries") + xDialog = self.xUITest.getTopFocusWindow() + xOK = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOK) + #5 -Expected: All Cells show last day of month / Actual: some months skipped + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 41213) + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 41243) + self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 41274) + self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 41305) + self.assertEqual(get_cell_by_position(document, 0, 0, 4).getValue(), 41333) + self.assertEqual(get_cell_by_position(document, 0, 0, 5).getValue(), 41364) + self.assertEqual(get_cell_by_position(document, 0, 0, 6).getValue(), 41394) + self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 41425) + self.assertEqual(get_cell_by_position(document, 0, 0, 8).getValue(), 41455) + self.assertEqual(get_cell_by_position(document, 0, 0, 9).getValue(), 41486) + self.assertEqual(get_cell_by_position(document, 0, 0, 10).getValue(), 41517) + self.assertEqual(get_cell_by_position(document, 0, 0, 11).getValue(), 41547) + self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 41578) + self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 41608) + self.assertEqual(get_cell_by_position(document, 0, 0, 14).getValue(), 41639) + self.assertEqual(get_cell_by_position(document, 0, 0, 15).getValue(), 41670) + self.assertEqual(get_cell_by_position(document, 0, 0, 16).getValue(), 41698) + self.assertEqual(get_cell_by_position(document, 0, 0, 17).getValue(), 41729) + self.assertEqual(get_cell_by_position(document, 0, 0, 18).getValue(), 41759) + self.assertEqual(get_cell_by_position(document, 0, 0, 19).getValue(), 41790) + #4 - undo. + self.xUITest.executeCommand(".uno:Undo") + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 41213) + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 0) + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file diff --git a/sc/qa/uitest/calc_tests3/tdf64001.py b/sc/qa/uitest/calc_tests3/tdf64001.py new file mode 100644 index 000000000..4c19f32c9 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf64001.py @@ -0,0 +1,40 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +from uitest.uihelper.calc import enter_text_to_cell +from uitest.debug import sleep +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues + +class tdf64001(UITestCase): + + def test_tdf64001(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + #1) Type TRUE in cell A1 + enter_text_to_cell(gridwin, "A1", "TRUE") + #2) Autofill/drag A1 to A10, all cells show TRUE + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A10"})) + self.ui_test.execute_dialog_through_command(".uno:FillSeries") + xDialog = self.xUITest.getTopFocusWindow() + xautofill = xDialog.getChild("autofill") + xautofill.executeAction("CLICK", tuple()) + xOK = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOK) + #3) Type FALSE in A11 + enter_text_to_cell(gridwin, "A11", "FALSE") + #4) Enter in B1: =COUNTIF(A1:A11,TRUE) , hit enter + enter_text_to_cell(gridwin, "B1", "=COUNTIF(A1:A11,TRUE)") + #The formula changes to =COUNTIF(A1:A11,1) and displays result of 1 not 10. + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"})) + self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 10) + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file diff --git a/sc/qa/uitest/calc_tests3/tdf65856.py b/sc/qa/uitest/calc_tests3/tdf65856.py new file mode 100644 index 000000000..c3e03ec7a --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf65856.py @@ -0,0 +1,105 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +import org.libreoffice.unotest +import os +import pathlib +from uitest.uihelper.common import get_state_as_dict +from libreoffice.calc.document import get_sheet_from_doc +from libreoffice.calc.conditional_format import get_conditional_format_from_sheet +from uitest.debug import sleep +from libreoffice.uno.propertyvalue import mkPropertyValues +from libreoffice.calc.document import get_cell_by_position + +def get_url_for_data_file(file_name): + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() + +class tdf65856(UITestCase): + + def test_tdf65856_paste_special_shift_right(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf65856.ods")) + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + #- mark D1:E14; copy + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D1:E14"})) + self.xUITest.executeCommand(".uno:Copy") + #mark cell D1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"})) + self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") + xDialog = self.xUITest.getTopFocusWindow() + + xmove_right = xDialog.getChild("move_right") + xmove_right.executeAction("CLICK", tuple()) + + xOkBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOkBtn) + + #check + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "T1") + self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "TE1") + self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "TES1") + self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "TEST1") + self.assertEqual(get_cell_by_position(document, 0, 4, 0).getString(), "TEST1") + self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "TEST1") + self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "TEST1") + self.assertEqual(get_cell_by_position(document, 0, 0, 13).getString(), "T14") + self.assertEqual(get_cell_by_position(document, 0, 1, 13).getString(), "TE14") + self.assertEqual(get_cell_by_position(document, 0, 2, 13).getString(), "TES14") + self.assertEqual(get_cell_by_position(document, 0, 3, 13).getString(), "TEST14") + self.assertEqual(get_cell_by_position(document, 0, 4, 13).getString(), "TEST14") + self.assertEqual(get_cell_by_position(document, 0, 5, 13).getString(), "TEST14") + self.assertEqual(get_cell_by_position(document, 0, 6, 13).getString(), "TEST14") + self.ui_test.close_doc() + + def test_tdf65856_paste_special_shift_right_2(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf65856_2.ods")) + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + #- select range C2:D4; copy + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C2:D4"})) + self.xUITest.executeCommand(".uno:Copy") + #mark cell B2 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"})) + self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") + xDialog = self.xUITest.getTopFocusWindow() + + xmove_right = xDialog.getChild("move_right") + xmove_right.executeAction("CLICK", tuple()) + + xOkBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOkBtn) + + #check + self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "1") + self.assertEqual(get_cell_by_position(document, 0, 2, 1).getString(), "1") + self.assertEqual(get_cell_by_position(document, 0, 3, 1).getString(), "1") + self.assertEqual(get_cell_by_position(document, 0, 4, 1).getString(), "1") + self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "1") + self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "2") + self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "2") + self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "2") + self.assertEqual(get_cell_by_position(document, 0, 4, 2).getString(), "2") + self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "2") + self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "3") + self.assertEqual(get_cell_by_position(document, 0, 2, 3).getString(), "3") + self.assertEqual(get_cell_by_position(document, 0, 3, 3).getString(), "3") + self.assertEqual(get_cell_by_position(document, 0, 4, 3).getString(), "3") + self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "3") + self.assertEqual(get_cell_by_position(document, 0, 4, 1).getFormula(), "=D2") + self.assertEqual(get_cell_by_position(document, 0, 5, 1).getFormula(), "=D2") + self.assertEqual(get_cell_by_position(document, 0, 3, 2).getFormula(), "=E3") + self.assertEqual(get_cell_by_position(document, 0, 5, 2).getFormula(), "=E3") + self.assertEqual(get_cell_by_position(document, 0, 3, 3).getFormula(), "=F4") + self.assertEqual(get_cell_by_position(document, 0, 4, 3).getFormula(), "=F4") + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: + diff --git a/sc/qa/uitest/calc_tests3/tdf68290.py b/sc/qa/uitest/calc_tests3/tdf68290.py new file mode 100644 index 000000000..b186efa88 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf68290.py @@ -0,0 +1,38 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +from uitest.path import get_srcdir_url +from libreoffice.calc.document import get_sheet_from_doc +from libreoffice.calc.conditional_format import get_conditional_format_from_sheet +from uitest.debug import sleep +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +#Enhancement: EDITING: cursor moves with Enter key +def get_url_for_data_file(file_name): + return get_srcdir_url() + "/sc/qa/uitest/calc_tests/data/" + file_name + +class tdf68290(UITestCase): + + def test_tdf68290_cursor_moves_with_Enter_key(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf68290.ods")) + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) + gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) + gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) + gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) + gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) + gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) + gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) + gridWinState = get_state_as_dict(gridwin) + self.assertEqual(gridWinState["CurrentRow"], "2") + self.assertEqual(gridWinState["CurrentColumn"], "12") + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests3/tdf69450.py b/sc/qa/uitest/calc_tests3/tdf69450.py new file mode 100644 index 000000000..ad375fecf --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf69450.py @@ -0,0 +1,63 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +from libreoffice.calc.document import get_sheet_from_doc +from uitest.debug import sleep +from libreoffice.uno.propertyvalue import mkPropertyValues +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.document import get_cell_by_position + +class tdf69450(UITestCase): + + def test_tdf69450(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + #add text to A1 and B1 + enter_text_to_cell(gridwin, "A1", "A") + enter_text_to_cell(gridwin, "B1", "B") + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + self.xUITest.executeCommand(".uno:Copy") + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"})) + self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") + xDialog = self.xUITest.getTopFocusWindow() + + xtext = xDialog.getChild("text") + xnumbers = xDialog.getChild("numbers") + xdatetime = xDialog.getChild("datetime") + xformats = xDialog.getChild("formats") + + xtext.executeAction("CLICK", tuple()) + xnumbers.executeAction("CLICK", tuple()) + xdatetime.executeAction("CLICK", tuple()) + xformats.executeAction("CLICK", tuple()) + + xOkBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOkBtn) + + #check B1 text + self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"})) + self.xUITest.executeCommand(".uno:Bold") + self.xUITest.executeCommand(".uno:Copy") + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"})) + self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") + xDialog = self.xUITest.getTopFocusWindow() #previous settings should be remembered (only format) + + xOkBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOkBtn) + + #check B1 text + self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B") + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: + diff --git a/sc/qa/uitest/calc_tests3/tdf69981.py b/sc/qa/uitest/calc_tests3/tdf69981.py new file mode 100644 index 000000000..34a4852b8 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf69981.py @@ -0,0 +1,93 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +from uitest.uihelper.common import select_pos +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.document import get_sheet_from_doc +from libreoffice.calc.conditional_format import get_conditional_format_from_sheet +from uitest.debug import sleep +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +import org.libreoffice.unotest +import pathlib + +def get_url_for_data_file(file_name): + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() + +class tdf69981(UITestCase): + + def test_tdf69981_text_to_columns(self): + + # FIXME flaky test, passed once, but broke multiple times. + return + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf69981.ods")) + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged. + self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog + xDialogOpt = self.xUITest.getTopFocusWindow() + + xPages = xDialogOpt.getChild("pages") + xWriterEntry = xPages.getChild('3') # Calc + xWriterEntry.executeAction("EXPAND", tuple()) + xWriterGeneralEntry = xWriterEntry.getChild('0') + xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb + xreplwarncb = xDialogOpt.getChild("replwarncb") + if (get_state_as_dict(xreplwarncb)["Selected"]) == "false": + xreplwarncb.executeAction("CLICK", tuple()) + xOKBtn = xDialogOpt.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + #Select A2:A7 + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A7"})) + #Data - Text to Columns + self.ui_test.execute_dialog_through_command(".uno:TextToColumns") + xDialog = self.xUITest.getTopFocusWindow() + xtab = xDialog.getChild("tab") + xcomma = xDialog.getChild("comma") + xtab.executeAction("CLICK", tuple()) + xcomma.executeAction("CLICK", tuple()) + #Click Ok + #overwrite warning come up + #press Ok. + xOK = xDialog.getChild("ok") + def handle_warn_dlg(dialog): + xyesBtn = dialog.getChild("yes") + self.ui_test.close_dialog_through_button(xyesBtn) + + self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), + dialog_handler=handle_warn_dlg) + #Verify + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Original") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "a") + self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "") + self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "") + self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "a") + self.assertEqual(get_cell_by_position(document, 0, 0, 5).getString(), "a") + self.assertEqual(get_cell_by_position(document, 0, 0, 6).getString(), "a") + + self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Copy") + self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "b") + self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "b") + self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "") + self.assertEqual(get_cell_by_position(document, 0, 1, 4).getString(), "") + self.assertEqual(get_cell_by_position(document, 0, 1, 5).getString(), "b") + self.assertEqual(get_cell_by_position(document, 0, 1, 6).getString(), "") + + self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "") + self.assertEqual(get_cell_by_position(document, 0, 2, 1).getString(), "c") + self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "c") + self.assertEqual(get_cell_by_position(document, 0, 2, 3).getString(), "c") + self.assertEqual(get_cell_by_position(document, 0, 2, 4).getString(), "") + self.assertEqual(get_cell_by_position(document, 0, 2, 5).getString(), "") + self.assertEqual(get_cell_by_position(document, 0, 2, 6).getString(), "c") + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests3/tdf71339.py b/sc/qa/uitest/calc_tests3/tdf71339.py new file mode 100644 index 000000000..0935d3168 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf71339.py @@ -0,0 +1,35 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +import os +from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.document import get_sheet_from_doc +from libreoffice.calc.conditional_format import get_conditional_format_from_sheet +from uitest.debug import sleep +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +#Bug: EDITING sigma icon (sum function) operating on selected range + +class tdf71339(UITestCase): + + def test_tdf71339_autosum_on_selected_range(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + enter_text_to_cell(gridwin, "A2", "1") + enter_text_to_cell(gridwin, "A3", "1") + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"})) + self.xUITest.executeCommand(".uno:AutoSum") + + self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 2) + self.assertEqual(get_cell_by_position(document, 0, 0, 3).getFormula(), "=SUM(A1:A3)") + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file diff --git a/sc/qa/uitest/calc_tests3/tdf73006.py b/sc/qa/uitest/calc_tests3/tdf73006.py new file mode 100644 index 000000000..8124bb420 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf73006.py @@ -0,0 +1,43 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +from uitest.uihelper.common import select_pos +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +#Bug 73006 - EDITING: Results filled in wrong cells after Text to Columns + +class tdf73006(UITestCase): + def test_tdf73006_text_to_columns(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + #Add data + enter_text_to_cell(gridwin, "A2", "A B") + #select column A + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) + self.xUITest.executeCommand(".uno:SelectColumn") + # Data - Text to Columns + self.ui_test.execute_dialog_through_command(".uno:TextToColumns") + xDialog = self.xUITest.getTopFocusWindow() + xspace = xDialog.getChild("space") + if (get_state_as_dict(xspace)["Selected"]) == "false": + xspace.executeAction("CLICK", tuple()) + # Click Ok + xOK = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOK) + + #Verify + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "A") + self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "B") + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file diff --git a/sc/qa/uitest/calc_tests3/tdf77509.py b/sc/qa/uitest/calc_tests3/tdf77509.py new file mode 100644 index 000000000..216a6f763 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf77509.py @@ -0,0 +1,65 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +from uitest.uihelper.common import select_pos +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.debug import sleep +import org.libreoffice.unotest +import pathlib + +def get_url_for_data_file(file_name): + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() + +#consolidatedialog.ui +class tdf77509(UITestCase): + def test_tdf77509_consolidate(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf77509.xls")) + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + #1. Open attachment: Consolidate-test.xls + #2. Select any empty cell, eg. cell D1 + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"})) + #3. Tab: Data > Consolidate + self.ui_test.execute_modeless_dialog_through_command(".uno:DataConsolidate") + xDialog = self.xUITest.getTopFocusWindow() + xfunc = xDialog.getChild("func") + xeddataarea = xDialog.getChild("eddataarea") + xadd = xDialog.getChild("add") + xbyrow = xDialog.getChild("byrow") + xbycol = xDialog.getChild("bycol") + xeddestarea = xDialog.getChild("eddestarea") + + props = {"TEXT": "Sum"} + actionProps = mkPropertyValues(props) + xfunc.executeAction("SELECT", actionProps) + #4. Source data ranges: $Sheet1.$A$1:$B$7 + #5. Click 'Add' so that ranges appear in "Consolidation ranges" + xeddataarea.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$7"})) + xadd.executeAction("CLICK", tuple()) + #6. Click 'Options' > check 'Row labels' > click OK + xbyrow.executeAction("CLICK", tuple()) + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + #verify + self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "A 1") + self.assertEqual(get_cell_by_position(document, 0, 3, 1).getString(), "AB 1") + self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "AB 12") + self.assertEqual(get_cell_by_position(document, 0, 3, 3).getString(), "AB 123") + self.assertEqual(get_cell_by_position(document, 0, 3, 4).getString(), "ABC 1") + + self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 1) + self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 2) + self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 2) + self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 1) + self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 1) + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file diff --git a/sc/qa/uitest/calc_tests3/tdf79983.py b/sc/qa/uitest/calc_tests3/tdf79983.py new file mode 100644 index 000000000..f4afc77ea --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf79983.py @@ -0,0 +1,71 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +from uitest.uihelper.common import select_pos +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.debug import sleep +#Bug 79983 - Calc sort lists aren't case sensitive + +class tdf79983(UITestCase): + def test_tdf79983_sort_list_case_sensitive(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + enter_text_to_cell(gridwin, "A1", "AAA") + enter_text_to_cell(gridwin, "A2", "BBB") + enter_text_to_cell(gridwin, "A3", "CCC") + enter_text_to_cell(gridwin, "A4", "DDD") + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"})) + + #Tools / Options / LibreOffice Calc / Sort Lists + self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog + xDialogOpt = self.xUITest.getTopFocusWindow() + + xPages = xDialogOpt.getChild("pages") + xCalcEntry = xPages.getChild('3') # Calc + xCalcEntry.executeAction("EXPAND", tuple()) + xCalcSortEntry = xCalcEntry.getChild('5') + xCalcSortEntry.executeAction("SELECT", tuple()) #Sort List + #copy new list from selected cells + xcopy = xDialogOpt.getChild("copy") + xcopy.executeAction("CLICK", tuple()) + xOKBtn = xDialogOpt.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"})) + gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"})) + + enter_text_to_cell(gridwin, "A1", "AAA") + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"})) + #fill down + self.ui_test.execute_dialog_through_command(".uno:FillSeries") + xDialog = self.xUITest.getTopFocusWindow() + xautofill = xDialog.getChild("autofill") + xautofill.executeAction("CLICK", tuple()) + xOK = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOK) + #verify + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "AAA") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "BBB") + self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "CCC") + self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "DDD") + #UNDO + self.xUITest.executeCommand(".uno:Undo") + #verify + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "AAA") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "") + self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "") + self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "") + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file diff --git a/sc/qa/uitest/calc_tests3/tdf80693.py b/sc/qa/uitest/calc_tests3/tdf80693.py new file mode 100644 index 000000000..f416fce81 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf80693.py @@ -0,0 +1,58 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +from uitest.uihelper.common import select_pos +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.document import get_sheet_from_doc +from libreoffice.calc.conditional_format import get_conditional_format_from_sheet +from uitest.debug import sleep +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues + +#Bug 80693 - EDITING: fill cell with random numbers with min = max +class tdf80693(UITestCase): + def test_tdf80693_random_numbers_min_max(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"})) + self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog") + xDialog = self.xUITest.getTopFocusWindow() + xcellrangeedit = xDialog.getChild("cell-range-edit") + xdistributioncombo = xDialog.getChild("distribution-combo") + xparameter1spin = xDialog.getChild("parameter1-spin") + xparameter2spin = xDialog.getChild("parameter2-spin") + xenableseedcheck = xDialog.getChild("enable-seed-check") + xseedspin = xDialog.getChild("seed-spin") + xenableroundingcheck = xDialog.getChild("enable-rounding-check") + xdecimalplacesspin = xDialog.getChild("decimal-places-spin") + + xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$2"})) + props = {"TEXT": "Uniform"} + actionProps = mkPropertyValues(props) + xdistributioncombo.executeAction("SELECT", actionProps) + + xparameter1spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xparameter1spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xparameter1spin.executeAction("TYPE", mkPropertyValues({"TEXT":"2"})) + xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xparameter2spin.executeAction("TYPE", mkPropertyValues({"TEXT":"2"})) + + xOKBtn = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + #Verify + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 2) + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 2) + #undo + self.xUITest.executeCommand(".uno:Undo") + self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False) + self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False) + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file diff --git a/sc/qa/uitest/calc_tests3/tdf81351.py b/sc/qa/uitest/calc_tests3/tdf81351.py new file mode 100644 index 000000000..520f1c3c6 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf81351.py @@ -0,0 +1,82 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 libreoffice.uno.propertyvalue import mkPropertyValues + +from uitest.framework import UITestCase +from libreoffice.calc.document import get_column +from libreoffice.calc.document import get_cell_by_position +import org.libreoffice.unotest +import pathlib +import time + +def get_url_for_data_file(file_name): + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() + +class tdf81351(UITestCase): + + def test_tdf81351(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf81351.ods")) + xTopWindow = self.xUITest.getTopFocusWindow() + document = self.ui_test.get_component() + gridwin = xTopWindow.getChild("grid_window") + + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), ".uno:Paste") + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:F5"})) + + self.xUITest.executeCommand(".uno:SortAscending") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B7"})) + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), ".uno:Bold") + + self.xUITest.executeCommand(".uno:Undo") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), ".uno:Paste") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B7"})) + + def test_tdf81351_comment4(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf81351.ods")) + xTopWindow = self.xUITest.getTopFocusWindow() + document = self.ui_test.get_component() + + gridwin = xTopWindow.getChild("grid_window") + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:F5"})) + + + self.xUITest.executeCommand(".uno:SortAscending") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), ".uno:Bold") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B7"})) + + self.xUITest.executeCommand(".uno:Undo") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), ".uno:Paste") + + self.xUITest.executeCommand(".uno:Redo") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), ".uno:Bold") + + def test_sort_descending(self): + calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf81351.ods")) + xTopWindow = self.xUITest.getTopFocusWindow() + document = self.ui_test.get_component() + + gridwin = xTopWindow.getChild("grid_window") + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:F5"})) + + self.xUITest.executeCommand(".uno:SortDescending") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), ".uno:Undo") + + gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B7"})) + + self.xUITest.executeCommand(".uno:Undo") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), ".uno:Paste") + + self.xUITest.executeCommand(".uno:Redo") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), ".uno:Undo") + + self.ui_test.close_doc() +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests3/tdf82398.py b/sc/qa/uitest/calc_tests3/tdf82398.py new file mode 100644 index 000000000..66e8d5784 --- /dev/null +++ b/sc/qa/uitest/calc_tests3/tdf82398.py @@ -0,0 +1,63 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# 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 +from uitest.uihelper.common import select_pos +from uitest.uihelper.calc import enter_text_to_cell +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues +#Bug 82398 - EDITING: "Text to Columns" not applied to selected cells after change 'Format Cells' + +class tdf82398(UITestCase): + def test_tdf82398_text_to_columns(self): + calc_doc = self.ui_test.create_doc_in_start_center("calc") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + document = self.ui_test.get_component() + + #Add data + enter_text_to_cell(gridwin, "A1", "afasdfs.fdfasd.fsadf.fasd") + enter_text_to_cell(gridwin, "A2", "3242.43242.3242.2342") + enter_text_to_cell(gridwin, "A3", "fdsfa.afsdfa.adfdas.fsad") + enter_text_to_cell(gridwin, "A4", "21312.1111.1111.111") + #select column A1:A4 / .uno:NumberFormatDate + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"})) + self.xUITest.executeCommand(".uno:NumberFormatDate") + # Data - Text to Columns + self.ui_test.execute_dialog_through_command(".uno:TextToColumns") + xDialog = self.xUITest.getTopFocusWindow() + xother = xDialog.getChild("other") + xinputother = xDialog.getChild("inputother") + + if (get_state_as_dict(xother)["Selected"]) == "false": + xother.executeAction("CLICK", tuple()) + xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"."})) + # Click Ok + xOK = xDialog.getChild("ok") + self.ui_test.close_dialog_through_button(xOK) + + #Verify + self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "afasdfs") + self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 3242) + self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "fdsfa") + self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 21312) + self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "fdfasd") + self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 43242) + self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "afsdfa") + self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1111) + self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "fsadf") + self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3242) + self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "adfdas") + self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 1111) + self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "fasd") + self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 2342) + self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "fsad") + self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 111) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file |