[Libreoffice-commits] core.git: sc/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 30 11:18:29 UTC 2021
sc/qa/uitest/autofilter/autofilter.py | 211 +--
sc/qa/uitest/autofilter/autofilterBugs.py | 48
sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py | 230 +--
sc/qa/uitest/autofilter/tdf126306.py | 223 +--
sc/qa/uitest/autofilter/tdf141559.py | 145 +-
sc/qa/uitest/autofilter/tdf141946.py | 91 -
sc/qa/uitest/autofilter/tdf36383.py | 63 -
sc/qa/uitest/autofilter/tdf46062.py | 45
sc/qa/uitest/autofilter/tdf48025.py | 85 -
sc/qa/uitest/autofilter/tdf68113.py | 101 -
sc/qa/uitest/calc_tests/CalcPasteOnly.py | 48
sc/qa/uitest/calc_tests/CellDropDownItems.py | 130 +-
sc/qa/uitest/calc_tests/Comments.py | 50
sc/qa/uitest/calc_tests/autofill.py | 26
sc/qa/uitest/calc_tests/calcSheetDelete.py | 180 +-
sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py | 350 ++---
sc/qa/uitest/calc_tests/columns.py | 412 +++---
sc/qa/uitest/calc_tests/fillRandomNumber.py | 78 -
sc/qa/uitest/calc_tests/formatCells.py | 736 +++++------
sc/qa/uitest/calc_tests/mergedRowsColumns.py | 25
sc/qa/uitest/calc_tests/printRange.py | 176 +-
sc/qa/uitest/calc_tests/rows.py | 338 ++---
sc/qa/uitest/calc_tests/sheetRename.py | 56
sc/qa/uitest/calc_tests/zoom.py | 83 -
sc/qa/uitest/calc_tests2/dataform.py | 13
sc/qa/uitest/calc_tests2/standardFilter.py | 1048 ++++++++---------
sc/qa/uitest/calc_tests2/tdf104117.py | 58
sc/qa/uitest/calc_tests2/tdf117367.py | 64 -
sc/qa/uitest/calc_tests2/tdf120174.py | 28
sc/qa/uitest/calc_tests2/tdf126577.py | 36
sc/qa/uitest/calc_tests2/tdf46138.py | 30
sc/qa/uitest/calc_tests2/tdf51700.py | 60
sc/qa/uitest/calc_tests3/clearCells.py | 490 +++----
sc/qa/uitest/calc_tests3/insertQrCodeGen.py | 80 -
sc/qa/uitest/calc_tests3/tdf69450.py | 72 -
sc/qa/uitest/calc_tests3/tdf73006.py | 36
sc/qa/uitest/calc_tests3/tdf79983.py | 80 -
sc/qa/uitest/calc_tests3/tdf80693.py | 64 -
sc/qa/uitest/calc_tests3/tdf82398.py | 74 -
sc/qa/uitest/calc_tests4/tdf88999.py | 50
sc/qa/uitest/calc_tests4/tdf89907.py | 78 -
sc/qa/uitest/calc_tests4/tdf92423.py | 90 -
sc/qa/uitest/calc_tests4/tdf94208.py | 54
sc/qa/uitest/calc_tests4/trackedChanges.py | 456 +++----
sc/qa/uitest/calc_tests6/autoFormat.py | 92 -
sc/qa/uitest/calc_tests6/autocorrectOptions.py | 162 +-
sc/qa/uitest/calc_tests6/hideShowSheet.py | 56
sc/qa/uitest/calc_tests6/moveCopySheet.py | 88 -
sc/qa/uitest/calc_tests6/multipleOperations.py | 194 +--
sc/qa/uitest/calc_tests6/scenarios.py | 54
sc/qa/uitest/calc_tests6/shareSpreadsheet.py | 20
sc/qa/uitest/calc_tests6/tdf104378.py | 24
sc/qa/uitest/calc_tests6/tdf116996.py | 70 -
sc/qa/uitest/calc_tests6/tdf121263.py | 34
sc/qa/uitest/calc_tests6/tdf91726.py | 56
sc/qa/uitest/calc_tests7/tdf106667.py | 22
sc/qa/uitest/calc_tests7/tdf117987.py | 20
sc/qa/uitest/calc_tests7/tdf123122.py | 76 -
sc/qa/uitest/calc_tests7/tdf125030.py | 30
sc/qa/uitest/calc_tests7/tdf45020.py | 40
sc/qa/uitest/calc_tests8/navigator.py | 49
sc/qa/uitest/calc_tests8/tdf118308.py | 47
sc/qa/uitest/calc_tests8/tdf125051.py | 34
sc/qa/uitest/calc_tests8/tdf137726.py | 23
sc/qa/uitest/calc_tests9/tdf117879.py | 35
sc/qa/uitest/calc_tests9/tdf121949.py | 21
sc/qa/uitest/calc_tests9/tdf133629.py | 64 -
sc/qa/uitest/calc_tests9/tdf141244.py | 27
sc/qa/uitest/chart/create_chart.py | 94 -
sc/qa/uitest/chart/edit_chart.py | 33
sc/qa/uitest/chart/tdf124295.py | 19
sc/qa/uitest/chart/tdf131715.py | 15
sc/qa/uitest/chart/tdf46885.py | 46
sc/qa/uitest/conditional_format/tdf105351.py | 78 -
sc/qa/uitest/conditional_format/tdf105411.py | 23
sc/qa/uitest/conditional_format/tdf105466.py | 21
sc/qa/uitest/csv_dialog/tdf142395.py | 1
sc/qa/uitest/csv_dialog/tdf57841.py | 1
sc/qa/uitest/csv_dialog/tdf60468.py | 1
sc/qa/uitest/function_wizard/function_wizard.py | 15
sc/qa/uitest/function_wizard/tdf132173.py | 22
sc/qa/uitest/hide_cols/tdf95306.py | 34
sc/qa/uitest/inputLine/tdf54197.py | 28
sc/qa/uitest/inputLine/tdf67346.py | 42
sc/qa/uitest/key_f4/f4.py | 186 +--
sc/qa/uitest/manual_tests/calc.py | 244 +--
sc/qa/uitest/manual_tests/more_calc.py | 46
sc/qa/uitest/options/tdf122977.py | 76 -
sc/qa/uitest/protect/protectSheet.py | 50
sc/qa/uitest/protect/protectSpreadsheet.py | 28
sc/qa/uitest/range_name/create_range_name.py | 191 +--
sc/qa/uitest/range_name/tdf137617.py | 101 -
sc/qa/uitest/range_name/tdf138822.py | 61
sc/qa/uitest/range_name/tdf86214.py | 57
sc/qa/uitest/search_replace/tdf132097.py | 35
sc/qa/uitest/search_replace/tdf39917.py | 128 +-
sc/qa/uitest/search_replace/tdf44398.py | 118 -
sc/qa/uitest/search_replace/tdf57523.py | 54
sc/qa/uitest/signatureLine/insertSignatureLine.py | 136 +-
sc/qa/uitest/sort/naturalSort.py | 142 +-
sc/qa/uitest/sort/sorting.py | 488 +++----
sc/qa/uitest/sort/subtotals.py | 50
sc/qa/uitest/sort/tdf100517.py | 64 -
sc/qa/uitest/sort/tdf126678.py | 60
sc/qa/uitest/sort/tdf53482.py | 62 -
sc/qa/uitest/sort/tdf91305.py | 189 +--
sc/qa/uitest/sort/tdf99773.py | 52
sc/qa/uitest/statistics/anova.py | 230 +--
sc/qa/uitest/statistics/chiSquare.py | 132 +-
sc/qa/uitest/statistics/correlation.py | 358 ++---
sc/qa/uitest/statistics/covariance.py | 354 ++---
sc/qa/uitest/statistics/descriptiveStatistics.py | 286 ++--
sc/qa/uitest/statistics/exponentialSmoothing.py | 308 ++--
sc/qa/uitest/statistics/fTest.py | 182 +-
sc/qa/uitest/statistics/movingAverage.py | 316 ++---
sc/qa/uitest/statistics/regression.py | 11
sc/qa/uitest/statistics/sampling.py | 166 +-
sc/qa/uitest/statistics/tTest.py | 188 +--
sc/qa/uitest/statistics/zTest.py | 166 +-
sc/qa/uitest/textCase/textCase.py | 220 +--
sc/qa/uitest/validity/tdf138134.py | 74 -
sc/qa/uitest/validity/tdf53920.py | 80 -
sc/qa/uitest/validity/tdf65686.py | 58
sc/qa/uitest/validity/tdf96698.py | 174 +-
sc/qa/uitest/validity/validity.py | 186 +--
125 files changed, 7216 insertions(+), 7593 deletions(-)
New commits:
commit 57e8d25a40d7c053fef8ecb452e159264c659604
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Jun 30 11:01:58 2021 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Jun 30 13:17:54 2021 +0200
uitest: guard create_doc_in_start_center in sc
Mostly done by a script
for motivation, see 89aaa17a0a4413f07da2bc5084b0164f15dc01ac
< UITest: introduce guarded context managers >
Change-Id: I9392c56e6efccde958f0cdd497376b3939b75be4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118152
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sc/qa/uitest/autofilter/autofilter.py b/sc/qa/uitest/autofilter/autofilter.py
index 1b5bcb1f113f..82e45d08254f 100644
--- a/sc/qa/uitest/autofilter/autofilter.py
+++ b/sc/qa/uitest/autofilter/autofilter.py
@@ -126,101 +126,97 @@ class AutofilterTest(UITestCase):
self.assertFalse(is_row_hidden(doc, 4))
def test_differentSearches(self):
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+ calcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = calcDoc.getChild("grid_window")
- enter_text_to_cell(xGridWindow, "A1", "X")
- enter_text_to_cell(xGridWindow, "A2", "11")
- enter_text_to_cell(xGridWindow, "A3", "22")
- xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
+ xGridWindow = calcDoc.getChild("grid_window")
+ enter_text_to_cell(xGridWindow, "A1", "X")
+ enter_text_to_cell(xGridWindow, "A2", "11")
+ enter_text_to_cell(xGridWindow, "A3", "22")
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
- self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
+ self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
- xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
+ xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
+ xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(2, len(xList.getChildren()))
- self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text'])
- self.assertEqual("22", get_state_as_dict(xList.getChild('1'))['Text'])
+ self.assertEqual(2, len(xList.getChildren()))
+ self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text'])
+ self.assertEqual("22", get_state_as_dict(xList.getChild('1'))['Text'])
- xSearchEdit = xFloatWindow.getChild("search_edit")
- xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "11"}))
+ xSearchEdit = xFloatWindow.getChild("search_edit")
+ xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "11"}))
- self.assertEqual(1, len(xList.getChildren()))
- self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text'])
+ self.assertEqual(1, len(xList.getChildren()))
+ self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text'])
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.assertFalse(is_row_hidden(document, 0))
- self.assertFalse(is_row_hidden(document, 1))
- self.assertTrue(is_row_hidden(document, 2))
+ self.assertFalse(is_row_hidden(document, 0))
+ self.assertFalse(is_row_hidden(document, 1))
+ self.assertTrue(is_row_hidden(document, 2))
- xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
+ xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
+ xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(2, len(xList.getChildren()))
- self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text'])
- self.assertEqual("22", get_state_as_dict(xList.getChild('1'))['Text'])
+ self.assertEqual(2, len(xList.getChildren()))
+ self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text'])
+ self.assertEqual("22", get_state_as_dict(xList.getChild('1'))['Text'])
- xSearchEdit = xFloatWindow.getChild("search_edit")
- xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "22"}))
+ xSearchEdit = xFloatWindow.getChild("search_edit")
+ xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "22"}))
- self.assertEqual(1, len(xList.getChildren()))
- self.assertEqual("22", get_state_as_dict(xList.getChild('0'))['Text'])
+ self.assertEqual(1, len(xList.getChildren()))
+ self.assertEqual("22", get_state_as_dict(xList.getChild('0'))['Text'])
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.assertFalse(is_row_hidden(document, 0))
- self.assertTrue(is_row_hidden(document, 1))
- self.assertFalse(is_row_hidden(document, 2))
+ self.assertFalse(is_row_hidden(document, 0))
+ self.assertTrue(is_row_hidden(document, 1))
+ self.assertFalse(is_row_hidden(document, 2))
- self.ui_test.close_doc()
def test_tdf89244(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()
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- enter_text_to_cell(gridwin, "A1", "AAA")
- enter_text_to_cell(gridwin, "A3", "BBB")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ enter_text_to_cell(gridwin, "A1", "AAA")
+ enter_text_to_cell(gridwin, "A3", "BBB")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.xUITest.executeCommand(".uno:MergeCells")
+ self.xUITest.executeCommand(".uno:MergeCells")
- self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
+ self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
+ xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
+ xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(2, len(xList.getChildren()))
- self.assertEqual("(empty)", get_state_as_dict(xList.getChild('0'))['Text'])
- self.assertEqual("BBB", get_state_as_dict(xList.getChild('1'))['Text'])
+ self.assertEqual(2, len(xList.getChildren()))
+ self.assertEqual("(empty)", get_state_as_dict(xList.getChild('0'))['Text'])
+ self.assertEqual("BBB", get_state_as_dict(xList.getChild('1'))['Text'])
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.ui_test.close_doc()
def test_tdf116818(self):
with self.ui_test.load_file(get_url_for_data_file("tdf116818.xlsx")) as doc:
@@ -372,54 +368,51 @@ class AutofilterTest(UITestCase):
self.assertFalse(is_row_hidden(doc, 7))
def test_tdf142350(self):
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- gridwin = calcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- enter_text_to_cell(gridwin, "A1", "A")
- enter_text_to_cell(gridwin, "A2", "0")
- enter_text_to_cell(gridwin, "A3", "")
- enter_text_to_cell(gridwin, "A4", "1")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
-
- self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
-
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
-
- # tdf140745 show (empty) entry on top of the checkbox list
- self.assertEqual(3, len(xList.getChildren()))
- self.assertEqual("(empty)", get_state_as_dict(xList.getChild('0'))['Text'])
- self.assertEqual("0", get_state_as_dict(xList.getChild('1'))['Text'])
- self.assertEqual("1", get_state_as_dict(xList.getChild('2'))['Text'])
-
- xEntry = xList.getChild("0")
- xEntry.executeAction("CLICK", tuple())
-
- xOkButton = xFloatWindow.getChild("ok")
- xOkButton.executeAction("CLICK", tuple())
-
- self.assertFalse(is_row_hidden(document, 1))
- self.assertTrue(is_row_hidden(document, 2))
- self.assertFalse(is_row_hidden(document, 3))
-
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(3, len(xList.getChildren()))
- self.assertEqual('false', get_state_as_dict(xList.getChild('0'))['IsChecked'])
- self.assertEqual('true', get_state_as_dict(xList.getChild('1'))['IsChecked'])
- self.assertEqual('true', get_state_as_dict(xList.getChild('2'))['IsChecked'])
- xCloseButton = xFloatWindow.getChild("cancel")
- xCloseButton.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+ calcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = calcDoc.getChild("grid_window")
+
+ enter_text_to_cell(gridwin, "A1", "A")
+ enter_text_to_cell(gridwin, "A2", "0")
+ enter_text_to_cell(gridwin, "A3", "")
+ enter_text_to_cell(gridwin, "A4", "1")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+
+ self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
+
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+
+ # tdf140745 show (empty) entry on top of the checkbox list
+ self.assertEqual(3, len(xList.getChildren()))
+ self.assertEqual("(empty)", get_state_as_dict(xList.getChild('0'))['Text'])
+ self.assertEqual("0", get_state_as_dict(xList.getChild('1'))['Text'])
+ self.assertEqual("1", get_state_as_dict(xList.getChild('2'))['Text'])
+
+ xEntry = xList.getChild("0")
+ xEntry.executeAction("CLICK", tuple())
+
+ xOkButton = xFloatWindow.getChild("ok")
+ xOkButton.executeAction("CLICK", tuple())
+
+ self.assertFalse(is_row_hidden(document, 1))
+ self.assertTrue(is_row_hidden(document, 2))
+ self.assertFalse(is_row_hidden(document, 3))
+
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(3, len(xList.getChildren()))
+ self.assertEqual('false', get_state_as_dict(xList.getChild('0'))['IsChecked'])
+ self.assertEqual('true', get_state_as_dict(xList.getChild('1'))['IsChecked'])
+ self.assertEqual('true', get_state_as_dict(xList.getChild('2'))['IsChecked'])
+ xCloseButton = xFloatWindow.getChild("cancel")
+ xCloseButton.executeAction("CLICK", tuple())
+
def test_tdf138438(self):
with self.ui_test.load_file(get_url_for_data_file("tdf138438.ods")) as doc:
diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py b/sc/qa/uitest/autofilter/autofilterBugs.py
index 8a5250ae62c0..0b058da8c2b2 100644
--- a/sc/qa/uitest/autofilter/autofilterBugs.py
+++ b/sc/qa/uitest/autofilter/autofilterBugs.py
@@ -23,31 +23,29 @@ class autofilter(UITestCase):
self.assertEqual(calc_doc.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
def test_tdf94055(self):
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = calcDoc.getChild("grid_window")
- enter_text_to_cell(xGridWindow, "A1", "X")
- enter_text_to_cell(xGridWindow, "B1", "Y")
- enter_text_to_cell(xGridWindow, "A2", "a")
- enter_text_to_cell(xGridWindow, "B2", "b")
- enter_text_to_cell(xGridWindow, "A3", "c")
- enter_text_to_cell(xGridWindow, "B3", "d")
- xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B1"}))
-
- with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="yes"):
- pass
-
- xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A3"}))
- self.xUITest.executeCommand(".uno:SelectRow") #select two rows
-
- with self.ui_test.execute_dialog_through_command(".uno:DataSort"):
- pass
-
- #autofilter still exist
- self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = calcDoc.getChild("grid_window")
+ enter_text_to_cell(xGridWindow, "A1", "X")
+ enter_text_to_cell(xGridWindow, "B1", "Y")
+ enter_text_to_cell(xGridWindow, "A2", "a")
+ enter_text_to_cell(xGridWindow, "B2", "b")
+ enter_text_to_cell(xGridWindow, "A3", "c")
+ enter_text_to_cell(xGridWindow, "B3", "d")
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B1"}))
+
+ with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="yes"):
+ pass
+
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A3"}))
+ self.xUITest.executeCommand(".uno:SelectRow") #select two rows
+
+ with self.ui_test.execute_dialog_through_command(".uno:DataSort"):
+ pass
+
+ #autofilter still exist
+ self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
+
#tdf77479.ods
def test_tdf77479(self):
diff --git a/sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py b/sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py
index a266925f1c00..5e2cd379fbd1 100644
--- a/sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py
+++ b/sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py
@@ -49,128 +49,126 @@ class tdf117276_autofilter_reset(UITestCase):
self.assertEqual(2, self.get_values_count_in_AutoFilter(xGridWindow, "1"))
def test_run(self):
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = calcDoc.getChild("grid_window")
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = calcDoc.getChild("grid_window")
# self.ui_test.execute_dialog_through_command(".uno:Insert") # insert sheet
# xDialog = self.xUITest.getTopFocusWindow()
# xOKButton = xDialog.getChild("ok")
# xOKButton.executeAction("CLICK", tuple())
- # 1. prepare document
- # | A | B |
- # -----------------------------------------
- # 1 | HEADER-A | HEADER-B |
- # -----------------------------------------
- # 2 | Unique a2 | common value for B2:B4 |
- # 3 | Unique a3 | common value for B2:B4 |
- # 4 | Unique a4 | common value for B2:B4 |
- # 5 | Unique a5 | Unique b5 |
- # 6 | Unique a6 | Unique b6 |
- #
- # row-1
- enter_text_to_cell(xGridWindow, "A1", "HEADER-A")
- enter_text_to_cell(xGridWindow, "B1", "HEADER-B")
-
- # row-1
- enter_text_to_cell(xGridWindow, "A2", "Unique a2")
- enter_text_to_cell(xGridWindow, "B2", "common value for B2:B4")
-
- # row-2
- enter_text_to_cell(xGridWindow, "A3", "Unique a3")
- enter_text_to_cell(xGridWindow, "B3", "common value for B2:B4")
-
- # row-3
- enter_text_to_cell(xGridWindow, "A4", "Unique a4")
- enter_text_to_cell(xGridWindow, "B4", "common value for B2:B4")
-
- # row-4
- enter_text_to_cell(xGridWindow, "A5", "Unique a5")
- enter_text_to_cell(xGridWindow, "B5", "Unique b5")
-
- # row-5
- enter_text_to_cell(xGridWindow, "A6", "Unique a6")
- enter_text_to_cell(xGridWindow, "B6", "Unique b6")
-
- xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B6"}))
-
- # 2. switch on auto-filter
- with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="yes"):
- pass
-
- # autofilter still exist
- self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
-
- # 3. open filter of column A and deselect first 3 entries (Unique a2, Unique a3, Unique a4)
- xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
-
- xEntry1 = xTreeList.getChild("0")
- xEntry1.executeAction("CLICK", tuple()) # Unique a2
- xEntry2 = xTreeList.getChild("1")
- xEntry2.executeAction("CLICK", tuple()) # Unique a3
- xEntry3 = xTreeList.getChild("2")
- xEntry3.executeAction("CLICK", tuple()) # Unique a4
-
- xOkButton = xFloatWindow.getChild("ok")
- xOkButton.executeAction("CLICK", tuple())
-
- # check filtering
- # | A | B |
- # -----------------------------------------
- # 1 | HEADER-A | HEADER-B |
- # -----------------------------------------
- # 5 | Unique a5 | Unique b5 |
- # 6 | Unique a6 | Unique b6 |
- self.assertFalse(is_row_hidden(document, 0)) # column headers
- self.assertTrue(is_row_hidden(document, 1))
- self.assertTrue(is_row_hidden(document, 2))
- self.assertTrue(is_row_hidden(document, 3))
- self.assertFalse(is_row_hidden(document, 4))
- self.assertFalse(is_row_hidden(document, 5))
-
- self.assertEqual(5, self.get_values_count_in_AutoFilter(xGridWindow, "0"))
- self.assertEqual(2, self.get_values_count_in_AutoFilter(xGridWindow, "1"))
-
- # 4. open filter of column B and deselect "Unique b5"
- xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
-
- xEntry = xTreeList.getChild("0")
- xEntry.executeAction("CLICK", tuple()) # Unique b5
-
- xOkButton = xFloatWindow.getChild("ok")
- xOkButton.executeAction("CLICK", tuple())
-
- # check filtering
- # | A | B |
- # -----------------------------------------
- # 1 | HEADER-A | HEADER-B |
- # -----------------------------------------
- # 6 | Unique a6 | Unique b6 |
- self.check_state(document, xGridWindow)
-
- # 4. open filters of column A, B and close it using different buttons
- self.openAutoFilterAndCloseIt(xGridWindow, "1", "ok")
- self.check_state(document, xGridWindow)
-
- self.openAutoFilterAndCloseIt(xGridWindow, "1", "cancel")
- self.check_state(document, xGridWindow)
-
- self.openAutoFilterAndCloseIt(xGridWindow, "0", "cancel")
- self.check_state(document, xGridWindow)
-
- self.openAutoFilterAndCloseIt(xGridWindow, "0", "ok")
- self.check_state(document, xGridWindow)
-
- # finish
- self.ui_test.close_doc()
+ # 1. prepare document
+ # | A | B |
+ # -----------------------------------------
+ # 1 | HEADER-A | HEADER-B |
+ # -----------------------------------------
+ # 2 | Unique a2 | common value for B2:B4 |
+ # 3 | Unique a3 | common value for B2:B4 |
+ # 4 | Unique a4 | common value for B2:B4 |
+ # 5 | Unique a5 | Unique b5 |
+ # 6 | Unique a6 | Unique b6 |
+ #
+ # row-1
+ enter_text_to_cell(xGridWindow, "A1", "HEADER-A")
+ enter_text_to_cell(xGridWindow, "B1", "HEADER-B")
+
+ # row-1
+ enter_text_to_cell(xGridWindow, "A2", "Unique a2")
+ enter_text_to_cell(xGridWindow, "B2", "common value for B2:B4")
+
+ # row-2
+ enter_text_to_cell(xGridWindow, "A3", "Unique a3")
+ enter_text_to_cell(xGridWindow, "B3", "common value for B2:B4")
+
+ # row-3
+ enter_text_to_cell(xGridWindow, "A4", "Unique a4")
+ enter_text_to_cell(xGridWindow, "B4", "common value for B2:B4")
+
+ # row-4
+ enter_text_to_cell(xGridWindow, "A5", "Unique a5")
+ enter_text_to_cell(xGridWindow, "B5", "Unique b5")
+
+ # row-5
+ enter_text_to_cell(xGridWindow, "A6", "Unique a6")
+ enter_text_to_cell(xGridWindow, "B6", "Unique b6")
+
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B6"}))
+
+ # 2. switch on auto-filter
+ with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="yes"):
+ pass
+
+ # autofilter still exist
+ self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
+
+ # 3. open filter of column A and deselect first 3 entries (Unique a2, Unique a3, Unique a4)
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+
+ xEntry1 = xTreeList.getChild("0")
+ xEntry1.executeAction("CLICK", tuple()) # Unique a2
+ xEntry2 = xTreeList.getChild("1")
+ xEntry2.executeAction("CLICK", tuple()) # Unique a3
+ xEntry3 = xTreeList.getChild("2")
+ xEntry3.executeAction("CLICK", tuple()) # Unique a4
+
+ xOkButton = xFloatWindow.getChild("ok")
+ xOkButton.executeAction("CLICK", tuple())
+
+ # check filtering
+ # | A | B |
+ # -----------------------------------------
+ # 1 | HEADER-A | HEADER-B |
+ # -----------------------------------------
+ # 5 | Unique a5 | Unique b5 |
+ # 6 | Unique a6 | Unique b6 |
+ self.assertFalse(is_row_hidden(document, 0)) # column headers
+ self.assertTrue(is_row_hidden(document, 1))
+ self.assertTrue(is_row_hidden(document, 2))
+ self.assertTrue(is_row_hidden(document, 3))
+ self.assertFalse(is_row_hidden(document, 4))
+ self.assertFalse(is_row_hidden(document, 5))
+
+ self.assertEqual(5, self.get_values_count_in_AutoFilter(xGridWindow, "0"))
+ self.assertEqual(2, self.get_values_count_in_AutoFilter(xGridWindow, "1"))
+
+ # 4. open filter of column B and deselect "Unique b5"
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+
+ xEntry = xTreeList.getChild("0")
+ xEntry.executeAction("CLICK", tuple()) # Unique b5
+
+ xOkButton = xFloatWindow.getChild("ok")
+ xOkButton.executeAction("CLICK", tuple())
+
+ # check filtering
+ # | A | B |
+ # -----------------------------------------
+ # 1 | HEADER-A | HEADER-B |
+ # -----------------------------------------
+ # 6 | Unique a6 | Unique b6 |
+ self.check_state(document, xGridWindow)
+
+ # 4. open filters of column A, B and close it using different buttons
+ self.openAutoFilterAndCloseIt(xGridWindow, "1", "ok")
+ self.check_state(document, xGridWindow)
+
+ self.openAutoFilterAndCloseIt(xGridWindow, "1", "cancel")
+ self.check_state(document, xGridWindow)
+
+ self.openAutoFilterAndCloseIt(xGridWindow, "0", "cancel")
+ self.check_state(document, xGridWindow)
+
+ self.openAutoFilterAndCloseIt(xGridWindow, "0", "ok")
+ self.check_state(document, xGridWindow)
+
+ # finish
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf126306.py b/sc/qa/uitest/autofilter/tdf126306.py
index 6423760d2a60..e0a895ba5cce 100644
--- a/sc/qa/uitest/autofilter/tdf126306.py
+++ b/sc/qa/uitest/autofilter/tdf126306.py
@@ -21,118 +21,115 @@ class tdf126306(UITestCase):
self.assertEqual(bVisible, value)
def test_run(self):
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWin = calcDoc.getChild("grid_window")
-
- default_values = [25, 1023, 17, 9, 19, 0, 107, 89, 8, 453, 33, 3, 25, 204]
- document = self.ui_test.get_component()
-
- for i, value in enumerate(default_values, start=2):
- enter_text_to_cell(xGridWin, "A" + str(i), str(value))
-
- xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A15"}))
-
- with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="yes"):
- pass
-
- self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
-
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # Sort ascending button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"SPACE"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- sort_asc_values = [0, 3, 8, 9, 17, 19, 25, 25, 33, 89, 107, 204, 453, 1023]
- self.check_values(document, sort_asc_values)
- self.check_row_hidden(document)
-
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # Sort descending button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- sort_des_values = [1023, 453, 204, 107, 89, 33, 25, 25, 19, 17, 9, 8, 3, 0]
- self.check_values(document, sort_des_values)
- self.check_row_hidden(document)
-
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # Top 10 button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- top10_hidden_values = [True, True, True, False, True, False, True,
- True, False, True, True, False, True, True]
-
- #Values are the same
- self.check_values(document, default_values)
- self.check_row_hidden(document, top10_hidden_values)
-
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # Empty button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- empty_values = [False] * 14
- #Values are the same
- self.check_values(document, default_values)
- self.check_row_hidden(document, empty_values)
-
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # Not Empty button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- #Nothing should change
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.check_values(document, default_values)
- self.check_row_hidden(document)
-
- # finish
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWin = calcDoc.getChild("grid_window")
+
+ default_values = [25, 1023, 17, 9, 19, 0, 107, 89, 8, 453, 33, 3, 25, 204]
+
+ for i, value in enumerate(default_values, start=2):
+ enter_text_to_cell(xGridWin, "A" + str(i), str(value))
+
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A15"}))
+
+ with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="yes"):
+ pass
+
+ self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
+
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # Sort ascending button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"SPACE"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ sort_asc_values = [0, 3, 8, 9, 17, 19, 25, 25, 33, 89, 107, 204, 453, 1023]
+ self.check_values(document, sort_asc_values)
+ self.check_row_hidden(document)
+
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # Sort descending button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ sort_des_values = [1023, 453, 204, 107, 89, 33, 25, 25, 19, 17, 9, 8, 3, 0]
+ self.check_values(document, sort_des_values)
+ self.check_row_hidden(document)
+
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # Top 10 button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ top10_hidden_values = [True, True, True, False, True, False, True,
+ True, False, True, True, False, True, True]
+
+ #Values are the same
+ self.check_values(document, default_values)
+ self.check_row_hidden(document, top10_hidden_values)
+
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # Empty button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ empty_values = [False] * 14
+ #Values are the same
+ self.check_values(document, default_values)
+ self.check_row_hidden(document, empty_values)
+
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # Not Empty button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ #Nothing should change
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.check_values(document, default_values)
+ self.check_row_hidden(document)
+
+ # finish
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf141559.py b/sc/qa/uitest/autofilter/tdf141559.py
index 6bce18852ff3..7c727bd1669a 100644
--- a/sc/qa/uitest/autofilter/tdf141559.py
+++ b/sc/qa/uitest/autofilter/tdf141559.py
@@ -15,79 +15,76 @@ from uitest.uihelper.common import get_state_as_dict
class tdf141559(UITestCase):
def test_tdf141559_clear_filter(self):
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- gridwin = calcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- enter_text_to_cell(gridwin, "A1", "A")
- enter_text_to_cell(gridwin, "A2", "1")
- enter_text_to_cell(gridwin, "A3", "2")
- enter_text_to_cell(gridwin, "A4", "3")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
-
- self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
-
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- #Choose Standard Filter... button
- xMenu = xFloatWindow.getChild("menu")
-
- # check last item: 'Standard Filter...' (new menu item 'Clear Filter' is optional)
- nLastIdx = int(get_state_as_dict(xMenu)['Children']) - 1
- self.assertEqual(10, nLastIdx)
- self.assertEqual('Standard Filter...', get_state_as_dict(xMenu.getChild(str(nLastIdx)))['Text'])
-
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- self.assertEqual("Standard Filter...", get_state_as_dict(xMenu)['SelectEntryText'])
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xcond1 = xDialog.getChild("cond1")
- xval1 = xDialog.getChild("val1")
-
- select_by_text(xfield1, "A")
- select_by_text(xcond1, ">")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- row = get_row(document, 1)
- self.assertFalse(row.getPropertyValue("IsVisible"))
-
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- #Choose Clear Filter button
- xMenu = xFloatWindow.getChild("menu")
-
- # check last item: 'Clear Filter'
- nLastIdx = int(get_state_as_dict(xMenu)['Children']) - 1
- self.assertEqual(11, nLastIdx)
- self.assertEqual('Clear Filter', get_state_as_dict(xMenu.getChild(str(nLastIdx)))['Text'])
-
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- # Use new menu item "Clear Filter" to remove the standard filter condition
- self.assertEqual("Clear Filter", get_state_as_dict(xMenu)['SelectEntryText'])
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- self.assertTrue(row.getPropertyValue("IsVisible"))
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+ calcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = calcDoc.getChild("grid_window")
+
+ enter_text_to_cell(gridwin, "A1", "A")
+ enter_text_to_cell(gridwin, "A2", "1")
+ enter_text_to_cell(gridwin, "A3", "2")
+ enter_text_to_cell(gridwin, "A4", "3")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+
+ self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
+
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ #Choose Standard Filter... button
+ xMenu = xFloatWindow.getChild("menu")
+
+ # check last item: 'Standard Filter...' (new menu item 'Clear Filter' is optional)
+ nLastIdx = int(get_state_as_dict(xMenu)['Children']) - 1
+ self.assertEqual(10, nLastIdx)
+ self.assertEqual('Standard Filter...', get_state_as_dict(xMenu.getChild(str(nLastIdx)))['Text'])
+
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ self.assertEqual("Standard Filter...", get_state_as_dict(xMenu)['SelectEntryText'])
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xcond1 = xDialog.getChild("cond1")
+ xval1 = xDialog.getChild("val1")
+
+ select_by_text(xfield1, "A")
+ select_by_text(xcond1, ">")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ row = get_row(document, 1)
+ self.assertFalse(row.getPropertyValue("IsVisible"))
+
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ #Choose Clear Filter button
+ xMenu = xFloatWindow.getChild("menu")
+
+ # check last item: 'Clear Filter'
+ nLastIdx = int(get_state_as_dict(xMenu)['Children']) - 1
+ self.assertEqual(11, nLastIdx)
+ self.assertEqual('Clear Filter', get_state_as_dict(xMenu.getChild(str(nLastIdx)))['Text'])
+
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ # Use new menu item "Clear Filter" to remove the standard filter condition
+ self.assertEqual("Clear Filter", get_state_as_dict(xMenu)['SelectEntryText'])
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+ self.assertTrue(row.getPropertyValue("IsVisible"))
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf141946.py b/sc/qa/uitest/autofilter/tdf141946.py
index 4e45ecfb7d5a..7e53dd1c879d 100644
--- a/sc/qa/uitest/autofilter/tdf141946.py
+++ b/sc/qa/uitest/autofilter/tdf141946.py
@@ -12,64 +12,61 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf141946(UITestCase):
def test_tdf141946_inserted_column(self):
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- gridwin = calcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center_guarded("calc"):
+ calcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = calcDoc.getChild("grid_window")
- enter_text_to_cell(gridwin, "A1", "A")
- enter_text_to_cell(gridwin, "A2", "1")
- enter_text_to_cell(gridwin, "A3", "2")
- enter_text_to_cell(gridwin, "A4", "3")
+ enter_text_to_cell(gridwin, "A1", "A")
+ enter_text_to_cell(gridwin, "A2", "1")
+ enter_text_to_cell(gridwin, "A3", "2")
+ enter_text_to_cell(gridwin, "A4", "3")
- enter_text_to_cell(gridwin, "B1", "B")
- enter_text_to_cell(gridwin, "B2", "4")
- enter_text_to_cell(gridwin, "B3", "5")
- enter_text_to_cell(gridwin, "B4", "6")
+ enter_text_to_cell(gridwin, "B1", "B")
+ enter_text_to_cell(gridwin, "B2", "4")
+ enter_text_to_cell(gridwin, "B3", "5")
+ enter_text_to_cell(gridwin, "B4", "6")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B4"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B4"}))
- self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
+ self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- xEntry = xList.getChild("1")
- xEntry.executeAction("CLICK", tuple())
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ xEntry = xList.getChild("1")
+ xEntry.executeAction("CLICK", tuple())
- xOkButton = xFloatWindow.getChild("ok")
- xOkButton.executeAction("CLICK", tuple())
+ xOkButton = xFloatWindow.getChild("ok")
+ xOkButton.executeAction("CLICK", tuple())
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- self.xUITest.executeCommand(".uno:InsertColumnsBefore")
+ self.xUITest.executeCommand(".uno:InsertColumnsBefore")
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(2, len(xList.getChildren()))
- xCloseBtn = xFloatWindow.getChild("cancel")
- xCloseBtn.executeAction("CLICK", tuple())
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(2, len(xList.getChildren()))
+ xCloseBtn = xFloatWindow.getChild("cancel")
+ xCloseBtn.executeAction("CLICK", tuple())
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(1, len(xList.getChildren()))
- xCloseBtn = xFloatWindow.getChild("cancel")
- xCloseBtn.executeAction("CLICK", tuple())
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(1, len(xList.getChildren()))
+ xCloseBtn = xFloatWindow.getChild("cancel")
+ xCloseBtn.executeAction("CLICK", tuple())
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(3, len(xList.getChildren()))
- xCloseBtn = xFloatWindow.getChild("cancel")
- xCloseBtn.executeAction("CLICK", tuple())
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(3, len(xList.getChildren()))
+ xCloseBtn = xFloatWindow.getChild("cancel")
+ xCloseBtn.executeAction("CLICK", tuple())
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf36383.py b/sc/qa/uitest/autofilter/tdf36383.py
index 26003ebcf9fb..a36001cfcab2 100644
--- a/sc/qa/uitest/autofilter/tdf36383.py
+++ b/sc/qa/uitest/autofilter/tdf36383.py
@@ -13,50 +13,47 @@ from libreoffice.calc.document import get_row
class tdf36383(UITestCase):
def test_tdf36383_row_height(self):
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- gridwin = calcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+ calcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = calcDoc.getChild("grid_window")
- enter_text_to_cell(gridwin, "A1", "A")
- enter_text_to_cell(gridwin, "A2", "1")
- enter_text_to_cell(gridwin, "A3", "2")
- enter_text_to_cell(gridwin, "A4", "3")
+ enter_text_to_cell(gridwin, "A1", "A")
+ enter_text_to_cell(gridwin, "A2", "1")
+ enter_text_to_cell(gridwin, "A3", "2")
+ enter_text_to_cell(gridwin, "A4", "3")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
+ self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- xEntry = xList.getChild("1")
- xEntry.executeAction("CLICK", tuple())
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ xEntry = xList.getChild("1")
+ xEntry.executeAction("CLICK", tuple())
- xOkButton = xFloatWindow.getChild("ok")
- xOkButton.executeAction("CLICK", tuple())
+ xOkButton = xFloatWindow.getChild("ok")
+ xOkButton.executeAction("CLICK", tuple())
- row = get_row(document, 2)
- self.assertFalse(row.getPropertyValue("IsVisible"))
+ row = get_row(document, 2)
+ self.assertFalse(row.getPropertyValue("IsVisible"))
- #row height
- with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog:
- xvalue = xDialog.getChild("value")
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
+ #row height
+ with self.ui_test.execute_dialog_through_command(".uno:RowHeight") as xDialog:
+ xvalue = xDialog.getChild("value")
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
- self.assertFalse(row.getPropertyValue("IsVisible"))
+ self.assertFalse(row.getPropertyValue("IsVisible"))
- #optimal row height
- with self.ui_test.execute_dialog_through_command(".uno:SetOptimalRowHeight"):
- pass
+ #optimal row height
+ with self.ui_test.execute_dialog_through_command(".uno:SetOptimalRowHeight"):
+ pass
- self.assertFalse(row.getPropertyValue("IsVisible"))
+ self.assertFalse(row.getPropertyValue("IsVisible"))
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf46062.py b/sc/qa/uitest/autofilter/tdf46062.py
index 065279e686ab..6d3f9655991e 100644
--- a/sc/qa/uitest/autofilter/tdf46062.py
+++ b/sc/qa/uitest/autofilter/tdf46062.py
@@ -13,35 +13,34 @@ class tdf46062(UITestCase):
def test_tdf46062(self):
- self.ui_test.create_doc_in_start_center("calc")
- calcDoc = self.xUITest.getTopFocusWindow()
- gridwin = calcDoc.getChild("grid_window")
+ with self.ui_test.create_doc_in_start_center_guarded("calc"):
+ calcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = calcDoc.getChild("grid_window")
- enter_text_to_cell(gridwin, "A1", "spaces")
- enter_text_to_cell(gridwin, "A2", " ")
- enter_text_to_cell(gridwin, "A3", " ")
- enter_text_to_cell(gridwin, "A4", " ")
+ enter_text_to_cell(gridwin, "A1", "spaces")
+ enter_text_to_cell(gridwin, "A2", " ")
+ enter_text_to_cell(gridwin, "A3", " ")
+ enter_text_to_cell(gridwin, "A4", " ")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="yes"):
- pass
+ with self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter", close_button="yes"):
+ pass
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(3, len(xList.getChildren()))
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(3, len(xList.getChildren()))
- # Without the fix in place, this test would have failed with
- # AssertionError: '" "' != ' '
- self.assertEqual('" "', get_state_as_dict(xList.getChild("0"))['Text'])
- self.assertEqual('" "', get_state_as_dict(xList.getChild("1"))['Text'])
- self.assertEqual('" "', get_state_as_dict(xList.getChild("2"))['Text'])
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '" "' != ' '
+ self.assertEqual('" "', get_state_as_dict(xList.getChild("0"))['Text'])
+ self.assertEqual('" "', get_state_as_dict(xList.getChild("1"))['Text'])
+ self.assertEqual('" "', get_state_as_dict(xList.getChild("2"))['Text'])
- xOkButton = xFloatWindow.getChild("ok")
- xOkButton.executeAction("CLICK", tuple())
+ xOkButton = xFloatWindow.getChild("ok")
+ xOkButton.executeAction("CLICK", tuple())
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf48025.py b/sc/qa/uitest/autofilter/tdf48025.py
index c5d5c711da5f..ac90453e8951 100644
--- a/sc/qa/uitest/autofilter/tdf48025.py
+++ b/sc/qa/uitest/autofilter/tdf48025.py
@@ -12,61 +12,58 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf48025(UITestCase):
def test_tdf48025_deleted_columns(self):
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- gridwin = calcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center_guarded("calc"):
+ calcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = calcDoc.getChild("grid_window")
- enter_text_to_cell(gridwin, "A1", "A")
- enter_text_to_cell(gridwin, "A2", "1")
- enter_text_to_cell(gridwin, "A3", "2")
- enter_text_to_cell(gridwin, "A4", "3")
+ enter_text_to_cell(gridwin, "A1", "A")
+ enter_text_to_cell(gridwin, "A2", "1")
+ enter_text_to_cell(gridwin, "A3", "2")
+ enter_text_to_cell(gridwin, "A4", "3")
- enter_text_to_cell(gridwin, "B1", "B")
- enter_text_to_cell(gridwin, "B2", "4")
- enter_text_to_cell(gridwin, "B3", "5")
- enter_text_to_cell(gridwin, "B4", "6")
+ enter_text_to_cell(gridwin, "B1", "B")
+ enter_text_to_cell(gridwin, "B2", "4")
+ enter_text_to_cell(gridwin, "B3", "5")
+ enter_text_to_cell(gridwin, "B4", "6")
- enter_text_to_cell(gridwin, "C1", "C")
- enter_text_to_cell(gridwin, "C2", "7")
- enter_text_to_cell(gridwin, "C3", "8")
- enter_text_to_cell(gridwin, "C4", "9")
+ enter_text_to_cell(gridwin, "C1", "C")
+ enter_text_to_cell(gridwin, "C2", "7")
+ enter_text_to_cell(gridwin, "C3", "8")
+ enter_text_to_cell(gridwin, "C4", "9")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C4"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C4"}))
- self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
+ self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- xEntry = xList.getChild("1")
- xEntry.executeAction("CLICK", tuple())
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ xEntry = xList.getChild("1")
+ xEntry.executeAction("CLICK", tuple())
- xOkButton = xFloatWindow.getChild("ok")
- xOkButton.executeAction("CLICK", tuple())
+ xOkButton = xFloatWindow.getChild("ok")
+ xOkButton.executeAction("CLICK", tuple())
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:DeleteColumns")
+ self.xUITest.executeCommand(".uno:DeleteColumns")
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(3, len(xList.getChildren()))
- xCloseBtn = xFloatWindow.getChild("cancel")
- xCloseBtn.executeAction("CLICK", tuple())
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(3, len(xList.getChildren()))
+ xCloseBtn = xFloatWindow.getChild("cancel")
+ xCloseBtn.executeAction("CLICK", tuple())
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(2, len(xList.getChildren()))
- xCloseBtn = xFloatWindow.getChild("cancel")
- xCloseBtn.executeAction("CLICK", tuple())
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(2, len(xList.getChildren()))
+ xCloseBtn = xFloatWindow.getChild("cancel")
+ xCloseBtn.executeAction("CLICK", tuple())
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf68113.py b/sc/qa/uitest/autofilter/tdf68113.py
index f62ac9ce95c0..6f6b4e97f52b 100644
--- a/sc/qa/uitest/autofilter/tdf68113.py
+++ b/sc/qa/uitest/autofilter/tdf68113.py
@@ -13,65 +13,62 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf68113(UITestCase):
def test_tdf68113_empty_notempty_button(self):
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWin = calcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center_guarded("calc"):
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWin = calcDoc.getChild("grid_window")
- enter_text_to_cell(xGridWin, "A1", "A")
- enter_text_to_cell(xGridWin, "A2", "1")
- enter_text_to_cell(xGridWin, "A3", "2")
- enter_text_to_cell(xGridWin, "A5", "4")
- enter_text_to_cell(xGridWin, "A7", "6")
+ enter_text_to_cell(xGridWin, "A1", "A")
+ enter_text_to_cell(xGridWin, "A2", "1")
+ enter_text_to_cell(xGridWin, "A3", "2")
+ enter_text_to_cell(xGridWin, "A5", "4")
+ enter_text_to_cell(xGridWin, "A7", "6")
- xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A7"}))
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A7"}))
- self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
+ self.xUITest.executeCommand(".uno:DataFilterAutoFilter")
- # Empty button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+ # Empty button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
- # Checkbox elements
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(5, len(xTreeList.getChildren()))
- self.assertEqual('true', get_state_as_dict(xTreeList.getChild('0'))['IsChecked'])
- self.assertEqual('false', get_state_as_dict(xTreeList.getChild('2'))['IsChecked'])
- self.assertEqual('false', get_state_as_dict(xTreeList.getChild('4'))['IsChecked'])
- xCancelBtn = xFloatWindow.getChild("cancel")
- xCancelBtn.executeAction("CLICK", tuple())
+ # Checkbox elements
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(5, len(xTreeList.getChildren()))
+ self.assertEqual('true', get_state_as_dict(xTreeList.getChild('0'))['IsChecked'])
+ self.assertEqual('false', get_state_as_dict(xTreeList.getChild('2'))['IsChecked'])
+ self.assertEqual('false', get_state_as_dict(xTreeList.getChild('4'))['IsChecked'])
+ xCancelBtn = xFloatWindow.getChild("cancel")
+ xCancelBtn.executeAction("CLICK", tuple())
- # Not Empty button
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xMenu = xFloatWindow.getChild("menu")
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+ # Not Empty button
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xMenu = xFloatWindow.getChild("menu")
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
- # Checkbox elements
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(5, len(xTreeList.getChildren()))
- self.assertEqual('false', get_state_as_dict(xTreeList.getChild('0'))['IsChecked'])
- self.assertEqual('true', get_state_as_dict(xTreeList.getChild('2'))['IsChecked'])
- self.assertEqual('true', get_state_as_dict(xTreeList.getChild('4'))['IsChecked'])
- xCancelBtn = xFloatWindow.getChild("cancel")
- xCancelBtn.executeAction("CLICK", tuple())
+ # Checkbox elements
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(5, len(xTreeList.getChildren()))
+ self.assertEqual('false', get_state_as_dict(xTreeList.getChild('0'))['IsChecked'])
+ self.assertEqual('true', get_state_as_dict(xTreeList.getChild('2'))['IsChecked'])
+ self.assertEqual('true', get_state_as_dict(xTreeList.getChild('4'))['IsChecked'])
+ xCancelBtn = xFloatWindow.getChild("cancel")
+ xCancelBtn.executeAction("CLICK", tuple())
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/CalcPasteOnly.py b/sc/qa/uitest/calc_tests/CalcPasteOnly.py
index 414f58230a51..de52826d121e 100644
--- a/sc/qa/uitest/calc_tests/CalcPasteOnly.py
+++ b/sc/qa/uitest/calc_tests/CalcPasteOnly.py
@@ -13,29 +13,27 @@ from uitest.uihelper.calc import enter_text_to_cell
class CalcPasteOnly(UITestCase):
def test_paste_only(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xTopWindow = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- gridwin = xTopWindow.getChild("grid_window")
-
- enter_text_to_cell(gridwin, "A1", "=SUM(A2:A3)")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:Copy")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- self.xUITest.executeCommand(".uno:PasteOnlyText")
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
- self.xUITest.executeCommand(".uno:PasteOnlyValue")
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "0")
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 0)
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"}))
- self.xUITest.executeCommand(".uno:PasteOnlyFormula")
- self.assertEqual(get_cell_by_position(document, 0, 4, 0).getString(), "0")
- self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 4, 0).getFormula(), "=SUM(E2:E3)")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+ xTopWindow = self.xUITest.getTopFocusWindow()
+ gridwin = xTopWindow.getChild("grid_window")
+
+ enter_text_to_cell(gridwin, "A1", "=SUM(A2:A3)")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ self.xUITest.executeCommand(".uno:PasteOnlyText")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ self.xUITest.executeCommand(".uno:PasteOnlyValue")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "0")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 0)
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"}))
+ self.xUITest.executeCommand(".uno:PasteOnlyFormula")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 0).getString(), "0")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 0).getFormula(), "=SUM(E2:E3)")
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/CellDropDownItems.py b/sc/qa/uitest/calc_tests/CellDropDownItems.py
index ce443cda3283..b81589daccec 100644
--- a/sc/qa/uitest/calc_tests/CellDropDownItems.py
+++ b/sc/qa/uitest/calc_tests/CellDropDownItems.py
@@ -13,71 +13,69 @@ class CellDropDownItems(UITestCase):
def test_dropdownitems(self):
#This is to test Dropdown items in grid window
- 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()
-
- #select cell C10
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C10"}))
-
- #Open Validation Dialog
- with self.ui_test.execute_dialog_through_command(".uno:Validation") as xDialog:
-
- #Select List option
- xallow = xDialog.getChild("allow")
- xallow.executeAction("SELECT", mkPropertyValues({"POS": "6"}))
-
- #Add items to the List
- xminlist = xDialog.getChild("minlist")
- xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item1"}))
- xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item2"}))
- xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item3"}))
- xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item4"}))
- xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item5"}))
-
- #Close the dialog
-
- #Launch the Select Menu to view the list ans select first item in the list
- gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "2", "ROW": "9"}))
-
- #Select the TreeList UI Object
- xWin = self.xUITest.getTopFocusWindow()
- xlist = xWin.getChild("list")
-
- xListItem = xlist.getChild('0')
- xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
- self.assertEqual(get_cell_by_position(document, 0, 2, 9).getString(), "Item1")
-
- #Launch the Select Menu to view the list ans select Third item in the list
- gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "2", "ROW": "9"}))
-
- #Select the TreeList UI Object
- xWin = self.xUITest.getTopFocusWindow()
- xlist = xWin.getChild("list")
-
- xListItem = xlist.getChild('2')
- xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
- self.assertEqual(get_cell_by_position(document, 0, 2, 9).getString(), "Item3")
-
- #Launch the Select Menu to view the list ans select Fifth item in the list
- gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "2", "ROW": "9"}))
-
- #Select the TreeList UI Object
- xWin = self.xUITest.getTopFocusWindow()
- xlist = xWin.getChild("list")
-
- xListItem = xlist.getChild('4')
- xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
- self.assertEqual(get_cell_by_position(document, 0, 2, 9).getString(), "Item5")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #select cell C10
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C10"}))
+
+ #Open Validation Dialog
+ with self.ui_test.execute_dialog_through_command(".uno:Validation") as xDialog:
+
+ #Select List option
+ xallow = xDialog.getChild("allow")
+ xallow.executeAction("SELECT", mkPropertyValues({"POS": "6"}))
+
+ #Add items to the List
+ xminlist = xDialog.getChild("minlist")
+ xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item1"}))
+ xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item2"}))
+ xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item3"}))
+ xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item4"}))
+ xminlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xminlist.executeAction("TYPE", mkPropertyValues({"TEXT": "Item5"}))
+
+ #Close the dialog
+
+ #Launch the Select Menu to view the list ans select first item in the list
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "2", "ROW": "9"}))
+
+ #Select the TreeList UI Object
+ xWin = self.xUITest.getTopFocusWindow()
+ xlist = xWin.getChild("list")
+
+ xListItem = xlist.getChild('0')
+ xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
+ self.assertEqual(get_cell_by_position(document, 0, 2, 9).getString(), "Item1")
+
+ #Launch the Select Menu to view the list ans select Third item in the list
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "2", "ROW": "9"}))
+
+ #Select the TreeList UI Object
+ xWin = self.xUITest.getTopFocusWindow()
+ xlist = xWin.getChild("list")
+
+ xListItem = xlist.getChild('2')
+ xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
+ self.assertEqual(get_cell_by_position(document, 0, 2, 9).getString(), "Item3")
+
+ #Launch the Select Menu to view the list ans select Fifth item in the list
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "2", "ROW": "9"}))
+
+ #Select the TreeList UI Object
+ xWin = self.xUITest.getTopFocusWindow()
+ xlist = xWin.getChild("list")
+
+ xListItem = xlist.getChild('4')
+ xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
+ self.assertEqual(get_cell_by_position(document, 0, 2, 9).getString(), "Item5")
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/Comments.py b/sc/qa/uitest/calc_tests/Comments.py
index 3841686d99f5..2bfce36a6ba9 100644
--- a/sc/qa/uitest/calc_tests/Comments.py
+++ b/sc/qa/uitest/calc_tests/Comments.py
@@ -10,39 +10,37 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class Comments(UITestCase):
def test_comment(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()
+ with self.ui_test.create_doc_in_start_center_guarded("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- # Select Cell D8
- gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "0"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D8"}))
+ # Select Cell D8
+ gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "0"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D8"}))
- # Create comment and open it's window
- gridwin.executeAction("COMMENT", mkPropertyValues({"OPEN": ""}))
+ # Create comment and open it's window
+ gridwin.executeAction("COMMENT", mkPropertyValues({"OPEN": ""}))
- # Write text in the Comment Window
- gridwin.executeAction("TYPE", mkPropertyValues({"TEXT": "First Comment"}))
+ # Write text in the Comment Window
+ gridwin.executeAction("TYPE", mkPropertyValues({"TEXT": "First Comment"}))
- # Close Comment Window
- gridwin.executeAction("COMMENT", mkPropertyValues({"CLOSE":""}))
+ # Close Comment Window
+ gridwin.executeAction("COMMENT", mkPropertyValues({"CLOSE":""}))
- # Check on the comment text
- self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "First Comment")
+ # Check on the comment text
+ self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "First Comment")
- # Check on comment in another cell
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("COMMENT", mkPropertyValues({"OPEN": ""}))
- gridwin.executeAction("TYPE", mkPropertyValues({"TEXT": "Second Comment"}))
- gridwin.executeAction("COMMENT", mkPropertyValues({"CLOSE":""}))
- self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "Second Comment")
+ # Check on comment in another cell
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("COMMENT", mkPropertyValues({"OPEN": ""}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"TEXT": "Second Comment"}))
+ gridwin.executeAction("COMMENT", mkPropertyValues({"CLOSE":""}))
+ self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "Second Comment")
- # Write Comment without opening Comment window
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B5"}))
- gridwin.executeAction("COMMENT", mkPropertyValues({"SETTEXT": "Third Comment"}))
- self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "Third Comment")
+ # Write Comment without opening Comment window
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B5"}))
+ gridwin.executeAction("COMMENT", mkPropertyValues({"SETTEXT": "Third Comment"}))
+ self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "Third Comment")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/autofill.py b/sc/qa/uitest/calc_tests/autofill.py
index 665410da2d48..c81d1549a8c7 100644
--- a/sc/qa/uitest/calc_tests/autofill.py
+++ b/sc/qa/uitest/calc_tests/autofill.py
@@ -107,19 +107,17 @@ class CalcAutofill(UITestCase):
self.assertEqual(get_cell_by_position(calc_doc, 0, 15, 11).getString(), "10.64.127.7")
def test_autofill_with_suffix(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", "1st")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
- with self.ui_test.execute_dialog_through_command(".uno:FillSeries") as xDialog:
- xautofill = xDialog.getChild("autofill")
- xautofill.executeAction("CLICK", tuple())
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "1st")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "2nd")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "3rd")
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ enter_text_to_cell(gridwin, "A1", "1st")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
+ with self.ui_test.execute_dialog_through_command(".uno:FillSeries") as xDialog:
+ xautofill = xDialog.getChild("autofill")
+ xautofill.executeAction("CLICK", tuple())
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "1st")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "2nd")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "3rd")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/calcSheetDelete.py b/sc/qa/uitest/calc_tests/calcSheetDelete.py
index c3e28bee2d0c..3a93f2a69034 100644
--- a/sc/qa/uitest/calc_tests/calcSheetDelete.py
+++ b/sc/qa/uitest/calc_tests/calcSheetDelete.py
@@ -13,127 +13,119 @@ class calcSheetDelete(UITestCase):
def test_tdf114228_insert_and_delete_sheet(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
- xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": "L12"}))
- nrSheets = document.Sheets.getCount() #default number
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": "L12"}))
+ nrSheets = document.Sheets.getCount() #default number
- with self.ui_test.execute_dialog_through_command(".uno:Insert"):
- pass
+ with self.ui_test.execute_dialog_through_command(".uno:Insert"):
+ pass
- self.assertEqual(document.Sheets.getCount(), nrSheets + 1)
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 1)
- with self.ui_test.execute_dialog_through_command(".uno:Remove", close_button="yes"):
- pass
- xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
- xToolkit.processEventsToIdle()
+ with self.ui_test.execute_dialog_through_command(".uno:Remove", close_button="yes"):
+ pass
+ xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+ xToolkit.processEventsToIdle()
- self.assertEqual(document.Sheets.getCount(), nrSheets)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Sheets.getCount(), nrSheets + 1)
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(document.Sheets.getCount(), nrSheets)
+ self.assertEqual(document.Sheets.getCount(), nrSheets)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 1)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Sheets.getCount(), nrSheets)
- self.ui_test.close_doc()
def test_tdf43078_insert_and_delete_sheet_insert_text(self):
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
- nrSheets = document.Sheets.getCount() #default number of sheets
+ nrSheets = document.Sheets.getCount() #default number of sheets
- with self.ui_test.execute_dialog_through_command(".uno:Insert"):
- pass
+ with self.ui_test.execute_dialog_through_command(".uno:Insert"):
+ pass
- with self.ui_test.execute_dialog_through_command(".uno:Insert"):
- pass
- xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
- xToolkit.processEventsToIdle()
+ with self.ui_test.execute_dialog_through_command(".uno:Insert"):
+ pass
+ xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+ xToolkit.processEventsToIdle()
- self.assertEqual(document.Sheets.getCount(), nrSheets + 2)
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
- enter_text_to_cell(xGridWindow, "B2", "abcd")
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 2)
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
+ enter_text_to_cell(xGridWindow, "B2", "abcd")
- with self.ui_test.execute_dialog_through_command(".uno:Remove", close_button="yes"):
- pass
+ with self.ui_test.execute_dialog_through_command(".uno:Remove", close_button="yes"):
+ pass
- self.assertEqual(document.Sheets.getCount(), nrSheets + 1)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Sheets.getCount(), nrSheets + 2)
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(document.Sheets.getCount(), nrSheets + 1)
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 2)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 1)
- self.ui_test.close_doc()
def test_delete_more_sheets_at_once(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- nrSheets = document.Sheets.getCount() #default number
- i = 0
- while i < 6:
- with self.ui_test.execute_dialog_through_command(".uno:Insert"):
- pass
- i = i + 1
- self.assertEqual(document.Sheets.getCount(), nrSheets + 6)
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
+ nrSheets = document.Sheets.getCount() #default number
+ i = 0
+ while i < 6:
+ with self.ui_test.execute_dialog_through_command(".uno:Insert"):
+ pass
+ i = i + 1
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 6)
- i = 0
- while i < 5:
- self.xUITest.executeCommand(".uno:JumpToNextTableSel") #select next sheet
- i = i + 1
+ i = 0
+ while i < 5:
+ self.xUITest.executeCommand(".uno:JumpToNextTableSel") #select next sheet
+ i = i + 1
- with self.ui_test.execute_dialog_through_command(".uno:Remove", close_button="yes"):
- pass
+ with self.ui_test.execute_dialog_through_command(".uno:Remove", close_button="yes"):
+ pass
- xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
- xToolkit.processEventsToIdle()
- self.assertEqual(document.Sheets.getCount(), nrSheets)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Sheets.getCount(), nrSheets + 6)
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(document.Sheets.getCount(), nrSheets)
+ xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+ xToolkit.processEventsToIdle()
+ self.assertEqual(document.Sheets.getCount(), nrSheets)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 6)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Sheets.getCount(), nrSheets)
- self.ui_test.close_doc()
def test_tdf105105_delete_lots_of_sheets_at_once(self):
- self.ui_test.create_doc_in_start_center("calc")
-
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- nrSheets = document.Sheets.getCount() #default number
- i = 0
- while i < 100:
- with self.ui_test.execute_dialog_through_command(".uno:Insert"):
+ with self.ui_test.create_doc_in_start_center_guarded("calc") as document:
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
+ nrSheets = document.Sheets.getCount() #default number
+ i = 0
+ while i < 100:
+ with self.ui_test.execute_dialog_through_command(".uno:Insert"):
+ pass
+ i = i + 1
+ xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+ xToolkit.processEventsToIdle()
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 100)
+
+ i = 0
+ while i < 99:
+ self.xUITest.executeCommand(".uno:JumpToNextTableSel") #select next sheet
+ i = i + 1
+
+ with self.ui_test.execute_dialog_through_command(".uno:Remove", close_button="yes"):
pass
- i = i + 1
- xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
- xToolkit.processEventsToIdle()
- self.assertEqual(document.Sheets.getCount(), nrSheets + 100)
-
- i = 0
- while i < 99:
- self.xUITest.executeCommand(".uno:JumpToNextTableSel") #select next sheet
- i = i + 1
-
- with self.ui_test.execute_dialog_through_command(".uno:Remove", close_button="yes"):
- pass
-
- self.assertEqual(document.Sheets.getCount(), nrSheets)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Sheets.getCount(), nrSheets + 100)
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(document.Sheets.getCount(), nrSheets)
-
- self.ui_test.close_doc()
+
+ self.assertEqual(document.Sheets.getCount(), nrSheets)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 100)
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(document.Sheets.getCount(), nrSheets)
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py b/sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py
index 129488b50feb..8487f232fe65 100644
--- a/sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py
+++ b/sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list