diff options
Diffstat (limited to 'sc/qa/uitest')
-rw-r--r-- | sc/qa/uitest/autofilter2/tdf149907.py | 37 | ||||
-rw-r--r-- | sc/qa/uitest/calc_tests6/tdf85976.py | 65 | ||||
-rw-r--r-- | sc/qa/uitest/conditional_format/colorScale.py | 93 | ||||
-rw-r--r-- | sc/qa/uitest/conditional_format/iconSet.py | 57 | ||||
-rw-r--r-- | sc/qa/uitest/conditional_format/tdf160252.py | 53 | ||||
-rw-r--r-- | sc/qa/uitest/conditional_format/tdf162692.py | 58 | ||||
-rw-r--r-- | sc/qa/uitest/conditional_format/tdf163897.py | 54 | ||||
-rw-r--r-- | sc/qa/uitest/conditional_format/tdf164722.py | 43 | ||||
-rw-r--r-- | sc/qa/uitest/data/autofilter/tdf149907.ods | bin | 0 -> 7950 bytes | |||
-rw-r--r-- | sc/qa/uitest/data/tdf160252.ods | bin | 0 -> 9487 bytes | |||
-rw-r--r-- | sc/qa/uitest/data/tdf162692.ods | bin | 0 -> 12118 bytes | |||
-rw-r--r-- | sc/qa/uitest/data/tdf85976.ods | bin | 0 -> 32712 bytes |
12 files changed, 460 insertions, 0 deletions
diff --git a/sc/qa/uitest/autofilter2/tdf149907.py b/sc/qa/uitest/autofilter2/tdf149907.py new file mode 100644 index 000000000000..d4e84638e9ea --- /dev/null +++ b/sc/qa/uitest/autofilter2/tdf149907.py @@ -0,0 +1,37 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from uitest.uihelper.common import get_url_for_data_file, get_state_as_dict, select_by_text +from libreoffice.calc.document import is_row_hidden + +class tdf149907(UITestCase): + + def test_tdf149907(self): + + with self.ui_test.load_file(get_url_for_data_file("tdf149907.ods")) as doc: + + with self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter") as xDialog: + xField1 = xDialog.getChild("field1") + xVal1 = xDialog.getChild("val1") + xCond1 = xDialog.getChild("cond1") + self.assertEqual('Test', get_state_as_dict(xField1)['SelectEntryText']) + self.assertEqual('=', get_state_as_dict(xCond1)['SelectEntryText']) + self.assertEqual('1', get_state_as_dict(xVal1)['Text']) + select_by_text(xCond1, ">") + + self.assertFalse(is_row_hidden(doc, 0)) + # Without the fix in place, it would have failed here with AssertionError: False is not true + self.assertTrue(is_row_hidden(doc, 1)) + self.assertFalse(is_row_hidden(doc, 2)) + self.assertFalse(is_row_hidden(doc, 3)) + self.assertFalse(is_row_hidden(doc, 4)) + self.assertFalse(is_row_hidden(doc, 5)) + self.assertFalse(is_row_hidden(doc, 6)) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/calc_tests6/tdf85976.py b/sc/qa/uitest/calc_tests6/tdf85976.py new file mode 100644 index 000000000000..7b8a997b1e89 --- /dev/null +++ b/sc/qa/uitest/calc_tests6/tdf85976.py @@ -0,0 +1,65 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from libreoffice.calc.document import get_cell_by_position +from uitest.uihelper.common import get_url_for_data_file +from uitest.uihelper.common import get_state_as_dict + +class tdf85976(UITestCase): + def test_tdf85976(self): + with self.ui_test.load_file(get_url_for_data_file("tdf85976.ods")) as calc_doc: + with self.ui_test.execute_dialog_through_command(".uno:HandleDuplicateRecords") as xDialog: + xColumn = xDialog.getChild("column") + xRow = xDialog.getChild("row") + xIncludesHeaders = xDialog.getChild("includesheaders") + xAllCheckBtn = xDialog.getChild("allcheckbtn") + xCheckList = xDialog.getChild("checklist") + xSelect = xDialog.getChild("select") + xRemove = xDialog.getChild("remove") + self.assertEqual("false", get_state_as_dict(xColumn)["Checked"]) + self.assertEqual("true", get_state_as_dict(xRow)["Checked"]) + self.assertEqual("false", get_state_as_dict(xIncludesHeaders)["Selected"]) + self.assertEqual("true", get_state_as_dict(xAllCheckBtn)["Selected"]) + self.assertEqual("6", get_state_as_dict(xCheckList)["Children"]) + self.assertEqual("false", get_state_as_dict(xSelect)["Checked"]) + self.assertEqual("true", get_state_as_dict(xRemove)["Checked"]) + + expectedText = ["A", "B", "C", "D", "E", "F"] + for i in range(6): + self.assertEqual(expectedText[i], get_state_as_dict(xCheckList.getChild(i))["Text"]) + self.assertEqual("true", get_state_as_dict(xCheckList.getChild(i))["IsChecked"]) + + xIncludesHeaders.executeAction("CLICK", tuple()) + + expectedText = ["Id", "SepalLengthCm", "SepalWidthCm", "PetalLengthCm", "PetalWidthCm", "Species"] + for i in range(6): + self.assertEqual(expectedText[i], get_state_as_dict(xCheckList.getChild(i))["Text"]) + self.assertEqual("true", get_state_as_dict(xCheckList.getChild(i))["IsChecked"]) + + xAllCheckBtn.executeAction("CLICK", tuple()) + for i in range(6): + self.assertEqual(expectedText[i], get_state_as_dict(xCheckList.getChild(i))["Text"]) + self.assertEqual("false", get_state_as_dict(xCheckList.getChild(i))["IsChecked"]) + + xCheckList.getChild(5).executeAction("CLICK", tuple()) + + for i in range(5): + self.assertEqual(expectedText[i], get_state_as_dict(xCheckList.getChild(i))["Text"]) + self.assertEqual("false", get_state_as_dict(xCheckList.getChild(i))["IsChecked"]) + + self.assertEqual("Species", get_state_as_dict(xCheckList.getChild(5))["Text"]) + self.assertEqual("true", get_state_as_dict(xCheckList.getChild(5))["IsChecked"]) + + self.assertEqual("Id", get_cell_by_position(calc_doc, 0, 0, 0).getString()) + self.assertEqual("1", get_cell_by_position(calc_doc, 0, 0, 1).getString()) + self.assertEqual("51", get_cell_by_position(calc_doc, 0, 0, 2).getString()) + self.assertEqual("101", get_cell_by_position(calc_doc, 0, 0, 3).getString()) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/conditional_format/colorScale.py b/sc/qa/uitest/conditional_format/colorScale.py new file mode 100644 index 000000000000..759a4794ba65 --- /dev/null +++ b/sc/qa/uitest/conditional_format/colorScale.py @@ -0,0 +1,93 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.calc import enter_text_to_cell +from uitest.uihelper.common import select_by_text, type_text + +class colorScale(UITestCase): + + def test_colorScale3Entries(self): + + with self.ui_test.create_doc_in_start_center("calc") as document: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + cond_formats = document.Sheets[0].ConditionalFormats + self.assertEqual(0, cond_formats.Length) + + enter_text_to_cell(gridwin, "A1", "1") + enter_text_to_cell(gridwin, "A2", "2") + enter_text_to_cell(gridwin, "A3", "3") + + self.xUITest.executeCommand(".uno:SelectColumn") + + with self.ui_test.execute_dialog_through_command(".uno:ColorScaleFormatDialog") as xCondFormat: + self.assertEqual("Condition 1", get_state_as_dict(xCondFormat.getChild("number"))["Text"]) + self.assertEqual("All Cells", get_state_as_dict(xCondFormat.getChild("type"))["SelectEntryText"]) + self.assertEqual("Color Scale (3 Entries)", get_state_as_dict(xCondFormat.getChild("colorformat"))["SelectEntryText"]) + self.assertEqual("Min", get_state_as_dict(xCondFormat.getChild("colscalemin"))["SelectEntryText"]) + self.assertEqual("Percentile", get_state_as_dict(xCondFormat.getChild("colscalemiddle"))["SelectEntryText"]) + self.assertEqual("Max", get_state_as_dict(xCondFormat.getChild("colscalemax"))["SelectEntryText"]) + self.assertEqual("Red", get_state_as_dict(xCondFormat.getChild("lbcolmin"))["Text"]) + self.assertEqual("Yellow", get_state_as_dict(xCondFormat.getChild("lbcolmiddle"))["Text"]) + self.assertEqual("Green", get_state_as_dict(xCondFormat.getChild("lbcolmax"))["Text"]) + self.assertEqual("", get_state_as_dict(xCondFormat.getChild("edcolscalemin"))["Text"]) + self.assertEqual("50", get_state_as_dict(xCondFormat.getChild("edcolscalemiddle"))["Text"]) + self.assertEqual("", get_state_as_dict(xCondFormat.getChild("edcolscalemax"))["Text"]) + + self.assertEqual(1, cond_formats.Length) + self.assertEqual(3, len(cond_formats.ConditionalFormats[0].getByIndex(0).ColorScaleEntries)) + self.assertEqual(16711680, cond_formats.ConditionalFormats[0].getByIndex(0).ColorScaleEntries[0].Color) + self.assertEqual(16776960, cond_formats.ConditionalFormats[0].getByIndex(0).ColorScaleEntries[1].Color) + self.assertEqual(43315, cond_formats.ConditionalFormats[0].getByIndex(0).ColorScaleEntries[2].Color) + + def test_colorScale2Entries(self): + + with self.ui_test.create_doc_in_start_center("calc") as document: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + cond_formats = document.Sheets[0].ConditionalFormats + self.assertEqual(0, cond_formats.Length) + + enter_text_to_cell(gridwin, "A1", "1") + enter_text_to_cell(gridwin, "A2", "2") + enter_text_to_cell(gridwin, "A3", "3") + + self.xUITest.executeCommand(".uno:SelectColumn") + + with self.ui_test.execute_dialog_through_command(".uno:ColorScaleFormatDialog", close_button="") as xCondFormat: + self.assertEqual("Condition 1", get_state_as_dict(xCondFormat.getChild("number"))["Text"]) + self.assertEqual("All Cells", get_state_as_dict(xCondFormat.getChild("type"))["SelectEntryText"]) + + select_by_text(xCondFormat.getChild("colorformat"), "Color Scale (2 Entries)") + + # we need to get a pointer again after changing the color format + xCondFormat = self.xUITest.getTopFocusWindow() + + self.assertEqual("Color Scale (2 Entries)", get_state_as_dict(xCondFormat.getChild("colorformat"))["SelectEntryText"]) + self.assertEqual("Min", get_state_as_dict(xCondFormat.getChild("colscalemin"))["SelectEntryText"]) + self.assertEqual("Max", get_state_as_dict(xCondFormat.getChild("colscalemax"))["SelectEntryText"]) + self.assertEqual("Light Yellow 2", get_state_as_dict(xCondFormat.getChild("lbcolmin"))["Text"]) + self.assertEqual("Light Green 2", get_state_as_dict(xCondFormat.getChild("lbcolmax"))["Text"]) + self.assertEqual("", get_state_as_dict(xCondFormat.getChild("edcolscalemin"))["Text"]) + self.assertEqual("", get_state_as_dict(xCondFormat.getChild("edcolscalemax"))["Text"]) + + # close the conditional format manager + xOKBtn = xCondFormat.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + self.assertEqual(1, cond_formats.Length) + self.assertEqual(2, len(cond_formats.ConditionalFormats[0].getByIndex(0).ColorScaleEntries)) + self.assertEqual(16777069, cond_formats.ConditionalFormats[0].getByIndex(0).ColorScaleEntries[0].Color) + self.assertEqual(7847013, cond_formats.ConditionalFormats[0].getByIndex(0).ColorScaleEntries[1].Color) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/conditional_format/iconSet.py b/sc/qa/uitest/conditional_format/iconSet.py new file mode 100644 index 000000000000..817f7d6cb43e --- /dev/null +++ b/sc/qa/uitest/conditional_format/iconSet.py @@ -0,0 +1,57 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.calc import enter_text_to_cell +from uitest.uihelper.common import select_by_text, type_text + +class IconSet(UITestCase): + + def test_IconSet(self): + + with self.ui_test.create_doc_in_start_center("calc") as document: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + cond_formats = document.Sheets[0].ConditionalFormats + self.assertEqual(0, cond_formats.Length) + + enter_text_to_cell(gridwin, "A1", "1") + enter_text_to_cell(gridwin, "A2", "2") + enter_text_to_cell(gridwin, "A3", "3") + + self.xUITest.executeCommand(".uno:SelectColumn") + + with self.ui_test.execute_dialog_through_command(".uno:IconSetFormatDialog", close_button="") as xCondFormat: + self.assertEqual("Condition 1", get_state_as_dict(xCondFormat.getChild("number"))["Text"]) + self.assertEqual("All Cells", get_state_as_dict(xCondFormat.getChild("type"))["SelectEntryText"]) + self.assertEqual("Icon Set", get_state_as_dict(xCondFormat.getChild("colorformat"))["SelectEntryText"]) + self.assertEqual("3 Arrows", get_state_as_dict(xCondFormat.getChild("iconsettype"))["SelectEntryText"]) + select_by_text(xCondFormat.getChild("iconsettype"), "4 Gray Arrows") + + # we need to get a pointer again after changing the IconSet type + xCondFormat = self.xUITest.getTopFocusWindow() + + self.assertEqual("Percent", get_state_as_dict(xCondFormat.getChild("listbox1"))["SelectEntryText"]) + self.assertEqual("Percent", get_state_as_dict(xCondFormat.getChild("listbox2"))["SelectEntryText"]) + self.assertEqual("Percent", get_state_as_dict(xCondFormat.getChild("listbox3"))["SelectEntryText"]) + self.assertEqual("", get_state_as_dict(xCondFormat.getChild("entry1"))["Text"]) + self.assertEqual("", get_state_as_dict(xCondFormat.getChild("entry2"))["Text"]) + self.assertEqual("", get_state_as_dict(xCondFormat.getChild("entry3"))["Text"]) + + # close the conditional format manager + xOKBtn = xCondFormat.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + self.assertEqual(1, cond_formats.Length) + self.assertEqual(11, cond_formats.ConditionalFormats[0].getByIndex(0).Icons) # IconSet_4ArrowsGray + self.assertEqual(4, len(cond_formats.ConditionalFormats[0].getByIndex(0).IconSetEntries)) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/conditional_format/tdf160252.py b/sc/qa/uitest/conditional_format/tdf160252.py new file mode 100644 index 000000000000..4311b9144146 --- /dev/null +++ b/sc/qa/uitest/conditional_format/tdf160252.py @@ -0,0 +1,53 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file + +class tdf160252(UITestCase): + def test_tdf160252(self): + + with self.ui_test.load_file(get_url_for_data_file("tdf160252.ods")) as calc_doc: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + self.assertEqual("1", get_state_as_dict(gridwin)["CurrentColumn"]) + self.assertEqual("10", get_state_as_dict(gridwin)["CurrentRow"]) + + with self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog", close_button="") as xCondFormatMgr: + + xContainer = xCondFormatMgr.getChild("CONTAINER") + self.assertEqual("2", get_state_as_dict(xContainer)["Children"]) + + xEditBtn = xCondFormatMgr.getChild("edit") + with self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name = "ModelessDialogVisible", close_button="cancel") as xCondFormatDlg: + xEdassign = xCondFormatDlg.getChild("edassign") + self.assertEqual("A1:A3", get_state_as_dict(xEdassign)["Text"]) + + # we need to get a pointer again as the old window has been deleted + xCondFormatMgr = self.xUITest.getTopFocusWindow() + + xContainer = xCondFormatMgr.getChild("CONTAINER") + self.assertEqual("2", get_state_as_dict(xContainer)["Children"]) + + xEditBtn = xCondFormatMgr.getChild("edit") + with self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name = "ModelessDialogVisible", close_button="cancel") as xCondFormatDlg: + xEdassign = xCondFormatDlg.getChild("edassign") + # Without the fix in place, this test would have failed with + # AssertionError: 'A1:A3' != 'B11' + self.assertEqual("A1:A3", get_state_as_dict(xEdassign)["Text"]) + + # we need to get a pointer again as the old window has been deleted + xCondFormatMgr = self.xUITest.getTopFocusWindow() + + # close the conditional format manager + xOKBtn = xCondFormatMgr.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/conditional_format/tdf162692.py b/sc/qa/uitest/conditional_format/tdf162692.py new file mode 100644 index 000000000000..4dd5bdaf81d7 --- /dev/null +++ b/sc/qa/uitest/conditional_format/tdf162692.py @@ -0,0 +1,58 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file + +class tdf162692(UITestCase): + def test_tdf162692(self): + + with self.ui_test.load_file(get_url_for_data_file("tdf162692.ods")): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + self.assertEqual("0", get_state_as_dict(gridwin)["SelectedTable"]) + + with self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog", close_button="") as xCondFormatMgr: + + xContainer = xCondFormatMgr.getChild("CONTAINER") + self.assertEqual("2", get_state_as_dict(xContainer)['Children']) + + self.assertEqual("A1:A500\tCell value is unique ", get_state_as_dict(xContainer.getChild("0"))["Text"]) + self.assertEqual("B1:B500\tCell value contains \"я столб без рамки\"", get_state_as_dict(xContainer.getChild("1"))["Text"]) + + xEditBtn = xCondFormatMgr.getChild("edit") + with self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name="ModelessDialogVisible", close_button="cancel"): + pass + + # we need to get a pointer again as the old window has been removed + xCondFormatMgr = self.xUITest.getTopFocusWindow() + + xContainer = xCondFormatMgr.getChild("CONTAINER") + + # close the conditional format manager + xOKBtn = xCondFormatMgr.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + + with self.ui_test.execute_dialog_through_command(".uno:JumpToTable") as xDialogGoToSheet: + xtree_view = xDialogGoToSheet.getChild("treeview") + xtree_view.getChild('1').executeAction("SELECT", tuple()) + + self.assertEqual("1", get_state_as_dict(gridwin)["SelectedTable"]) + + with self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog") as xCondFormatMgr: + xContainer = xCondFormatMgr.getChild("CONTAINER") + + # Without the fix in place, this test would have failed with + # AssertionError: '1' != '2' + self.assertEqual("1", get_state_as_dict(xContainer)['Children']) + + self.assertEqual("D1:D400\tCell value is unique ", get_state_as_dict(xContainer.getChild("0"))["Text"]) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/conditional_format/tdf163897.py b/sc/qa/uitest/conditional_format/tdf163897.py new file mode 100644 index 000000000000..8f3710f4f621 --- /dev/null +++ b/sc/qa/uitest/conditional_format/tdf163897.py @@ -0,0 +1,54 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file + +class tdf163897(UITestCase): + def test_tdf163897(self): + + # Use an existing document + with self.ui_test.load_file(get_url_for_data_file("tdf105544.ods")): + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + with self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog", close_button="") as xCondFormatMgr: + + xContainer = xCondFormatMgr.getChild("CONTAINER") + self.assertEqual("4", get_state_as_dict(xContainer)['Children']) + + xRemoveBtn = xCondFormatMgr.getChild("remove") + + xRemoveBtn.executeAction("CLICK", tuple()) + self.assertEqual("3", get_state_as_dict(xContainer)['Children']) + xRemoveBtn.executeAction("CLICK", tuple()) + self.assertEqual("2", get_state_as_dict(xContainer)['Children']) + xRemoveBtn.executeAction("CLICK", tuple()) + self.assertEqual("1", get_state_as_dict(xContainer)['Children']) + xRemoveBtn.executeAction("CLICK", tuple()) + self.assertEqual("0", get_state_as_dict(xContainer)['Children']) + + xAddBtn = xCondFormatMgr.getChild("add") + with self.ui_test.execute_dialog_through_action(xAddBtn, "CLICK", event_name="ModelessDialogVisible", close_button="cancel"): + pass + + # we need to get a pointer again as the old window has been removed + xCondFormatMgr = self.xUITest.getTopFocusWindow() + + xContainer = xCondFormatMgr.getChild("CONTAINER") + + # Without the fix in place, this test would have failed with + # AssertionError: '0' != '4' + self.assertEqual("0", get_state_as_dict(xContainer)['Children']) + + # close the conditional format manager + xOKBtn = xCondFormatMgr.getChild("ok") + self.ui_test.close_dialog_through_button(xOKBtn) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/conditional_format/tdf164722.py b/sc/qa/uitest/conditional_format/tdf164722.py new file mode 100644 index 000000000000..b6b1ed555d89 --- /dev/null +++ b/sc/qa/uitest/conditional_format/tdf164722.py @@ -0,0 +1,43 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.calc import enter_text_to_cell + +class tdf164722(UITestCase): + def test_tdf164722(self): + + with self.ui_test.create_doc_in_start_center("calc") as document: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + cond_formats = document.Sheets[0].ConditionalFormats + self.assertEqual(0, cond_formats.Length) + + enter_text_to_cell(gridwin, "A1", "1") + enter_text_to_cell(gridwin, "A2", "2") + enter_text_to_cell(gridwin, "A3", "3") + + self.xUITest.executeCommand(".uno:SelectColumn") + + with self.ui_test.execute_dialog_through_command(".uno:ColorScaleFormatDialog") as xCondFormat: + pass + + self.assertEqual(1, cond_formats.Length) + + self.xUITest.executeCommand(".uno:Undo") + + # Without the fix in place, it would have failed here + with self.ui_test.execute_dialog_through_command(".uno:ColorScaleFormatDialog") as xCondFormat: + pass + + self.assertEqual(1, cond_formats.Length) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/qa/uitest/data/autofilter/tdf149907.ods b/sc/qa/uitest/data/autofilter/tdf149907.ods Binary files differnew file mode 100644 index 000000000000..716c4551ef1d --- /dev/null +++ b/sc/qa/uitest/data/autofilter/tdf149907.ods diff --git a/sc/qa/uitest/data/tdf160252.ods b/sc/qa/uitest/data/tdf160252.ods Binary files differnew file mode 100644 index 000000000000..2cb64c86482e --- /dev/null +++ b/sc/qa/uitest/data/tdf160252.ods diff --git a/sc/qa/uitest/data/tdf162692.ods b/sc/qa/uitest/data/tdf162692.ods Binary files differnew file mode 100644 index 000000000000..211ead17f4b6 --- /dev/null +++ b/sc/qa/uitest/data/tdf162692.ods diff --git a/sc/qa/uitest/data/tdf85976.ods b/sc/qa/uitest/data/tdf85976.ods Binary files differnew file mode 100644 index 000000000000..cc4feeadb8c2 --- /dev/null +++ b/sc/qa/uitest/data/tdf85976.ods |