diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-16 10:31:40 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-02-16 13:10:03 +0100 |
commit | 19a2ea083355344acaaff4bdd2d83f76935da099 (patch) | |
tree | 4a0568c19dc49fab049f35cad1010ed9fe7cf6b9 /sc/qa/uitest/calc_tests4 | |
parent | 537c60b9e5f2c72013d213159f16777f5e8a8803 (diff) |
uitest: sc: move these tests to 'sort' folder
Change-Id: Ib91417c3edd5f449074f55b2a1628e4ee2df4a6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110980
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/uitest/calc_tests4')
-rw-r--r-- | sc/qa/uitest/calc_tests4/tdf91305.py | 140 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests4/tdf95192.py | 47 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests4/tdf99208.py | 65 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests4/tdf99627.py | 48 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests4/tdf99773.py | 52 |
5 files changed, 0 insertions, 352 deletions
diff --git a/sc/qa/uitest/calc_tests4/tdf91305.py b/sc/qa/uitest/calc_tests4/tdf91305.py deleted file mode 100644 index eae7e8c4555e..000000000000 --- a/sc/qa/uitest/calc_tests4/tdf91305.py +++ /dev/null @@ -1,140 +0,0 @@ -# -*- 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 91305 - Sort button does not sort first cell if it has text format - -class tdf91305(UITestCase): - - def test_tdf91305_sort_text_cells_rows(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() - #In column A enter texts - enter_text_to_cell(gridwin, "A1", "cc") - enter_text_to_cell(gridwin, "A2", "ff") - enter_text_to_cell(gridwin, "A3", "aa") - - gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"})) - #Press toolbarbutton for ascending sorting .uno:SortAsc - self.xUITest.executeCommand(".uno:SortAscending") - #verify - self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "aa") - self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "cc") - self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "ff") - #Press toolbarbutton for descending sorting .uno:SortDescending - self.xUITest.executeCommand(".uno:SortDescending") - self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "ff") - self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "cc") - self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "aa") - - def test_tdf91305_sort_text_cells_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() - #In column A enter texts - enter_text_to_cell(gridwin, "A1", "cc") - enter_text_to_cell(gridwin, "B1", "ff") - enter_text_to_cell(gridwin, "C1", "aa") - - gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C1"})) - #Open sort dialog by DATA - SORT - self.ui_test.execute_dialog_through_command(".uno:DataSort") - xDialog = self.xUITest.getTopFocusWindow() - xTabs = xDialog.getChild("tabcontrol") - xleftright = xDialog.getChild("leftright") - select_pos(xTabs, "1") - xleftright.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(), "aa") - self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "cc") - self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "ff") - #Open sort dialog by DATA - SORT - self.ui_test.execute_dialog_through_command(".uno:DataSort") - xDialog = self.xUITest.getTopFocusWindow() - xTabs = xDialog.getChild("tabcontrol") - xleftright = xDialog.getChild("leftright") - xdown = xDialog.getChild("down") - select_pos(xTabs, "1") - xleftright.executeAction("CLICK", tuple()) - select_pos(xTabs, "0") - xdown.executeAction("CLICK", tuple()) - xOK = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOK) - self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "ff") - self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "cc") - self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "aa") - self.ui_test.close_doc() - - #comment 6 - Additional sub-bugs: - def test_tdf91305_sort_text_cells_rows(self): - #Selecting some empty cells and pressing SORT causes empty cells to move below. - #No matter if you sort from A to Z or from Z to A. - 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() - #In column A enter text - enter_text_to_cell(gridwin, "A5", "ff") - gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"})) - #sorting - self.xUITest.executeCommand(".uno:SortAscending") - self.xUITest.executeCommand(".uno:SortDescending") - #verify - self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "ff") - # Assert that the correct range has been selected - gridWinState = get_state_as_dict(gridwin) - self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A1:Sheet1.A4") - - self.ui_test.close_doc() - - #2) Placing digit to the header position and running set of sorts will make digit to be on 2nd or last position. - def test_tdf91305_sort_text_cells_1st_row_digit(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() - #In column A enter texts - enter_text_to_cell(gridwin, "A1", "1") - enter_text_to_cell(gridwin, "A2", "ff") - enter_text_to_cell(gridwin, "A3", "aa") - enter_text_to_cell(gridwin, "A4", "cc") - - gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"})) - #Press toolbarbutton for ascending sorting .uno:SortAsc - self.xUITest.executeCommand(".uno:SortAscending") - #verify - self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "1") - self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "aa") - self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "cc") - self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "ff") - #Press toolbarbutton for descending sorting .uno:SortDescending - self.xUITest.executeCommand(".uno:SortDescending") - self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "ff") - self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "cc") - self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "aa") - self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "1") - #Undo - self.xUITest.executeCommand(".uno:Undo") - self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "1") - self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "aa") - self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "cc") - self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "ff") - - 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_tests4/tdf95192.py b/sc/qa/uitest/calc_tests4/tdf95192.py deleted file mode 100644 index be310f6a4eb1..000000000000 --- a/sc/qa/uitest/calc_tests4/tdf95192.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- 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, get_url_for_data_file -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 95192 - SORTING Natural sorting not working with non-letter,non-number content - -class tdf95192(UITestCase): - def test_td99627_natural_sort(self): - calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf95192.ods")) - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - document = self.ui_test.get_component() - - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - - #Open sort dialog by DATA - SORT - self.ui_test.execute_dialog_through_command(".uno:DataSort") - xDialog = self.xUITest.getTopFocusWindow() - xTabs = xDialog.getChild("tabcontrol") - select_pos(xTabs, "1") - xNatural = xDialog.getChild("naturalsort") - xNatural.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(), "Sal. Capra 1/17") - self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Sal. Capra 1/20") - self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "Sal. Oregina 1/2") - self.assertEqual(get_cell_by_position(document, 0, 0, 41).getString(), "Vico Chiuso Cinque Santi 18/10") - #UNDO - self.xUITest.executeCommand(".uno:Undo") - #Verify - self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Sal. Oregina 1/2") - self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Via A. Centurione 11/7") - self.assertEqual(get_cell_by_position(document, 0, 0, 41).getString(), "Vico Chiuso Cinque Santi 18/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_tests4/tdf99208.py b/sc/qa/uitest/calc_tests4/tdf99208.py deleted file mode 100644 index f590b9f2063e..000000000000 --- a/sc/qa/uitest/calc_tests4/tdf99208.py +++ /dev/null @@ -1,65 +0,0 @@ -# -*- 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, get_url_for_data_file -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 99208 - Spreadsheet sort hangs - -class tdf99208(UITestCase): - def test_td99627_natural_sort(self): - calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf99208.ods")) - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - document = self.ui_test.get_component() - #select A3:C245 - gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C245"})) - - #Menu 'Data -> Sort - #Column A - Ascending' <ok> - self.ui_test.execute_dialog_through_command(".uno:DataSort") - xDialog = self.xUITest.getTopFocusWindow() - xTabs = xDialog.getChild("tabcontrol") - select_pos(xTabs, "1") - xNatural = xDialog.getChild("naturalsort") - xtopdown = xDialog.getChild("topdown") - xHeader = xDialog.getChild("header") - xFormats = xDialog.getChild("formats") - if (get_state_as_dict(xNatural)["Selected"]) == "false": - xNatural.executeAction("CLICK", tuple()) - if (get_state_as_dict(xHeader)["Selected"]) == "false": - xHeader.executeAction("CLICK", tuple()) - if (get_state_as_dict(xFormats)["Selected"]) == "false": - xFormats.executeAction("CLICK", tuple()) - xtopdown.executeAction("CLICK", tuple()) - select_pos(xTabs, "0") - xSortKey1 = xDialog.getChild("sortlb") - xAsc = xDialog.getChild("up") - props = {"TEXT": "FODMAP"} - actionProps = mkPropertyValues(props) - xSortKey1.executeAction("SELECT", actionProps) - xAsc.executeAction("CLICK", tuple()) - xOk = xDialog.getChild("ok") - self.ui_test.close_dialog_through_button(xOk) - #Verify Expected: Values column B sorted ascending, column "control" unsorted - self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "FODMAP") - self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "agave") - self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "almond milk") - self.assertEqual(get_cell_by_position(document, 0, 0, 244).getString(), "zucchini") - # UNDO - self.xUITest.executeCommand(".uno:Undo") - # Verify - self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "FODMAP") - self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "beef (grass fed, no breadcrumbs)") - self.assertEqual(get_cell_by_position(document, 0, 0, 244).getString(), "salsa") - - 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_tests4/tdf99627.py b/sc/qa/uitest/calc_tests4/tdf99627.py deleted file mode 100644 index d5071adeae79..000000000000 --- a/sc/qa/uitest/calc_tests4/tdf99627.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- 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, get_url_for_data_file -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 99627 - Calc freezes when applying natural sorting on text columns - -class tdf99627(UITestCase): - def test_td99627_natural_sort(self): - calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf99627.ods")) - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") - document = self.ui_test.get_component() - - gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"})) - - #Open sort dialog by DATA - SORT - self.ui_test.execute_dialog_through_command(".uno:DataSort") - xDialog = self.xUITest.getTopFocusWindow() - xTabs = xDialog.getChild("tabcontrol") - select_pos(xTabs, "1") - xNatural = xDialog.getChild("naturalsort") - xdown = xDialog.getChild("down") - xNatural.executeAction("CLICK", tuple()) - select_pos(xTabs, "0") - xdown.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, 1).getString(), "2998") - self.assertEqual(get_cell_by_position(document, 0, 0, 2998).getString(), "1") - #UNDO - self.xUITest.executeCommand(".uno:Undo") - #Verify - self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "1") - self.assertEqual(get_cell_by_position(document, 0, 0, 2998).getString(), "2998") - - 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_tests4/tdf99773.py b/sc/qa/uitest/calc_tests4/tdf99773.py deleted file mode 100644 index 099788fa1428..000000000000 --- a/sc/qa/uitest/calc_tests4/tdf99773.py +++ /dev/null @@ -1,52 +0,0 @@ -# -*- 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 99773 - EDITING: calc freezes if sorting in natural mode - -class tdf99773(UITestCase): - def test_tdf99773_natural_sorting_space(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 data - enter_text_to_cell(gridwin, "A1", "A 11") - enter_text_to_cell(gridwin, "A2", "A 2") - enter_text_to_cell(gridwin, "A3", "B 2") - enter_text_to_cell(gridwin, "A4", "A 5") - enter_text_to_cell(gridwin, "A5", "A 50") - enter_text_to_cell(gridwin, "A6", "B 20") - - gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A6"})) - #Open sort dialog by DATA - SORT - self.ui_test.execute_dialog_through_command(".uno:DataSort") - xDialog = self.xUITest.getTopFocusWindow() - xTabs = xDialog.getChild("tabcontrol") - select_pos(xTabs, "1") - xNatural = xDialog.getChild("naturalsort") - if (get_state_as_dict(xNatural)["Selected"]) == "false": - xNatural.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(), "A 2") - self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "A 5") - self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "A 11") - self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "A 50") - self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "B 2") - self.assertEqual(get_cell_by_position(document, 0, 0, 5).getString(), "B 20") - - self.ui_test.close_doc() -# vim: set shiftwidth=4 softtabstop=4 expandtab: |