summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-06-22 11:17:29 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-22 21:47:11 +0200
commit374baf308979306aa35575118c40ccd7caae1e29 (patch)
tree2570881a42fe5b5555db1dbf2aecc0a3fdd33878 /sc
parentb2331179fc508fd6bc37355e5c3c5a5ee54557c4 (diff)
uitest: guard create_doc_in_start_center
Mostly done by a script for motivation, see 89aaa17a0a4413f07da2bc5084b0164f15dc01ac < UITest: introduce guarded context managers > Change-Id: I75ef7712af3676363a9a464acf83f6f68ffc4f85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117617 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/autofilter/autofilter.py216
-rw-r--r--sc/qa/uitest/autofilter/autofilterBugs.py54
-rw-r--r--sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py247
-rw-r--r--sc/qa/uitest/autofilter/tdf126306.py229
-rw-r--r--sc/qa/uitest/autofilter/tdf141559.py146
-rw-r--r--sc/qa/uitest/autofilter/tdf141946.py94
-rw-r--r--sc/qa/uitest/autofilter/tdf36383.py76
-rw-r--r--sc/qa/uitest/autofilter/tdf46062.py62
-rw-r--r--sc/qa/uitest/autofilter/tdf48025.py88
-rw-r--r--sc/qa/uitest/autofilter/tdf68113.py104
-rw-r--r--sc/qa/uitest/calc_tests/CalcPasteOnly.py49
-rw-r--r--sc/qa/uitest/calc_tests/CellDropDownItems.py136
-rw-r--r--sc/qa/uitest/calc_tests/Comments.py66
-rw-r--r--sc/qa/uitest/calc_tests/autofill.py33
-rw-r--r--sc/qa/uitest/calc_tests/calcSheetDelete.py207
-rw-r--r--sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py368
-rw-r--r--sc/qa/uitest/calc_tests/columns.py478
-rw-r--r--sc/qa/uitest/calc_tests/fillRandomNumber.py79
-rw-r--r--sc/qa/uitest/calc_tests/formatCells.py832
-rw-r--r--sc/qa/uitest/calc_tests/mergedRowsColumns.py25
-rw-r--r--sc/qa/uitest/calc_tests/printRange.py183
-rw-r--r--sc/qa/uitest/calc_tests/rows.py398
-rw-r--r--sc/qa/uitest/calc_tests/sheetRename.py81
-rw-r--r--sc/qa/uitest/calc_tests/zoom.py92
-rw-r--r--sc/qa/uitest/calc_tests2/dataform.py17
-rw-r--r--sc/qa/uitest/calc_tests2/standardFilter.py1053
-rw-r--r--sc/qa/uitest/calc_tests2/tdf104117.py59
-rw-r--r--sc/qa/uitest/calc_tests2/tdf117367.py70
-rw-r--r--sc/qa/uitest/calc_tests2/tdf120174.py29
-rw-r--r--sc/qa/uitest/calc_tests2/tdf126577.py44
-rw-r--r--sc/qa/uitest/calc_tests2/tdf46138.py37
-rw-r--r--sc/qa/uitest/calc_tests2/tdf51700.py68
-rw-r--r--sc/qa/uitest/calc_tests3/clearCells.py548
-rw-r--r--sc/qa/uitest/calc_tests3/insertQrCodeGen.py125
-rw-r--r--sc/qa/uitest/calc_tests3/tdf69450.py85
-rw-r--r--sc/qa/uitest/calc_tests3/tdf73006.py44
-rw-r--r--sc/qa/uitest/calc_tests3/tdf79983.py94
-rw-r--r--sc/qa/uitest/calc_tests3/tdf80693.py65
-rw-r--r--sc/qa/uitest/calc_tests3/tdf82398.py82
-rw-r--r--sc/qa/uitest/calc_tests4/tdf88999.py58
-rw-r--r--sc/qa/uitest/calc_tests4/tdf89907.py86
-rw-r--r--sc/qa/uitest/calc_tests4/tdf92423.py104
-rw-r--r--sc/qa/uitest/calc_tests4/tdf94208.py56
-rw-r--r--sc/qa/uitest/calc_tests4/trackedChanges.py472
-rw-r--r--sc/qa/uitest/calc_tests6/autoFormat.py106
-rw-r--r--sc/qa/uitest/calc_tests6/autocorrectOptions.py168
-rw-r--r--sc/qa/uitest/calc_tests6/hideShowSheet.py78
-rw-r--r--sc/qa/uitest/calc_tests6/moveCopySheet.py112
-rw-r--r--sc/qa/uitest/calc_tests6/multipleOperations.py197
-rw-r--r--sc/qa/uitest/calc_tests6/scenarios.py67
-rw-r--r--sc/qa/uitest/calc_tests6/shareSpreadsheet.py27
-rw-r--r--sc/qa/uitest/calc_tests6/tdf104378.py30
-rw-r--r--sc/qa/uitest/calc_tests6/tdf116996.py77
-rw-r--r--sc/qa/uitest/calc_tests6/tdf121263.py59
-rw-r--r--sc/qa/uitest/calc_tests6/tdf91726.py58
-rw-r--r--sc/qa/uitest/calc_tests7/tdf106667.py27
-rw-r--r--sc/qa/uitest/calc_tests7/tdf117987.py21
-rw-r--r--sc/qa/uitest/calc_tests7/tdf123122.py89
-rw-r--r--sc/qa/uitest/calc_tests7/tdf125030.py31
-rw-r--r--sc/qa/uitest/calc_tests7/tdf45020.py41
-rw-r--r--sc/qa/uitest/calc_tests8/navigator.py50
-rw-r--r--sc/qa/uitest/calc_tests8/tdf114710.py2
-rw-r--r--sc/qa/uitest/calc_tests8/tdf118308.py65
-rw-r--r--sc/qa/uitest/calc_tests8/tdf125051.py52
-rw-r--r--sc/qa/uitest/calc_tests8/tdf126248.py2
-rw-r--r--sc/qa/uitest/calc_tests8/tdf137726.py22
-rw-r--r--sc/qa/uitest/calc_tests9/tdf113571.py2
-rw-r--r--sc/qa/uitest/calc_tests9/tdf117879.py38
-rw-r--r--sc/qa/uitest/calc_tests9/tdf121949.py26
-rw-r--r--sc/qa/uitest/calc_tests9/tdf125440.py2
-rw-r--r--sc/qa/uitest/calc_tests9/tdf133629.py98
-rw-r--r--sc/qa/uitest/calc_tests9/tdf141244.py34
-rw-r--r--sc/qa/uitest/chart/copyPaste.py2
-rw-r--r--sc/qa/uitest/chart/create_chart.py115
-rw-r--r--sc/qa/uitest/chart/edit_chart.py44
-rw-r--r--sc/qa/uitest/chart/tdf107097.py2
-rw-r--r--sc/qa/uitest/chart/tdf120348.py2
-rw-r--r--sc/qa/uitest/chart/tdf124295.py26
-rw-r--r--sc/qa/uitest/chart/tdf131715.py21
-rw-r--r--sc/qa/uitest/chart/tdf136011.py2
-rw-r--r--sc/qa/uitest/chart/tdf46885.py61
-rw-r--r--sc/qa/uitest/chart/tdf62057.py2
-rw-r--r--sc/qa/uitest/chart/tdf98690.py2
-rw-r--r--sc/qa/uitest/conditional_format/tdf105351.py80
-rw-r--r--sc/qa/uitest/conditional_format/tdf105411.py24
-rw-r--r--sc/qa/uitest/conditional_format/tdf105466.py22
-rw-r--r--sc/qa/uitest/conditional_format/tdf117899.py29
-rw-r--r--sc/qa/uitest/function_wizard/function_wizard.py16
-rw-r--r--sc/qa/uitest/function_wizard/tdf132173.py24
-rw-r--r--sc/qa/uitest/hide_cols/tdf95306.py34
-rw-r--r--sc/qa/uitest/inputLine/tdf54197.py30
-rw-r--r--sc/qa/uitest/inputLine/tdf67346.py44
-rw-r--r--sc/qa/uitest/key_f4/f4.py201
-rw-r--r--sc/qa/uitest/manual_tests/calc.py266
-rw-r--r--sc/qa/uitest/manual_tests/more_calc.py53
-rw-r--r--sc/qa/uitest/options/tdf122977.py82
-rw-r--r--sc/qa/uitest/protect/protectSheet.py82
-rw-r--r--sc/qa/uitest/protect/protectSpreadsheet.py42
-rw-r--r--sc/qa/uitest/range_name/create_range_name.py224
-rw-r--r--sc/qa/uitest/range_name/tdf137617.py126
-rw-r--r--sc/qa/uitest/range_name/tdf138822.py62
-rw-r--r--sc/qa/uitest/range_name/tdf86214.py58
-rw-r--r--sc/qa/uitest/search_replace/tdf132097.py36
-rw-r--r--sc/qa/uitest/search_replace/tdf39917.py153
-rw-r--r--sc/qa/uitest/search_replace/tdf44398.py121
-rw-r--r--sc/qa/uitest/search_replace/tdf57523.py56
-rw-r--r--sc/qa/uitest/signatureLine/insertSignatureLine.py155
-rw-r--r--sc/qa/uitest/sort/naturalSort.py163
-rw-r--r--sc/qa/uitest/sort/sorting.py533
-rw-r--r--sc/qa/uitest/sort/subtotals.py58
-rw-r--r--sc/qa/uitest/sort/tdf100517.py66
-rw-r--r--sc/qa/uitest/sort/tdf126678.py62
-rw-r--r--sc/qa/uitest/sort/tdf53482.py70
-rw-r--r--sc/qa/uitest/sort/tdf91305.py206
-rw-r--r--sc/qa/uitest/sort/tdf99773.py59
-rw-r--r--sc/qa/uitest/statistics/anova.py231
-rw-r--r--sc/qa/uitest/statistics/chiSquare.py134
-rw-r--r--sc/qa/uitest/statistics/correlation.py359
-rw-r--r--sc/qa/uitest/statistics/covariance.py355
-rw-r--r--sc/qa/uitest/statistics/descriptiveStatistics.py287
-rw-r--r--sc/qa/uitest/statistics/exponentialSmoothing.py311
-rw-r--r--sc/qa/uitest/statistics/fTest.py184
-rw-r--r--sc/qa/uitest/statistics/movingAverage.py316
-rw-r--r--sc/qa/uitest/statistics/regression.py12
-rw-r--r--sc/qa/uitest/statistics/sampling.py167
-rw-r--r--sc/qa/uitest/statistics/tTest.py190
-rw-r--r--sc/qa/uitest/statistics/zTest.py168
-rw-r--r--sc/qa/uitest/textCase/textCase.py221
-rw-r--r--sc/qa/uitest/validity/tdf138134.py80
-rw-r--r--sc/qa/uitest/validity/tdf53920.py106
-rw-r--r--sc/qa/uitest/validity/tdf65686.py72
-rw-r--r--sc/qa/uitest/validity/tdf96698.py222
-rw-r--r--sc/qa/uitest/validity/validity.py220
133 files changed, 7966 insertions, 8305 deletions
diff --git a/sc/qa/uitest/autofilter/autofilter.py b/sc/qa/uitest/autofilter/autofilter.py
index 1b5bcb1f113f..2a06199b4c8c 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("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, "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()
-
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xFloatWindow = self.xUITest.getFloatWindow()
- xList = xCheckListMenu.getChild("check_list_box")
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- 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'])
+ xList = xCheckListMenu.getChild("check_list_box")
- xSearchEdit = xFloatWindow.getChild("search_edit")
- xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "11"}))
+ 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(1, len(xList.getChildren()))
- self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text'])
+ xSearchEdit = xFloatWindow.getChild("search_edit")
+ xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "11"}))
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ self.assertEqual(1, len(xList.getChildren()))
+ self.assertEqual("11", get_state_as_dict(xList.getChild('0'))['Text'])
- self.assertFalse(is_row_hidden(document, 0))
- self.assertFalse(is_row_hidden(document, 1))
- self.assertTrue(is_row_hidden(document, 2))
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ self.assertFalse(is_row_hidden(document, 0))
+ self.assertFalse(is_row_hidden(document, 1))
+ self.assertTrue(is_row_hidden(document, 2))
- xFloatWindow = self.xUITest.getFloatWindow()
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xFloatWindow = self.xUITest.getFloatWindow()
- xList = xCheckListMenu.getChild("check_list_box")
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- 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'])
+ xList = xCheckListMenu.getChild("check_list_box")
- xSearchEdit = xFloatWindow.getChild("search_edit")
- xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "22"}))
+ 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(1, len(xList.getChildren()))
- self.assertEqual("22", get_state_as_dict(xList.getChild('0'))['Text'])
+ xSearchEdit = xFloatWindow.getChild("search_edit")
+ xSearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT" : "22"}))
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ 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())
- 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()
+ self.assertFalse(is_row_hidden(document, 0))
+ self.assertTrue(is_row_hidden(document, 1))
+ self.assertFalse(is_row_hidden(document, 2))
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("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "AAA")
- enter_text_to_cell(gridwin, "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()
-
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xFloatWindow = self.xUITest.getFloatWindow()
- xList = xCheckListMenu.getChild("check_list_box")
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- 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'])
+ xList = xCheckListMenu.getChild("check_list_box")
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ 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.ui_test.close_doc()
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
def test_tdf116818(self):
with self.ui_test.load_file(get_url_for_data_file("tdf116818.xlsx")) as doc:
@@ -372,54 +368,52 @@ 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("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())
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 ffb6419690ea..189c524c5f1a 100644
--- a/sc/qa/uitest/autofilter/autofilterBugs.py
+++ b/sc/qa/uitest/autofilter/autofilterBugs.py
@@ -26,34 +26,32 @@ class autofilter(UITestCase):
self.assertEqual(document.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"}))
-
- self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xYesBtn = xDialog.getChild("yes")
- self.ui_test.close_dialog_through_button(xYesBtn)
-
- xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A3"}))
- self.xUITest.executeCommand(".uno:SelectRow") #select two rows
-
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #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("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"}))
+
+ self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xYesBtn = xDialog.getChild("yes")
+ self.ui_test.close_dialog_through_button(xYesBtn)
+
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A3"}))
+ self.xUITest.executeCommand(".uno:SelectRow") #select two rows
+
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #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 89be1bb51099..51f3e1cf1efb 100644
--- a/sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py
+++ b/sc/qa/uitest/autofilter/tdf117276_autofilter_reset.py
@@ -49,130 +49,129 @@ 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")
-
-# 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
- self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xYesBtn = xDialog.getChild("yes")
- self.ui_test.close_dialog_through_button(xYesBtn)
-
- # 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()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ document = self.ui_test.get_component()
+ 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
+ self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xYesBtn = xDialog.getChild("yes")
+ self.ui_test.close_dialog_through_button(xYesBtn)
+
+ # 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 73f8d83f8b85..71102365fd5e 100644
--- a/sc/qa/uitest/autofilter/tdf126306.py
+++ b/sc/qa/uitest/autofilter/tdf126306.py
@@ -21,120 +21,119 @@ 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"}))
-
- self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xYesBtn = xDialog.getChild("yes")
- self.ui_test.close_dialog_through_button(xYesBtn)
-
- 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("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"}))
+
+ self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xYesBtn = xDialog.getChild("yes")
+ self.ui_test.close_dialog_through_button(xYesBtn)
+
+ 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..dc09609f5655 100644
--- a/sc/qa/uitest/autofilter/tdf141559.py
+++ b/sc/qa/uitest/autofilter/tdf141559.py
@@ -15,79 +15,77 @@ 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("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"))
# 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..464728e8ef9c 100644
--- a/sc/qa/uitest/autofilter/tdf141946.py
+++ b/sc/qa/uitest/autofilter/tdf141946.py
@@ -12,64 +12,62 @@ 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("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")
+ 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())
-
- self.ui_test.close_doc()
+ 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())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf36383.py b/sc/qa/uitest/autofilter/tdf36383.py
index d55db21837b3..9c341845b617 100644
--- a/sc/qa/uitest/autofilter/tdf36383.py
+++ b/sc/qa/uitest/autofilter/tdf36383.py
@@ -13,56 +13,54 @@ 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("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")
+ 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
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- 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
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
- self.assertFalse(row.getPropertyValue("IsVisible"))
+ self.assertFalse(row.getPropertyValue("IsVisible"))
- #optimal row height
- self.ui_test.execute_dialog_through_command(".uno:SetOptimalRowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
+ #optimal row height
+ self.ui_test.execute_dialog_through_command(".uno:SetOptimalRowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
- self.assertFalse(row.getPropertyValue("IsVisible"))
-
- self.ui_test.close_doc()
+ self.assertFalse(row.getPropertyValue("IsVisible"))
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf46062.py b/sc/qa/uitest/autofilter/tdf46062.py
index 41b42eb0e475..769d20fd31b1 100644
--- a/sc/qa/uitest/autofilter/tdf46062.py
+++ b/sc/qa/uitest/autofilter/tdf46062.py
@@ -13,37 +13,35 @@ 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")
-
- 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"}))
-
- self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xYesBtn = xDialog.getChild("yes")
- self.ui_test.close_dialog_through_button(xYesBtn)
-
- 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'])
-
- xOkButton = xFloatWindow.getChild("ok")
- xOkButton.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("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", " ")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+
+ self.ui_test.execute_dialog_through_command(".uno:DataFilterAutoFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xYesBtn = xDialog.getChild("yes")
+ self.ui_test.close_dialog_through_button(xYesBtn)
+
+ 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'])
+
+ xOkButton = xFloatWindow.getChild("ok")
+ xOkButton.executeAction("CLICK", tuple())
# 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..dbbdefe5ff42 100644
--- a/sc/qa/uitest/autofilter/tdf48025.py
+++ b/sc/qa/uitest/autofilter/tdf48025.py
@@ -12,61 +12,59 @@ 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("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")
+ 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())
-
- self.ui_test.close_doc()
+ 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())
# 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..5a65398866ef 100644
--- a/sc/qa/uitest/autofilter/tdf68113.py
+++ b/sc/qa/uitest/autofilter/tdf68113.py
@@ -13,65 +13,63 @@ 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("calc"):
+ document = self.ui_test.get_component()
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWin = calcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- 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())
-
- self.ui_test.close_doc()
+ # 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())
# 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..1c567549af66 100644
--- a/sc/qa/uitest/calc_tests/CalcPasteOnly.py
+++ b/sc/qa/uitest/calc_tests/CalcPasteOnly.py
@@ -13,29 +13,28 @@ 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("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)")
+
# 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 7b089751cff5..ffef1e8c6644 100644
--- a/sc/qa/uitest/calc_tests/CellDropDownItems.py
+++ b/sc/qa/uitest/calc_tests/CellDropDownItems.py
@@ -13,74 +13,72 @@ 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
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
-
- #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
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
-
- #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("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
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ #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
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+
+ #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..dc06f37f5a28 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()
-
- # 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": ""}))
-
- # Write text in the Comment Window
- gridwin.executeAction("TYPE", mkPropertyValues({"TEXT": "First Comment"}))
-
- # 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 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")
-
- self.ui_test.close_doc()
+ with 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 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": ""}))
+
+ # Write text in the Comment Window
+ gridwin.executeAction("TYPE", mkPropertyValues({"TEXT": "First Comment"}))
+
+ # 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 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")
# 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 57691ef5c499..1c3257573ace 100644
--- a/sc/qa/uitest/calc_tests/autofill.py
+++ b/sc/qa/uitest/calc_tests/autofill.py
@@ -123,22 +123,21 @@ class CalcAutofill(UITestCase):
self.assertEqual(get_cell_by_position(document, 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"}))
- self.ui_test.execute_dialog_through_command(".uno:FillSeries")
- xDialog = self.xUITest.getTopFocusWindow()
- xautofill = xDialog.getChild("autofill")
- xautofill.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- 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("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"}))
+ self.ui_test.execute_dialog_through_command(".uno:FillSeries")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xautofill = xDialog.getChild("autofill")
+ xautofill.executeAction("CLICK", tuple())
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ 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 ae8867c6f97c..eabc9b5c28c3 100644
--- a/sc/qa/uitest/calc_tests/calcSheetDelete.py
+++ b/sc/qa/uitest/calc_tests/calcSheetDelete.py
@@ -13,137 +13,130 @@ 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("calc"):
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": "L12"}))
- nrSheets = document.Sheets.getCount() #default number
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"CELL": "L12"}))
+ nrSheets = document.Sheets.getCount() #default number
- self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("ok")
- xOKButton.executeAction("CLICK", tuple())
-
- self.assertEqual(document.Sheets.getCount(), nrSheets + 1)
+ self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKButton = xDialog.getChild("ok")
+ xOKButton.executeAction("CLICK", tuple())
- self.ui_test.execute_dialog_through_command(".uno:Remove") #delete sheet
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("yes")
- xOKButton.executeAction("CLICK", tuple())
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 1)
- 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.execute_dialog_through_command(".uno:Remove") #delete sheet
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKButton = xDialog.getChild("yes")
+ xOKButton.executeAction("CLICK", tuple())
- self.ui_test.close_doc()
+ 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)
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()
-
- nrSheets = document.Sheets.getCount() #default number of sheets
+ with self.ui_test.create_doc_in_start_center("calc"):
+ document = self.ui_test.get_component()
- self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("ok")
- xOKButton.executeAction("CLICK", tuple())
+ nrSheets = document.Sheets.getCount() #default number of sheets
- self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("ok")
- xOKButton.executeAction("CLICK", tuple())
+ self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKButton = xDialog.getChild("ok")
+ xOKButton.executeAction("CLICK", tuple())
- self.assertEqual(document.Sheets.getCount(), nrSheets + 2)
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
- enter_text_to_cell(xGridWindow, "B2", "abcd")
+ self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKButton = xDialog.getChild("ok")
+ xOKButton.executeAction("CLICK", tuple())
- self.ui_test.execute_dialog_through_command(".uno:Remove") #delete sheet
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("yes")
- xOKButton.executeAction("CLICK", tuple())
+ 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 + 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.execute_dialog_through_command(".uno:Remove") #delete sheet
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKButton = xDialog.getChild("yes")
+ xOKButton.executeAction("CLICK", tuple())
- self.ui_test.close_doc()
+ 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)
def test_delete_more_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 < 6:
- self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
+ with 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 < 6:
+ self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKButton = xDialog.getChild("ok")
+ xOKButton.executeAction("CLICK", tuple())
+ 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
+
+ self.ui_test.execute_dialog_through_command(".uno:Remove") #delete selected sheets
xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("ok")
+ xOKButton = xDialog.getChild("yes")
xOKButton.executeAction("CLICK", tuple())
- 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
- self.ui_test.execute_dialog_through_command(".uno:Remove") #delete selected sheets
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("yes")
- xOKButton.executeAction("CLICK", tuple())
-
- 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()
+ 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)
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:
- self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
+ with 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:
+ self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKButton = xDialog.getChild("ok")
+ xOKButton.executeAction("CLICK", tuple())
+ i = i + 1
+ self.assertEqual(document.Sheets.getCount(), nrSheets + 100)
+
+ i = 0
+ while i < 99:
+ self.xUITest.executeCommand(".uno:JumpToNextTableSel") #select next sheet
+ i = i + 1
+
+ self.ui_test.execute_dialog_through_command(".uno:Remove") #delete selected sheets
xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("ok")
+ xOKButton = xDialog.getChild("yes")
xOKButton.executeAction("CLICK", tuple())
- i = i + 1
- self.assertEqual(document.Sheets.getCount(), nrSheets + 100)
-
- i = 0
- while i < 99:
- self.xUITest.executeCommand(".uno:JumpToNextTableSel") #select next sheet
- i = i + 1
-
- self.ui_test.execute_dialog_through_command(".uno:Remove") #delete selected sheets
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("yes")
- xOKButton.executeAction("CLICK", tuple())
-
- 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 7d4c2ff089ba..b7cb4bc5b335 100644
--- a/sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py
+++ b/sc/qa/uitest/calc_tests/cellBackgroundColorSelector.py
@@ -15,195 +15,191 @@ class CalcCellBackgroundColorSelector(UITestCase):
def test_color_selector(self):
#This is to test color selection
- 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 A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "6") #tab Numbers
- # click on color btn
- xbtncolor = xDialog.getChild("btncolor")
- xbtncolor.executeAction("CLICK",tuple())
- xpaletteselector = xDialog.getChild("paletteselector")
-
- # Now we have the ColorPage that we can get the color selector from it
- xColorpage = xDialog.getChild("ColorPage")
- color_selector = xColorpage.getChild("colorset")
-
- # For chart-palettes colors
- select_by_text(xpaletteselector, "chart-palettes")
- # Select Color with id 2
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "2"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "2")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "1")
- self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "12")
- self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Chart 2")
- self.assertEqual(get_state_as_dict(color_selector)["RGB"], "(255,66,14)")
-
- # Select Color with id 5
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "5"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "5")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "4")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Chart 5")
- self.assertEqual(get_state_as_dict(color_selector)["RGB"], "(126,0,33)")
-
- # For libreoffice colors
- select_by_text(xpaletteselector, "libreoffice")
- # Select Color with id 6
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "6"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "6")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "5")
- self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "32")
- self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Green Accent")
- self.assertEqual(get_state_as_dict(color_selector)["RGB"], "(44,238,14)")
-
- # Select Color with id 30
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "30"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "30")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "29")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Yellow Accent")
- self.assertEqual(get_state_as_dict(color_selector)["RGB"], "(255,215,76)")
-
- # For html colors
- select_by_text(xpaletteselector, "html")
- # Select Color with id 1
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "1")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "0")
- self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "139")
- self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "White")
- # Select Color with id 120
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "120"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "120")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "119")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Navy")
-
- # For freecolour-hlc colors
- select_by_text(xpaletteselector, "freecolour-hlc")
- # Select Color with id 988
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "988"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "988")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "987")
- self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "1032")
- self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "HLC 350 60 10")
- # Select Color with id 575
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "575"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "575")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "574")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "HLC 190 50 20")
-
- # For tonal colors
- select_by_text(xpaletteselector, "tonal")
- # Select Color with id 17
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "17"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "17")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "16")
- self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "120")
- self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Cyan 82%")
- # Select Color with id 13
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "13"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "13")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "12")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Magenta 82%")
-
- # For material colors
- select_by_text(xpaletteselector, "material")
- # Select Color with id 9
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "9"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "9")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "8")
- self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "228")
- self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Gray 800")
-
- # For standard colors
- select_by_text(xpaletteselector, "standard")
- # Select Color with id 3
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "3"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "3")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "2")
- self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "120")
- self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Dark Gray 3")
-
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
-
- self.ui_test.close_doc()
+ with 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 A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "6") #tab Numbers
+ # click on color btn
+ xbtncolor = xDialog.getChild("btncolor")
+ xbtncolor.executeAction("CLICK",tuple())
+ xpaletteselector = xDialog.getChild("paletteselector")
+
+ # Now we have the ColorPage that we can get the color selector from it
+ xColorpage = xDialog.getChild("ColorPage")
+ color_selector = xColorpage.getChild("colorset")
+
+ # For chart-palettes colors
+ select_by_text(xpaletteselector, "chart-palettes")
+ # Select Color with id 2
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "2"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "2")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "1")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "12")
+ self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Chart 2")
+ self.assertEqual(get_state_as_dict(color_selector)["RGB"], "(255,66,14)")
+
+ # Select Color with id 5
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "5"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "5")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "4")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Chart 5")
+ self.assertEqual(get_state_as_dict(color_selector)["RGB"], "(126,0,33)")
+
+ # For libreoffice colors
+ select_by_text(xpaletteselector, "libreoffice")
+ # Select Color with id 6
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "6"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "6")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "5")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "32")
+ self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Green Accent")
+ self.assertEqual(get_state_as_dict(color_selector)["RGB"], "(44,238,14)")
+
+ # Select Color with id 30
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "30"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "30")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "29")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Yellow Accent")
+ self.assertEqual(get_state_as_dict(color_selector)["RGB"], "(255,215,76)")
+
+ # For html colors
+ select_by_text(xpaletteselector, "html")
+ # Select Color with id 1
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "1")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "0")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "139")
+ self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "White")
+ # Select Color with id 120
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "120"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "120")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "119")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Navy")
+
+ # For freecolour-hlc colors
+ select_by_text(xpaletteselector, "freecolour-hlc")
+ # Select Color with id 988
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "988"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "988")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "987")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "1032")
+ self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "HLC 350 60 10")
+ # Select Color with id 575
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "575"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "575")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "574")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "HLC 190 50 20")
+
+ # For tonal colors
+ select_by_text(xpaletteselector, "tonal")
+ # Select Color with id 17
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "17"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "17")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "16")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "120")
+ self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Cyan 82%")
+ # Select Color with id 13
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "13"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "13")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "12")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Magenta 82%")
+
+ # For material colors
+ select_by_text(xpaletteselector, "material")
+ # Select Color with id 9
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "9"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "9")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "8")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "228")
+ self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Gray 800")
+
+ # For standard colors
+ select_by_text(xpaletteselector, "standard")
+ # Select Color with id 3
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "3"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "3")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "2")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "120")
+ self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Dark Gray 3")
+
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
def test_recent_color_selector(self):
#This is to test recent color selection
- 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 A5
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A5"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "6") #tab Numbers
- # click on color btn
- xbtncolor = xDialog.getChild("btncolor")
- xbtncolor.executeAction("CLICK",tuple())
-
- # we will select color for cell A5 to be able to predict the latest color in
- # recent color selector
- xpaletteselector = xDialog.getChild("paletteselector")
- xColorpage = xDialog.getChild("ColorPage")
- color_selector = xColorpage.getChild("colorset")
-
- # For chart-palettes colors
- select_by_text(xpaletteselector, "chart-palettes")
- # Select Color with id 2
- color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "2"}))
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "2")
- self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "1")
- self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "12")
- self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
- self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Chart 2")
- xrgb = get_state_as_dict(color_selector)["RGB"]
-
- # close the dialog after selection of the color
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
-
- #select cell D3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D3"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "6") #tab Numbers
- # click on color btn
- xbtncolor = xDialog.getChild("btncolor")
- xbtncolor.executeAction("CLICK",tuple())
-
- xColorpage = xDialog.getChild("ColorPage")
- recent_color_selector = xColorpage.getChild("recentcolorset")
-
- # Select Color with id 1
- recent_color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
- self.assertEqual(get_state_as_dict(recent_color_selector)["CurrColorId"], "1")
- self.assertEqual(get_state_as_dict(recent_color_selector)["CurrColorPos"], "0")
- self.assertEqual(get_state_as_dict(recent_color_selector)["ColorText"], "Chart 2")
- self.assertEqual(get_state_as_dict(recent_color_selector)["RGB"], xrgb)
-
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
-
- self.ui_test.close_doc()
+ with 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 A5
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A5"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "6") #tab Numbers
+ # click on color btn
+ xbtncolor = xDialog.getChild("btncolor")
+ xbtncolor.executeAction("CLICK",tuple())
+
+ # we will select color for cell A5 to be able to predict the latest color in
+ # recent color selector
+ xpaletteselector = xDialog.getChild("paletteselector")
+ xColorpage = xDialog.getChild("ColorPage")
+ color_selector = xColorpage.getChild("colorset")
+
+ # For chart-palettes colors
+ select_by_text(xpaletteselector, "chart-palettes")
+ # Select Color with id 2
+ color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "2"}))
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorId"], "2")
+ self.assertEqual(get_state_as_dict(color_selector)["CurrColorPos"], "1")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorsCount"], "12")
+ self.assertEqual(get_state_as_dict(color_selector)["ColCount"], "12")
+ self.assertEqual(get_state_as_dict(color_selector)["ColorText"], "Chart 2")
+ xrgb = get_state_as_dict(color_selector)["RGB"]
+
+ # close the dialog after selection of the color
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+
+ #select cell D3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D3"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "6") #tab Numbers
+ # click on color btn
+ xbtncolor = xDialog.getChild("btncolor")
+ xbtncolor.executeAction("CLICK",tuple())
+
+ xColorpage = xDialog.getChild("ColorPage")
+ recent_color_selector = xColorpage.getChild("recentcolorset")
+
+ # Select Color with id 1
+ recent_color_selector.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
+ self.assertEqual(get_state_as_dict(recent_color_selector)["CurrColorId"], "1")
+ self.assertEqual(get_state_as_dict(recent_color_selector)["CurrColorPos"], "0")
+ self.assertEqual(get_state_as_dict(recent_color_selector)["ColorText"], "Chart 2")
+ self.assertEqual(get_state_as_dict(recent_color_selector)["RGB"], xrgb)
+
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/columns.py b/sc/qa/uitest/calc_tests/columns.py
index 28649d07f3c2..7938d5a25c99 100644
--- a/sc/qa/uitest/calc_tests/columns.py
+++ b/sc/qa/uitest/calc_tests/columns.py
@@ -11,275 +11,263 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class CalcColumns(UITestCase):
def test_column_width(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("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- change_measurement_unit(self, "Centimeter")
+ change_measurement_unit(self, "Centimeter")
- #select A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #column width
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- xdefault = xDialog.getChild("default")
- self.assertEqual(get_state_as_dict(xdefault)["Selected"], "true") #default selected
- heightStrOrig = get_state_as_dict(xvalue)["Text"]
- heightVal = heightStrOrig[:4] #default 2.26 cm
- xvalue.executeAction("UP", tuple()) #2.36 cm
- heightStr = get_state_as_dict(xvalue)["Text"]
- heightValNew = heightStr[:4]
- self.assertEqual(get_state_as_dict(xdefault)["Selected"], "false") #default not selected
- self.assertEqual(heightValNew > heightVal, True) #new value is bigger
- xdefault.executeAction("CLICK", tuple()) #click default
- self.assertEqual(get_state_as_dict(xvalue)["Text"] == heightStrOrig, True) #default value set
- #write your own value
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #verify
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xCancel = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancel)
-
- self.ui_test.close_doc()
+ #select A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #column width
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ xdefault = xDialog.getChild("default")
+ self.assertEqual(get_state_as_dict(xdefault)["Selected"], "true") #default selected
+ heightStrOrig = get_state_as_dict(xvalue)["Text"]
+ heightVal = heightStrOrig[:4] #default 2.26 cm
+ xvalue.executeAction("UP", tuple()) #2.36 cm
+ heightStr = get_state_as_dict(xvalue)["Text"]
+ heightValNew = heightStr[:4]
+ self.assertEqual(get_state_as_dict(xdefault)["Selected"], "false") #default not selected
+ self.assertEqual(heightValNew > heightVal, True) #new value is bigger
+ xdefault.executeAction("CLICK", tuple()) #click default
+ self.assertEqual(get_state_as_dict(xvalue)["Text"] == heightStrOrig, True) #default value set
+ #write your own value
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #verify
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xCancel = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancel)
def test_column_width_two_columns(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- change_measurement_unit(self, "Centimeter")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1", "EXTEND":"1"}))
+ change_measurement_unit(self, "Centimeter")
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- xdefault = xDialog.getChild("default")
- #write your own value
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1", "EXTEND":"1"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ xdefault = xDialog.getChild("default")
+ #write your own value
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- self.ui_test.close_doc()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
def test_column_width_copy(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()
-
- change_measurement_unit(self, "Centimeter")
+ with 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 A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #column width
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #select column 1
- self.xUITest.executeCommand(".uno:SelectColumn")
- #copy
- self.xUITest.executeCommand(".uno:Copy")
- #select C1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- #paste
- self.xUITest.executeCommand(".uno:Paste")
- #verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ change_measurement_unit(self, "Centimeter")
- self.ui_test.close_doc()
+ #select A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #column width
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #select column 1
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ #copy
+ self.xUITest.executeCommand(".uno:Copy")
+ #select C1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ #paste
+ self.xUITest.executeCommand(".uno:Paste")
+ #verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
def test_column_hide_show(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()
- #select A3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- self.xUITest.executeCommand(".uno:HideColumn") #uno command moves focus one cell down
- #verify D1
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentColumn"], "3")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"LEFT"}))
- #verify B (column C is hidden)
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentColumn"], "1")
- #Show hidden column: select B1:D1
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:D1"}))
- self.xUITest.executeCommand(".uno:ShowColumn")
- #verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentColumn"], "3")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"LEFT"}))
- #verify C1 (COlumn C is not hidden)
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentColumn"], "2")
-
- self.ui_test.close_doc()
+ with 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 A3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ self.xUITest.executeCommand(".uno:HideColumn") #uno command moves focus one cell down
+ #verify D1
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentColumn"], "3")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"LEFT"}))
+ #verify B (column C is hidden)
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentColumn"], "1")
+ #Show hidden column: select B1:D1
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:D1"}))
+ self.xUITest.executeCommand(".uno:ShowColumn")
+ #verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentColumn"], "3")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"LEFT"}))
+ #verify C1 (COlumn C is not hidden)
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentColumn"], "2")
def test_column_test_move(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()
- #select C1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentColumn"], "2")
- #right
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RIGHT"}))
- #verify D1
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentColumn"], "3")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"LEFT"}))
- #verify C1
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentColumn"], "2")
-
- self.ui_test.close_doc()
+ with 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 C1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentColumn"], "2")
+ #right
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RIGHT"}))
+ #verify D1
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentColumn"], "3")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"LEFT"}))
+ #verify C1
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentColumn"], "2")
def test_tdf117522_column_width_insert_left(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()
-
- change_measurement_unit(self, "Centimeter")
+ with 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 C1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- #column width
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #select D1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
- #column width
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"2 cm"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #select E1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"}))
- #column width
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"3 cm"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #select columns C-E
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:E1"}))
- self.xUITest.executeCommand(".uno:SelectColumn")
- #Insert Columns Left
- self.xUITest.executeCommand(".uno:InsertColumnsBefore")
- #verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ change_measurement_unit(self, "Centimeter")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.0003 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ #select C1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ #column width
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #select D1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ #column width
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"2 cm"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #select E1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"}))
+ #column width
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"3 cm"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #select columns C-E
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:E1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ #Insert Columns Left
+ self.xUITest.executeCommand(".uno:InsertColumnsBefore")
+ #verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"}))
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.0004 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.0003 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "F1"}))
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"}))
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.0004 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "G1"}))
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.0003 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "F1"}))
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "H1"}))
- self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.0004 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "G1"}))
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "2.0003 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- self.ui_test.close_doc()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "H1"}))
+ self.ui_test.execute_dialog_through_command(".uno:ColumnWidth")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "3.0004 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/fillRandomNumber.py b/sc/qa/uitest/calc_tests/fillRandomNumber.py
index 800786bbbac0..de70825e5390 100644
--- a/sc/qa/uitest/calc_tests/fillRandomNumber.py
+++ b/sc/qa/uitest/calc_tests/fillRandomNumber.py
@@ -12,47 +12,46 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
#randomnumbergenerator.ui
class fillRandomNumber(UITestCase):
def test_fill_random_number(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xcellrangeedit = xDialog.getChild("cell-range-edit")
- xdistributioncombo = xDialog.getChild("distribution-combo")
- xparameter1spin = xDialog.getChild("parameter1-spin")
- xparameter2spin = xDialog.getChild("parameter2-spin")
- xenableseedcheck = xDialog.getChild("enable-seed-check")
- xseedspin = xDialog.getChild("seed-spin")
- xenableroundingcheck = xDialog.getChild("enable-rounding-check")
- xdecimalplacesspin = xDialog.getChild("decimal-places-spin")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xcellrangeedit = xDialog.getChild("cell-range-edit")
+ xdistributioncombo = xDialog.getChild("distribution-combo")
+ xparameter1spin = xDialog.getChild("parameter1-spin")
+ xparameter2spin = xDialog.getChild("parameter2-spin")
+ xenableseedcheck = xDialog.getChild("enable-seed-check")
+ xseedspin = xDialog.getChild("seed-spin")
+ xenableroundingcheck = xDialog.getChild("enable-rounding-check")
+ xdecimalplacesspin = xDialog.getChild("decimal-places-spin")
- xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$2"}))
- select_by_text(xdistributioncombo, "Uniform Integer")
+ xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$2"}))
+ select_by_text(xdistributioncombo, "Uniform Integer")
- xparameter1spin.executeAction("UP", tuple())
- xparameter2spin.executeAction("UP", tuple())
- xenableseedcheck.executeAction("CLICK", tuple())
- xseedspin.executeAction("UP", tuple())
- xenableroundingcheck.executeAction("CLICK", tuple())
- xdecimalplacesspin.executeAction("UP", tuple())
+ xparameter1spin.executeAction("UP", tuple())
+ xparameter2spin.executeAction("UP", tuple())
+ xenableseedcheck.executeAction("CLICK", tuple())
+ xseedspin.executeAction("UP", tuple())
+ xenableroundingcheck.executeAction("CLICK", tuple())
+ xdecimalplacesspin.executeAction("UP", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), True)
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), True)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False)
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False)
- #close dialog without doing anything
- self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False)
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False)
- self.ui_test.close_doc()
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), True)
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), True)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False)
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False)
+ #close dialog without doing anything
+ self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False)
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/formatCells.py b/sc/qa/uitest/calc_tests/formatCells.py
index f8b5cfd7c30c..17a90669596a 100644
--- a/sc/qa/uitest/calc_tests/formatCells.py
+++ b/sc/qa/uitest/calc_tests/formatCells.py
@@ -14,451 +14,433 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class formatCell(UITestCase):
def test_format_cell_numbers_tab(self):
#numberingformatpage.ui
- 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 A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0") #tab Numbers
- xliststore1 = xDialog.getChild("categorylb") #1st list / Category
- xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
- xdecimalsed = xDialog.getChild("decimalsed")
- xleadzerosed = xDialog.getChild("leadzerosed")
- xnegnumred = xDialog.getChild("negnumred")
- xthousands = xDialog.getChild("thousands")
- xlanguagelb = xDialog.getChild("languagelb")
- xformatted = xDialog.getChild("formatted")
- #language
- select_by_text(xlanguagelb, "English (USA)")
- #other properties
- xdecimalsed.executeAction("UP", tuple())
- xleadzerosed.executeAction("UP", tuple())
- xnegnumred.executeAction("CLICK", tuple())
- xthousands.executeAction("CLICK", tuple())
- #format #,#00.0;[RED]-#,#00.0
- self.assertEqual(get_state_as_dict(xformatted)["Text"], "#,#00.0;[RED]-#,#00.0")
- #save
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
- #verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0") #tab Numbers
- xliststore1 = xDialog.getChild("categorylb") #1st list / Category
- xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
- xdecimalsed = xDialog.getChild("decimalsed")
- xleadzerosed = xDialog.getChild("leadzerosed")
- xnegnumred = xDialog.getChild("negnumred")
- xthousands = xDialog.getChild("thousands")
- xlanguagelb = xDialog.getChild("languagelb")
- xformatted = xDialog.getChild("formatted")
-
- self.assertEqual(get_state_as_dict(xliststore1)["SelectEntryText"], "Number")
- self.assertEqual(get_state_as_dict(xlanguagelb)["SelectEntryText"], "English (USA)")
- self.assertEqual(get_state_as_dict(xdecimalsed)["Text"], "1")
- self.assertEqual(get_state_as_dict(xleadzerosed)["Text"], "2")
- self.assertEqual(get_state_as_dict(xnegnumred)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xthousands)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xformatted)["Text"], "#,#00.0;[RED]-#,#00.0")
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
-
- self.ui_test.close_doc()
+ with 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 A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0") #tab Numbers
+ xliststore1 = xDialog.getChild("categorylb") #1st list / Category
+ xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
+ xdecimalsed = xDialog.getChild("decimalsed")
+ xleadzerosed = xDialog.getChild("leadzerosed")
+ xnegnumred = xDialog.getChild("negnumred")
+ xthousands = xDialog.getChild("thousands")
+ xlanguagelb = xDialog.getChild("languagelb")
+ xformatted = xDialog.getChild("formatted")
+ #language
+ select_by_text(xlanguagelb, "English (USA)")
+ #other properties
+ xdecimalsed.executeAction("UP", tuple())
+ xleadzerosed.executeAction("UP", tuple())
+ xnegnumred.executeAction("CLICK", tuple())
+ xthousands.executeAction("CLICK", tuple())
+ #format #,#00.0;[RED]-#,#00.0
+ self.assertEqual(get_state_as_dict(xformatted)["Text"], "#,#00.0;[RED]-#,#00.0")
+ #save
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+ #verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0") #tab Numbers
+ xliststore1 = xDialog.getChild("categorylb") #1st list / Category
+ xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
+ xdecimalsed = xDialog.getChild("decimalsed")
+ xleadzerosed = xDialog.getChild("leadzerosed")
+ xnegnumred = xDialog.getChild("negnumred")
+ xthousands = xDialog.getChild("thousands")
+ xlanguagelb = xDialog.getChild("languagelb")
+ xformatted = xDialog.getChild("formatted")
+
+ self.assertEqual(get_state_as_dict(xliststore1)["SelectEntryText"], "Number")
+ self.assertEqual(get_state_as_dict(xlanguagelb)["SelectEntryText"], "English (USA)")
+ self.assertEqual(get_state_as_dict(xdecimalsed)["Text"], "1")
+ self.assertEqual(get_state_as_dict(xleadzerosed)["Text"], "2")
+ self.assertEqual(get_state_as_dict(xnegnumred)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xthousands)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xformatted)["Text"], "#,#00.0;[RED]-#,#00.0")
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
def test_format_cell_font_tab(self):
#numberingformatpage.ui
- 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 A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1") #tab Font
- xSizeFont = xDialog.getChild("westsizelb-cjk")
- xSizeFontEast = xDialog.getChild("eastsizelb")
- xSizeFontCTL = xDialog.getChild("ctlsizelb")
- xLangFont = xDialog.getChild("westlanglb-cjk")
- xLangFontEast = xDialog.getChild("eastlanglb")
- xLangFontCTL = xDialog.getChild("ctllanglb")
-
- xSizeFont.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xSizeFont.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
- xSizeFontEast.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xSizeFontEast.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
- xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
- select_pos(xLangFont, "0")
- select_pos(xLangFontEast, "0")
- select_pos(xLangFontCTL, "0")
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- #Verify - select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1") #tab Font
- xSizeFont = xDialog.getChild("westsizelb-cjk")
- xSizeFontEast = xDialog.getChild("eastsizelb")
- xSizeFontCTL = xDialog.getChild("ctlsizelb")
- xLangFont = xDialog.getChild("westlanglb-cjk")
- xLangFontEast = xDialog.getChild("eastlanglb")
- xLangFontCTL = xDialog.getChild("ctllanglb")
-
- self.assertEqual(get_state_as_dict(xSizeFont)["Text"], "18 pt")
- self.assertEqual(get_state_as_dict(xSizeFontEast)["Text"], "18 pt")
- self.assertEqual(get_state_as_dict(xSizeFontCTL)["Text"], "18 pt") #check font size
- self.assertEqual(get_state_as_dict(xLangFont)["Text"], "[None]")
- self.assertEqual(get_state_as_dict(xLangFontEast)["SelectEntryText"], "[None]")
- self.assertEqual(get_state_as_dict(xLangFontCTL)["SelectEntryText"], "[None]")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
-
- self.ui_test.close_doc()
+ with 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 A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1") #tab Font
+ xSizeFont = xDialog.getChild("westsizelb-cjk")
+ xSizeFontEast = xDialog.getChild("eastsizelb")
+ xSizeFontCTL = xDialog.getChild("ctlsizelb")
+ xLangFont = xDialog.getChild("westlanglb-cjk")
+ xLangFontEast = xDialog.getChild("eastlanglb")
+ xLangFontCTL = xDialog.getChild("ctllanglb")
+
+ xSizeFont.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSizeFont.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
+ xSizeFontEast.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSizeFontEast.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
+ xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xSizeFontCTL.executeAction("TYPE", mkPropertyValues({"TEXT":"18"})) #set font size 18
+ select_pos(xLangFont, "0")
+ select_pos(xLangFontEast, "0")
+ select_pos(xLangFontCTL, "0")
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+
+ #Verify - select cell A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1") #tab Font
+ xSizeFont = xDialog.getChild("westsizelb-cjk")
+ xSizeFontEast = xDialog.getChild("eastsizelb")
+ xSizeFontCTL = xDialog.getChild("ctlsizelb")
+ xLangFont = xDialog.getChild("westlanglb-cjk")
+ xLangFontEast = xDialog.getChild("eastlanglb")
+ xLangFontCTL = xDialog.getChild("ctllanglb")
+
+ self.assertEqual(get_state_as_dict(xSizeFont)["Text"], "18 pt")
+ self.assertEqual(get_state_as_dict(xSizeFontEast)["Text"], "18 pt")
+ self.assertEqual(get_state_as_dict(xSizeFontCTL)["Text"], "18 pt") #check font size
+ self.assertEqual(get_state_as_dict(xLangFont)["Text"], "[None]")
+ self.assertEqual(get_state_as_dict(xLangFontEast)["SelectEntryText"], "[None]")
+ self.assertEqual(get_state_as_dict(xLangFontCTL)["SelectEntryText"], "[None]")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
def test_format_cell_font_effects_tab(self):
#numberingformatpage.ui
- 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 A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2") #tab Font Effects
- xRelief = xDialog.getChild("relieflb")
- xOverline = xDialog.getChild("overlinelb")
- xStrikeout = xDialog.getChild("strikeoutlb")
- xUnderline = xDialog.getChild("underlinelb")
- xEmphasis = xDialog.getChild("emphasislb")
- xPosition = xDialog.getChild("positionlb")
-
- select_pos(xRelief, "1")
- select_pos(xOverline, "1")
- select_pos(xStrikeout, "1")
- select_pos(xUnderline, "1")
- select_pos(xEmphasis, "1")
- select_pos(xPosition, "1")
-
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
- #Verify- select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
-
- xRelief = xDialog.getChild("relieflb")
- xOverline = xDialog.getChild("overlinelb")
- xStrikeout = xDialog.getChild("strikeoutlb")
- xUnderline = xDialog.getChild("underlinelb")
- xEmphasis = xDialog.getChild("emphasislb")
- xPosition = xDialog.getChild("positionlb")
-
- self.assertEqual(get_state_as_dict(xRelief)["SelectEntryText"], "Embossed")
- self.assertEqual(get_state_as_dict(xOverline)["SelectEntryText"], "Single")
- self.assertEqual(get_state_as_dict(xStrikeout)["SelectEntryText"], "Single")
- self.assertEqual(get_state_as_dict(xUnderline)["SelectEntryText"], "Single")
- self.assertEqual(get_state_as_dict(xEmphasis)["SelectEntryText"], "Dot")
- self.assertEqual(get_state_as_dict(xPosition)["SelectEntryText"], "Below text")
-
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
-
- self.ui_test.close_doc()
+ with 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 A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2") #tab Font Effects
+ xRelief = xDialog.getChild("relieflb")
+ xOverline = xDialog.getChild("overlinelb")
+ xStrikeout = xDialog.getChild("strikeoutlb")
+ xUnderline = xDialog.getChild("underlinelb")
+ xEmphasis = xDialog.getChild("emphasislb")
+ xPosition = xDialog.getChild("positionlb")
+
+ select_pos(xRelief, "1")
+ select_pos(xOverline, "1")
+ select_pos(xStrikeout, "1")
+ select_pos(xUnderline, "1")
+ select_pos(xEmphasis, "1")
+ select_pos(xPosition, "1")
+
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+ #Verify- select cell A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+
+ xRelief = xDialog.getChild("relieflb")
+ xOverline = xDialog.getChild("overlinelb")
+ xStrikeout = xDialog.getChild("strikeoutlb")
+ xUnderline = xDialog.getChild("underlinelb")
+ xEmphasis = xDialog.getChild("emphasislb")
+ xPosition = xDialog.getChild("positionlb")
+
+ self.assertEqual(get_state_as_dict(xRelief)["SelectEntryText"], "Embossed")
+ self.assertEqual(get_state_as_dict(xOverline)["SelectEntryText"], "Single")
+ self.assertEqual(get_state_as_dict(xStrikeout)["SelectEntryText"], "Single")
+ self.assertEqual(get_state_as_dict(xUnderline)["SelectEntryText"], "Single")
+ self.assertEqual(get_state_as_dict(xEmphasis)["SelectEntryText"], "Dot")
+ self.assertEqual(get_state_as_dict(xPosition)["SelectEntryText"], "Below text")
+
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
def test_format_cell_alignment_tab(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()
- #select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "3") #tab Alignment
- comboboxHorzAlign = xDialog.getChild("comboboxHorzAlign")
- xspinIndentFrom = xDialog.getChild("spinIndentFrom")
- xcomboboxVertAlign = xDialog.getChild("comboboxVertAlign")
- xcheckVertStack = xDialog.getChild("checkVertStack")
- xcheckWrapTextAuto = xDialog.getChild("checkWrapTextAuto")
- xcheckHyphActive = xDialog.getChild("checkHyphActive")
- xcomboTextDirBox = xDialog.getChild("comboTextDirBox")
-
- select_by_text(comboboxHorzAlign, "Left")
- xspinIndentFrom.executeAction("UP", tuple())
- indentVal = get_state_as_dict(xspinIndentFrom)["Text"]
- select_by_text(xcomboboxVertAlign, "Top")
- xcheckVertStack.executeAction("CLICK", tuple())
- xcheckWrapTextAuto.executeAction("CLICK", tuple())
- xcheckHyphActive.executeAction("CLICK", tuple())
- select_by_text(xcomboTextDirBox, "Left-to-right (LTR)")
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
- #Verify- select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "3")
- comboboxHorzAlign = xDialog.getChild("comboboxHorzAlign")
- xspinIndentFrom = xDialog.getChild("spinIndentFrom")
- xcomboboxVertAlign = xDialog.getChild("comboboxVertAlign")
- xcheckVertStack = xDialog.getChild("checkVertStack")
- xcheckWrapTextAuto = xDialog.getChild("checkWrapTextAuto")
- xcheckHyphActive = xDialog.getChild("checkHyphActive")
- xcomboTextDirBox = xDialog.getChild("comboTextDirBox")
-
- self.assertEqual(get_state_as_dict(comboboxHorzAlign)["SelectEntryText"], "Left")
- self.assertEqual(get_state_as_dict(xspinIndentFrom)["Text"] == indentVal, True)
- self.assertEqual(get_state_as_dict(xcomboboxVertAlign)["SelectEntryText"], "Top")
- self.assertEqual(get_state_as_dict(xcheckVertStack)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xcheckWrapTextAuto)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xcheckHyphActive)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xcomboTextDirBox)["SelectEntryText"], "Left-to-right (LTR)")
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with 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 A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3") #tab Alignment
+ comboboxHorzAlign = xDialog.getChild("comboboxHorzAlign")
+ xspinIndentFrom = xDialog.getChild("spinIndentFrom")
+ xcomboboxVertAlign = xDialog.getChild("comboboxVertAlign")
+ xcheckVertStack = xDialog.getChild("checkVertStack")
+ xcheckWrapTextAuto = xDialog.getChild("checkWrapTextAuto")
+ xcheckHyphActive = xDialog.getChild("checkHyphActive")
+ xcomboTextDirBox = xDialog.getChild("comboTextDirBox")
+
+ select_by_text(comboboxHorzAlign, "Left")
+ xspinIndentFrom.executeAction("UP", tuple())
+ indentVal = get_state_as_dict(xspinIndentFrom)["Text"]
+ select_by_text(xcomboboxVertAlign, "Top")
+ xcheckVertStack.executeAction("CLICK", tuple())
+ xcheckWrapTextAuto.executeAction("CLICK", tuple())
+ xcheckHyphActive.executeAction("CLICK", tuple())
+ select_by_text(xcomboTextDirBox, "Left-to-right (LTR)")
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+ #Verify- select cell A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
+ comboboxHorzAlign = xDialog.getChild("comboboxHorzAlign")
+ xspinIndentFrom = xDialog.getChild("spinIndentFrom")
+ xcomboboxVertAlign = xDialog.getChild("comboboxVertAlign")
+ xcheckVertStack = xDialog.getChild("checkVertStack")
+ xcheckWrapTextAuto = xDialog.getChild("checkWrapTextAuto")
+ xcheckHyphActive = xDialog.getChild("checkHyphActive")
+ xcomboTextDirBox = xDialog.getChild("comboTextDirBox")
+
+ self.assertEqual(get_state_as_dict(comboboxHorzAlign)["SelectEntryText"], "Left")
+ self.assertEqual(get_state_as_dict(xspinIndentFrom)["Text"] == indentVal, True)
+ self.assertEqual(get_state_as_dict(xcomboboxVertAlign)["SelectEntryText"], "Top")
+ self.assertEqual(get_state_as_dict(xcheckVertStack)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xcheckWrapTextAuto)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xcheckHyphActive)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xcomboTextDirBox)["SelectEntryText"], "Left-to-right (LTR)")
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
def test_format_cell_asian_typography_tab(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()
- #select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4") #tab Asian typography
- xcheckForbidList = xDialog.getChild("checkForbidList")
- xcheckForbidList.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
- #Verify- select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "4")
- xcheckForbidList = xDialog.getChild("checkForbidList")
- self.assertEqual(get_state_as_dict(xcheckForbidList)["Selected"], "true")
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with 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 A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4") #tab Asian typography
+ xcheckForbidList = xDialog.getChild("checkForbidList")
+ xcheckForbidList.executeAction("CLICK", tuple())
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
+ #Verify- select cell A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+ xcheckForbidList = xDialog.getChild("checkForbidList")
+ self.assertEqual(get_state_as_dict(xcheckForbidList)["Selected"], "true")
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
def test_minimal_border_width(self):
#borderpage.ui, tdf#137790
- 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()
-
- #set points pt measurement
- change_measurement_unit(self, "Point")
-
- #select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5") #tab Borders
-
- linewidthmf = xDialog.getChild("linewidthmf")
- xLineSet = xDialog.getChild('lineset')
-
- # check line-width for default solid line
- self.assertEqual('0', get_state_as_dict(xLineSet)['SelectedItemPos'])
- widthVal = get_state_as_dict(linewidthmf)["Text"]
- self.assertEqual(widthVal, '0.75 pt')
-
- # set line style to "double" (minimal width is taken)
- xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": '16'}))
- widthVal = get_state_as_dict(linewidthmf)["Text"]
- self.assertEqual(widthVal, '1.10 pt')
-
- # set line style to "solid"
- xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
- widthVal = get_state_as_dict(linewidthmf)["Text"]
- self.assertEqual(widthVal, '0.75 pt')
-
- # make custom line width
- linewidthmf.executeAction("UP", tuple())
- linewidthmf.executeAction("UP", tuple())
- linewidthmf.executeAction("UP", tuple())
- widthVal = get_state_as_dict(linewidthmf)["Text"]
- self.assertEqual(widthVal, '1.50 pt')
-
- # set line style to "double" (minimal width is not taken)
- xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": "8"}))
- widthVal = get_state_as_dict(linewidthmf)["Text"]
- self.assertEqual(widthVal, '1.50 pt')
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ #set points pt measurement
+ change_measurement_unit(self, "Point")
+
+ #select cell A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5") #tab Borders
+
+ linewidthmf = xDialog.getChild("linewidthmf")
+ xLineSet = xDialog.getChild('lineset')
+
+ # check line-width for default solid line
+ self.assertEqual('0', get_state_as_dict(xLineSet)['SelectedItemPos'])
+ widthVal = get_state_as_dict(linewidthmf)["Text"]
+ self.assertEqual(widthVal, '0.75 pt')
+
+ # set line style to "double" (minimal width is taken)
+ xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": '16'}))
+ widthVal = get_state_as_dict(linewidthmf)["Text"]
+ self.assertEqual(widthVal, '1.10 pt')
+
+ # set line style to "solid"
+ xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
+ widthVal = get_state_as_dict(linewidthmf)["Text"]
+ self.assertEqual(widthVal, '0.75 pt')
+
+ # make custom line width
+ linewidthmf.executeAction("UP", tuple())
+ linewidthmf.executeAction("UP", tuple())
+ linewidthmf.executeAction("UP", tuple())
+ widthVal = get_state_as_dict(linewidthmf)["Text"]
+ self.assertEqual(widthVal, '1.50 pt')
+
+ # set line style to "double" (minimal width is not taken)
+ xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": "8"}))
+ widthVal = get_state_as_dict(linewidthmf)["Text"]
+ self.assertEqual(widthVal, '1.50 pt')
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
def test_format_cell_borders_tab(self):
#borderpage.ui
- 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()
-
- #set points pt measurement
- change_measurement_unit(self, "Point")
-
- #select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5") #tab Borders
- xsync = xDialog.getChild("sync")
- xleftmf = xDialog.getChild("leftmf")
- xrightmf = xDialog.getChild("rightmf")
- xtopmf = xDialog.getChild("topmf")
- xbottommf = xDialog.getChild("bottommf")
-
- xsync.executeAction("CLICK", tuple()) #uncheck Synchronize
- xleftmf.executeAction("UP", tuple())
- xrightmf.executeAction("UP", tuple())
- xrightmf.executeAction("UP", tuple())
- xtopmf.executeAction("UP", tuple())
- xtopmf.executeAction("UP", tuple())
- xtopmf.executeAction("UP", tuple())
- xbottommf.executeAction("UP", tuple())
- xbottommf.executeAction("UP", tuple())
- xbottommf.executeAction("UP", tuple())
- xbottommf.executeAction("UP", tuple())
-
- leftVal = get_state_as_dict(xleftmf)["Text"]
- rightVal = get_state_as_dict(xrightmf)["Text"]
- topVal = get_state_as_dict(xtopmf)["Text"]
- bottomVal = get_state_as_dict(xbottommf)["Text"]
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- # Verify select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5") #tab Borders
- xsync = xDialog.getChild("sync")
- xleftmf = xDialog.getChild("leftmf")
- xrightmf = xDialog.getChild("rightmf")
- xtopmf = xDialog.getChild("topmf")
- xbottommf = xDialog.getChild("bottommf")
-
- self.assertEqual(get_state_as_dict(xsync)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xleftmf)["Text"] == leftVal, True)
- self.assertEqual(get_state_as_dict(xrightmf)["Text"] == rightVal, True)
- self.assertEqual(get_state_as_dict(xtopmf)["Text"] == topVal, True)
- self.assertEqual(get_state_as_dict(xbottommf)["Text"] == bottomVal, True)
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ #set points pt measurement
+ change_measurement_unit(self, "Point")
+
+ #select cell A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5") #tab Borders
+ xsync = xDialog.getChild("sync")
+ xleftmf = xDialog.getChild("leftmf")
+ xrightmf = xDialog.getChild("rightmf")
+ xtopmf = xDialog.getChild("topmf")
+ xbottommf = xDialog.getChild("bottommf")
+
+ xsync.executeAction("CLICK", tuple()) #uncheck Synchronize
+ xleftmf.executeAction("UP", tuple())
+ xrightmf.executeAction("UP", tuple())
+ xrightmf.executeAction("UP", tuple())
+ xtopmf.executeAction("UP", tuple())
+ xtopmf.executeAction("UP", tuple())
+ xtopmf.executeAction("UP", tuple())
+ xbottommf.executeAction("UP", tuple())
+ xbottommf.executeAction("UP", tuple())
+ xbottommf.executeAction("UP", tuple())
+ xbottommf.executeAction("UP", tuple())
+
+ leftVal = get_state_as_dict(xleftmf)["Text"]
+ rightVal = get_state_as_dict(xrightmf)["Text"]
+ topVal = get_state_as_dict(xtopmf)["Text"]
+ bottomVal = get_state_as_dict(xbottommf)["Text"]
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ # Verify select cell A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5") #tab Borders
+ xsync = xDialog.getChild("sync")
+ xleftmf = xDialog.getChild("leftmf")
+ xrightmf = xDialog.getChild("rightmf")
+ xtopmf = xDialog.getChild("topmf")
+ xbottommf = xDialog.getChild("bottommf")
+
+ self.assertEqual(get_state_as_dict(xsync)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xleftmf)["Text"] == leftVal, True)
+ self.assertEqual(get_state_as_dict(xrightmf)["Text"] == rightVal, True)
+ self.assertEqual(get_state_as_dict(xtopmf)["Text"] == topVal, True)
+ self.assertEqual(get_state_as_dict(xbottommf)["Text"] == bottomVal, True)
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
def test_format_cell_cell_protection_tab(self):
#cellprotectionpage.ui
- 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 A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "6") #tab Cell protection
- xcheckHideFormula = xDialog.getChild("checkHideFormula")
- xcheckHideAll = xDialog.getChild("checkHideAll")
- xcheckHidePrinting = xDialog.getChild("checkHidePrinting")
-
- xcheckHideFormula.executeAction("CLICK", tuple())
- xcheckHideAll.executeAction("CLICK", tuple())
- xcheckHidePrinting.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- # Verify select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "6") #tab Borders
- xcheckHideFormula = xDialog.getChild("checkHideFormula")
- xcheckHideAll = xDialog.getChild("checkHideAll")
- xcheckHidePrinting = xDialog.getChild("checkHidePrinting")
-
- self.assertEqual(get_state_as_dict(xcheckHideFormula)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xcheckHideAll)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xcheckHidePrinting)["Selected"], "false")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with 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 A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "6") #tab Cell protection
+ xcheckHideFormula = xDialog.getChild("checkHideFormula")
+ xcheckHideAll = xDialog.getChild("checkHideAll")
+ xcheckHidePrinting = xDialog.getChild("checkHidePrinting")
+
+ xcheckHideFormula.executeAction("CLICK", tuple())
+ xcheckHideAll.executeAction("CLICK", tuple())
+ xcheckHidePrinting.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ # Verify select cell A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "6") #tab Borders
+ xcheckHideFormula = xDialog.getChild("checkHideFormula")
+ xcheckHideAll = xDialog.getChild("checkHideAll")
+ xcheckHidePrinting = xDialog.getChild("checkHidePrinting")
+
+ self.assertEqual(get_state_as_dict(xcheckHideFormula)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xcheckHideAll)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xcheckHidePrinting)["Selected"], "false")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
def test_tdf130762(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()
- #select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "3") #tab Alignment
- xspinDegrees = xDialog.getChild("spinDegrees")
- self.assertEqual(get_state_as_dict(xspinDegrees)["Text"].replace('°', ''), "0")
- xspinDegrees.executeAction("DOWN", tuple())
- self.assertEqual(get_state_as_dict(xspinDegrees)["Text"].replace('°', ''), "355")
- xspinDegrees.executeAction("UP", tuple())
- self.assertEqual(get_state_as_dict(xspinDegrees)["Text"].replace('°', ''), "0")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with 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 A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3") #tab Alignment
+ xspinDegrees = xDialog.getChild("spinDegrees")
+ self.assertEqual(get_state_as_dict(xspinDegrees)["Text"].replace('°', ''), "0")
+ xspinDegrees.executeAction("DOWN", tuple())
+ self.assertEqual(get_state_as_dict(xspinDegrees)["Text"].replace('°', ''), "355")
+ xspinDegrees.executeAction("UP", tuple())
+ self.assertEqual(get_state_as_dict(xspinDegrees)["Text"].replace('°', ''), "0")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/mergedRowsColumns.py b/sc/qa/uitest/calc_tests/mergedRowsColumns.py
index 2bc225d1f84d..297bfccda421 100644
--- a/sc/qa/uitest/calc_tests/mergedRowsColumns.py
+++ b/sc/qa/uitest/calc_tests/mergedRowsColumns.py
@@ -180,18 +180,17 @@ class mergedRowsColumns(UITestCase):
self.xUITest.executeCommand(".uno:Undo")
def test_move_merged_cells(self):
- self.ui_test.create_doc_in_start_center("calc")
- xTopWindow = self.xUITest.getTopFocusWindow()
- gridwin = xTopWindow.getChild("grid_window")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:C1"}))
- self.xUITest.executeCommand(".uno:ToggleMergeCells")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
- self.xUITest.executeCommand(".uno:GoLeft")
- self.xUITest.executeCommand(".uno:GoLeft")
- self.assertEqual(get_state_as_dict(gridwin)["CurrentColumn"], "0")
- self.assertEqual(get_state_as_dict(gridwin)["CurrentRow"], "0") #position A1
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xTopWindow = self.xUITest.getTopFocusWindow()
+ gridwin = xTopWindow.getChild("grid_window")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:C1"}))
+ self.xUITest.executeCommand(".uno:ToggleMergeCells")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ self.xUITest.executeCommand(".uno:GoLeft")
+ self.xUITest.executeCommand(".uno:GoLeft")
+ self.assertEqual(get_state_as_dict(gridwin)["CurrentColumn"], "0")
+ self.assertEqual(get_state_as_dict(gridwin)["CurrentRow"], "0") #position A1
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/printRange.py b/sc/qa/uitest/calc_tests/printRange.py
index a08262595035..143c94658ea3 100644
--- a/sc/qa/uitest/calc_tests/printRange.py
+++ b/sc/qa/uitest/calc_tests/printRange.py
@@ -10,105 +10,102 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class printRange(UITestCase):
def test_printRange(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("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:F20"}))
- #Set print range
- self.xUITest.executeCommand(".uno:DefinePrintArea")
- # Print Range dialog
- self.ui_test.execute_modeless_dialog_through_command(".uno:EditPrintArea")
- xDialog = self.xUITest.getTopFocusWindow()
- xlbprintarea = xDialog.getChild("lbprintarea")
- xedprintarea = xDialog.getChild("edprintarea")
- #verify range
- self.assertEqual(get_state_as_dict(xlbprintarea)["SelectEntryText"], "- selection -")
- self.assertEqual(get_state_as_dict(xedprintarea)["Text"], "$A$1:$F$20")
- #set Row
- xedrepeatrow = xDialog.getChild("edrepeatrow")
- xedrepeatrow.executeAction("TYPE", mkPropertyValues({"TEXT":"$1"}))
- #set Column
- xedrepeatcol = xDialog.getChild("edrepeatcol")
- xedrepeatcol.executeAction("TYPE", mkPropertyValues({"TEXT":"$A"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:F20"}))
+ #Set print range
+ self.xUITest.executeCommand(".uno:DefinePrintArea")
+ # Print Range dialog
+ self.ui_test.execute_modeless_dialog_through_command(".uno:EditPrintArea")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xlbprintarea = xDialog.getChild("lbprintarea")
+ xedprintarea = xDialog.getChild("edprintarea")
+ #verify range
+ self.assertEqual(get_state_as_dict(xlbprintarea)["SelectEntryText"], "- selection -")
+ self.assertEqual(get_state_as_dict(xedprintarea)["Text"], "$A$1:$F$20")
+ #set Row
+ xedrepeatrow = xDialog.getChild("edrepeatrow")
+ xedrepeatrow.executeAction("TYPE", mkPropertyValues({"TEXT":"$1"}))
+ #set Column
+ xedrepeatcol = xDialog.getChild("edrepeatcol")
+ xedrepeatcol.executeAction("TYPE", mkPropertyValues({"TEXT":"$A"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- #Verify Print Range dialog
- self.ui_test.execute_modeless_dialog_through_command(".uno:EditPrintArea")
- xDialog = self.xUITest.getTopFocusWindow()
- xedprintarea = xDialog.getChild("edprintarea")
- xedrepeatrow = xDialog.getChild("edrepeatrow")
- xedrepeatcol = xDialog.getChild("edrepeatcol")
- self.assertEqual(get_state_as_dict(xedprintarea)["Text"], "$A$1:$F$20")
- self.assertEqual(get_state_as_dict(xedrepeatrow)["Text"], "$1")
- self.assertEqual(get_state_as_dict(xedrepeatcol)["Text"], "$A")
- xCancel = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancel)
+ #Verify Print Range dialog
+ self.ui_test.execute_modeless_dialog_through_command(".uno:EditPrintArea")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xedprintarea = xDialog.getChild("edprintarea")
+ xedrepeatrow = xDialog.getChild("edrepeatrow")
+ xedrepeatcol = xDialog.getChild("edrepeatcol")
+ self.assertEqual(get_state_as_dict(xedprintarea)["Text"], "$A$1:$F$20")
+ self.assertEqual(get_state_as_dict(xedrepeatrow)["Text"], "$1")
+ self.assertEqual(get_state_as_dict(xedrepeatcol)["Text"], "$A")
+ xCancel = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancel)
- #delete print ranges
- self.xUITest.executeCommand(".uno:DeletePrintArea")
- #Verify Print Range dialog
- self.ui_test.execute_modeless_dialog_through_command(".uno:EditPrintArea")
- xDialog = self.xUITest.getTopFocusWindow()
- xedprintarea = xDialog.getChild("edprintarea")
- xlbprintarea = xDialog.getChild("lbprintarea")
- xedrepeatrow = xDialog.getChild("edrepeatrow")
- xedrepeatcol = xDialog.getChild("edrepeatcol")
- self.assertEqual(get_state_as_dict(xedprintarea)["Text"], "")
- self.assertEqual(get_state_as_dict(xlbprintarea)["SelectEntryText"], "- entire sheet -")
- self.assertEqual(get_state_as_dict(xedrepeatrow)["Text"], "$1")
- self.assertEqual(get_state_as_dict(xedrepeatcol)["Text"], "$A")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- self.ui_test.close_doc()
+ #delete print ranges
+ self.xUITest.executeCommand(".uno:DeletePrintArea")
+ #Verify Print Range dialog
+ self.ui_test.execute_modeless_dialog_through_command(".uno:EditPrintArea")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xedprintarea = xDialog.getChild("edprintarea")
+ xlbprintarea = xDialog.getChild("lbprintarea")
+ xedrepeatrow = xDialog.getChild("edrepeatrow")
+ xedrepeatcol = xDialog.getChild("edrepeatcol")
+ self.assertEqual(get_state_as_dict(xedprintarea)["Text"], "")
+ self.assertEqual(get_state_as_dict(xlbprintarea)["SelectEntryText"], "- entire sheet -")
+ self.assertEqual(get_state_as_dict(xedrepeatrow)["Text"], "$1")
+ self.assertEqual(get_state_as_dict(xedrepeatcol)["Text"], "$A")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
def test_tdf33341_copy_sheet_with_print_range(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:F20"}))
- #Set print range
- self.xUITest.executeCommand(".uno:DefinePrintArea")
- # Print Range dialog
- self.ui_test.execute_modeless_dialog_through_command(".uno:EditPrintArea")
- xDialog = self.xUITest.getTopFocusWindow()
- xlbprintarea = xDialog.getChild("lbprintarea")
- xedprintarea = xDialog.getChild("edprintarea")
- #verify range
- self.assertEqual(get_state_as_dict(xlbprintarea)["SelectEntryText"], "- selection -")
- self.assertEqual(get_state_as_dict(xedprintarea)["Text"], "$A$1:$F$20")
- #set Row
- xedrepeatrow = xDialog.getChild("edrepeatrow")
- xedrepeatrow.executeAction("TYPE", mkPropertyValues({"TEXT":"$1"}))
- #set Column
- xedrepeatcol = xDialog.getChild("edrepeatcol")
- xedrepeatcol.executeAction("TYPE", mkPropertyValues({"TEXT":"$A"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:F20"}))
+ #Set print range
+ self.xUITest.executeCommand(".uno:DefinePrintArea")
+ # Print Range dialog
+ self.ui_test.execute_modeless_dialog_through_command(".uno:EditPrintArea")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xlbprintarea = xDialog.getChild("lbprintarea")
+ xedprintarea = xDialog.getChild("edprintarea")
+ #verify range
+ self.assertEqual(get_state_as_dict(xlbprintarea)["SelectEntryText"], "- selection -")
+ self.assertEqual(get_state_as_dict(xedprintarea)["Text"], "$A$1:$F$20")
+ #set Row
+ xedrepeatrow = xDialog.getChild("edrepeatrow")
+ xedrepeatrow.executeAction("TYPE", mkPropertyValues({"TEXT":"$1"}))
+ #set Column
+ xedrepeatcol = xDialog.getChild("edrepeatcol")
+ xedrepeatcol.executeAction("TYPE", mkPropertyValues({"TEXT":"$A"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- #Copy sheet
- self.ui_test.execute_dialog_through_command(".uno:Move")
- xDialog = self.xUITest.getTopFocusWindow()
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #Verify Print Range dialog on new sheet
- self.ui_test.execute_modeless_dialog_through_command(".uno:EditPrintArea")
- xDialog = self.xUITest.getTopFocusWindow()
- xedprintarea = xDialog.getChild("edprintarea")
- xedrepeatrow = xDialog.getChild("edrepeatrow")
- xedrepeatcol = xDialog.getChild("edrepeatcol")
- self.assertEqual(get_state_as_dict(xedprintarea)["Text"], "$A$1:$F$20")
- self.assertEqual(get_state_as_dict(xedrepeatrow)["Text"], "$1")
- self.assertEqual(get_state_as_dict(xedrepeatcol)["Text"], "$A")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
-
- self.ui_test.close_doc()
+ #Copy sheet
+ self.ui_test.execute_dialog_through_command(".uno:Move")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #Verify Print Range dialog on new sheet
+ self.ui_test.execute_modeless_dialog_through_command(".uno:EditPrintArea")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xedprintarea = xDialog.getChild("edprintarea")
+ xedrepeatrow = xDialog.getChild("edrepeatrow")
+ xedrepeatcol = xDialog.getChild("edrepeatcol")
+ self.assertEqual(get_state_as_dict(xedprintarea)["Text"], "$A$1:$F$20")
+ self.assertEqual(get_state_as_dict(xedrepeatrow)["Text"], "$1")
+ self.assertEqual(get_state_as_dict(xedrepeatcol)["Text"], "$A")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/rows.py b/sc/qa/uitest/calc_tests/rows.py
index b5e40fa1e327..2b3d3413521e 100644
--- a/sc/qa/uitest/calc_tests/rows.py
+++ b/sc/qa/uitest/calc_tests/rows.py
@@ -11,221 +11,209 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class CalcRows(UITestCase):
def test_row_height(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()
-
- change_measurement_unit(self, "Centimeter")
-
- #select A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #row height
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- xdefault = xDialog.getChild("default")
- self.assertEqual(get_state_as_dict(xdefault)["Selected"], "true") #default selected
- heightStrOrig = get_state_as_dict(xvalue)["Text"]
- heightVal = heightStrOrig[:4] #default 0.45 cm
- xvalue.executeAction("UP", tuple()) #0.50 cm
- heightStr = get_state_as_dict(xvalue)["Text"]
- heightValNew = heightStr[:4]
- self.assertEqual(get_state_as_dict(xdefault)["Selected"], "false") #default not selected
- self.assertEqual(heightValNew > heightVal, True) #new value is bigger
- xdefault.executeAction("CLICK", tuple()) #click default
- self.assertEqual(get_state_as_dict(xvalue)["Text"] == heightStrOrig, True) #default value set
- #write your own value
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #verify
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xCancel = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancel)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ #select A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #row height
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ xdefault = xDialog.getChild("default")
+ self.assertEqual(get_state_as_dict(xdefault)["Selected"], "true") #default selected
+ heightStrOrig = get_state_as_dict(xvalue)["Text"]
+ heightVal = heightStrOrig[:4] #default 0.45 cm
+ xvalue.executeAction("UP", tuple()) #0.50 cm
+ heightStr = get_state_as_dict(xvalue)["Text"]
+ heightValNew = heightStr[:4]
+ self.assertEqual(get_state_as_dict(xdefault)["Selected"], "false") #default not selected
+ self.assertEqual(heightValNew > heightVal, True) #new value is bigger
+ xdefault.executeAction("CLICK", tuple()) #click default
+ self.assertEqual(get_state_as_dict(xvalue)["Text"] == heightStrOrig, True) #default value set
+ #write your own value
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #verify
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xCancel = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancel)
def test_row_height_two_rows(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- change_measurement_unit(self, "Centimeter")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3", "EXTEND":"1"}))
-
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- xdefault = xDialog.getChild("default")
- #write your own value
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3", "EXTEND":"1"}))
+
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ xdefault = xDialog.getChild("default")
+ #write your own value
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
def test_tdf89140_row_height_copy(self):
#Bug 89140 - Calc row paste doesn't keep row height
- 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()
-
- change_measurement_unit(self, "Centimeter")
-
- #select A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #row height
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #select row 1
- self.xUITest.executeCommand(".uno:SelectRow")
- #copy
- self.xUITest.executeCommand(".uno:Copy")
- #select A3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- #paste
- self.xUITest.executeCommand(".uno:Paste")
- #verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ #select A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #row height
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #select row 1
+ self.xUITest.executeCommand(".uno:SelectRow")
+ #copy
+ self.xUITest.executeCommand(".uno:Copy")
+ #select A3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ #paste
+ self.xUITest.executeCommand(".uno:Paste")
+ #verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
def test_row_hide_show(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()
- #select A3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- self.xUITest.executeCommand(".uno:HideRow") #uno command moves focus one cell down
- #verify A4
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "3")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"UP"}))
- #verify A2 (row 3 is hidden)
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "1")
- #Show hidden row: select A2:A4
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A4"}))
- self.xUITest.executeCommand(".uno:ShowRow")
- #verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A4"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "3")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"UP"}))
- #verify A3 (row 3 is not hidden)
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "2")
-
- self.ui_test.close_doc()
+ with 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 A3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ self.xUITest.executeCommand(".uno:HideRow") #uno command moves focus one cell down
+ #verify A4
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "3")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"UP"}))
+ #verify A2 (row 3 is hidden)
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "1")
+ #Show hidden row: select A2:A4
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A4"}))
+ self.xUITest.executeCommand(".uno:ShowRow")
+ #verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A4"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "3")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"UP"}))
+ #verify A3 (row 3 is not hidden)
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "2")
def test_row_test_move(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()
- #select A3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "2")
- #down
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- #verify A4
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "3")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"UP"}))
- #verify A2
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "2")
-
- self.ui_test.close_doc()
+ with 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 A3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "2")
+ #down
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
+ #verify A4
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "3")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"UP"}))
+ #verify A2
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "2")
def test_row_height_insert_below(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()
-
- change_measurement_unit(self, "Centimeter")
-
- #select A3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- #row height
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #select row 3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- self.xUITest.executeCommand(".uno:SelectRow")
- #insert rows below
- self.xUITest.executeCommand(".uno:InsertRowsAfter")
-
- #verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A4"}))
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ #select A3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ #row height
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvalue.executeAction("TYPE", mkPropertyValues({"TEXT":"1 cm"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #select row 3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ self.xUITest.executeCommand(".uno:SelectRow")
+ #insert rows below
+ self.xUITest.executeCommand(".uno:InsertRowsAfter")
+
+ #verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A4"}))
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ self.assertEqual(get_state_as_dict(xvalue)["Text"], "1.0001 cm")
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/sheetRename.py b/sc/qa/uitest/calc_tests/sheetRename.py
index 0f8478b8454b..e175faccde52 100644
--- a/sc/qa/uitest/calc_tests/sheetRename.py
+++ b/sc/qa/uitest/calc_tests/sheetRename.py
@@ -10,53 +10,49 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class sheetRename(UITestCase):
def test_sheet_rename(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- self.ui_test.execute_dialog_through_command(".uno:RenameTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xname_entry = xDialog.getChild("name_entry")
- xname_entry.executeAction("TYPE", mkPropertyValues({"TEXT":"NewName"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.ui_test.execute_dialog_through_command(".uno:RenameTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xname_entry = xDialog.getChild("name_entry")
- self.assertEqual(get_state_as_dict(xname_entry)["Text"], "NewName")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ self.ui_test.execute_dialog_through_command(".uno:RenameTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xname_entry = xDialog.getChild("name_entry")
+ xname_entry.executeAction("TYPE", mkPropertyValues({"TEXT":"NewName"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.ui_test.execute_dialog_through_command(".uno:RenameTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xname_entry = xDialog.getChild("name_entry")
+ self.assertEqual(get_state_as_dict(xname_entry)["Text"], "NewName")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_sheet_rename_invalid_sheet_name(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- self.ui_test.execute_dialog_through_command(".uno:RenameTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xname_entry = xDialog.getChild("name_entry")
- nameVal = get_state_as_dict(xname_entry)["Text"]
- xname_entry.executeAction("TYPE", mkPropertyValues({"TEXT":"NewName**"}))
- xOKBtn = xDialog.getChild("ok")
-
- with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ())):
- pass
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ self.ui_test.execute_dialog_through_command(".uno:RenameTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xname_entry = xDialog.getChild("name_entry")
+ nameVal = get_state_as_dict(xname_entry)["Text"]
+ xname_entry.executeAction("TYPE", mkPropertyValues({"TEXT":"NewName**"}))
+ xOKBtn = xDialog.getChild("ok")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ())):
+ pass
- #Verify
- self.ui_test.execute_dialog_through_command(".uno:RenameTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xname_entry = xDialog.getChild("name_entry")
- self.assertEqual(get_state_as_dict(xname_entry)["Text"], nameVal)
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
- self.ui_test.close_doc()
+ #Verify
+ self.ui_test.execute_dialog_through_command(".uno:RenameTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xname_entry = xDialog.getChild("name_entry")
+ self.assertEqual(get_state_as_dict(xname_entry)["Text"], nameVal)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
# def test_tdf81431_rename_sheet_clipboard_content_wiped_out(self):
# calc_doc = self.ui_test.create_doc_in_start_center("calc")
@@ -98,5 +94,4 @@ class sheetRename(UITestCase):
# xOKBtn = xDialog.getChild("ok")
# self.ui_test.close_dialog_through_button(xOKBtn)
-# self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/zoom.py b/sc/qa/uitest/calc_tests/zoom.py
index dc4ef64ff5e6..15b94914c095 100644
--- a/sc/qa/uitest/calc_tests/zoom.py
+++ b/sc/qa/uitest/calc_tests/zoom.py
@@ -11,59 +11,57 @@ from uitest.uihelper.common import get_state_as_dict
class calcZoom(UITestCase):
def test_zoom_calc(self):
- MainDoc = self.ui_test.create_doc_in_start_center("calc")
- MainWindow = self.xUITest.getTopFocusWindow()
- gridwin = MainWindow.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "0"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ with self.ui_test.create_doc_in_start_center("calc"):
+ MainWindow = self.xUITest.getTopFocusWindow()
+ gridwin = MainWindow.getChild("grid_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "0"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #Set the Zoom to be 100%
- gridwin.executeAction("SET", mkPropertyValues({"ZOOM": "100"}))
- self.assertEqual(get_state_as_dict(gridwin)["Zoom"], "100")
+ #Set the Zoom to be 100%
+ gridwin.executeAction("SET", mkPropertyValues({"ZOOM": "100"}))
+ self.assertEqual(get_state_as_dict(gridwin)["Zoom"], "100")
- #dialog View-Zoom-Zoom
- self.ui_test.execute_dialog_through_command(".uno:Zoom")
- xDialog = self.xUITest.getTopFocusWindow()
+ #dialog View-Zoom-Zoom
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
- #select fit weight & height - OK - open and verify
- fitwandh = xDialog.getChild("fitwandh")
- fitwandh.executeAction("CLICK",tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ #select fit weight & height - OK - open and verify
+ fitwandh = xDialog.getChild("fitwandh")
+ fitwandh.executeAction("CLICK",tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.execute_dialog_through_command(".uno:Zoom")
- xDialog = self.xUITest.getTopFocusWindow()
- #select fit weight - OK - open and verify
- fitw = xDialog.getChild("fitw")
- fitw.executeAction("CLICK",tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #select fit weight - OK - open and verify
+ fitw = xDialog.getChild("fitw")
+ fitw.executeAction("CLICK",tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.execute_dialog_through_command(".uno:Zoom")
- xDialog = self.xUITest.getTopFocusWindow()
- #select 100% & Automatic - OK - open and verify
- x100pc = xDialog.getChild("100pc")
- x100pc.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- self.assertEqual(get_state_as_dict(gridwin)["Zoom"], "100")
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #select 100% & Automatic - OK - open and verify
+ x100pc = xDialog.getChild("100pc")
+ x100pc.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ self.assertEqual(get_state_as_dict(gridwin)["Zoom"], "100")
- #Set the Zoom to be 103%
- gridwin.executeAction("SET", mkPropertyValues({"ZOOM": "103"}))
- self.assertEqual(get_state_as_dict(gridwin)["Zoom"], "103")
+ #Set the Zoom to be 103%
+ gridwin.executeAction("SET", mkPropertyValues({"ZOOM": "103"}))
+ self.assertEqual(get_state_as_dict(gridwin)["Zoom"], "103")
- self.ui_test.execute_dialog_through_command(".uno:Zoom")
- xDialog = self.xUITest.getTopFocusWindow()
- #select variable option and make zoom 100% again - OK - open and verify
- zoomsb = xDialog.getChild("zoomsb")
- self.assertEqual(get_state_as_dict(zoomsb)["Text"], "103%")
- zoomsb.executeAction("DOWN",tuple())
- zoomsb.executeAction("DOWN",tuple())
- zoomsb.executeAction("DOWN",tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- self.assertEqual(get_state_as_dict(gridwin)["Zoom"], "100")
-
- self.ui_test.close_doc()
+ self.ui_test.execute_dialog_through_command(".uno:Zoom")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #select variable option and make zoom 100% again - OK - open and verify
+ zoomsb = xDialog.getChild("zoomsb")
+ self.assertEqual(get_state_as_dict(zoomsb)["Text"], "103%")
+ zoomsb.executeAction("DOWN",tuple())
+ zoomsb.executeAction("DOWN",tuple())
+ zoomsb.executeAction("DOWN",tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ self.assertEqual(get_state_as_dict(gridwin)["Zoom"], "100")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests2/dataform.py b/sc/qa/uitest/calc_tests2/dataform.py
index fedbebc3cd52..94634025265a 100644
--- a/sc/qa/uitest/calc_tests2/dataform.py
+++ b/sc/qa/uitest/calc_tests2/dataform.py
@@ -9,17 +9,16 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class dataform(UITestCase):
def test_dataform(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A10"}))
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A10"}))
- self.ui_test.execute_dialog_through_command(".uno:DataForm")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:DataForm")
+ xDialog = self.xUITest.getTopFocusWindow()
- xCloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
- self.ui_test.close_doc()
+ xCloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests2/standardFilter.py b/sc/qa/uitest/calc_tests2/standardFilter.py
index 25b6373c7e42..bd73c7aacf52 100644
--- a/sc/qa/uitest/calc_tests2/standardFilter.py
+++ b/sc/qa/uitest/calc_tests2/standardFilter.py
@@ -136,554 +136,541 @@ class standardFilter(UITestCase):
self.assertEqual(get_cell_by_position(document, 1, 7, 2).getValue(), 4)
def test_standard_filter_case_sensitive(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- enter_text_to_cell(gridwin, "A1", "first")
- enter_text_to_cell(gridwin, "B1", "second")
- enter_text_to_cell(gridwin, "A2", "a1")
- enter_text_to_cell(gridwin, "A3", "A1")
- enter_text_to_cell(gridwin, "A4", "A1")
- 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"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcase = xDialog.getChild("case")
-
- select_by_text(xfield1, "first")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"a1"}))
- xcase.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #2x down - should be on row 5
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "4")
- #reopen filter and verify
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcase = xDialog.getChild("case")
-
- self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "first")
- self.assertEqual(get_state_as_dict(xval1)["Text"], "a1")
- self.assertEqual(get_state_as_dict(xcase)["Selected"], "true")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.close_doc()
+ with 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", "first")
+ enter_text_to_cell(gridwin, "B1", "second")
+ enter_text_to_cell(gridwin, "A2", "a1")
+ enter_text_to_cell(gridwin, "A3", "A1")
+ enter_text_to_cell(gridwin, "A4", "A1")
+ 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"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcase = xDialog.getChild("case")
+
+ select_by_text(xfield1, "first")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"a1"}))
+ xcase.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #2x down - should be on row 5
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "4")
+ #reopen filter and verify
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcase = xDialog.getChild("case")
+
+ self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "first")
+ self.assertEqual(get_state_as_dict(xval1)["Text"], "a1")
+ self.assertEqual(get_state_as_dict(xcase)["Selected"], "true")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
def test_standard_filter_regular_expression(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", "first")
- enter_text_to_cell(gridwin, "B1", "second")
- enter_text_to_cell(gridwin, "A2", "aa")
- enter_text_to_cell(gridwin, "A3", "aaa")
- enter_text_to_cell(gridwin, "A4", "abbb")
- enter_text_to_cell(gridwin, "A5", "accc")
- enter_text_to_cell(gridwin, "A6", "a*")
- enter_text_to_cell(gridwin, "B2", "1")
- enter_text_to_cell(gridwin, "B3", "2")
- enter_text_to_cell(gridwin, "B4", "3")
- enter_text_to_cell(gridwin, "B5", "4")
- enter_text_to_cell(gridwin, "B6", "5")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B6"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xregexp = xDialog.getChild("regexp")
-
- select_by_text(xfield1, "first")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"a*"}))
- xregexp.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #3x down - should be on row 7
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "6")
- #reopen filter and verify
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xregexp = xDialog.getChild("regexp")
-
- self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "first")
- self.assertEqual(get_state_as_dict(xval1)["Text"], "a*")
- self.assertEqual(get_state_as_dict(xregexp)["Selected"], "true")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.close_doc()
+ with 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", "first")
+ enter_text_to_cell(gridwin, "B1", "second")
+ enter_text_to_cell(gridwin, "A2", "aa")
+ enter_text_to_cell(gridwin, "A3", "aaa")
+ enter_text_to_cell(gridwin, "A4", "abbb")
+ enter_text_to_cell(gridwin, "A5", "accc")
+ enter_text_to_cell(gridwin, "A6", "a*")
+ enter_text_to_cell(gridwin, "B2", "1")
+ enter_text_to_cell(gridwin, "B3", "2")
+ enter_text_to_cell(gridwin, "B4", "3")
+ enter_text_to_cell(gridwin, "B5", "4")
+ enter_text_to_cell(gridwin, "B6", "5")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B6"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xregexp = xDialog.getChild("regexp")
+
+ select_by_text(xfield1, "first")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"a*"}))
+ xregexp.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #3x down - should be on row 7
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "6")
+ #reopen filter and verify
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xregexp = xDialog.getChild("regexp")
+
+ self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "first")
+ self.assertEqual(get_state_as_dict(xval1)["Text"], "a*")
+ self.assertEqual(get_state_as_dict(xregexp)["Selected"], "true")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
def test_standard_filter_condition_contains(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", "first")
- enter_text_to_cell(gridwin, "B1", "second")
- enter_text_to_cell(gridwin, "A2", "aa")
- enter_text_to_cell(gridwin, "A3", "aaa")
- enter_text_to_cell(gridwin, "A4", "abbb")
- enter_text_to_cell(gridwin, "A5", "accc")
- enter_text_to_cell(gridwin, "A6", "a*")
- enter_text_to_cell(gridwin, "B2", "1")
- enter_text_to_cell(gridwin, "B3", "2")
- enter_text_to_cell(gridwin, "B4", "3")
- enter_text_to_cell(gridwin, "B5", "4")
- enter_text_to_cell(gridwin, "B6", "5")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B6"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xregexp = xDialog.getChild("regexp")
-
- select_by_text(xfield1, "first")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"a*"}))
- xregexp.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #3x down - should be on row 7
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "6")
- #reopen filter and verify
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xregexp = xDialog.getChild("regexp")
-
- self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "first")
- self.assertEqual(get_state_as_dict(xval1)["Text"], "a*")
- self.assertEqual(get_state_as_dict(xregexp)["Selected"], "true")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.close_doc()
+ with 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", "first")
+ enter_text_to_cell(gridwin, "B1", "second")
+ enter_text_to_cell(gridwin, "A2", "aa")
+ enter_text_to_cell(gridwin, "A3", "aaa")
+ enter_text_to_cell(gridwin, "A4", "abbb")
+ enter_text_to_cell(gridwin, "A5", "accc")
+ enter_text_to_cell(gridwin, "A6", "a*")
+ enter_text_to_cell(gridwin, "B2", "1")
+ enter_text_to_cell(gridwin, "B3", "2")
+ enter_text_to_cell(gridwin, "B4", "3")
+ enter_text_to_cell(gridwin, "B5", "4")
+ enter_text_to_cell(gridwin, "B6", "5")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B6"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xregexp = xDialog.getChild("regexp")
+
+ select_by_text(xfield1, "first")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"a*"}))
+ xregexp.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #3x down - should be on row 7
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "6")
+ #reopen filter and verify
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xregexp = xDialog.getChild("regexp")
+
+ self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "first")
+ self.assertEqual(get_state_as_dict(xval1)["Text"], "a*")
+ self.assertEqual(get_state_as_dict(xregexp)["Selected"], "true")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
#from testcasespecification OOo
def test_standard_filter_condition_contains2(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", "A")
- enter_text_to_cell(gridwin, "B1", "B")
- enter_text_to_cell(gridwin, "C1", "C")
- enter_text_to_cell(gridwin, "D1", "D")
- enter_text_to_cell(gridwin, "A2", "economics")
- enter_text_to_cell(gridwin, "B2", "34")
- enter_text_to_cell(gridwin, "C2", "67")
- enter_text_to_cell(gridwin, "D2", "122")
- enter_text_to_cell(gridwin, "A3", "socioeconomic")
- enter_text_to_cell(gridwin, "B3", "45")
- enter_text_to_cell(gridwin, "C3", "77")
- enter_text_to_cell(gridwin, "D3", "333")
- enter_text_to_cell(gridwin, "A4", "sociology")
- enter_text_to_cell(gridwin, "B4", "78")
- enter_text_to_cell(gridwin, "C4", "89")
- enter_text_to_cell(gridwin, "D4", "56")
- enter_text_to_cell(gridwin, "A5", "humanities")
- enter_text_to_cell(gridwin, "B5", "45")
- enter_text_to_cell(gridwin, "C5", "67")
- enter_text_to_cell(gridwin, "D5", "89")
- #Select
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
- #Choose DATA-FILTER-STANDARDFILTER
- #Choose field name "A"/ Choose condition "Contains"/Enter value "cio"/Press OK button
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
-
- select_by_text(xfield1, "A")
- select_by_text(xcond1, "Contains")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"cio"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Verify that row 1,3, 4 are visible (2 and 5 are hidden)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "2")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "3")
- #reopen filter and verify
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
- self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
- self.assertEqual(get_state_as_dict(xval1)["Text"], "cio")
- self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Contains")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
- self.ui_test.close_doc()
+ with 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", "A")
+ enter_text_to_cell(gridwin, "B1", "B")
+ enter_text_to_cell(gridwin, "C1", "C")
+ enter_text_to_cell(gridwin, "D1", "D")
+ enter_text_to_cell(gridwin, "A2", "economics")
+ enter_text_to_cell(gridwin, "B2", "34")
+ enter_text_to_cell(gridwin, "C2", "67")
+ enter_text_to_cell(gridwin, "D2", "122")
+ enter_text_to_cell(gridwin, "A3", "socioeconomic")
+ enter_text_to_cell(gridwin, "B3", "45")
+ enter_text_to_cell(gridwin, "C3", "77")
+ enter_text_to_cell(gridwin, "D3", "333")
+ enter_text_to_cell(gridwin, "A4", "sociology")
+ enter_text_to_cell(gridwin, "B4", "78")
+ enter_text_to_cell(gridwin, "C4", "89")
+ enter_text_to_cell(gridwin, "D4", "56")
+ enter_text_to_cell(gridwin, "A5", "humanities")
+ enter_text_to_cell(gridwin, "B5", "45")
+ enter_text_to_cell(gridwin, "C5", "67")
+ enter_text_to_cell(gridwin, "D5", "89")
+ #Select
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
+ #Choose DATA-FILTER-STANDARDFILTER
+ #Choose field name "A"/ Choose condition "Contains"/Enter value "cio"/Press OK button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+
+ select_by_text(xfield1, "A")
+ select_by_text(xcond1, "Contains")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"cio"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Verify that row 1,3, 4 are visible (2 and 5 are hidden)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "2")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "3")
+ #reopen filter and verify
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+ self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
+ self.assertEqual(get_state_as_dict(xval1)["Text"], "cio")
+ self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Contains")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_standard_filter_condition_does_not_contains(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", "A")
- enter_text_to_cell(gridwin, "B1", "B")
- enter_text_to_cell(gridwin, "C1", "C")
- enter_text_to_cell(gridwin, "D1", "D")
- enter_text_to_cell(gridwin, "A2", "economics")
- enter_text_to_cell(gridwin, "B2", "34")
- enter_text_to_cell(gridwin, "C2", "67")
- enter_text_to_cell(gridwin, "D2", "122")
- enter_text_to_cell(gridwin, "A3", "socioeconomic")
- enter_text_to_cell(gridwin, "B3", "45")
- enter_text_to_cell(gridwin, "C3", "77")
- enter_text_to_cell(gridwin, "D3", "333")
- enter_text_to_cell(gridwin, "A4", "sociology")
- enter_text_to_cell(gridwin, "B4", "78")
- enter_text_to_cell(gridwin, "C4", "89")
- enter_text_to_cell(gridwin, "D4", "56")
- enter_text_to_cell(gridwin, "A5", "humanities")
- enter_text_to_cell(gridwin, "B5", "45")
- enter_text_to_cell(gridwin, "C5", "67")
- enter_text_to_cell(gridwin, "D5", "89")
- #Select
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
- #Choose DATA-FILTER-STANDARDFILTER
- #Choose field name "A"/ Choose condition "Does not contain"/Enter value "cio"/Press OK button
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
-
- select_by_text(xfield1, "A")
- select_by_text(xcond1, "Does not contain")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"cio"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Verify that row 1,2, 5 are visible (3 and 4 are hidden)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "1")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "4")
- #reopen filter and verify
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
- self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
- self.assertEqual(get_state_as_dict(xval1)["Text"], "cio")
- self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Does not contain")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with 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", "A")
+ enter_text_to_cell(gridwin, "B1", "B")
+ enter_text_to_cell(gridwin, "C1", "C")
+ enter_text_to_cell(gridwin, "D1", "D")
+ enter_text_to_cell(gridwin, "A2", "economics")
+ enter_text_to_cell(gridwin, "B2", "34")
+ enter_text_to_cell(gridwin, "C2", "67")
+ enter_text_to_cell(gridwin, "D2", "122")
+ enter_text_to_cell(gridwin, "A3", "socioeconomic")
+ enter_text_to_cell(gridwin, "B3", "45")
+ enter_text_to_cell(gridwin, "C3", "77")
+ enter_text_to_cell(gridwin, "D3", "333")
+ enter_text_to_cell(gridwin, "A4", "sociology")
+ enter_text_to_cell(gridwin, "B4", "78")
+ enter_text_to_cell(gridwin, "C4", "89")
+ enter_text_to_cell(gridwin, "D4", "56")
+ enter_text_to_cell(gridwin, "A5", "humanities")
+ enter_text_to_cell(gridwin, "B5", "45")
+ enter_text_to_cell(gridwin, "C5", "67")
+ enter_text_to_cell(gridwin, "D5", "89")
+ #Select
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
+ #Choose DATA-FILTER-STANDARDFILTER
+ #Choose field name "A"/ Choose condition "Does not contain"/Enter value "cio"/Press OK button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+
+ select_by_text(xfield1, "A")
+ select_by_text(xcond1, "Does not contain")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"cio"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Verify that row 1,2, 5 are visible (3 and 4 are hidden)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "1")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "4")
+ #reopen filter and verify
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+ self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
+ self.assertEqual(get_state_as_dict(xval1)["Text"], "cio")
+ self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Does not contain")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_standard_filter_condition_Begins_with(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", "A")
- enter_text_to_cell(gridwin, "B1", "B")
- enter_text_to_cell(gridwin, "C1", "C")
- enter_text_to_cell(gridwin, "D1", "D")
- enter_text_to_cell(gridwin, "A2", "economics")
- enter_text_to_cell(gridwin, "B2", "34")
- enter_text_to_cell(gridwin, "C2", "67")
- enter_text_to_cell(gridwin, "D2", "122")
- enter_text_to_cell(gridwin, "A3", "socioeconomic")
- enter_text_to_cell(gridwin, "B3", "45")
- enter_text_to_cell(gridwin, "C3", "77")
- enter_text_to_cell(gridwin, "D3", "333")
- enter_text_to_cell(gridwin, "A4", "sociology")
- enter_text_to_cell(gridwin, "B4", "78")
- enter_text_to_cell(gridwin, "C4", "89")
- enter_text_to_cell(gridwin, "D4", "56")
- enter_text_to_cell(gridwin, "A5", "humanities")
- enter_text_to_cell(gridwin, "B5", "45")
- enter_text_to_cell(gridwin, "C5", "67")
- enter_text_to_cell(gridwin, "D5", "89")
- #Select
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
- #Choose DATA-FILTER-STANDARDFILTER
- #Choose field name "A"/ Choose condition "Begins with"/Enter value "si"/Press OK button
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
-
- select_by_text(xfield1, "A")
- select_by_text(xcond1, "Begins with")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"so"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Verify that row 1,3, 4 are visible (2 and 5 are hidden)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "2")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "3")
- #reopen filter and verify
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
- self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
- self.assertEqual(get_state_as_dict(xval1)["Text"], "so")
- self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Begins with")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with 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", "A")
+ enter_text_to_cell(gridwin, "B1", "B")
+ enter_text_to_cell(gridwin, "C1", "C")
+ enter_text_to_cell(gridwin, "D1", "D")
+ enter_text_to_cell(gridwin, "A2", "economics")
+ enter_text_to_cell(gridwin, "B2", "34")
+ enter_text_to_cell(gridwin, "C2", "67")
+ enter_text_to_cell(gridwin, "D2", "122")
+ enter_text_to_cell(gridwin, "A3", "socioeconomic")
+ enter_text_to_cell(gridwin, "B3", "45")
+ enter_text_to_cell(gridwin, "C3", "77")
+ enter_text_to_cell(gridwin, "D3", "333")
+ enter_text_to_cell(gridwin, "A4", "sociology")
+ enter_text_to_cell(gridwin, "B4", "78")
+ enter_text_to_cell(gridwin, "C4", "89")
+ enter_text_to_cell(gridwin, "D4", "56")
+ enter_text_to_cell(gridwin, "A5", "humanities")
+ enter_text_to_cell(gridwin, "B5", "45")
+ enter_text_to_cell(gridwin, "C5", "67")
+ enter_text_to_cell(gridwin, "D5", "89")
+ #Select
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
+ #Choose DATA-FILTER-STANDARDFILTER
+ #Choose field name "A"/ Choose condition "Begins with"/Enter value "si"/Press OK button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+
+ select_by_text(xfield1, "A")
+ select_by_text(xcond1, "Begins with")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"so"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Verify that row 1,3, 4 are visible (2 and 5 are hidden)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "2")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "3")
+ #reopen filter and verify
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+ self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
+ self.assertEqual(get_state_as_dict(xval1)["Text"], "so")
+ self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Begins with")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_standard_filter_condition_Does_not_begin_with(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", "A")
- enter_text_to_cell(gridwin, "B1", "B")
- enter_text_to_cell(gridwin, "C1", "C")
- enter_text_to_cell(gridwin, "D1", "D")
- enter_text_to_cell(gridwin, "A2", "economics")
- enter_text_to_cell(gridwin, "B2", "34")
- enter_text_to_cell(gridwin, "C2", "67")
- enter_text_to_cell(gridwin, "D2", "122")
- enter_text_to_cell(gridwin, "A3", "socioeconomic")
- enter_text_to_cell(gridwin, "B3", "45")
- enter_text_to_cell(gridwin, "C3", "77")
- enter_text_to_cell(gridwin, "D3", "333")
- enter_text_to_cell(gridwin, "A4", "sociology")
- enter_text_to_cell(gridwin, "B4", "78")
- enter_text_to_cell(gridwin, "C4", "89")
- enter_text_to_cell(gridwin, "D4", "56")
- enter_text_to_cell(gridwin, "A5", "humanities")
- enter_text_to_cell(gridwin, "B5", "45")
- enter_text_to_cell(gridwin, "C5", "67")
- enter_text_to_cell(gridwin, "D5", "89")
- #Select
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
- #Choose DATA-FILTER-STANDARDFILTER
- #Choose field name "A"/ Choose condition "Does not contain"/Enter value "cio"/Press OK button
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
-
- select_by_text(xfield1, "A")
- select_by_text(xcond1, "Does not begin with")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"so"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Verify that row 1,2, 5 are visible (3 and 4 are hidden)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "1")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "4")
- #reopen filter and verify
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
- self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
- self.assertEqual(get_state_as_dict(xval1)["Text"], "so")
- self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Does not begin with")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with 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", "A")
+ enter_text_to_cell(gridwin, "B1", "B")
+ enter_text_to_cell(gridwin, "C1", "C")
+ enter_text_to_cell(gridwin, "D1", "D")
+ enter_text_to_cell(gridwin, "A2", "economics")
+ enter_text_to_cell(gridwin, "B2", "34")
+ enter_text_to_cell(gridwin, "C2", "67")
+ enter_text_to_cell(gridwin, "D2", "122")
+ enter_text_to_cell(gridwin, "A3", "socioeconomic")
+ enter_text_to_cell(gridwin, "B3", "45")
+ enter_text_to_cell(gridwin, "C3", "77")
+ enter_text_to_cell(gridwin, "D3", "333")
+ enter_text_to_cell(gridwin, "A4", "sociology")
+ enter_text_to_cell(gridwin, "B4", "78")
+ enter_text_to_cell(gridwin, "C4", "89")
+ enter_text_to_cell(gridwin, "D4", "56")
+ enter_text_to_cell(gridwin, "A5", "humanities")
+ enter_text_to_cell(gridwin, "B5", "45")
+ enter_text_to_cell(gridwin, "C5", "67")
+ enter_text_to_cell(gridwin, "D5", "89")
+ #Select
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
+ #Choose DATA-FILTER-STANDARDFILTER
+ #Choose field name "A"/ Choose condition "Does not contain"/Enter value "cio"/Press OK button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+
+ select_by_text(xfield1, "A")
+ select_by_text(xcond1, "Does not begin with")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"so"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Verify that row 1,2, 5 are visible (3 and 4 are hidden)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "1")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "4")
+ #reopen filter and verify
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+ self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
+ self.assertEqual(get_state_as_dict(xval1)["Text"], "so")
+ self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Does not begin with")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_standard_filter_condition_Ends_with(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", "A")
- enter_text_to_cell(gridwin, "B1", "B")
- enter_text_to_cell(gridwin, "C1", "C")
- enter_text_to_cell(gridwin, "D1", "D")
- enter_text_to_cell(gridwin, "A2", "economics")
- enter_text_to_cell(gridwin, "B2", "34")
- enter_text_to_cell(gridwin, "C2", "67")
- enter_text_to_cell(gridwin, "D2", "122")
- enter_text_to_cell(gridwin, "A3", "socioeconomic")
- enter_text_to_cell(gridwin, "B3", "45")
- enter_text_to_cell(gridwin, "C3", "77")
- enter_text_to_cell(gridwin, "D3", "333")
- enter_text_to_cell(gridwin, "A4", "sociology")
- enter_text_to_cell(gridwin, "B4", "78")
- enter_text_to_cell(gridwin, "C4", "89")
- enter_text_to_cell(gridwin, "D4", "56")
- enter_text_to_cell(gridwin, "A5", "humanities")
- enter_text_to_cell(gridwin, "B5", "45")
- enter_text_to_cell(gridwin, "C5", "67")
- enter_text_to_cell(gridwin, "D5", "89")
- #Select
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
- #Choose DATA-FILTER-STANDARDFILTER
- #Choose field name "A"/ Choose condition "Does not contain"/Enter value "cio"/Press OK button
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
-
- select_by_text(xfield1, "A")
- select_by_text(xcond1, "Ends with")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"s"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Verify that row 1,2, 5 are visible (3 and 4 are hidden)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "1")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "4")
- #reopen filter and verify
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
- self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
- self.assertEqual(get_state_as_dict(xval1)["Text"], "s")
- self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Ends with")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with 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", "A")
+ enter_text_to_cell(gridwin, "B1", "B")
+ enter_text_to_cell(gridwin, "C1", "C")
+ enter_text_to_cell(gridwin, "D1", "D")
+ enter_text_to_cell(gridwin, "A2", "economics")
+ enter_text_to_cell(gridwin, "B2", "34")
+ enter_text_to_cell(gridwin, "C2", "67")
+ enter_text_to_cell(gridwin, "D2", "122")
+ enter_text_to_cell(gridwin, "A3", "socioeconomic")
+ enter_text_to_cell(gridwin, "B3", "45")
+ enter_text_to_cell(gridwin, "C3", "77")
+ enter_text_to_cell(gridwin, "D3", "333")
+ enter_text_to_cell(gridwin, "A4", "sociology")
+ enter_text_to_cell(gridwin, "B4", "78")
+ enter_text_to_cell(gridwin, "C4", "89")
+ enter_text_to_cell(gridwin, "D4", "56")
+ enter_text_to_cell(gridwin, "A5", "humanities")
+ enter_text_to_cell(gridwin, "B5", "45")
+ enter_text_to_cell(gridwin, "C5", "67")
+ enter_text_to_cell(gridwin, "D5", "89")
+ #Select
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
+ #Choose DATA-FILTER-STANDARDFILTER
+ #Choose field name "A"/ Choose condition "Does not contain"/Enter value "cio"/Press OK button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+
+ select_by_text(xfield1, "A")
+ select_by_text(xcond1, "Ends with")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"s"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Verify that row 1,2, 5 are visible (3 and 4 are hidden)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "1")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "4")
+ #reopen filter and verify
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+ self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
+ self.assertEqual(get_state_as_dict(xval1)["Text"], "s")
+ self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Ends with")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_standard_filter_condition_Does_not_end_with(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", "A")
- enter_text_to_cell(gridwin, "B1", "B")
- enter_text_to_cell(gridwin, "C1", "C")
- enter_text_to_cell(gridwin, "D1", "D")
- enter_text_to_cell(gridwin, "A2", "economics")
- enter_text_to_cell(gridwin, "B2", "34")
- enter_text_to_cell(gridwin, "C2", "67")
- enter_text_to_cell(gridwin, "D2", "122")
- enter_text_to_cell(gridwin, "A3", "socioeconomic")
- enter_text_to_cell(gridwin, "B3", "45")
- enter_text_to_cell(gridwin, "C3", "77")
- enter_text_to_cell(gridwin, "D3", "333")
- enter_text_to_cell(gridwin, "A4", "sociology")
- enter_text_to_cell(gridwin, "B4", "78")
- enter_text_to_cell(gridwin, "C4", "89")
- enter_text_to_cell(gridwin, "D4", "56")
- enter_text_to_cell(gridwin, "A5", "humanities")
- enter_text_to_cell(gridwin, "B5", "45")
- enter_text_to_cell(gridwin, "C5", "67")
- enter_text_to_cell(gridwin, "D5", "89")
- #Select
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
- #Choose DATA-FILTER-STANDARDFILTER
- #Choose field name "A"/ Choose condition "Begins with"/Enter value "si"/Press OK button
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
-
- select_by_text(xfield1, "A")
- select_by_text(xcond1, "Does not end with")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"s"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Verify that row 1,3, 4 are visible (2 and 5 are hidden)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "2")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["CurrentRow"], "3")
- #reopen filter and verify
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xcond1 = xDialog.getChild("cond1")
- self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
- self.assertEqual(get_state_as_dict(xval1)["Text"], "s")
- self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Does not end with")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with 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", "A")
+ enter_text_to_cell(gridwin, "B1", "B")
+ enter_text_to_cell(gridwin, "C1", "C")
+ enter_text_to_cell(gridwin, "D1", "D")
+ enter_text_to_cell(gridwin, "A2", "economics")
+ enter_text_to_cell(gridwin, "B2", "34")
+ enter_text_to_cell(gridwin, "C2", "67")
+ enter_text_to_cell(gridwin, "D2", "122")
+ enter_text_to_cell(gridwin, "A3", "socioeconomic")
+ enter_text_to_cell(gridwin, "B3", "45")
+ enter_text_to_cell(gridwin, "C3", "77")
+ enter_text_to_cell(gridwin, "D3", "333")
+ enter_text_to_cell(gridwin, "A4", "sociology")
+ enter_text_to_cell(gridwin, "B4", "78")
+ enter_text_to_cell(gridwin, "C4", "89")
+ enter_text_to_cell(gridwin, "D4", "56")
+ enter_text_to_cell(gridwin, "A5", "humanities")
+ enter_text_to_cell(gridwin, "B5", "45")
+ enter_text_to_cell(gridwin, "C5", "67")
+ enter_text_to_cell(gridwin, "D5", "89")
+ #Select
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D5"}))
+ #Choose DATA-FILTER-STANDARDFILTER
+ #Choose field name "A"/ Choose condition "Begins with"/Enter value "si"/Press OK button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+
+ select_by_text(xfield1, "A")
+ select_by_text(xcond1, "Does not end with")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"s"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Verify that row 1,3, 4 are visible (2 and 5 are hidden)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "2")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["CurrentRow"], "3")
+ #reopen filter and verify
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xcond1 = xDialog.getChild("cond1")
+ self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "A")
+ self.assertEqual(get_state_as_dict(xval1)["Text"], "s")
+ self.assertEqual(get_state_as_dict(xcond1)["SelectEntryText"], "Does not end with")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests2/tdf104117.py b/sc/qa/uitest/calc_tests2/tdf104117.py
index a226427311ee..610e133249d6 100644
--- a/sc/qa/uitest/calc_tests2/tdf104117.py
+++ b/sc/qa/uitest/calc_tests2/tdf104117.py
@@ -12,36 +12,35 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
#Bug 104117 - Crash in Calc when selecting "Uniform Integer" with an max value "100000000000000" in "Random Number Generator
class tdf104117(UITestCase):
def test_tdf104117(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xcellrangeedit = xDialog.getChild("cell-range-edit")
- xdistributioncombo = xDialog.getChild("distribution-combo")
- xparameter1spin = xDialog.getChild("parameter1-spin")
- xparameter2spin = xDialog.getChild("parameter2-spin")
- xenableseedcheck = xDialog.getChild("enable-seed-check")
- xseedspin = xDialog.getChild("seed-spin")
- xenableroundingcheck = xDialog.getChild("enable-rounding-check")
- xdecimalplacesspin = xDialog.getChild("decimal-places-spin")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xcellrangeedit = xDialog.getChild("cell-range-edit")
+ xdistributioncombo = xDialog.getChild("distribution-combo")
+ xparameter1spin = xDialog.getChild("parameter1-spin")
+ xparameter2spin = xDialog.getChild("parameter2-spin")
+ xenableseedcheck = xDialog.getChild("enable-seed-check")
+ xseedspin = xDialog.getChild("seed-spin")
+ xenableroundingcheck = xDialog.getChild("enable-rounding-check")
+ xdecimalplacesspin = xDialog.getChild("decimal-places-spin")
- xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$2"}))
- select_by_text(xdistributioncombo, "Uniform Integer")
- xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xparameter2spin.executeAction("TYPE", mkPropertyValues({"TEXT":"1000000000000000000000000000000000000000000000"}))
+ xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$2"}))
+ select_by_text(xdistributioncombo, "Uniform Integer")
+ xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xparameter2spin.executeAction("TYPE", mkPropertyValues({"TEXT":"1000000000000000000000000000000000000000000000"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), True)
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), True)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False)
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False)
- self.ui_test.close_doc()
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), True)
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), True)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False)
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests2/tdf117367.py b/sc/qa/uitest/calc_tests2/tdf117367.py
index 47ee214f14de..86804907f2e6 100644
--- a/sc/qa/uitest/calc_tests2/tdf117367.py
+++ b/sc/qa/uitest/calc_tests2/tdf117367.py
@@ -12,41 +12,39 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf117367(UITestCase):
def test_tdf117367_merge_cells_radio_buttons(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- enter_text_to_cell(gridwin, "A1", "AAA")
- enter_text_to_cell(gridwin, "A2", "BBB")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B4"}))
-
- #Right-click - Merge cells /Select all three options
- self.ui_test.execute_dialog_through_command(".uno:MergeCells")
- xDialog = self.xUITest.getTopFocusWindow()
- xmoveCellsRadio = xDialog.getChild("move-cells-radio")
- xemptyCellsRadio = xDialog.getChild("empty-cells-radio")
- xkeepContentRadio = xDialog.getChild("keep-content-radio")
- xmoveCellsRadio.executeAction("CLICK", tuple())
- xmoveCellsRadio.executeAction("CLICK", tuple())
- #Issue: I think these should be exclusive, not possible to select more than one. It is also impossible to uncheck any of the buttons.
- self.assertEqual(get_state_as_dict(xmoveCellsRadio)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xemptyCellsRadio)["Checked"], "false")
- self.assertEqual(get_state_as_dict(xkeepContentRadio)["Checked"], "false")
-
- xemptyCellsRadio.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(xmoveCellsRadio)["Checked"], "false")
- self.assertEqual(get_state_as_dict(xemptyCellsRadio)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xkeepContentRadio)["Checked"], "false")
-
- xkeepContentRadio.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(xmoveCellsRadio)["Checked"], "false")
- self.assertEqual(get_state_as_dict(xemptyCellsRadio)["Checked"], "false")
- self.assertEqual(get_state_as_dict(xkeepContentRadio)["Checked"], "true")
-
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ enter_text_to_cell(gridwin, "A1", "AAA")
+ enter_text_to_cell(gridwin, "A2", "BBB")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B4"}))
+
+ #Right-click - Merge cells /Select all three options
+ self.ui_test.execute_dialog_through_command(".uno:MergeCells")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xmoveCellsRadio = xDialog.getChild("move-cells-radio")
+ xemptyCellsRadio = xDialog.getChild("empty-cells-radio")
+ xkeepContentRadio = xDialog.getChild("keep-content-radio")
+ xmoveCellsRadio.executeAction("CLICK", tuple())
+ xmoveCellsRadio.executeAction("CLICK", tuple())
+ #Issue: I think these should be exclusive, not possible to select more than one. It is also impossible to uncheck any of the buttons.
+ self.assertEqual(get_state_as_dict(xmoveCellsRadio)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xemptyCellsRadio)["Checked"], "false")
+ self.assertEqual(get_state_as_dict(xkeepContentRadio)["Checked"], "false")
+
+ xemptyCellsRadio.executeAction("CLICK", tuple())
+ self.assertEqual(get_state_as_dict(xmoveCellsRadio)["Checked"], "false")
+ self.assertEqual(get_state_as_dict(xemptyCellsRadio)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xkeepContentRadio)["Checked"], "false")
+
+ xkeepContentRadio.executeAction("CLICK", tuple())
+ self.assertEqual(get_state_as_dict(xmoveCellsRadio)["Checked"], "false")
+ self.assertEqual(get_state_as_dict(xemptyCellsRadio)["Checked"], "false")
+ self.assertEqual(get_state_as_dict(xkeepContentRadio)["Checked"], "true")
+
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests2/tdf120174.py b/sc/qa/uitest/calc_tests2/tdf120174.py
index 752d276c5db5..a5c6efe3e82f 100644
--- a/sc/qa/uitest/calc_tests2/tdf120174.py
+++ b/sc/qa/uitest/calc_tests2/tdf120174.py
@@ -11,20 +11,19 @@ from uitest.uihelper.calc import enter_text_to_cell
class tdf120174(UITestCase):
def test_tdf120174(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", "121")
- enter_text_to_cell(gridwin, "B1", "=A1")
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 121) # B1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- # Delete contents of A1
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"}))
- # Before the fix the result would be still 121.
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 0) # B1
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 121) # B1
- self.ui_test.close_doc()
+ with 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", "121")
+ enter_text_to_cell(gridwin, "B1", "=A1")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 121) # B1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ # Delete contents of A1
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"}))
+ # Before the fix the result would be still 121.
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 0) # B1
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 121) # B1
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests2/tdf126577.py b/sc/qa/uitest/calc_tests2/tdf126577.py
index 2e994aca7fd3..c7f983ac38cd 100644
--- a/sc/qa/uitest/calc_tests2/tdf126577.py
+++ b/sc/qa/uitest/calc_tests2/tdf126577.py
@@ -12,36 +12,34 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf126577(UITestCase):
def test_tdf126577(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("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A20"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A20"}))
- self.ui_test.execute_dialog_through_command(".uno:FillSeries")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:FillSeries")
+ xDialog = self.xUITest.getTopFocusWindow()
- self.assertEqual("true", get_state_as_dict(xDialog.getChild("down"))['Checked'])
- self.assertEqual("true", get_state_as_dict(xDialog.getChild("linear"))['Checked'])
+ self.assertEqual("true", get_state_as_dict(xDialog.getChild("down"))['Checked'])
+ self.assertEqual("true", get_state_as_dict(xDialog.getChild("linear"))['Checked'])
- xStart = xDialog.getChild("startValue")
- xStart.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ xStart = xDialog.getChild("startValue")
+ xStart.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- xEnd = xDialog.getChild("endValue")
- xEnd.executeAction("TYPE", mkPropertyValues({"TEXT":"10"}))
+ xEnd = xDialog.getChild("endValue")
+ xEnd.executeAction("TYPE", mkPropertyValues({"TEXT":"10"}))
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- for i in range(10):
- self.assertEqual(str(i + 1), get_cell_by_position(document, 0, 0, i).getString())
+ for i in range(10):
+ self.assertEqual(str(i + 1), get_cell_by_position(document, 0, 0, i).getString())
- for i in range(10, 20):
- # Without the fix in place, this test would have failed with
- # AssertionError: '' != '#NUM!'
- self.assertEqual("", get_cell_by_position(document, 0, 0, i).getString())
-
- self.ui_test.close_doc()
+ for i in range(10, 20):
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '' != '#NUM!'
+ self.assertEqual("", get_cell_by_position(document, 0, 0, i).getString())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests2/tdf46138.py b/sc/qa/uitest/calc_tests2/tdf46138.py
index 244e1634a1ec..f584490639a7 100644
--- a/sc/qa/uitest/calc_tests2/tdf46138.py
+++ b/sc/qa/uitest/calc_tests2/tdf46138.py
@@ -11,24 +11,23 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf46138(UITestCase):
def test_tdf46138(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()
- #Choose a column,
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:SelectColumn")
- #select 'edit'>'fill'>'series'>Starting Value '1' then "OK",
- self.ui_test.execute_dialog_through_command(".uno:FillSeries")
- xDialog = self.xUITest.getTopFocusWindow()
- xStart = xDialog.getChild("startValue")
- xStart.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "1")
- #then "Ctrl+Z"/ undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Choose a column,
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ #select 'edit'>'fill'>'series'>Starting Value '1' then "OK",
+ self.ui_test.execute_dialog_through_command(".uno:FillSeries")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xStart = xDialog.getChild("startValue")
+ xStart.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "1")
+ #then "Ctrl+Z"/ undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests2/tdf51700.py b/sc/qa/uitest/calc_tests2/tdf51700.py
index 00eadf1469bd..a3fc638ff39d 100644
--- a/sc/qa/uitest/calc_tests2/tdf51700.py
+++ b/sc/qa/uitest/calc_tests2/tdf51700.py
@@ -13,42 +13,40 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf51700(UITestCase):
def test_tdf51700_text_to_columns(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #Add data
- enter_text_to_cell(gridwin, "A2", "3242,43242,3242,2342")
- enter_text_to_cell(gridwin, "A3", "fdsfa,afsdfa,adfdas,fsad")
- enter_text_to_cell(gridwin, "A4", "21312,1111,1111,111")
- #select column A
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:SelectColumn")
- # Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- xcomma = xDialog.getChild("comma")
- if (get_state_as_dict(xcomma)["Selected"]) == "false":
- xcomma.executeAction("CLICK", tuple())
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ #Add data
+ enter_text_to_cell(gridwin, "A2", "3242,43242,3242,2342")
+ enter_text_to_cell(gridwin, "A3", "fdsfa,afsdfa,adfdas,fsad")
+ enter_text_to_cell(gridwin, "A4", "21312,1111,1111,111")
+ #select column A
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ # Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xcomma = xDialog.getChild("comma")
+ if (get_state_as_dict(xcomma)["Selected"]) == "false":
+ xcomma.executeAction("CLICK", tuple())
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 3242)
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "fdsfa")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 21312)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 43242)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "afsdfa")
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1111)
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3242)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "adfdas")
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 1111)
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 2342)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "fsad")
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 111)
-
- self.ui_test.close_doc()
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "fdsfa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 21312)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 43242)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "afsdfa")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "adfdas")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 2342)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "fsad")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 111)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/clearCells.py b/sc/qa/uitest/calc_tests3/clearCells.py
index 7df66ef7f93f..ad45f5a6f829 100644
--- a/sc/qa/uitest/calc_tests3/clearCells.py
+++ b/sc/qa/uitest/calc_tests3/clearCells.py
@@ -14,295 +14,283 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
#+ Bug 101904 - Delete Contents dialog -- won't delete cell content "Date & time"
class clearCells(UITestCase):
def test_clear_cells_text(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "aa")
- enter_text_to_cell(gridwin, "A2", "1")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.ui_test.execute_dialog_through_command(".uno:Delete")
- xDialog = self.xUITest.getTopFocusWindow()
- xdeleteall = xDialog.getChild("deleteall")
- xtext = xDialog.getChild("text")
- xdatetime = xDialog.getChild("datetime")
- xcomments = xDialog.getChild("comments")
- xobjects = xDialog.getChild("objects")
- xnumbers = xDialog.getChild("numbers")
- xformulas = xDialog.getChild("formulas")
- xformats = xDialog.getChild("formats")
-
- if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
- xdeleteall.executeAction("CLICK", tuple())
- if (get_state_as_dict(xtext)["Selected"]) == "false":
- xtext.executeAction("CLICK", tuple())
- if (get_state_as_dict(xdatetime)["Selected"]) == "true":
- xdatetime.executeAction("CLICK", tuple())
- if (get_state_as_dict(xcomments)["Selected"]) == "true":
- xcomments.executeAction("CLICK", tuple())
- if (get_state_as_dict(xobjects)["Selected"]) == "true":
- xobjects.executeAction("CLICK", tuple())
- if (get_state_as_dict(xnumbers)["Selected"]) == "true":
- xnumbers.executeAction("CLICK", tuple())
- if (get_state_as_dict(xformulas)["Selected"]) == "true":
- xformulas.executeAction("CLICK", tuple())
- if (get_state_as_dict(xformats)["Selected"]) == "true":
- xformats.executeAction("CLICK", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 1)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ enter_text_to_cell(gridwin, "A1", "aa")
+ enter_text_to_cell(gridwin, "A2", "1")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ self.ui_test.execute_dialog_through_command(".uno:Delete")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xdeleteall = xDialog.getChild("deleteall")
+ xtext = xDialog.getChild("text")
+ xdatetime = xDialog.getChild("datetime")
+ xcomments = xDialog.getChild("comments")
+ xobjects = xDialog.getChild("objects")
+ xnumbers = xDialog.getChild("numbers")
+ xformulas = xDialog.getChild("formulas")
+ xformats = xDialog.getChild("formats")
+
+ if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
+ xdeleteall.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xtext)["Selected"]) == "false":
+ xtext.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xdatetime)["Selected"]) == "true":
+ xdatetime.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xcomments)["Selected"]) == "true":
+ xcomments.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xobjects)["Selected"]) == "true":
+ xobjects.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xnumbers)["Selected"]) == "true":
+ xnumbers.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xformulas)["Selected"]) == "true":
+ xformulas.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xformats)["Selected"]) == "true":
+ xformats.executeAction("CLICK", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 1)
def test_clear_cells_date_tdf101904(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "01/01/2000")
- enter_text_to_cell(gridwin, "A2", "1")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.ui_test.execute_dialog_through_command(".uno:Delete")
- xDialog = self.xUITest.getTopFocusWindow()
- xdeleteall = xDialog.getChild("deleteall")
- xtext = xDialog.getChild("text")
- xdatetime = xDialog.getChild("datetime")
- xcomments = xDialog.getChild("comments")
- xobjects = xDialog.getChild("objects")
- xnumbers = xDialog.getChild("numbers")
- xformulas = xDialog.getChild("formulas")
- xformats = xDialog.getChild("formats")
-
- if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
- xdeleteall.executeAction("CLICK", tuple())
- if (get_state_as_dict(xtext)["Selected"]) == "true":
- xtext.executeAction("CLICK", tuple())
- if (get_state_as_dict(xdatetime)["Selected"]) == "false":
- xdatetime.executeAction("CLICK", tuple())
- if (get_state_as_dict(xcomments)["Selected"]) == "true":
- xcomments.executeAction("CLICK", tuple())
- if (get_state_as_dict(xobjects)["Selected"]) == "true":
- xobjects.executeAction("CLICK", tuple())
- if (get_state_as_dict(xnumbers)["Selected"]) == "true":
- xnumbers.executeAction("CLICK", tuple())
- if (get_state_as_dict(xformulas)["Selected"]) == "true":
- xformulas.executeAction("CLICK", tuple())
- if (get_state_as_dict(xformats)["Selected"]) == "true":
- xformats.executeAction("CLICK", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 1)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ enter_text_to_cell(gridwin, "A1", "01/01/2000")
+ enter_text_to_cell(gridwin, "A2", "1")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ self.ui_test.execute_dialog_through_command(".uno:Delete")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xdeleteall = xDialog.getChild("deleteall")
+ xtext = xDialog.getChild("text")
+ xdatetime = xDialog.getChild("datetime")
+ xcomments = xDialog.getChild("comments")
+ xobjects = xDialog.getChild("objects")
+ xnumbers = xDialog.getChild("numbers")
+ xformulas = xDialog.getChild("formulas")
+ xformats = xDialog.getChild("formats")
+
+ if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
+ xdeleteall.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xtext)["Selected"]) == "true":
+ xtext.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xdatetime)["Selected"]) == "false":
+ xdatetime.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xcomments)["Selected"]) == "true":
+ xcomments.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xobjects)["Selected"]) == "true":
+ xobjects.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xnumbers)["Selected"]) == "true":
+ xnumbers.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xformulas)["Selected"]) == "true":
+ xformulas.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xformats)["Selected"]) == "true":
+ xformats.executeAction("CLICK", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 1)
def test_clear_cells_number(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "aa")
- enter_text_to_cell(gridwin, "A2", "1")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.ui_test.execute_dialog_through_command(".uno:Delete")
- xDialog = self.xUITest.getTopFocusWindow()
- xdeleteall = xDialog.getChild("deleteall")
- xtext = xDialog.getChild("text")
- xdatetime = xDialog.getChild("datetime")
- xcomments = xDialog.getChild("comments")
- xobjects = xDialog.getChild("objects")
- xnumbers = xDialog.getChild("numbers")
- xformulas = xDialog.getChild("formulas")
- xformats = xDialog.getChild("formats")
-
- if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
- xdeleteall.executeAction("CLICK", tuple())
- if (get_state_as_dict(xtext)["Selected"]) == "true":
- xtext.executeAction("CLICK", tuple())
- if (get_state_as_dict(xdatetime)["Selected"]) == "true":
- xdatetime.executeAction("CLICK", tuple())
- if (get_state_as_dict(xcomments)["Selected"]) == "true":
- xcomments.executeAction("CLICK", tuple())
- if (get_state_as_dict(xobjects)["Selected"]) == "true":
- xobjects.executeAction("CLICK", tuple())
- if (get_state_as_dict(xnumbers)["Selected"]) == "false":
- xnumbers.executeAction("CLICK", tuple())
- if (get_state_as_dict(xformulas)["Selected"]) == "true":
- xformulas.executeAction("CLICK", tuple())
- if (get_state_as_dict(xformats)["Selected"]) == "true":
- xformats.executeAction("CLICK", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "aa")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 0)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ enter_text_to_cell(gridwin, "A1", "aa")
+ enter_text_to_cell(gridwin, "A2", "1")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ self.ui_test.execute_dialog_through_command(".uno:Delete")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xdeleteall = xDialog.getChild("deleteall")
+ xtext = xDialog.getChild("text")
+ xdatetime = xDialog.getChild("datetime")
+ xcomments = xDialog.getChild("comments")
+ xobjects = xDialog.getChild("objects")
+ xnumbers = xDialog.getChild("numbers")
+ xformulas = xDialog.getChild("formulas")
+ xformats = xDialog.getChild("formats")
+
+ if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
+ xdeleteall.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xtext)["Selected"]) == "true":
+ xtext.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xdatetime)["Selected"]) == "true":
+ xdatetime.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xcomments)["Selected"]) == "true":
+ xcomments.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xobjects)["Selected"]) == "true":
+ xobjects.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xnumbers)["Selected"]) == "false":
+ xnumbers.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xformulas)["Selected"]) == "true":
+ xformulas.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xformats)["Selected"]) == "true":
+ xformats.executeAction("CLICK", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "aa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 0)
+
def test_clear_cells_formulas(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "1")
- enter_text_to_cell(gridwin, "A2", "=A1+1")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.ui_test.execute_dialog_through_command(".uno:Delete")
- xDialog = self.xUITest.getTopFocusWindow()
- xdeleteall = xDialog.getChild("deleteall")
- xtext = xDialog.getChild("text")
- xdatetime = xDialog.getChild("datetime")
- xcomments = xDialog.getChild("comments")
- xobjects = xDialog.getChild("objects")
- xnumbers = xDialog.getChild("numbers")
- xformulas = xDialog.getChild("formulas")
- xformats = xDialog.getChild("formats")
-
- if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
- xdeleteall.executeAction("CLICK", tuple())
- if (get_state_as_dict(xtext)["Selected"]) == "true":
- xtext.executeAction("CLICK", tuple())
- if (get_state_as_dict(xdatetime)["Selected"]) == "true":
- xdatetime.executeAction("CLICK", tuple())
- if (get_state_as_dict(xcomments)["Selected"]) == "true":
- xcomments.executeAction("CLICK", tuple())
- if (get_state_as_dict(xobjects)["Selected"]) == "true":
- xobjects.executeAction("CLICK", tuple())
- if (get_state_as_dict(xnumbers)["Selected"]) == "true":
- xnumbers.executeAction("CLICK", tuple())
- if (get_state_as_dict(xformulas)["Selected"]) == "false":
- xformulas.executeAction("CLICK", tuple())
- if (get_state_as_dict(xformats)["Selected"]) == "true":
- xformats.executeAction("CLICK", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "1")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString() , "")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ enter_text_to_cell(gridwin, "A1", "1")
+ enter_text_to_cell(gridwin, "A2", "=A1+1")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ self.ui_test.execute_dialog_through_command(".uno:Delete")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xdeleteall = xDialog.getChild("deleteall")
+ xtext = xDialog.getChild("text")
+ xdatetime = xDialog.getChild("datetime")
+ xcomments = xDialog.getChild("comments")
+ xobjects = xDialog.getChild("objects")
+ xnumbers = xDialog.getChild("numbers")
+ xformulas = xDialog.getChild("formulas")
+ xformats = xDialog.getChild("formats")
+
+ if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
+ xdeleteall.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xtext)["Selected"]) == "true":
+ xtext.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xdatetime)["Selected"]) == "true":
+ xdatetime.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xcomments)["Selected"]) == "true":
+ xcomments.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xobjects)["Selected"]) == "true":
+ xobjects.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xnumbers)["Selected"]) == "true":
+ xnumbers.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xformulas)["Selected"]) == "false":
+ xformulas.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xformats)["Selected"]) == "true":
+ xformats.executeAction("CLICK", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "1")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString() , "")
def test_clear_cells_formats(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "aa")
- enter_text_to_cell(gridwin, "A2", "1")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.xUITest.executeCommand(".uno:Bold")
- self.ui_test.execute_dialog_through_command(".uno:Delete")
- xDialog = self.xUITest.getTopFocusWindow()
- xdeleteall = xDialog.getChild("deleteall")
- xtext = xDialog.getChild("text")
- xdatetime = xDialog.getChild("datetime")
- xcomments = xDialog.getChild("comments")
- xobjects = xDialog.getChild("objects")
- xnumbers = xDialog.getChild("numbers")
- xformulas = xDialog.getChild("formulas")
- xformats = xDialog.getChild("formats")
-
- if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
- xdeleteall.executeAction("CLICK", tuple())
- if (get_state_as_dict(xtext)["Selected"]) == "true":
- xtext.executeAction("CLICK", tuple())
- if (get_state_as_dict(xdatetime)["Selected"]) == "true":
- xdatetime.executeAction("CLICK", tuple())
- if (get_state_as_dict(xcomments)["Selected"]) == "true":
- xcomments.executeAction("CLICK", tuple())
- if (get_state_as_dict(xobjects)["Selected"]) == "true":
- xobjects.executeAction("CLICK", tuple())
- if (get_state_as_dict(xnumbers)["Selected"]) == "true":
- xnumbers.executeAction("CLICK", tuple())
- if (get_state_as_dict(xformulas)["Selected"]) == "true":
- xformulas.executeAction("CLICK", tuple())
- if (get_state_as_dict(xformats)["Selected"]) == "false":
- xformats.executeAction("CLICK", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1") #tab Font
-
- xstylelb = xDialog.getChild("weststylelb-cjk")
- print(get_state_as_dict(xstylelb))
-
-
- self.assertEqual(get_state_as_dict(xstylelb)["Text"], "Regular")
-
- xOK = xDialog.getChild("ok")
- xOK.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ enter_text_to_cell(gridwin, "A1", "aa")
+ enter_text_to_cell(gridwin, "A2", "1")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ self.xUITest.executeCommand(".uno:Bold")
+ self.ui_test.execute_dialog_through_command(".uno:Delete")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xdeleteall = xDialog.getChild("deleteall")
+ xtext = xDialog.getChild("text")
+ xdatetime = xDialog.getChild("datetime")
+ xcomments = xDialog.getChild("comments")
+ xobjects = xDialog.getChild("objects")
+ xnumbers = xDialog.getChild("numbers")
+ xformulas = xDialog.getChild("formulas")
+ xformats = xDialog.getChild("formats")
+
+ if (get_state_as_dict(xdeleteall)["Selected"]) == "true":
+ xdeleteall.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xtext)["Selected"]) == "true":
+ xtext.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xdatetime)["Selected"]) == "true":
+ xdatetime.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xcomments)["Selected"]) == "true":
+ xcomments.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xobjects)["Selected"]) == "true":
+ xobjects.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xnumbers)["Selected"]) == "true":
+ xnumbers.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xformulas)["Selected"]) == "true":
+ xformulas.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xformats)["Selected"]) == "false":
+ xformats.executeAction("CLICK", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1") #tab Font
+
+ xstylelb = xDialog.getChild("weststylelb-cjk")
+ print(get_state_as_dict(xstylelb))
+
+
+ self.assertEqual(get_state_as_dict(xstylelb)["Text"], "Regular")
+
+ xOK = xDialog.getChild("ok")
+ xOK.executeAction("CLICK", tuple())
def test_clear_cells_all(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "aa")
- enter_text_to_cell(gridwin, "A2", "1")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.xUITest.executeCommand(".uno:Bold")
- self.ui_test.execute_dialog_through_command(".uno:Delete")
- xDialog = self.xUITest.getTopFocusWindow()
- xdeleteall = xDialog.getChild("deleteall")
- xtext = xDialog.getChild("text")
- xdatetime = xDialog.getChild("datetime")
- xcomments = xDialog.getChild("comments")
- xobjects = xDialog.getChild("objects")
- xnumbers = xDialog.getChild("numbers")
- xformulas = xDialog.getChild("formulas")
- xformats = xDialog.getChild("formats")
-
- if (get_state_as_dict(xdeleteall)["Selected"]) == "false":
- xdeleteall.executeAction("CLICK", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString() , "")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ enter_text_to_cell(gridwin, "A1", "aa")
+ enter_text_to_cell(gridwin, "A2", "1")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ self.xUITest.executeCommand(".uno:Bold")
+ self.ui_test.execute_dialog_through_command(".uno:Delete")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xdeleteall = xDialog.getChild("deleteall")
+ xtext = xDialog.getChild("text")
+ xdatetime = xDialog.getChild("datetime")
+ xcomments = xDialog.getChild("comments")
+ xobjects = xDialog.getChild("objects")
+ xnumbers = xDialog.getChild("numbers")
+ xformulas = xDialog.getChild("formulas")
+ xformats = xDialog.getChild("formats")
+
+ if (get_state_as_dict(xdeleteall)["Selected"]) == "false":
+ xdeleteall.executeAction("CLICK", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString() , "")
def test_cancel_clear_cells_all(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "aa")
- enter_text_to_cell(gridwin, "A2", "1")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.ui_test.execute_dialog_through_command(".uno:Delete")
- xDialog = self.xUITest.getTopFocusWindow()
- xdeleteall = xDialog.getChild("deleteall")
-
- if (get_state_as_dict(xdeleteall)["Selected"]) == "false":
- xdeleteall.executeAction("CLICK", tuple())
-
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "aa")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString() , "1")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ enter_text_to_cell(gridwin, "A1", "aa")
+ enter_text_to_cell(gridwin, "A2", "1")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ self.ui_test.execute_dialog_through_command(".uno:Delete")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xdeleteall = xDialog.getChild("deleteall")
+
+ if (get_state_as_dict(xdeleteall)["Selected"]) == "false":
+ xdeleteall.executeAction("CLICK", tuple())
+
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() , "aa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString() , "1")
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py
index 691eadcbea29..3896de55958d 100644
--- a/sc/qa/uitest/calc_tests3/insertQrCodeGen.py
+++ b/sc/qa/uitest/calc_tests3/insertQrCodeGen.py
@@ -11,70 +11,67 @@ from com.sun.star.lang import IndexOutOfBoundsException
class insertQrCode(UITestCase):
def test_insert_qr_code_gen(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- # cancel the dialog without doing anything
- self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xURL = xDialog.getChild("edit_text")
- type_text(xURL, "www.libreoffice.org")
-
- xCloseBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCloseBtn)
- with self.assertRaises(IndexOutOfBoundsException):
- document.Sheets.getByIndex(0).DrawPage.getByIndex(0)
-
- # Reopen the dialog box
- self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
- xDialog = self.xUITest.getTopFocusWindow()
-
- # Get elements in the Dialog Box
- xURL = xDialog.getChild("edit_text")
- xECC_Low = xDialog.getChild("button_low") #How radio button input is written in text.
- xBorder = xDialog.getChild("edit_margin")
-
- type_text(xURL, "www.libreoffice.org") #set the QR code
- xECC_Low.executeAction("CLICK", tuple())
- xBorder.executeAction("UP", tuple())
- xBorder.executeAction("DOWN", tuple())
- xOKBtn = xDialog.getChild("ok")
- xOKBtn.executeAction("CLICK", tuple())
-
- # check the QR code in the document
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1)
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Border, 1)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ # cancel the dialog without doing anything
+ self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xURL = xDialog.getChild("edit_text")
+ type_text(xURL, "www.libreoffice.org")
+
+ xCloseBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+ with self.assertRaises(IndexOutOfBoundsException):
+ document.Sheets.getByIndex(0).DrawPage.getByIndex(0)
+
+ # Reopen the dialog box
+ self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ # Get elements in the Dialog Box
+ xURL = xDialog.getChild("edit_text")
+ xECC_Low = xDialog.getChild("button_low") #How radio button input is written in text.
+ xBorder = xDialog.getChild("edit_margin")
+
+ type_text(xURL, "www.libreoffice.org") #set the QR code
+ xECC_Low.executeAction("CLICK", tuple())
+ xBorder.executeAction("UP", tuple())
+ xBorder.executeAction("DOWN", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ xOKBtn.executeAction("CLICK", tuple())
+
+ # check the QR code in the document
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org")
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1)
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Border, 1)
def test_insert_qr_code_gen2(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xURL = xDialog.getChild("edit_text")
- xECC_Low = xDialog.getChild("button_low")
- xBorder = xDialog.getChild("edit_margin")
-
- type_text(xURL, "www.libreoffice.org") #set the QR code
- xECC_Low.executeAction("CLICK", tuple())
- xBorder.executeAction("UP", tuple())
- xBorder.executeAction("DOWN", tuple())
- xOKBtn = xDialog.getChild("ok")
- xOKBtn.executeAction("CLICK", tuple())
-
- #check the QR Code in the document
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1)
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Border, 1)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertQrCode")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xURL = xDialog.getChild("edit_text")
+ xECC_Low = xDialog.getChild("button_low")
+ xBorder = xDialog.getChild("edit_margin")
+
+ type_text(xURL, "www.libreoffice.org") #set the QR code
+ xECC_Low.executeAction("CLICK", tuple())
+ xBorder.executeAction("UP", tuple())
+ xBorder.executeAction("DOWN", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ xOKBtn.executeAction("CLICK", tuple())
+
+ #check the QR Code in the document
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Payload, "www.libreoffice.org")
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.ErrorCorrection, 1)
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).QRCodeProperties.Border, 1)
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/tdf69450.py b/sc/qa/uitest/calc_tests3/tdf69450.py
index 2951b385b8ca..f19eb36d02e1 100644
--- a/sc/qa/uitest/calc_tests3/tdf69450.py
+++ b/sc/qa/uitest/calc_tests3/tdf69450.py
@@ -12,49 +12,48 @@ from libreoffice.calc.document import get_cell_by_position
class tdf69450(UITestCase):
def test_tdf69450(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- #add text to A1 and B1
- enter_text_to_cell(gridwin, "A1", "A")
- enter_text_to_cell(gridwin, "B1", "B")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:Copy")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xtext = xDialog.getChild("text")
- xnumbers = xDialog.getChild("numbers")
- xdatetime = xDialog.getChild("datetime")
- xformats = xDialog.getChild("formats")
-
- xtext.executeAction("CLICK", tuple())
- xnumbers.executeAction("CLICK", tuple())
- xdatetime.executeAction("CLICK", tuple())
- xformats.executeAction("CLICK", tuple())
-
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- #check B1 text
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
- self.xUITest.executeCommand(".uno:Bold")
- self.xUITest.executeCommand(".uno:Copy")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
- xDialog = self.xUITest.getTopFocusWindow() #previous settings should be remembered (only format)
-
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- #check B1 text
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B")
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ #add text to A1 and B1
+ enter_text_to_cell(gridwin, "A1", "A")
+ enter_text_to_cell(gridwin, "B1", "B")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xtext = xDialog.getChild("text")
+ xnumbers = xDialog.getChild("numbers")
+ xdatetime = xDialog.getChild("datetime")
+ xformats = xDialog.getChild("formats")
+
+ xtext.executeAction("CLICK", tuple())
+ xnumbers.executeAction("CLICK", tuple())
+ xdatetime.executeAction("CLICK", tuple())
+ xformats.executeAction("CLICK", tuple())
+
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ #check B1 text
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+ self.xUITest.executeCommand(".uno:Bold")
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xDialog = self.xUITest.getTopFocusWindow() #previous settings should be remembered (only format)
+
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ #check B1 text
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/tdf73006.py b/sc/qa/uitest/calc_tests3/tdf73006.py
index 558367e6e6fb..a81ff470c042 100644
--- a/sc/qa/uitest/calc_tests3/tdf73006.py
+++ b/sc/qa/uitest/calc_tests3/tdf73006.py
@@ -13,30 +13,28 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf73006(UITestCase):
def test_tdf73006_text_to_columns(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #Add data
- enter_text_to_cell(gridwin, "A2", "A B")
- #select column A
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:SelectColumn")
- # Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- xspace = xDialog.getChild("space")
- if (get_state_as_dict(xspace)["Selected"]) == "false":
- xspace.executeAction("CLICK", tuple())
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ #Add data
+ enter_text_to_cell(gridwin, "A2", "A B")
+ #select column A
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ # Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xspace = xDialog.getChild("space")
+ if (get_state_as_dict(xspace)["Selected"]) == "false":
+ xspace.executeAction("CLICK", tuple())
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "A")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "B")
-
- self.ui_test.close_doc()
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "A")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "B")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/tdf79983.py b/sc/qa/uitest/calc_tests3/tdf79983.py
index c90561cee034..777af1e1a027 100644
--- a/sc/qa/uitest/calc_tests3/tdf79983.py
+++ b/sc/qa/uitest/calc_tests3/tdf79983.py
@@ -13,60 +13,58 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf79983(UITestCase):
def test_tdf79983_sort_list_case_sensitive(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "AAA")
- enter_text_to_cell(gridwin, "A2", "BBB")
- enter_text_to_cell(gridwin, "A3", "CCC")
- enter_text_to_cell(gridwin, "A4", "DDD")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ enter_text_to_cell(gridwin, "A1", "AAA")
+ enter_text_to_cell(gridwin, "A2", "BBB")
+ enter_text_to_cell(gridwin, "A3", "CCC")
+ enter_text_to_cell(gridwin, "A4", "DDD")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- #Tools / Options / LibreOffice Calc / Sort Lists
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
+ #Tools / Options / LibreOffice Calc / Sort Lists
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xCalcEntry = xPages.getChild('3') # Calc
- xCalcEntry.executeAction("EXPAND", tuple())
- xCalcSortEntry = xCalcEntry.getChild('5')
- xCalcSortEntry.executeAction("SELECT", tuple()) #Sort List
- #copy new list from selected cells
- xcopy = xDialogOpt.getChild("copy")
- xcopy.executeAction("CLICK", tuple())
+ xPages = xDialogOpt.getChild("pages")
+ xCalcEntry = xPages.getChild('3') # Calc
+ xCalcEntry.executeAction("EXPAND", tuple())
+ xCalcSortEntry = xCalcEntry.getChild('5')
+ xCalcSortEntry.executeAction("SELECT", tuple()) #Sort List
+ #copy new list from selected cells
+ xcopy = xDialogOpt.getChild("copy")
+ xcopy.executeAction("CLICK", tuple())
- self.assertEqual("AAA\nBBB\nCCC\nDDD", get_state_as_dict(xDialogOpt.getChild("entries"))['Text'])
+ self.assertEqual("AAA\nBBB\nCCC\nDDD", get_state_as_dict(xDialogOpt.getChild("entries"))['Text'])
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DELETE"}))
- enter_text_to_cell(gridwin, "A1", "AAA")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- #fill down
- self.ui_test.execute_dialog_through_command(".uno:FillSeries")
- xDialog = self.xUITest.getTopFocusWindow()
- xautofill = xDialog.getChild("autofill")
- xautofill.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "AAA")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "BBB")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "CCC")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "DDD")
- #UNDO
- self.xUITest.executeCommand(".uno:Undo")
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "AAA")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "")
-
- self.ui_test.close_doc()
+ enter_text_to_cell(gridwin, "A1", "AAA")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ #fill down
+ self.ui_test.execute_dialog_through_command(".uno:FillSeries")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xautofill = xDialog.getChild("autofill")
+ xautofill.executeAction("CLICK", tuple())
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "AAA")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "BBB")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "CCC")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "DDD")
+ #UNDO
+ self.xUITest.executeCommand(".uno:Undo")
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "AAA")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/tdf80693.py b/sc/qa/uitest/calc_tests3/tdf80693.py
index 8b16978c95f9..5e687e01da23 100644
--- a/sc/qa/uitest/calc_tests3/tdf80693.py
+++ b/sc/qa/uitest/calc_tests3/tdf80693.py
@@ -12,40 +12,39 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
#Bug 80693 - EDITING: fill cell with random numbers with min = max
class tdf80693(UITestCase):
def test_tdf80693_random_numbers_min_max(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xcellrangeedit = xDialog.getChild("cell-range-edit")
- xdistributioncombo = xDialog.getChild("distribution-combo")
- xparameter1spin = xDialog.getChild("parameter1-spin")
- xparameter2spin = xDialog.getChild("parameter2-spin")
- xenableseedcheck = xDialog.getChild("enable-seed-check")
- xseedspin = xDialog.getChild("seed-spin")
- xenableroundingcheck = xDialog.getChild("enable-rounding-check")
- xdecimalplacesspin = xDialog.getChild("decimal-places-spin")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xcellrangeedit = xDialog.getChild("cell-range-edit")
+ xdistributioncombo = xDialog.getChild("distribution-combo")
+ xparameter1spin = xDialog.getChild("parameter1-spin")
+ xparameter2spin = xDialog.getChild("parameter2-spin")
+ xenableseedcheck = xDialog.getChild("enable-seed-check")
+ xseedspin = xDialog.getChild("seed-spin")
+ xenableroundingcheck = xDialog.getChild("enable-rounding-check")
+ xdecimalplacesspin = xDialog.getChild("decimal-places-spin")
- xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$2"}))
- select_by_text(xdistributioncombo, "Uniform")
+ xcellrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$2"}))
+ select_by_text(xdistributioncombo, "Uniform")
- xparameter1spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xparameter1spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xparameter1spin.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
- xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xparameter2spin.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
+ xparameter1spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xparameter1spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xparameter1spin.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
+ xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xparameter2spin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xparameter2spin.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 2)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False)
- self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False)
- self.ui_test.close_doc()
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue() , 2)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 0).getString() ), False)
+ self.assertEqual(bool(get_cell_by_position(document, 0, 0, 1).getString() ), False)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/tdf82398.py b/sc/qa/uitest/calc_tests3/tdf82398.py
index 6cf2e8c671d0..e5c74198b19c 100644
--- a/sc/qa/uitest/calc_tests3/tdf82398.py
+++ b/sc/qa/uitest/calc_tests3/tdf82398.py
@@ -13,50 +13,48 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf82398(UITestCase):
def test_tdf82398_text_to_columns(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #Add data
- enter_text_to_cell(gridwin, "A1", "afasdfs.fdfasd.fsadf.fasd")
- enter_text_to_cell(gridwin, "A2", "3242.43242.3242.2342")
- enter_text_to_cell(gridwin, "A3", "fdsfa.afsdfa.adfdas.fsad")
- enter_text_to_cell(gridwin, "A4", "21312.1111.1111.111")
- #select column A1:A4 / .uno:NumberFormatDate
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- self.xUITest.executeCommand(".uno:NumberFormatDate")
- # Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- xother = xDialog.getChild("other")
- xinputother = xDialog.getChild("inputother")
+ #Add data
+ enter_text_to_cell(gridwin, "A1", "afasdfs.fdfasd.fsadf.fasd")
+ enter_text_to_cell(gridwin, "A2", "3242.43242.3242.2342")
+ enter_text_to_cell(gridwin, "A3", "fdsfa.afsdfa.adfdas.fsad")
+ enter_text_to_cell(gridwin, "A4", "21312.1111.1111.111")
+ #select column A1:A4 / .uno:NumberFormatDate
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ self.xUITest.executeCommand(".uno:NumberFormatDate")
+ # Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xother = xDialog.getChild("other")
+ xinputother = xDialog.getChild("inputother")
- if (get_state_as_dict(xother)["Selected"]) == "false":
- xother.executeAction("CLICK", tuple())
- xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"."}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ if (get_state_as_dict(xother)["Selected"]) == "false":
+ xother.executeAction("CLICK", tuple())
+ xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"."}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "afasdfs")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 3242)
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "fdsfa")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 21312)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "fdfasd")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 43242)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "afsdfa")
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1111)
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "fsadf")
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3242)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "adfdas")
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 1111)
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "fasd")
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 2342)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "fsad")
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 111)
-
- self.ui_test.close_doc()
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "afasdfs")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "fdsfa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 21312)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "fdfasd")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 43242)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "afsdfa")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "fsadf")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "adfdas")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "fasd")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 2342)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "fsad")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 111)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/tdf88999.py b/sc/qa/uitest/calc_tests4/tdf88999.py
index 4f27a34d85f5..bcd7b166dd0d 100644
--- a/sc/qa/uitest/calc_tests4/tdf88999.py
+++ b/sc/qa/uitest/calc_tests4/tdf88999.py
@@ -14,36 +14,34 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf88999(UITestCase):
def test_tdf88999_scientific_format_decimal_value(self):
#numberingformatpage.ui
- 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", "1e-2")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- #select cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0") #tab Numbers
- xliststore1 = xDialog.getChild("categorylb") #1st list / Category
- xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
- xdecimalsed = xDialog.getChild("decimalsed")
- xleadzerosed = xDialog.getChild("leadzerosed")
- xnegnumred = xDialog.getChild("negnumred")
- xthousands = xDialog.getChild("thousands")
- xlanguagelb = xDialog.getChild("languagelb")
- xformatted = xDialog.getChild("formatted")
+ with 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", "1e-2")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ #select cell A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0") #tab Numbers
+ xliststore1 = xDialog.getChild("categorylb") #1st list / Category
+ xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
+ xdecimalsed = xDialog.getChild("decimalsed")
+ xleadzerosed = xDialog.getChild("leadzerosed")
+ xnegnumred = xDialog.getChild("negnumred")
+ xthousands = xDialog.getChild("thousands")
+ xlanguagelb = xDialog.getChild("languagelb")
+ xformatted = xDialog.getChild("formatted")
- self.assertEqual(get_state_as_dict(xliststore1)["SelectEntryText"], "Scientific")
- self.assertEqual(get_state_as_dict(xdecimalsed)["Text"], "2")
- self.assertEqual(get_state_as_dict(xdecimalsed)["Enabled"], "true")
- self.assertEqual(get_state_as_dict(xleadzerosed)["Text"], "1")
- self.assertEqual(get_state_as_dict(xformatted)["Text"], "0.00E+00")
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
-
- self.ui_test.close_doc()
+ self.assertEqual(get_state_as_dict(xliststore1)["SelectEntryText"], "Scientific")
+ self.assertEqual(get_state_as_dict(xdecimalsed)["Text"], "2")
+ self.assertEqual(get_state_as_dict(xdecimalsed)["Enabled"], "true")
+ self.assertEqual(get_state_as_dict(xleadzerosed)["Text"], "1")
+ self.assertEqual(get_state_as_dict(xformatted)["Text"], "0.00E+00")
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/tdf89907.py b/sc/qa/uitest/calc_tests4/tdf89907.py
index 5e0cde458670..5d93409b354c 100644
--- a/sc/qa/uitest/calc_tests4/tdf89907.py
+++ b/sc/qa/uitest/calc_tests4/tdf89907.py
@@ -13,51 +13,49 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf89907(UITestCase):
def test_tdf89907_text_to_columns(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #Add data
- enter_text_to_cell(gridwin, "A1", "afasdfs.fdfasd.fsadf.fasd")
- enter_text_to_cell(gridwin, "A2", "3242.43242.3242.2342")
- enter_text_to_cell(gridwin, "A3", "fdsfa.afsdfa.adfdas.fsad")
- enter_text_to_cell(gridwin, "A4", "21312.1111.1111.111")
- #select column A
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:SelectColumn")
- #Optimal Width
- self.xUITest.executeCommand(".uno:SetOptimalColumnWidthDirect")
- # Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- xother = xDialog.getChild("other")
- xinputother = xDialog.getChild("inputother")
- if (get_state_as_dict(xother)["Selected"]) == "false":
- xother.executeAction("CLICK", tuple())
- xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"."}))
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ #Add data
+ enter_text_to_cell(gridwin, "A1", "afasdfs.fdfasd.fsadf.fasd")
+ enter_text_to_cell(gridwin, "A2", "3242.43242.3242.2342")
+ enter_text_to_cell(gridwin, "A3", "fdsfa.afsdfa.adfdas.fsad")
+ enter_text_to_cell(gridwin, "A4", "21312.1111.1111.111")
+ #select column A
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ #Optimal Width
+ self.xUITest.executeCommand(".uno:SetOptimalColumnWidthDirect")
+ # Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xother = xDialog.getChild("other")
+ xinputother = xDialog.getChild("inputother")
+ if (get_state_as_dict(xother)["Selected"]) == "false":
+ xother.executeAction("CLICK", tuple())
+ xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"."}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "afasdfs")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 3242)
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "fdsfa")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 21312)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "fdfasd")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 43242)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "afsdfa")
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1111)
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "fsadf")
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3242)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "adfdas")
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 1111)
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "fasd")
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 2342)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "fsad")
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 111)
-
- self.ui_test.close_doc()
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "afasdfs")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "fdsfa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 21312)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "fdfasd")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 43242)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "afsdfa")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "fsadf")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "adfdas")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "fasd")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 2342)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "fsad")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 111)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/tdf92423.py b/sc/qa/uitest/calc_tests4/tdf92423.py
index c5bde52e2468..1590373c9630 100644
--- a/sc/qa/uitest/calc_tests4/tdf92423.py
+++ b/sc/qa/uitest/calc_tests4/tdf92423.py
@@ -13,61 +13,59 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf92423(UITestCase):
def test_tdf92423_text_to_columns(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
+ #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xWriterEntry = xPages.getChild('3') # Calc
- xWriterEntry.executeAction("EXPAND", tuple())
- xWriterGeneralEntry = xWriterEntry.getChild('0')
- xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
- xreplwarncb = xDialogOpt.getChild("replwarncb")
- if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
- xreplwarncb.executeAction("CLICK", tuple())
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #enter data
- enter_text_to_cell(gridwin, "A1", "1;2")
- enter_text_to_cell(gridwin, "A2", "2;3")
- enter_text_to_cell(gridwin, "A3", "3;4")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
- #copy data
- self.xUITest.executeCommand(".uno:Copy")
- #move down
- self.xUITest.executeCommand(".uno:GoDown")
- self.xUITest.executeCommand(".uno:GoDown")
- self.xUITest.executeCommand(".uno:GoDown")
- self.xUITest.executeCommand(".uno:GoDown")
- self.xUITest.executeCommand(".uno:GoDown")
- self.xUITest.executeCommand(".uno:GoDown")
- #paste data, should be selected
- self.xUITest.executeCommand(".uno:Paste") #A7:A9
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A7:Sheet1.A9")
- # Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- xSemicolon = xDialog.getChild("semicolon") #check semicolon checkbox
- if (get_state_as_dict(xSemicolon)["Selected"]) == "false":
- xSemicolon.executeAction("CLICK", tuple())
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ xPages = xDialogOpt.getChild("pages")
+ xWriterEntry = xPages.getChild('3') # Calc
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xWriterGeneralEntry = xWriterEntry.getChild('0')
+ xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
+ xreplwarncb = xDialogOpt.getChild("replwarncb")
+ if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
+ xreplwarncb.executeAction("CLICK", tuple())
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #enter data
+ enter_text_to_cell(gridwin, "A1", "1;2")
+ enter_text_to_cell(gridwin, "A2", "2;3")
+ enter_text_to_cell(gridwin, "A3", "3;4")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
+ #copy data
+ self.xUITest.executeCommand(".uno:Copy")
+ #move down
+ self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:GoDown")
+ #paste data, should be selected
+ self.xUITest.executeCommand(".uno:Paste") #A7:A9
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A7:Sheet1.A9")
+ # Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xSemicolon = xDialog.getChild("semicolon") #check semicolon checkbox
+ if (get_state_as_dict(xSemicolon)["Selected"]) == "false":
+ xSemicolon.executeAction("CLICK", tuple())
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 6).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 0, 8).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 1, 6).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 7).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 1, 8).getValue(), 4)
-
- self.ui_test.close_doc()
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 6).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 8).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 6).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 7).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 8).getValue(), 4)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/tdf94208.py b/sc/qa/uitest/calc_tests4/tdf94208.py
index 542b8a2daa91..fa7a06f02076 100644
--- a/sc/qa/uitest/calc_tests4/tdf94208.py
+++ b/sc/qa/uitest/calc_tests4/tdf94208.py
@@ -13,35 +13,33 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf94208(UITestCase):
def test_tdf94208_Undo_fill_down_rows_selected(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("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #1 - Fill data
- enter_text_to_cell(gridwin, "A3", "Range")
- enter_text_to_cell(gridwin, "A4", "Range")
- enter_text_to_cell(gridwin, "A5", "Range")
- enter_text_to_cell(gridwin, "A6", "Range")
- enter_text_to_cell(gridwin, "A7", "Range")
- enter_text_to_cell(gridwin, "A8", "Range")
- enter_text_to_cell(gridwin, "B6", "test")
- #2 - Select rows three though eight.
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A3:A8"}))
- self.xUITest.executeCommand(".uno:SelectRow")
- #3 - type Control-D/Fill Down
- self.xUITest.executeCommand(".uno:FillDown")
- #4 - undo.
- self.xUITest.executeCommand(".uno:Undo")
- #5 - Ouch! The data isn't right.
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "Range")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Range")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "Range")
- self.assertEqual(get_cell_by_position(document, 0, 0, 5).getString(), "Range")
- self.assertEqual(get_cell_by_position(document, 0, 0, 6).getString(), "Range")
- self.assertEqual(get_cell_by_position(document, 0, 0, 6).getString(), "Range")
- self.assertEqual(get_cell_by_position(document, 0, 1, 5).getString(), "test")
-
- self.ui_test.close_doc()
+ #1 - Fill data
+ enter_text_to_cell(gridwin, "A3", "Range")
+ enter_text_to_cell(gridwin, "A4", "Range")
+ enter_text_to_cell(gridwin, "A5", "Range")
+ enter_text_to_cell(gridwin, "A6", "Range")
+ enter_text_to_cell(gridwin, "A7", "Range")
+ enter_text_to_cell(gridwin, "A8", "Range")
+ enter_text_to_cell(gridwin, "B6", "test")
+ #2 - Select rows three though eight.
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A3:A8"}))
+ self.xUITest.executeCommand(".uno:SelectRow")
+ #3 - type Control-D/Fill Down
+ self.xUITest.executeCommand(".uno:FillDown")
+ #4 - undo.
+ self.xUITest.executeCommand(".uno:Undo")
+ #5 - Ouch! The data isn't right.
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "Range")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Range")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "Range")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 5).getString(), "Range")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 6).getString(), "Range")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 6).getString(), "Range")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 5).getString(), "test")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/trackedChanges.py b/sc/qa/uitest/calc_tests4/trackedChanges.py
index e9e54206faa7..6cc99974cfda 100644
--- a/sc/qa/uitest/calc_tests4/trackedChanges.py
+++ b/sc/qa/uitest/calc_tests4/trackedChanges.py
@@ -40,257 +40,251 @@ class CalcTrackedChanges(UITestCase):
xCancBtn.executeAction("CLICK", tuple())
def test_tdf66263_Protect_Records(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- self.ui_test.wait_until_child_is_available("grid_window")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- self.xUITest.executeCommand(".uno:TraceChangeMode")
- #protect dialog
- self.ui_test.execute_dialog_through_command(".uno:ProtectTraceChangeMode")
- xDialog = self.xUITest.getTopFocusWindow()
- xpass = xDialog.getChild("pass1ed")
- xpass.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
- xconfirm = xDialog.getChild("confirm1ed")
- xconfirm.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
- #verify password
- self.ui_test.execute_dialog_through_command(".uno:ProtectTraceChangeMode")
- xDialog = self.xUITest.getTopFocusWindow()
- xpass = xDialog.getChild("pass1ed")
- xpass.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ self.ui_test.wait_until_child_is_available("grid_window")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ self.xUITest.executeCommand(".uno:TraceChangeMode")
+ #protect dialog
+ self.ui_test.execute_dialog_through_command(".uno:ProtectTraceChangeMode")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xpass = xDialog.getChild("pass1ed")
+ xpass.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
+ xconfirm = xDialog.getChild("confirm1ed")
+ xconfirm.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+ #verify password
+ self.ui_test.execute_dialog_through_command(".uno:ProtectTraceChangeMode")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xpass = xDialog.getChild("pass1ed")
+ xpass.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
def test_tracked_changes_accept(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- self.ui_test.wait_until_child_is_available("grid_window")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #track changes; enter text to cell
- self.xUITest.executeCommand(".uno:TraceChangeMode")
- enter_text_to_cell(gridwin, "A1", "Test LibreOffice")
- enter_text_to_cell(gridwin, "A2", "Test LibreOffice")
- #accept tracked changes
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
-
- xChangesList = xTrackDlg.getChild("calcchanges")
- self.assertEqual(2, len(xChangesList.getChildren()))
-
- textStart = "Changed contents\tSheet1.A1\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
- textEnd = "(Cell A1 changed from '<empty>' to 'Test LibreOffice')"
- textStart2 = "Changed contents\tSheet1.A2\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
- textEnd2 = "(Cell A2 changed from '<empty>' to 'Test LibreOffice')"
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].endswith(textEnd2))
-
- xAccBtn = xTrackDlg.getChild("accept")
- xAccBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(2, len(xChangesList.getChildren()))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd2))
- self.assertEqual(get_state_as_dict(xChangesList.getChild('1'))["Text"], "Accepted")
-
- xAccBtn = xTrackDlg.getChild("accept")
- xAccBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(1, len(xChangesList.getChildren()))
- self.assertEqual(get_state_as_dict(xChangesList.getChild('0'))["Text"], "Accepted")
- xChangesList.getChild('0').executeAction("EXPAND", tuple())
-
- self.assertEqual(2, len(xChangesList.getChild('0').getChildren()))
-
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].startswith(textStart))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].endswith(textEnd))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].endswith(textEnd2))
-
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Test LibreOffice")
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ self.ui_test.wait_until_child_is_available("grid_window")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #track changes; enter text to cell
+ self.xUITest.executeCommand(".uno:TraceChangeMode")
+ enter_text_to_cell(gridwin, "A1", "Test LibreOffice")
+ enter_text_to_cell(gridwin, "A2", "Test LibreOffice")
+ #accept tracked changes
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
+
+ xChangesList = xTrackDlg.getChild("calcchanges")
+ self.assertEqual(2, len(xChangesList.getChildren()))
+
+ textStart = "Changed contents\tSheet1.A1\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
+ textEnd = "(Cell A1 changed from '<empty>' to 'Test LibreOffice')"
+ textStart2 = "Changed contents\tSheet1.A2\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
+ textEnd2 = "(Cell A2 changed from '<empty>' to 'Test LibreOffice')"
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].endswith(textEnd2))
+
+ xAccBtn = xTrackDlg.getChild("accept")
+ xAccBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(2, len(xChangesList.getChildren()))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd2))
+ self.assertEqual(get_state_as_dict(xChangesList.getChild('1'))["Text"], "Accepted")
+
+ xAccBtn = xTrackDlg.getChild("accept")
+ xAccBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(1, len(xChangesList.getChildren()))
+ self.assertEqual(get_state_as_dict(xChangesList.getChild('0'))["Text"], "Accepted")
+ xChangesList.getChild('0').executeAction("EXPAND", tuple())
+
+ self.assertEqual(2, len(xChangesList.getChild('0').getChildren()))
+
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].startswith(textStart))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].endswith(textEnd))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].endswith(textEnd2))
+
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Test LibreOffice")
def test_tracked_changes_acceptall(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- self.ui_test.wait_until_child_is_available("grid_window")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #track changes; enter text to cell
- self.xUITest.executeCommand(".uno:TraceChangeMode")
- enter_text_to_cell(gridwin, "A1", "Test LibreOffice")
- enter_text_to_cell(gridwin, "A2", "Test LibreOffice")
- #accept All tracked changes
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
-
- xChangesList = xTrackDlg.getChild("calcchanges")
- self.assertEqual(2, len(xChangesList.getChildren()))
-
- textStart = "Changed contents\tSheet1.A1\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
- textEnd = "(Cell A1 changed from '<empty>' to 'Test LibreOffice')"
- textStart2 = "Changed contents\tSheet1.A2\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
- textEnd2 = "(Cell A2 changed from '<empty>' to 'Test LibreOffice')"
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].endswith(textEnd2))
-
- xAccBtn = xTrackDlg.getChild("acceptall")
- xAccBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(1, len(xChangesList.getChildren()))
- self.assertEqual(get_state_as_dict(xChangesList.getChild('0'))["Text"], "Accepted")
- xChangesList.getChild('0').executeAction("EXPAND", tuple())
-
- self.assertEqual(2, len(xChangesList.getChild('0').getChildren()))
-
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].startswith(textStart))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].endswith(textEnd))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].endswith(textEnd2))
-
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Test LibreOffice")
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ self.ui_test.wait_until_child_is_available("grid_window")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #track changes; enter text to cell
+ self.xUITest.executeCommand(".uno:TraceChangeMode")
+ enter_text_to_cell(gridwin, "A1", "Test LibreOffice")
+ enter_text_to_cell(gridwin, "A2", "Test LibreOffice")
+ #accept All tracked changes
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
+
+ xChangesList = xTrackDlg.getChild("calcchanges")
+ self.assertEqual(2, len(xChangesList.getChildren()))
+
+ textStart = "Changed contents\tSheet1.A1\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
+ textEnd = "(Cell A1 changed from '<empty>' to 'Test LibreOffice')"
+ textStart2 = "Changed contents\tSheet1.A2\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
+ textEnd2 = "(Cell A2 changed from '<empty>' to 'Test LibreOffice')"
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].endswith(textEnd2))
+
+ xAccBtn = xTrackDlg.getChild("acceptall")
+ xAccBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(1, len(xChangesList.getChildren()))
+ self.assertEqual(get_state_as_dict(xChangesList.getChild('0'))["Text"], "Accepted")
+ xChangesList.getChild('0').executeAction("EXPAND", tuple())
+
+ self.assertEqual(2, len(xChangesList.getChild('0').getChildren()))
+
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].startswith(textStart))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].endswith(textEnd))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].endswith(textEnd2))
+
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Test LibreOffice")
def test_tracked_changes_reject(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- self.ui_test.wait_until_child_is_available("grid_window")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #track changes; enter text to cell
- self.xUITest.executeCommand(".uno:TraceChangeMode")
- enter_text_to_cell(gridwin, "A1", "Test LibreOffice")
- enter_text_to_cell(gridwin, "A2", "Test LibreOffice")
- #accept tracked changes
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
-
- xChangesList = xTrackDlg.getChild("calcchanges")
- self.assertEqual(2, len(xChangesList.getChildren()))
-
- textStart = "Changed contents\tSheet1.A1\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
- textEnd = "(Cell A1 changed from '<empty>' to 'Test LibreOffice')"
- textStart2 = "Changed contents\tSheet1.A2\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
- textEnd2 = "(Cell A2 changed from '<empty>' to 'Test LibreOffice')"
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].endswith(textEnd2))
-
- xRejBtn = xTrackDlg.getChild("reject")
- xRejBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(3, len(xChangesList.getChildren()))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd2))
- self.assertEqual(get_state_as_dict(xChangesList.getChild('1'))["Text"], "Accepted")
- self.assertEqual(get_state_as_dict(xChangesList.getChild('2'))["Text"], "Rejected")
-
- xAccBtn = xTrackDlg.getChild("reject")
- xAccBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(2, len(xChangesList.getChildren()))
- self.assertEqual(get_state_as_dict(xChangesList.getChild('0'))["Text"], "Accepted")
- self.assertEqual(get_state_as_dict(xChangesList.getChild('1'))["Text"], "Rejected")
-
- xChangesList.getChild('0').executeAction("EXPAND", tuple())
- self.assertEqual(2, len(xChangesList.getChild('0').getChildren()))
-
- textEnd3 = "(Cell A1 changed from 'Test LibreOffice' to '<empty>')"
- textEnd4 = "(Cell A2 changed from 'Test LibreOffice' to '<empty>')"
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].startswith(textStart))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].endswith(textEnd3))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].endswith(textEnd4))
-
- xChangesList.getChild('1').executeAction("EXPAND", tuple())
- self.assertEqual(2, len(xChangesList.getChild('1').getChildren()))
-
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('0'))["Text"].startswith(textStart))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('0'))["Text"].endswith(textEnd))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('1'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('1'))["Text"].endswith(textEnd2))
-
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ self.ui_test.wait_until_child_is_available("grid_window")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #track changes; enter text to cell
+ self.xUITest.executeCommand(".uno:TraceChangeMode")
+ enter_text_to_cell(gridwin, "A1", "Test LibreOffice")
+ enter_text_to_cell(gridwin, "A2", "Test LibreOffice")
+ #accept tracked changes
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
+
+ xChangesList = xTrackDlg.getChild("calcchanges")
+ self.assertEqual(2, len(xChangesList.getChildren()))
+
+ textStart = "Changed contents\tSheet1.A1\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
+ textEnd = "(Cell A1 changed from '<empty>' to 'Test LibreOffice')"
+ textStart2 = "Changed contents\tSheet1.A2\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
+ textEnd2 = "(Cell A2 changed from '<empty>' to 'Test LibreOffice')"
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].endswith(textEnd2))
+
+ xRejBtn = xTrackDlg.getChild("reject")
+ xRejBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(3, len(xChangesList.getChildren()))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd2))
+ self.assertEqual(get_state_as_dict(xChangesList.getChild('1'))["Text"], "Accepted")
+ self.assertEqual(get_state_as_dict(xChangesList.getChild('2'))["Text"], "Rejected")
+
+ xAccBtn = xTrackDlg.getChild("reject")
+ xAccBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(2, len(xChangesList.getChildren()))
+ self.assertEqual(get_state_as_dict(xChangesList.getChild('0'))["Text"], "Accepted")
+ self.assertEqual(get_state_as_dict(xChangesList.getChild('1'))["Text"], "Rejected")
+
+ xChangesList.getChild('0').executeAction("EXPAND", tuple())
+ self.assertEqual(2, len(xChangesList.getChild('0').getChildren()))
+
+ textEnd3 = "(Cell A1 changed from 'Test LibreOffice' to '<empty>')"
+ textEnd4 = "(Cell A2 changed from 'Test LibreOffice' to '<empty>')"
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].startswith(textStart))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].endswith(textEnd3))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].endswith(textEnd4))
+
+ xChangesList.getChild('1').executeAction("EXPAND", tuple())
+ self.assertEqual(2, len(xChangesList.getChild('1').getChildren()))
+
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('0'))["Text"].startswith(textStart))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('0'))["Text"].endswith(textEnd))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('1'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('1'))["Text"].endswith(textEnd2))
+
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
def test_tracked_changes_rejectall(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- self.ui_test.wait_until_child_is_available("grid_window")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #track changes; enter text to cell
- self.xUITest.executeCommand(".uno:TraceChangeMode")
- enter_text_to_cell(gridwin, "A1", "Test LibreOffice")
- enter_text_to_cell(gridwin, "A2", "Test LibreOffice")
- #accept tracked changes
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
-
- xChangesList = xTrackDlg.getChild("calcchanges")
- self.assertEqual(2, len(xChangesList.getChildren()))
-
- textStart = "Changed contents\tSheet1.A1\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
- textEnd = "(Cell A1 changed from '<empty>' to 'Test LibreOffice')"
- textStart2 = "Changed contents\tSheet1.A2\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
- textEnd2 = "(Cell A2 changed from '<empty>' to 'Test LibreOffice')"
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].endswith(textEnd2))
-
- xAccBtn = xTrackDlg.getChild("rejectall")
- xAccBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(2, len(xChangesList.getChildren()))
- self.assertEqual(get_state_as_dict(xChangesList.getChild('0'))["Text"], "Accepted")
- self.assertEqual(get_state_as_dict(xChangesList.getChild('1'))["Text"], "Rejected")
-
- xChangesList.getChild('0').executeAction("EXPAND", tuple())
- self.assertEqual(2, len(xChangesList.getChild('0').getChildren()))
-
- textEnd3 = "(Cell A1 changed from 'Test LibreOffice' to '<empty>')"
- textEnd4 = "(Cell A2 changed from 'Test LibreOffice' to '<empty>')"
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].endswith(textEnd4))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].startswith(textStart))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].endswith(textEnd3))
-
- xChangesList.getChild('1').executeAction("EXPAND", tuple())
- self.assertEqual(2, len(xChangesList.getChild('1').getChildren()))
-
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('0'))["Text"].startswith(textStart))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('0'))["Text"].endswith(textEnd))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('1'))["Text"].startswith(textStart2))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('1'))["Text"].endswith(textEnd2))
-
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ self.ui_test.wait_until_child_is_available("grid_window")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #track changes; enter text to cell
+ self.xUITest.executeCommand(".uno:TraceChangeMode")
+ enter_text_to_cell(gridwin, "A1", "Test LibreOffice")
+ enter_text_to_cell(gridwin, "A2", "Test LibreOffice")
+ #accept tracked changes
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
+
+ xChangesList = xTrackDlg.getChild("calcchanges")
+ self.assertEqual(2, len(xChangesList.getChildren()))
+
+ textStart = "Changed contents\tSheet1.A1\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
+ textEnd = "(Cell A1 changed from '<empty>' to 'Test LibreOffice')"
+ textStart2 = "Changed contents\tSheet1.A2\t \t" + datetime.datetime.now().strftime("%m/%d/%Y")
+ textEnd2 = "(Cell A2 changed from '<empty>' to 'Test LibreOffice')"
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1'))["Text"].endswith(textEnd2))
+
+ xAccBtn = xTrackDlg.getChild("rejectall")
+ xAccBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(2, len(xChangesList.getChildren()))
+ self.assertEqual(get_state_as_dict(xChangesList.getChild('0'))["Text"], "Accepted")
+ self.assertEqual(get_state_as_dict(xChangesList.getChild('1'))["Text"], "Rejected")
+
+ xChangesList.getChild('0').executeAction("EXPAND", tuple())
+ self.assertEqual(2, len(xChangesList.getChild('0').getChildren()))
+
+ textEnd3 = "(Cell A1 changed from 'Test LibreOffice' to '<empty>')"
+ textEnd4 = "(Cell A2 changed from 'Test LibreOffice' to '<empty>')"
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('0'))["Text"].endswith(textEnd4))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].startswith(textStart))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('0').getChild('1'))["Text"].endswith(textEnd3))
+
+ xChangesList.getChild('1').executeAction("EXPAND", tuple())
+ self.assertEqual(2, len(xChangesList.getChild('1').getChildren()))
+
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('0'))["Text"].startswith(textStart))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('0'))["Text"].endswith(textEnd))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('1'))["Text"].startswith(textStart2))
+ self.assertTrue(get_state_as_dict(xChangesList.getChild('1').getChild('1'))["Text"].endswith(textEnd2))
+
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
def test_tdf136062(self):
diff --git a/sc/qa/uitest/calc_tests6/autoFormat.py b/sc/qa/uitest/calc_tests6/autoFormat.py
index 362a42a6a411..52d9b7d9c253 100644
--- a/sc/qa/uitest/calc_tests6/autoFormat.py
+++ b/sc/qa/uitest/calc_tests6/autoFormat.py
@@ -11,65 +11,63 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class autoFormat(UITestCase):
def test_autoformat_styles(self):
- writer_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 A1:C5
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C5"}))
- #AutoFormat Styles
- self.ui_test.execute_dialog_through_command(".uno:AutoFormat")
- xDialog = self.xUITest.getTopFocusWindow()
+ with 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 A1:C5
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C5"}))
+ #AutoFormat Styles
+ self.ui_test.execute_dialog_through_command(".uno:AutoFormat")
+ xDialog = self.xUITest.getTopFocusWindow()
- formatlb = xDialog.getChild("formatlb")
- numformatcb = xDialog.getChild("numformatcb")
- bordercb = xDialog.getChild("bordercb")
- fontcb = xDialog.getChild("fontcb")
- patterncb = xDialog.getChild("patterncb")
- alignmentcb = xDialog.getChild("alignmentcb")
- autofitcb = xDialog.getChild("autofitcb")
+ formatlb = xDialog.getChild("formatlb")
+ numformatcb = xDialog.getChild("numformatcb")
+ bordercb = xDialog.getChild("bordercb")
+ fontcb = xDialog.getChild("fontcb")
+ patterncb = xDialog.getChild("patterncb")
+ alignmentcb = xDialog.getChild("alignmentcb")
+ autofitcb = xDialog.getChild("autofitcb")
- entry = formatlb.getChild("7") #Financial
- entry.executeAction("SELECT", tuple())
- numformatcb.executeAction("CLICK", tuple())
- bordercb.executeAction("CLICK", tuple())
- fontcb.executeAction("CLICK", tuple())
- patterncb.executeAction("CLICK", tuple())
- alignmentcb.executeAction("CLICK", tuple())
- autofitcb.executeAction("CLICK", tuple())
+ entry = formatlb.getChild("7") #Financial
+ entry.executeAction("SELECT", tuple())
+ numformatcb.executeAction("CLICK", tuple())
+ bordercb.executeAction("CLICK", tuple())
+ fontcb.executeAction("CLICK", tuple())
+ patterncb.executeAction("CLICK", tuple())
+ alignmentcb.executeAction("CLICK", tuple())
+ autofitcb.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.ui_test.execute_dialog_through_command(".uno:AutoFormat")
- xDialog = self.xUITest.getTopFocusWindow()
+ #verify
+ self.ui_test.execute_dialog_through_command(".uno:AutoFormat")
+ xDialog = self.xUITest.getTopFocusWindow()
- formatlb = xDialog.getChild("formatlb")
- numformatcb = xDialog.getChild("numformatcb")
- bordercb = xDialog.getChild("bordercb")
- fontcb = xDialog.getChild("fontcb")
- patterncb = xDialog.getChild("patterncb")
- alignmentcb = xDialog.getChild("alignmentcb")
- autofitcb = xDialog.getChild("autofitcb")
+ formatlb = xDialog.getChild("formatlb")
+ numformatcb = xDialog.getChild("numformatcb")
+ bordercb = xDialog.getChild("bordercb")
+ fontcb = xDialog.getChild("fontcb")
+ patterncb = xDialog.getChild("patterncb")
+ alignmentcb = xDialog.getChild("alignmentcb")
+ autofitcb = xDialog.getChild("autofitcb")
- entry = formatlb.getChild("7") #Financial
- entry.executeAction("SELECT", tuple())
- self.assertEqual(get_state_as_dict(numformatcb)["Selected"], "false")
- self.assertEqual(get_state_as_dict(bordercb)["Selected"], "false")
- self.assertEqual(get_state_as_dict(fontcb)["Selected"], "false")
- self.assertEqual(get_state_as_dict(patterncb)["Selected"], "false")
- self.assertEqual(get_state_as_dict(alignmentcb)["Selected"], "false")
- self.assertEqual(get_state_as_dict(autofitcb)["Selected"], "false")
- numformatcb.executeAction("CLICK", tuple())
- bordercb.executeAction("CLICK", tuple())
- fontcb.executeAction("CLICK", tuple())
- patterncb.executeAction("CLICK", tuple())
- alignmentcb.executeAction("CLICK", tuple())
- autofitcb.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ entry = formatlb.getChild("7") #Financial
+ entry.executeAction("SELECT", tuple())
+ self.assertEqual(get_state_as_dict(numformatcb)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(bordercb)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(fontcb)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(patterncb)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(alignmentcb)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(autofitcb)["Selected"], "false")
+ numformatcb.executeAction("CLICK", tuple())
+ bordercb.executeAction("CLICK", tuple())
+ fontcb.executeAction("CLICK", tuple())
+ patterncb.executeAction("CLICK", tuple())
+ alignmentcb.executeAction("CLICK", tuple())
+ autofitcb.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/autocorrectOptions.py b/sc/qa/uitest/calc_tests6/autocorrectOptions.py
index 8daa3e537bfb..cbe43f0e5214 100644
--- a/sc/qa/uitest/calc_tests6/autocorrectOptions.py
+++ b/sc/qa/uitest/calc_tests6/autocorrectOptions.py
@@ -12,90 +12,88 @@ from uitest.uihelper.common import select_pos
class autocorrectOptions(UITestCase):
def test_autocorrect_options_calc(self):
- self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- self.ui_test.execute_dialog_through_command(".uno:AutoCorrectDlg")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0") #tab replace
- origtext = xDialog.getChild("origtext")
- newtext = xDialog.getChild("newtext")
- xnew = xDialog.getChild("new")
- xdelete = xDialog.getChild("delete")
- xtabview = xDialog.getChild("tabview")
- xreset = xDialog.getChild("reset")
- nrRows = get_state_as_dict(xtabview)["VisibleCount"]
-
- self.assertTrue(int(nrRows) > 0)
-
- #add new rule
- origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- origtext.executeAction("TYPE", mkPropertyValues({"TEXT":"::::"}))
- newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- newtext.executeAction("TYPE", mkPropertyValues({"TEXT":"dvojtecky"}))
- xnew.executeAction("CLICK", tuple())
- nrRowsNew = get_state_as_dict(xtabview)["VisibleCount"]
- nrRowsDiff = int(nrRowsNew) - int(nrRows)
- self.assertEqual(nrRowsDiff, 1) #we have +1 rule
- #delete rule
- origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- origtext.executeAction("TYPE", mkPropertyValues({"TEXT":"::::"}))
- newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- newtext.executeAction("TYPE", mkPropertyValues({"TEXT":"dvojtecky"}))
- xdelete.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(xtabview)["VisibleCount"], nrRows) #we have default nr of rules
-
- select_pos(xTabs, "1") #tab Exceptions
- #abbreviations
- abbrev = xDialog.getChild("abbrev")
- newabbrev = xDialog.getChild("newabbrev")
- delabbrev = xDialog.getChild("delabbrev")
- abbrevlist = xDialog.getChild("abbrevlist")
-
- nrRowsAbb = get_state_as_dict(abbrevlist)["VisibleCount"]
-
- self.assertTrue(int(nrRowsAbb) > 0)
-
- abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- abbrev.executeAction("TYPE", mkPropertyValues({"TEXT":"qqqqq"}))
- newabbrev.executeAction("CLICK", tuple())
- nrRowsAbbNew = get_state_as_dict(abbrevlist)["VisibleCount"]
- nrRowsAbbDiff = int(nrRowsAbbNew) - int(nrRowsAbb)
- self.assertEqual(nrRowsAbbDiff, 1) #we have +1 rule
- delabbrev.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(abbrevlist)["VisibleCount"], nrRowsAbb) #we have default nr of rules
-
- #words with two initial capitals
- double = xDialog.getChild("double")
- newdouble = xDialog.getChild("newdouble")
- deldouble = xDialog.getChild("deldouble")
- doublelist = xDialog.getChild("doublelist")
-
- nrRowsDouble = get_state_as_dict(doublelist)["VisibleCount"]
-
- self.assertTrue(int(nrRowsDouble) > 0)
-
- double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- double.executeAction("TYPE", mkPropertyValues({"TEXT":"QQqqq"}))
- newdouble.executeAction("CLICK", tuple())
- nrRowsDoubleNew = get_state_as_dict(doublelist)["VisibleCount"]
- nrRowsDoubleDiff = int(nrRowsDoubleNew) - int(nrRowsDouble) #convert string and
- self.assertEqual(nrRowsDoubleDiff, 1) #we have +1 rule
- deldouble.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(doublelist)["VisibleCount"], nrRowsDouble) #we have default nr of rules
-
- xCancelButton = xDialog.getChild("cancel")
- xCancelButton.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ self.ui_test.execute_dialog_through_command(".uno:AutoCorrectDlg")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0") #tab replace
+ origtext = xDialog.getChild("origtext")
+ newtext = xDialog.getChild("newtext")
+ xnew = xDialog.getChild("new")
+ xdelete = xDialog.getChild("delete")
+ xtabview = xDialog.getChild("tabview")
+ xreset = xDialog.getChild("reset")
+ nrRows = get_state_as_dict(xtabview)["VisibleCount"]
+
+ self.assertTrue(int(nrRows) > 0)
+
+ #add new rule
+ origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ origtext.executeAction("TYPE", mkPropertyValues({"TEXT":"::::"}))
+ newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ newtext.executeAction("TYPE", mkPropertyValues({"TEXT":"dvojtecky"}))
+ xnew.executeAction("CLICK", tuple())
+ nrRowsNew = get_state_as_dict(xtabview)["VisibleCount"]
+ nrRowsDiff = int(nrRowsNew) - int(nrRows)
+ self.assertEqual(nrRowsDiff, 1) #we have +1 rule
+ #delete rule
+ origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ origtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ origtext.executeAction("TYPE", mkPropertyValues({"TEXT":"::::"}))
+ newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ newtext.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ newtext.executeAction("TYPE", mkPropertyValues({"TEXT":"dvojtecky"}))
+ xdelete.executeAction("CLICK", tuple())
+ self.assertEqual(get_state_as_dict(xtabview)["VisibleCount"], nrRows) #we have default nr of rules
+
+ select_pos(xTabs, "1") #tab Exceptions
+ #abbreviations
+ abbrev = xDialog.getChild("abbrev")
+ newabbrev = xDialog.getChild("newabbrev")
+ delabbrev = xDialog.getChild("delabbrev")
+ abbrevlist = xDialog.getChild("abbrevlist")
+
+ nrRowsAbb = get_state_as_dict(abbrevlist)["VisibleCount"]
+
+ self.assertTrue(int(nrRowsAbb) > 0)
+
+ abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ abbrev.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ abbrev.executeAction("TYPE", mkPropertyValues({"TEXT":"qqqqq"}))
+ newabbrev.executeAction("CLICK", tuple())
+ nrRowsAbbNew = get_state_as_dict(abbrevlist)["VisibleCount"]
+ nrRowsAbbDiff = int(nrRowsAbbNew) - int(nrRowsAbb)
+ self.assertEqual(nrRowsAbbDiff, 1) #we have +1 rule
+ delabbrev.executeAction("CLICK", tuple())
+ self.assertEqual(get_state_as_dict(abbrevlist)["VisibleCount"], nrRowsAbb) #we have default nr of rules
+
+ #words with two initial capitals
+ double = xDialog.getChild("double")
+ newdouble = xDialog.getChild("newdouble")
+ deldouble = xDialog.getChild("deldouble")
+ doublelist = xDialog.getChild("doublelist")
+
+ nrRowsDouble = get_state_as_dict(doublelist)["VisibleCount"]
+
+ self.assertTrue(int(nrRowsDouble) > 0)
+
+ double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ double.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ double.executeAction("TYPE", mkPropertyValues({"TEXT":"QQqqq"}))
+ newdouble.executeAction("CLICK", tuple())
+ nrRowsDoubleNew = get_state_as_dict(doublelist)["VisibleCount"]
+ nrRowsDoubleDiff = int(nrRowsDoubleNew) - int(nrRowsDouble) #convert string and
+ self.assertEqual(nrRowsDoubleDiff, 1) #we have +1 rule
+ deldouble.executeAction("CLICK", tuple())
+ self.assertEqual(get_state_as_dict(doublelist)["VisibleCount"], nrRowsDouble) #we have default nr of rules
+
+ xCancelButton = xDialog.getChild("cancel")
+ xCancelButton.executeAction("CLICK", tuple())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/hideShowSheet.py b/sc/qa/uitest/calc_tests6/hideShowSheet.py
index c6fccd92561b..9d4ea336ff4f 100644
--- a/sc/qa/uitest/calc_tests6/hideShowSheet.py
+++ b/sc/qa/uitest/calc_tests6/hideShowSheet.py
@@ -11,45 +11,43 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class hideShowSheet(UITestCase):
def test_hide_show_sheet(self):
- writer_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()
- #insert sheet
- self.ui_test.execute_dialog_through_command(".uno:Insert")
- current_dialog = self.xUITest.getTopFocusWindow()
- xOkButton = current_dialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkButton)
- #select sheet
- gridwin.executeAction("SELECT", mkPropertyValues({"TABLE":"1"}))
- self.assertEqual(get_state_as_dict(gridwin)["SelectedTable"], "1")
- #hide sheet
- self.xUITest.executeCommand(".uno:Hide")
- #show sheet Dialog
- self.ui_test.execute_dialog_through_command(".uno:Show")
- xDialog = self.xUITest.getTopFocusWindow()
- treeview = xDialog.getChild("treeview")
- self.assertEqual(get_state_as_dict(treeview)["Children"], "1")
- xcancel = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancel)
- #insert 2nd sheet
- self.ui_test.execute_dialog_through_command(".uno:Insert")
- current_dialog = self.xUITest.getTopFocusWindow()
- xOkButton = current_dialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkButton)
- #select sheet
- gridwin.executeAction("SELECT", mkPropertyValues({"TABLE":"2"}))
- self.assertEqual(get_state_as_dict(gridwin)["SelectedTable"], "1")
- #hide sheet
- self.xUITest.executeCommand(".uno:Hide")
- #show sheet Dialog
- self.ui_test.execute_dialog_through_command(".uno:Show")
- xDialog = self.xUITest.getTopFocusWindow()
- treeview = xDialog.getChild("treeview")
- self.assertEqual(get_state_as_dict(treeview)["Children"], "2")
- xcancel = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancel)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #insert sheet
+ self.ui_test.execute_dialog_through_command(".uno:Insert")
+ current_dialog = self.xUITest.getTopFocusWindow()
+ xOkButton = current_dialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkButton)
+ #select sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"TABLE":"1"}))
+ self.assertEqual(get_state_as_dict(gridwin)["SelectedTable"], "1")
+ #hide sheet
+ self.xUITest.executeCommand(".uno:Hide")
+ #show sheet Dialog
+ self.ui_test.execute_dialog_through_command(".uno:Show")
+ xDialog = self.xUITest.getTopFocusWindow()
+ treeview = xDialog.getChild("treeview")
+ self.assertEqual(get_state_as_dict(treeview)["Children"], "1")
+ xcancel = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancel)
+ #insert 2nd sheet
+ self.ui_test.execute_dialog_through_command(".uno:Insert")
+ current_dialog = self.xUITest.getTopFocusWindow()
+ xOkButton = current_dialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkButton)
+ #select sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"TABLE":"2"}))
+ self.assertEqual(get_state_as_dict(gridwin)["SelectedTable"], "1")
+ #hide sheet
+ self.xUITest.executeCommand(".uno:Hide")
+ #show sheet Dialog
+ self.ui_test.execute_dialog_through_command(".uno:Show")
+ xDialog = self.xUITest.getTopFocusWindow()
+ treeview = xDialog.getChild("treeview")
+ self.assertEqual(get_state_as_dict(treeview)["Children"], "2")
+ xcancel = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancel)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/moveCopySheet.py b/sc/qa/uitest/calc_tests6/moveCopySheet.py
index 8a0465c376e8..7c63b76672b8 100644
--- a/sc/qa/uitest/calc_tests6/moveCopySheet.py
+++ b/sc/qa/uitest/calc_tests6/moveCopySheet.py
@@ -11,70 +11,68 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class moveCopySheet(UITestCase):
def test_copy_move_sheet(self):
- writer_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()
- #default - 1 sheet; select the sheet (is selected), dialog move/copy sheet
- self.ui_test.execute_dialog_through_command(".uno:Move")
- xDialog = self.xUITest.getTopFocusWindow()
- #new name = newName
- newName = xDialog.getChild("newName")
- newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- newName.executeAction("TYPE", mkPropertyValues({"TEXT":"newName"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify, the file has 2 sheets; first one "newName" is selected
- self.assertEqual(document.Sheets.getCount(), 2)
- # dialog move/copy sheet ; Move is selected; select -move to end position - ; New Name = moveName
- self.ui_test.execute_dialog_through_command(".uno:Move")
- xDialog = self.xUITest.getTopFocusWindow()
- insertBefore = xDialog.getChild("insertBefore")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #default - 1 sheet; select the sheet (is selected), dialog move/copy sheet
+ self.ui_test.execute_dialog_through_command(".uno:Move")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #new name = newName
+ newName = xDialog.getChild("newName")
+ newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ newName.executeAction("TYPE", mkPropertyValues({"TEXT":"newName"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify, the file has 2 sheets; first one "newName" is selected
+ self.assertEqual(document.Sheets.getCount(), 2)
+ # dialog move/copy sheet ; Move is selected; select -move to end position - ; New Name = moveName
+ self.ui_test.execute_dialog_through_command(".uno:Move")
+ xDialog = self.xUITest.getTopFocusWindow()
+ insertBefore = xDialog.getChild("insertBefore")
- xTreeEntry = insertBefore.getChild('2')
- xTreeEntry.executeAction("SELECT", tuple())
+ xTreeEntry = insertBefore.getChild('2')
+ xTreeEntry.executeAction("SELECT", tuple())
- newName = xDialog.getChild("newName")
- self.assertEqual(get_state_as_dict(newName)["Text"], "newName")
- newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- newName.executeAction("TYPE", mkPropertyValues({"TEXT":"moveName"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- # Verify, the file has 2 sheets; first one is "Sheet1" ; second one is "moveName"
- self.assertEqual(document.Sheets.getCount(), 2)
+ newName = xDialog.getChild("newName")
+ self.assertEqual(get_state_as_dict(newName)["Text"], "newName")
+ newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ newName.executeAction("TYPE", mkPropertyValues({"TEXT":"moveName"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ # Verify, the file has 2 sheets; first one is "Sheet1" ; second one is "moveName"
+ self.assertEqual(document.Sheets.getCount(), 2)
- self.assertEqual(document.Sheets[0].Name, "Sheet1")
- self.assertEqual(document.Sheets[1].Name, "moveName")
+ self.assertEqual(document.Sheets[0].Name, "Sheet1")
+ self.assertEqual(document.Sheets[1].Name, "moveName")
- # Verify that the cancel button does not do anything
- self.ui_test.execute_dialog_through_command(".uno:Move")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ # Verify that the cancel button does not do anything
+ self.ui_test.execute_dialog_through_command(".uno:Move")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
- self.assertEqual(document.Sheets.getCount(), 2)
- self.assertEqual(document.Sheets[0].Name, "Sheet1")
- self.assertEqual(document.Sheets[1].Name, "moveName")
+ self.assertEqual(document.Sheets.getCount(), 2)
+ self.assertEqual(document.Sheets[0].Name, "Sheet1")
+ self.assertEqual(document.Sheets[1].Name, "moveName")
- #Check copy option
- self.ui_test.execute_dialog_through_command(".uno:Move")
- xDialog = self.xUITest.getTopFocusWindow()
- xCopy = xDialog.getChild("copy")
- xCopy.executeAction("CLICK", tuple())
- sheetName = "moveName_2"
- newName = xDialog.getChild("newName")
- self.assertEqual(get_state_as_dict(newName)["Text"], sheetName)
+ #Check copy option
+ self.ui_test.execute_dialog_through_command(".uno:Move")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCopy = xDialog.getChild("copy")
+ xCopy.executeAction("CLICK", tuple())
+ sheetName = "moveName_2"
+ newName = xDialog.getChild("newName")
+ self.assertEqual(get_state_as_dict(newName)["Text"], sheetName)
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.assertEqual(document.Sheets.getCount(), 3)
- self.assertEqual(document.Sheets[0].Name, sheetName)
- self.assertEqual(document.Sheets[1].Name, "Sheet1")
- self.assertEqual(document.Sheets[2].Name, "moveName")
-
- self.ui_test.close_doc()
+ self.assertEqual(document.Sheets.getCount(), 3)
+ self.assertEqual(document.Sheets[0].Name, sheetName)
+ self.assertEqual(document.Sheets[1].Name, "Sheet1")
+ self.assertEqual(document.Sheets[2].Name, "moveName")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/multipleOperations.py b/sc/qa/uitest/calc_tests6/multipleOperations.py
index 1f60937b056a..fc5f40882939 100644
--- a/sc/qa/uitest/calc_tests6/multipleOperations.py
+++ b/sc/qa/uitest/calc_tests6/multipleOperations.py
@@ -14,112 +14,109 @@ from uitest.uihelper.calc import enter_text_to_cell
class multipleOperations(UITestCase):
def test_multiple_operations_one_variable(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()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #enter data
- enter_text_to_cell(xGridWindow, "B1", "10")
- enter_text_to_cell(xGridWindow, "B2", "2")
- enter_text_to_cell(xGridWindow, "B3", "10000")
- enter_text_to_cell(xGridWindow, "B4", "2000")
- enter_text_to_cell(xGridWindow, "B5", "=B4*(B1-B2)-B3")
+ #enter data
+ enter_text_to_cell(xGridWindow, "B1", "10")
+ enter_text_to_cell(xGridWindow, "B2", "2")
+ enter_text_to_cell(xGridWindow, "B3", "10000")
+ enter_text_to_cell(xGridWindow, "B4", "2000")
+ enter_text_to_cell(xGridWindow, "B5", "=B4*(B1-B2)-B3")
- enter_text_to_cell(xGridWindow, "D2", "500")
- enter_text_to_cell(xGridWindow, "D3", "1000")
- enter_text_to_cell(xGridWindow, "D4", "1500")
- enter_text_to_cell(xGridWindow, "D5", "2000")
- enter_text_to_cell(xGridWindow, "D6", "2500")
- enter_text_to_cell(xGridWindow, "D7", "3000")
- enter_text_to_cell(xGridWindow, "D8", "3500")
- enter_text_to_cell(xGridWindow, "D9", "4000")
- enter_text_to_cell(xGridWindow, "D10", "4500")
- enter_text_to_cell(xGridWindow, "D11", "5000")
- #Select the range D2:E11
- xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "D2:E11"}))
- #Choose Data > Multiple Operations.
- self.ui_test.execute_modeless_dialog_through_command(".uno:TableOperationDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- #Formulas = B5 ; Column input cell = B4
- formulas = xDialog.getChild("formulas")
- col = xDialog.getChild("col")
- formulas.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$5"}))
- col.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$4"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), -6000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), -2000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 2000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 6000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 5).getValue(), 10000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 6).getValue(), 14000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 7).getValue(), 18000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 8).getValue(), 22000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 9).getValue(), 26000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 10).getValue(), 30000)
+ enter_text_to_cell(xGridWindow, "D2", "500")
+ enter_text_to_cell(xGridWindow, "D3", "1000")
+ enter_text_to_cell(xGridWindow, "D4", "1500")
+ enter_text_to_cell(xGridWindow, "D5", "2000")
+ enter_text_to_cell(xGridWindow, "D6", "2500")
+ enter_text_to_cell(xGridWindow, "D7", "3000")
+ enter_text_to_cell(xGridWindow, "D8", "3500")
+ enter_text_to_cell(xGridWindow, "D9", "4000")
+ enter_text_to_cell(xGridWindow, "D10", "4500")
+ enter_text_to_cell(xGridWindow, "D11", "5000")
+ #Select the range D2:E11
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "D2:E11"}))
+ #Choose Data > Multiple Operations.
+ self.ui_test.execute_modeless_dialog_through_command(".uno:TableOperationDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Formulas = B5 ; Column input cell = B4
+ formulas = xDialog.getChild("formulas")
+ col = xDialog.getChild("col")
+ formulas.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$5"}))
+ col.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$4"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), -6000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), -2000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 2000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 6000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 5).getValue(), 10000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 6).getValue(), 14000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 7).getValue(), 18000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 8).getValue(), 22000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 9).getValue(), 26000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 10).getValue(), 30000)
- self.ui_test.close_doc()
def test_multiple_operations_several_formulas(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()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #enter data
- enter_text_to_cell(xGridWindow, "B1", "10")
- enter_text_to_cell(xGridWindow, "B2", "2")
- enter_text_to_cell(xGridWindow, "B3", "10000")
- enter_text_to_cell(xGridWindow, "B4", "2000")
- enter_text_to_cell(xGridWindow, "B5", "=B4*(B1-B2)-B3")
- enter_text_to_cell(xGridWindow, "C5", "=B5/B4")
+ #enter data
+ enter_text_to_cell(xGridWindow, "B1", "10")
+ enter_text_to_cell(xGridWindow, "B2", "2")
+ enter_text_to_cell(xGridWindow, "B3", "10000")
+ enter_text_to_cell(xGridWindow, "B4", "2000")
+ enter_text_to_cell(xGridWindow, "B5", "=B4*(B1-B2)-B3")
+ enter_text_to_cell(xGridWindow, "C5", "=B5/B4")
- enter_text_to_cell(xGridWindow, "D2", "500")
- enter_text_to_cell(xGridWindow, "D3", "1000")
- enter_text_to_cell(xGridWindow, "D4", "1500")
- enter_text_to_cell(xGridWindow, "D5", "2000")
- enter_text_to_cell(xGridWindow, "D6", "2500")
- enter_text_to_cell(xGridWindow, "D7", "3000")
- enter_text_to_cell(xGridWindow, "D8", "3500")
- enter_text_to_cell(xGridWindow, "D9", "4000")
- enter_text_to_cell(xGridWindow, "D10", "4500")
- enter_text_to_cell(xGridWindow, "D11", "5000")
- #Select the range D2:F11
- xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "D2:F11"}))
- #Choose Data > Multiple Operations.
- self.ui_test.execute_modeless_dialog_through_command(".uno:TableOperationDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- #Formulas = B5 ; Column input cell = B4
- formulas = xDialog.getChild("formulas")
- col = xDialog.getChild("col")
- formulas.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$5:$C$5"}))
- col.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$4"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), -6000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), -2000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 2000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 6000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 5).getValue(), 10000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 6).getValue(), 14000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 7).getValue(), 18000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 8).getValue(), 22000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 9).getValue(), 26000)
- self.assertEqual(get_cell_by_position(document, 0, 4, 10).getValue(), 30000)
+ enter_text_to_cell(xGridWindow, "D2", "500")
+ enter_text_to_cell(xGridWindow, "D3", "1000")
+ enter_text_to_cell(xGridWindow, "D4", "1500")
+ enter_text_to_cell(xGridWindow, "D5", "2000")
+ enter_text_to_cell(xGridWindow, "D6", "2500")
+ enter_text_to_cell(xGridWindow, "D7", "3000")
+ enter_text_to_cell(xGridWindow, "D8", "3500")
+ enter_text_to_cell(xGridWindow, "D9", "4000")
+ enter_text_to_cell(xGridWindow, "D10", "4500")
+ enter_text_to_cell(xGridWindow, "D11", "5000")
+ #Select the range D2:F11
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "D2:F11"}))
+ #Choose Data > Multiple Operations.
+ self.ui_test.execute_modeless_dialog_through_command(".uno:TableOperationDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Formulas = B5 ; Column input cell = B4
+ formulas = xDialog.getChild("formulas")
+ col = xDialog.getChild("col")
+ formulas.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$5:$C$5"}))
+ col.executeAction("TYPE", mkPropertyValues({"TEXT":"$B$4"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), -6000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), -2000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 2000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 6000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 5).getValue(), 10000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 6).getValue(), 14000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 7).getValue(), 18000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 8).getValue(), 22000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 9).getValue(), 26000)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 10).getValue(), 30000)
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), -12)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), -2)
- self.assertEqual(round(get_cell_by_position(document, 0, 5, 3).getValue(),2), 1.33)
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 5, 5).getValue(), 4)
- self.assertEqual(round(get_cell_by_position(document, 0, 5, 6).getValue(),2), 4.67)
- self.assertEqual(round(get_cell_by_position(document, 0, 5, 7).getValue(),2), 5.14)
- self.assertEqual(get_cell_by_position(document, 0, 5, 8).getValue(), 5.5)
- self.assertEqual(round(get_cell_by_position(document, 0, 5, 9).getValue(),2), 5.78)
- self.assertEqual(get_cell_by_position(document, 0, 5, 10).getValue(), 6)
-
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), -12)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), -2)
+ self.assertEqual(round(get_cell_by_position(document, 0, 5, 3).getValue(),2), 1.33)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 5).getValue(), 4)
+ self.assertEqual(round(get_cell_by_position(document, 0, 5, 6).getValue(),2), 4.67)
+ self.assertEqual(round(get_cell_by_position(document, 0, 5, 7).getValue(),2), 5.14)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 8).getValue(), 5.5)
+ self.assertEqual(round(get_cell_by_position(document, 0, 5, 9).getValue(),2), 5.78)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 10).getValue(), 6)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/scenarios.py b/sc/qa/uitest/calc_tests6/scenarios.py
index 64469be7a2ea..f0ba6dd3f1e2 100644
--- a/sc/qa/uitest/calc_tests6/scenarios.py
+++ b/sc/qa/uitest/calc_tests6/scenarios.py
@@ -13,38 +13,37 @@ from uitest.uihelper.calc import enter_text_to_cell
class scenarios(UITestCase):
def test_scenarios(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()
-
- #fill B1:B4 with 1, select B1:B4;
- enter_text_to_cell(xGridWindow, "B1", "1")
- enter_text_to_cell(xGridWindow, "B2", "1")
- enter_text_to_cell(xGridWindow, "B3", "1")
- enter_text_to_cell(xGridWindow, "B4", "1")
- xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B4"}))
- #scenarios - scenario A1
- self.ui_test.execute_dialog_through_command(".uno:ScenarioManager")
- xDialog = self.xUITest.getTopFocusWindow()
-
- name = xDialog.getChild("name")
- name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- name.executeAction("TYPE", mkPropertyValues({"TEXT":"A1"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #next scenarios - scenario B1
- self.ui_test.execute_dialog_through_command(".uno:ScenarioManager")
- xDialog = self.xUITest.getTopFocusWindow()
-
- name = xDialog.getChild("name")
- name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- name.executeAction("TYPE", mkPropertyValues({"TEXT":"B1"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ #fill B1:B4 with 1, select B1:B4;
+ enter_text_to_cell(xGridWindow, "B1", "1")
+ enter_text_to_cell(xGridWindow, "B2", "1")
+ enter_text_to_cell(xGridWindow, "B3", "1")
+ enter_text_to_cell(xGridWindow, "B4", "1")
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B4"}))
+ #scenarios - scenario A1
+ self.ui_test.execute_dialog_through_command(".uno:ScenarioManager")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ name = xDialog.getChild("name")
+ name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ name.executeAction("TYPE", mkPropertyValues({"TEXT":"A1"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #next scenarios - scenario B1
+ self.ui_test.execute_dialog_through_command(".uno:ScenarioManager")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ name = xDialog.getChild("name")
+ name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ name.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ name.executeAction("TYPE", mkPropertyValues({"TEXT":"B1"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/shareSpreadsheet.py b/sc/qa/uitest/calc_tests6/shareSpreadsheet.py
index 032b32271e9a..cdded955a851 100644
--- a/sc/qa/uitest/calc_tests6/shareSpreadsheet.py
+++ b/sc/qa/uitest/calc_tests6/shareSpreadsheet.py
@@ -12,21 +12,20 @@ from uitest.uihelper.common import get_state_as_dict
class shareSpreadsheet(UITestCase):
def test_share_spreadsheet(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()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #dialog shareSpreadsheet
- self.ui_test.execute_dialog_through_command(".uno:ShareDocument")
- xDialog = self.xUITest.getTopFocusWindow()
+ #dialog shareSpreadsheet
+ self.ui_test.execute_dialog_through_command(".uno:ShareDocument")
+ xDialog = self.xUITest.getTopFocusWindow()
- share = xDialog.getChild("share")
- share.executeAction("CLICK", tuple())
- users = xDialog.getChild("users")
- self.assertEqual(get_state_as_dict(users)["Children"], "1")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ share = xDialog.getChild("share")
+ share.executeAction("CLICK", tuple())
+ users = xDialog.getChild("users")
+ self.assertEqual(get_state_as_dict(users)["Children"], "1")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/tdf104378.py b/sc/qa/uitest/calc_tests6/tdf104378.py
index 44c786019636..317b0eeb13d3 100644
--- a/sc/qa/uitest/calc_tests6/tdf104378.py
+++ b/sc/qa/uitest/calc_tests6/tdf104378.py
@@ -11,26 +11,24 @@ from libreoffice.calc.document import get_cell_by_position
class tdf104378(UITestCase):
def test_tdf104378(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- enter_text_to_cell(gridwin, "A1", "遠程MySQL連接遠程MySQL連接遠程MySQL連接")
+ enter_text_to_cell(gridwin, "A1", "遠程MySQL連接遠程MySQL連接遠程MySQL連接")
- self.ui_test.execute_dialog_through_command(".uno:ChineseConversion")
+ self.ui_test.execute_dialog_through_command(".uno:ChineseConversion")
- xDialog = self.xUITest.getTopFocusWindow()
- xOKBtn = xDialog.getChild('ok')
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKBtn = xDialog.getChild('ok')
+ self.ui_test.close_dialog_through_button(xOKBtn)
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- # Without the fix in place, this test would have failed with
- # - 远程MySQL連接遠程MySQL連接遠程MySQL連接
- # + 远程MySQL连接远程MySQL连接远程MySQL连接
- self.assertEqual(get_cell_by_position(
- document, 0, 0, 0).getString(), "远程MySQL连接远程MySQL连接远程MySQL连接")
-
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have failed with
+ # - 远程MySQL連接遠程MySQL連接遠程MySQL連接
+ # + 远程MySQL连接远程MySQL连接远程MySQL连接
+ self.assertEqual(get_cell_by_position(
+ document, 0, 0, 0).getString(), "远程MySQL连接远程MySQL连接远程MySQL连接")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/tdf116996.py b/sc/qa/uitest/calc_tests6/tdf116996.py
index 31cde88f909b..44b71325b0d2 100644
--- a/sc/qa/uitest/calc_tests6/tdf116996.py
+++ b/sc/qa/uitest/calc_tests6/tdf116996.py
@@ -11,43 +11,42 @@ from uitest.uihelper.common import get_state_as_dict
class tdf116996(UITestCase):
def test_tdf116996_enable_experimental_feature(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
-
- xPages = xDialogOpt.getChild("pages")
- xLOEntry = xPages.getChild('0') # Libreoffice
- xLOEntry.executeAction("EXPAND", tuple())
- xAdvancedEntry = xLOEntry.getChild('10')
- xAdvancedEntry.executeAction("SELECT", tuple()) #Libreoffice / Advanced
- xexperimental = xDialogOpt.getChild("experimental")
- xexperimental.executeAction("CLICK", tuple()) #enable experimental features
-
- xOKBtn = xDialogOpt.getChild("ok")
-
- with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="no"):
- pass
-
- #reopen options dialog and verify
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xLOEntry = xPages.getChild('0') # Libreoffice
- xLOEntry.executeAction("EXPAND", tuple())
- xAdvancedEntry = xLOEntry.getChild('10')
- xAdvancedEntry.executeAction("SELECT", tuple()) #Libreoffice / Advanced
- xexperimental = xDialogOpt.getChild("experimental")
-
- self.assertEqual(get_state_as_dict(xexperimental)["Selected"], "true")
- xexperimental.executeAction("CLICK", tuple()) #disable experimental features
- xOKBtn = xDialogOpt.getChild("ok")
-
- with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="no"):
- pass
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+
+ xPages = xDialogOpt.getChild("pages")
+ xLOEntry = xPages.getChild('0') # Libreoffice
+ xLOEntry.executeAction("EXPAND", tuple())
+ xAdvancedEntry = xLOEntry.getChild('10')
+ xAdvancedEntry.executeAction("SELECT", tuple()) #Libreoffice / Advanced
+ xexperimental = xDialogOpt.getChild("experimental")
+ xexperimental.executeAction("CLICK", tuple()) #enable experimental features
+
+ xOKBtn = xDialogOpt.getChild("ok")
+
+ with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="no"):
+ pass
+
+ #reopen options dialog and verify
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+ xPages = xDialogOpt.getChild("pages")
+ xLOEntry = xPages.getChild('0') # Libreoffice
+ xLOEntry.executeAction("EXPAND", tuple())
+ xAdvancedEntry = xLOEntry.getChild('10')
+ xAdvancedEntry.executeAction("SELECT", tuple()) #Libreoffice / Advanced
+ xexperimental = xDialogOpt.getChild("experimental")
+
+ self.assertEqual(get_state_as_dict(xexperimental)["Selected"], "true")
+ xexperimental.executeAction("CLICK", tuple()) #disable experimental features
+ xOKBtn = xDialogOpt.getChild("ok")
+
+ with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="no"):
+ pass
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/tdf121263.py b/sc/qa/uitest/calc_tests6/tdf121263.py
index 9d80fc24c64d..73677e42f9db 100644
--- a/sc/qa/uitest/calc_tests6/tdf121263.py
+++ b/sc/qa/uitest/calc_tests6/tdf121263.py
@@ -13,34 +13,33 @@ from uitest.uihelper.common import get_state_as_dict
class tdf121263(UITestCase):
def test_tdf121263_hide_more_sheets(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")
-
- self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("ok")
- xOKButton.executeAction("CLICK", tuple())
- self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("ok")
- xOKButton.executeAction("CLICK", tuple())
-
- gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "2"}))
- #select previous sheet
- self.xUITest.executeCommand(".uno:JumpToPrevTableSel")
-
- #hide sheet
- self.xUITest.executeCommand(".uno:Hide")
-
- #show sheet Dialog
- self.ui_test.execute_dialog_through_command(".uno:Show")
- xDialog = self.xUITest.getTopFocusWindow()
- treeview = xDialog.getChild("treeview")
- self.assertEqual(get_state_as_dict(treeview)["Children"], "2")
- xcancel = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancel)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xTopWindow = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ gridwin = xTopWindow.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())
+ self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKButton = xDialog.getChild("ok")
+ xOKButton.executeAction("CLICK", tuple())
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "2"}))
+ #select previous sheet
+ self.xUITest.executeCommand(".uno:JumpToPrevTableSel")
+
+ #hide sheet
+ self.xUITest.executeCommand(".uno:Hide")
+
+ #show sheet Dialog
+ self.ui_test.execute_dialog_through_command(".uno:Show")
+ xDialog = self.xUITest.getTopFocusWindow()
+ treeview = xDialog.getChild("treeview")
+ self.assertEqual(get_state_as_dict(treeview)["Children"], "2")
+ xcancel = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancel)
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/tdf91726.py b/sc/qa/uitest/calc_tests6/tdf91726.py
index bc134547aaf8..6c720e240629 100644
--- a/sc/qa/uitest/calc_tests6/tdf91726.py
+++ b/sc/qa/uitest/calc_tests6/tdf91726.py
@@ -11,41 +11,39 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf91726(UITestCase):
def test_tdf91726_new_style(self):
- writer_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 A1:E9
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:E9"}))
- #AutoFormat Styles
- self.ui_test.execute_dialog_through_command(".uno:AutoFormat")
- xDialog = self.xUITest.getTopFocusWindow()
- #add new style "Default"
- xadd = xDialog.getChild("add")
-
- # Use empty close_button to open consecutive dialogs
- with self.ui_test.execute_blocking_action(
- xadd.executeAction, args=('CLICK', ()), close_button="") as dialog:
- nameEntry = dialog.getChild("name_entry")
- nameEntry.executeAction("TYPE", mkPropertyValues({"TEXT":"Default"}))
- xOKBtn = dialog.getChild("ok")
+ with 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 A1:E9
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:E9"}))
+ #AutoFormat Styles
+ self.ui_test.execute_dialog_through_command(".uno:AutoFormat")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #add new style "Default"
+ xadd = xDialog.getChild("add")
+ # Use empty close_button to open consecutive dialogs
with self.ui_test.execute_blocking_action(
- xOKBtn.executeAction, args=('CLICK', ()), close_button="") as dialog2:
- #Error message: You have entered an invalid name.
- #AutoFormat could not be created.
- #Try again using a different name.
- xOKBtn2 = dialog2.getChild("ok")
+ xadd.executeAction, args=('CLICK', ()), close_button="") as dialog:
+ nameEntry = dialog.getChild("name_entry")
+ nameEntry.executeAction("TYPE", mkPropertyValues({"TEXT":"Default"}))
+ xOKBtn = dialog.getChild("ok")
with self.ui_test.execute_blocking_action(
- xOKBtn2.executeAction, args=('CLICK', ()), close_button="cancel") as dialog3:
- nameEntry = dialog3.getChild("name_entry")
- #back to name dialog, LO should not crash
- self.assertEqual(get_state_as_dict(nameEntry)["Text"], "Default")
+ xOKBtn.executeAction, args=('CLICK', ()), close_button="") as dialog2:
+ #Error message: You have entered an invalid name.
+ #AutoFormat could not be created.
+ #Try again using a different name.
+ xOKBtn2 = dialog2.getChild("ok")
- xCanceltn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanceltn)
+ with self.ui_test.execute_blocking_action(
+ xOKBtn2.executeAction, args=('CLICK', ()), close_button="cancel") as dialog3:
+ nameEntry = dialog3.getChild("name_entry")
+ #back to name dialog, LO should not crash
+ self.assertEqual(get_state_as_dict(nameEntry)["Text"], "Default")
- self.ui_test.close_doc()
+ xCanceltn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanceltn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests7/tdf106667.py b/sc/qa/uitest/calc_tests7/tdf106667.py
index 6c2792d1b403..16c6dfa14add 100644
--- a/sc/qa/uitest/calc_tests7/tdf106667.py
+++ b/sc/qa/uitest/calc_tests7/tdf106667.py
@@ -13,24 +13,23 @@ from libreoffice.calc.document import get_cell_by_position
class tdf106667(UITestCase):
def test_tdf106667_about_dlg_all(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with 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", "A")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A1000"}))
+ enter_text_to_cell(gridwin, "A1", "A")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A1000"}))
- self.xUITest.executeCommand(".uno:FillDown")
+ self.xUITest.executeCommand(".uno:FillDown")
- self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:SelectAll")
- self.ui_test.execute_dialog_through_command(".uno:About")
- xAboutDlg = self.xUITest.getTopFocusWindow()
- xCloseBtn = xAboutDlg.getChild("btnClose")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.execute_dialog_through_command(".uno:About")
+ xAboutDlg = self.xUITest.getTopFocusWindow()
+ xCloseBtn = xAboutDlg.getChild("btnClose")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests7/tdf117987.py b/sc/qa/uitest/calc_tests7/tdf117987.py
index 3de0b176ed01..e2a655222b15 100644
--- a/sc/qa/uitest/calc_tests7/tdf117987.py
+++ b/sc/qa/uitest/calc_tests7/tdf117987.py
@@ -10,16 +10,15 @@ from libreoffice.calc.document import get_cell_by_position
class tdf117987(UITestCase):
def test_highlight_cell_after_moving_cursor(self):
- self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- colorProperty = mkPropertyValues({"BackgroundColor": 16776960})
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommandWithParameters(".uno:BackgroundColor", colorProperty)
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- self.xUITest.executeCommandWithParameters(".uno:BackgroundColor", colorProperty)
+ colorProperty = mkPropertyValues({"BackgroundColor": 16776960})
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommandWithParameters(".uno:BackgroundColor", colorProperty)
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ self.xUITest.executeCommandWithParameters(".uno:BackgroundColor", colorProperty)
- document = self.ui_test.get_component()
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).CellBackColor, 16776960)
- self.ui_test.close_doc()
+ document = self.ui_test.get_component()
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).CellBackColor, 16776960)
diff --git a/sc/qa/uitest/calc_tests7/tdf123122.py b/sc/qa/uitest/calc_tests7/tdf123122.py
index d8d845b6c6e2..537664d584f1 100644
--- a/sc/qa/uitest/calc_tests7/tdf123122.py
+++ b/sc/qa/uitest/calc_tests7/tdf123122.py
@@ -14,54 +14,53 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf123122(UITestCase):
def test_tdf123122_format_cell_datetime(self):
#numberingformatpage.ui
- 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 A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0") #tab Numbers
- xliststore1 = xDialog.getChild("categorylb") #1st list / Category
- xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
- xdecimalsed = xDialog.getChild("decimalsed")
- xleadzerosed = xDialog.getChild("leadzerosed")
- xnegnumred = xDialog.getChild("negnumred")
- xthousands = xDialog.getChild("thousands")
- xlanguagelb = xDialog.getChild("languagelb")
- xformatted = xDialog.getChild("formatted")
+ with 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 A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0") #tab Numbers
+ xliststore1 = xDialog.getChild("categorylb") #1st list / Category
+ xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
+ xdecimalsed = xDialog.getChild("decimalsed")
+ xleadzerosed = xDialog.getChild("leadzerosed")
+ xnegnumred = xDialog.getChild("negnumred")
+ xthousands = xDialog.getChild("thousands")
+ xlanguagelb = xDialog.getChild("languagelb")
+ xformatted = xDialog.getChild("formatted")
- #Format cells and enter NN MMM DD YYYY HH:MM as format code
- xformatted.executeAction("CLEAR", tuple()) #clear textbox
- xformatted.executeAction("TYPE", mkPropertyValues({"TEXT":"NN MMM DD YYYY HH:MM"}))
- #save - OK
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
+ #Format cells and enter NN MMM DD YYYY HH:MM as format code
+ xformatted.executeAction("CLEAR", tuple()) #clear textbox
+ xformatted.executeAction("TYPE", mkPropertyValues({"TEXT":"NN MMM DD YYYY HH:MM"}))
+ #save - OK
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
- #verify
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #format - cell
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0") #tab Numbers
- xliststore1 = xDialog.getChild("categorylb") #1st list / Category
- xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
- xdecimalsed = xDialog.getChild("decimalsed")
- xleadzerosed = xDialog.getChild("leadzerosed")
- xnegnumred = xDialog.getChild("negnumred")
- xthousands = xDialog.getChild("thousands")
- xlanguagelb = xDialog.getChild("languagelb")
- xformatted = xDialog.getChild("formatted")
+ #verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #format - cell
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0") #tab Numbers
+ xliststore1 = xDialog.getChild("categorylb") #1st list / Category
+ xliststore2 = xDialog.getChild("formatlb") #2nd list / Format
+ xdecimalsed = xDialog.getChild("decimalsed")
+ xleadzerosed = xDialog.getChild("leadzerosed")
+ xnegnumred = xDialog.getChild("negnumred")
+ xthousands = xDialog.getChild("thousands")
+ xlanguagelb = xDialog.getChild("languagelb")
+ xformatted = xDialog.getChild("formatted")
- self.assertEqual(get_state_as_dict(xliststore1)["SelectEntryText"], "Date")
- self.assertEqual(get_state_as_dict(xformatted)["Text"], "NN MMM DD YYYY HH:MM")
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
+ self.assertEqual(get_state_as_dict(xliststore1)["SelectEntryText"], "Date")
+ self.assertEqual(get_state_as_dict(xformatted)["Text"], "NN MMM DD YYYY HH:MM")
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests7/tdf125030.py b/sc/qa/uitest/calc_tests7/tdf125030.py
index 51d9cb292a77..c8c931d302f9 100644
--- a/sc/qa/uitest/calc_tests7/tdf125030.py
+++ b/sc/qa/uitest/calc_tests7/tdf125030.py
@@ -13,21 +13,20 @@ from uitest.uihelper.calc import enter_text_to_cell
class tdf125030(UITestCase):
def test_tdf125030_repeat_crash(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #enter data
- enter_text_to_cell(gridwin, "A1", "aaaa")
- enter_text_to_cell(gridwin, "B1", "bbbb")
- #select A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:StyleApply?Style:string=Heading%201&FamilyName:string=CellStyles")
- #focus on A2
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
- #repeat (Ctrl+Shft+Y)
- self.xUITest.executeCommand(".uno:Repeat")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "aaaa")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #enter data
+ enter_text_to_cell(gridwin, "A1", "aaaa")
+ enter_text_to_cell(gridwin, "B1", "bbbb")
+ #select A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:StyleApply?Style:string=Heading%201&FamilyName:string=CellStyles")
+ #focus on A2
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+ #repeat (Ctrl+Shft+Y)
+ self.xUITest.executeCommand(".uno:Repeat")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "aaaa")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests7/tdf45020.py b/sc/qa/uitest/calc_tests7/tdf45020.py
index 48ca97fe51a5..b588d2122903 100644
--- a/sc/qa/uitest/calc_tests7/tdf45020.py
+++ b/sc/qa/uitest/calc_tests7/tdf45020.py
@@ -11,26 +11,25 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf45020(UITestCase):
def test_tdf45020_hide_rows_select(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #in cell A1-A4: apple pear melon mango
- enter_text_to_cell(gridwin, "A1", "apple")
- enter_text_to_cell(gridwin, "A1", "pear")
- enter_text_to_cell(gridwin, "A1", "melon")
- enter_text_to_cell(gridwin, "A1", "mango")
- #select A2 and A3
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A3"}))
- #format > Row > Hide
- self.ui_test._xUITest.executeCommand(".uno:HideRow")
- #select A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #press Shift+down
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"SHIFT+DOWN"}))
- #verify A1:A4 selected
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A1:Sheet1.A4")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #in cell A1-A4: apple pear melon mango
+ enter_text_to_cell(gridwin, "A1", "apple")
+ enter_text_to_cell(gridwin, "A1", "pear")
+ enter_text_to_cell(gridwin, "A1", "melon")
+ enter_text_to_cell(gridwin, "A1", "mango")
+ #select A2 and A3
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A3"}))
+ #format > Row > Hide
+ self.ui_test._xUITest.executeCommand(".uno:HideRow")
+ #select A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #press Shift+down
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"SHIFT+DOWN"}))
+ #verify A1:A4 selected
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A1:Sheet1.A4")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests8/navigator.py b/sc/qa/uitest/calc_tests8/navigator.py
index d92226771eb5..e2cb99ad7f68 100644
--- a/sc/qa/uitest/calc_tests8/navigator.py
+++ b/sc/qa/uitest/calc_tests8/navigator.py
@@ -114,40 +114,38 @@ class navigator(UITestCase):
def test_tdf134390(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWin = xCalcDoc.getChild("grid_window")
-
- self.xUITest.executeCommand(".uno:Sidebar")
- xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWin = xCalcDoc.getChild("grid_window")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
- xToolBar = xNavigatorPanel.getChild("toolbox2")
- xToolBar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 'toggle' button
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
- xRow = xNavigatorPanel.getChild('row')
- xColumn = xNavigatorPanel.getChild('column')
- self.assertEqual(get_state_as_dict(xColumn)['Value'], '1')
- self.assertEqual(get_state_as_dict(xRow)['Value'], '1')
- self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "0")
- self.assertEqual(get_state_as_dict(xGridWin)["CurrentColumn"], "0")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
+ xToolBar = xNavigatorPanel.getChild("toolbox2")
+ xToolBar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 'toggle' button
- xRow.executeAction("UP", tuple())
- xColumn.executeAction("UP", tuple())
+ xRow = xNavigatorPanel.getChild('row')
+ xColumn = xNavigatorPanel.getChild('column')
+ self.assertEqual(get_state_as_dict(xColumn)['Value'], '1')
+ self.assertEqual(get_state_as_dict(xRow)['Value'], '1')
+ self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "0")
+ self.assertEqual(get_state_as_dict(xGridWin)["CurrentColumn"], "0")
- # Use return to update the current cell
- xColumn.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+ xRow.executeAction("UP", tuple())
+ xColumn.executeAction("UP", tuple())
- self.assertEqual(get_state_as_dict(xColumn)['Value'], '2')
- self.assertEqual(get_state_as_dict(xRow)['Value'], '2')
+ # Use return to update the current cell
+ xColumn.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
- self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "1")
- self.assertEqual(get_state_as_dict(xGridWin)["CurrentColumn"], "1")
+ self.assertEqual(get_state_as_dict(xColumn)['Value'], '2')
+ self.assertEqual(get_state_as_dict(xRow)['Value'], '2')
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "1")
+ self.assertEqual(get_state_as_dict(xGridWin)["CurrentColumn"], "1")
- self.ui_test.close_doc()
+ self.xUITest.executeCommand(".uno:Sidebar")
def test_tdf141973(self):
with self.ui_test.load_file(get_url_for_data_file("tdf141973.ods")):
diff --git a/sc/qa/uitest/calc_tests8/tdf114710.py b/sc/qa/uitest/calc_tests8/tdf114710.py
index a4989a72de58..6bddee42a85b 100644
--- a/sc/qa/uitest/calc_tests8/tdf114710.py
+++ b/sc/qa/uitest/calc_tests8/tdf114710.py
@@ -21,7 +21,7 @@ class tdf114710(UITestCase):
self.xUITest.executeCommand(".uno:CloseDoc")
- self.ui_test.create_doc_in_start_center("writer")
+ with self.ui_test.create_doc_in_start_center("writer"):
self.xUITest.getTopFocusWindow()
diff --git a/sc/qa/uitest/calc_tests8/tdf118308.py b/sc/qa/uitest/calc_tests8/tdf118308.py
index 2c38cd11394d..80c79eedb1c9 100644
--- a/sc/qa/uitest/calc_tests8/tdf118308.py
+++ b/sc/qa/uitest/calc_tests8/tdf118308.py
@@ -13,49 +13,48 @@ from libreoffice.calc.document import get_cell_by_position
class tdf118308(UITestCase):
def test_tdf118308(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("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "A")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:Copy")
+ enter_text_to_cell(gridwin, "A1", "A")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
- self.ui_test.execute_dialog_through_command(".uno:CloseDoc")
- xDialog = self.xUITest.getTopFocusWindow()
- xDiscardBtn = xDialog.getChild("discard")
- self.ui_test.close_dialog_through_button(xDiscardBtn)
+ self.ui_test.execute_dialog_through_command(".uno:CloseDoc")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xDiscardBtn = xDialog.getChild("discard")
+ self.ui_test.close_dialog_through_button(xDiscardBtn)
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xDialog = self.xUITest.getTopFocusWindow()
- # Without the fix in place, this test would have failed here
- # since a different dialog would have been opened and the children
- # wouldn't have been found
- xText = xDialog.getChild("text")
- xNumbers = xDialog.getChild("numbers")
- xDatetime = xDialog.getChild("datetime")
- xFormats = xDialog.getChild("formats")
+ # Without the fix in place, this test would have failed here
+ # since a different dialog would have been opened and the children
+ # wouldn't have been found
+ xText = xDialog.getChild("text")
+ xNumbers = xDialog.getChild("numbers")
+ xDatetime = xDialog.getChild("datetime")
+ xFormats = xDialog.getChild("formats")
- self.assertEqual("true", get_state_as_dict(xText)["Selected"])
- self.assertEqual("true", get_state_as_dict(xNumbers)["Selected"])
- self.assertEqual("true", get_state_as_dict(xDatetime)["Selected"])
- self.assertEqual("false", get_state_as_dict(xFormats)["Selected"])
+ self.assertEqual("true", get_state_as_dict(xText)["Selected"])
+ self.assertEqual("true", get_state_as_dict(xNumbers)["Selected"])
+ self.assertEqual("true", get_state_as_dict(xDatetime)["Selected"])
+ self.assertEqual("false", get_state_as_dict(xFormats)["Selected"])
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.assertEqual("A", get_cell_by_position(document, 0, 0, 0).getString())
- self.ui_test.close_doc()
+ self.assertEqual("A", get_cell_by_position(document, 0, 0, 0).getString())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests8/tdf125051.py b/sc/qa/uitest/calc_tests8/tdf125051.py
index 5ebd02446450..8cc02ff2d67e 100644
--- a/sc/qa/uitest/calc_tests8/tdf125051.py
+++ b/sc/qa/uitest/calc_tests8/tdf125051.py
@@ -15,32 +15,30 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf125051(UITestCase):
def test_tdf125051_crash_spelling_dialog(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", "text")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.ui_test.execute_dialog_through_command(".uno:SpellDialog")
- xDialog = self.xUITest.getTopFocusWindow() #Spelling dialog
-
- xDialog2 = self.xUITest.getTopFocusWindow() # info dialog "The spellcheck of this sheet has been completed.-> OK"
- okBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(okBtn)
-
- xDialog = self.xUITest.getTopFocusWindow() #Spelling dialog
- #open options
- optionsBtn = xDialog.getChild("options")
-
- with self.ui_test.execute_blocking_action(optionsBtn.executeAction, args=('CLICK', ()), close_button="cancel"):
- pass
-
- closeBtn = xDialog.getChild("close") #close Spelling dialog
- self.ui_test.close_dialog_through_button(closeBtn)
-
- #verify, we didn't crash
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "text")
-
- self.ui_test.close_doc()
+ with 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", "text")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.ui_test.execute_dialog_through_command(".uno:SpellDialog")
+ xDialog = self.xUITest.getTopFocusWindow() #Spelling dialog
+
+ xDialog2 = self.xUITest.getTopFocusWindow() # info dialog "The spellcheck of this sheet has been completed.-> OK"
+ okBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(okBtn)
+
+ xDialog = self.xUITest.getTopFocusWindow() #Spelling dialog
+ #open options
+ optionsBtn = xDialog.getChild("options")
+
+ with self.ui_test.execute_blocking_action(optionsBtn.executeAction, args=('CLICK', ()), close_button="cancel"):
+ pass
+
+ closeBtn = xDialog.getChild("close") #close Spelling dialog
+ self.ui_test.close_dialog_through_button(closeBtn)
+
+ #verify, we didn't crash
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "text")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests8/tdf126248.py b/sc/qa/uitest/calc_tests8/tdf126248.py
index 27482acd0cde..8cc43708c72d 100644
--- a/sc/qa/uitest/calc_tests8/tdf126248.py
+++ b/sc/qa/uitest/calc_tests8/tdf126248.py
@@ -49,7 +49,7 @@ class tdf126248(UITestCase):
def test_tdf126248(self):
- with guarded.create_doc_in_start_center(self, "calc"):
+ with self.ui_test.create_doc_in_start_center("calc"):
self.changeLocalSetting("Chinese (traditional)")
diff --git a/sc/qa/uitest/calc_tests8/tdf137726.py b/sc/qa/uitest/calc_tests8/tdf137726.py
index 8256a778ba26..0d6cd00f8b00 100644
--- a/sc/qa/uitest/calc_tests8/tdf137726.py
+++ b/sc/qa/uitest/calc_tests8/tdf137726.py
@@ -9,20 +9,18 @@ from uitest.framework import UITestCase
class tdf137726(UITestCase):
def test_tdf137726(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- self.ui_test.execute_dialog_through_command(".uno:DataDataPilotRun")
+ self.ui_test.execute_dialog_through_command(".uno:DataDataPilotRun")
- # three dialogs are displayed one after the other, click OK in all of them
- for i in range(3):
- xDialog = self.xUITest.getTopFocusWindow()
- xOKBtn = xDialog.getChild('ok')
- self.ui_test.close_dialog_through_button(xOKBtn)
+ # three dialogs are displayed one after the other, click OK in all of them
+ for i in range(3):
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKBtn = xDialog.getChild('ok')
+ self.ui_test.close_dialog_through_button(xOKBtn)
- # Without the fix in place, this test would have hung here
-
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have hung here
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests9/tdf113571.py b/sc/qa/uitest/calc_tests9/tdf113571.py
index 48657e37e60d..213c521244d9 100644
--- a/sc/qa/uitest/calc_tests9/tdf113571.py
+++ b/sc/qa/uitest/calc_tests9/tdf113571.py
@@ -23,7 +23,7 @@ class Tdf113571(UITestCase):
# Close the document
self.xUITest.executeCommand(".uno:CloseDoc")
- self.ui_test.create_doc_in_start_center("writer")
+ with self.ui_test.create_doc_in_start_center("writer"):
self.xUITest.executeCommand(".uno:PasteUnformatted")
diff --git a/sc/qa/uitest/calc_tests9/tdf117879.py b/sc/qa/uitest/calc_tests9/tdf117879.py
index b67e27ff4c89..e880d0dbb31b 100644
--- a/sc/qa/uitest/calc_tests9/tdf117879.py
+++ b/sc/qa/uitest/calc_tests9/tdf117879.py
@@ -13,32 +13,30 @@ class tdf117879(UITestCase):
def test_tdf117879(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- calcDoc = self.xUITest.getTopFocusWindow()
- gridwin = calcDoc.getChild("grid_window")
+ calcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = calcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- type_text(gridwin, "=SUM({A1},2,3,4,5}")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ type_text(gridwin, "=SUM({A1},2,3,4,5}")
- # Without the fix in place, this dialog wouldn't have been displayed
- with self.ui_test.execute_blocking_action(gridwin.executeAction,
- args=("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})), close_button="yes"):
- pass
+ # Without the fix in place, this dialog wouldn't have been displayed
+ with self.ui_test.execute_blocking_action(gridwin.executeAction,
+ args=("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})), close_button="yes"):
+ pass
- document = self.ui_test.get_component()
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getFormula(), "=SUM({A1};2;3;4;5)")
+ document = self.ui_test.get_component()
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getFormula(), "=SUM({A1};2;3;4;5)")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- type_text(gridwin, "=SUM({A1},2,3,4,5}")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ type_text(gridwin, "=SUM({A1},2,3,4,5}")
- with self.ui_test.execute_blocking_action(gridwin.executeAction,
- args=("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})), close_button="no"):
- pass
+ with self.ui_test.execute_blocking_action(gridwin.executeAction,
+ args=("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})), close_button="no"):
+ pass
- document = self.ui_test.get_component()
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getFormula(), "=SUM({A1};2;3;4;5})")
-
- self.ui_test.close_doc()
+ document = self.ui_test.get_component()
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getFormula(), "=SUM({A1};2;3;4;5})")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests9/tdf121949.py b/sc/qa/uitest/calc_tests9/tdf121949.py
index 92dd66866510..26b5aa373f53 100644
--- a/sc/qa/uitest/calc_tests9/tdf121949.py
+++ b/sc/qa/uitest/calc_tests9/tdf121949.py
@@ -10,21 +10,19 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf121949 (UITestCase):
def test_tdf121949_copy_block_with_single_cell_not_included(self):
- self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- # mark a range with a single cell left our and copy to clipboard
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B1", "EXTEND":"1"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B3:B3", "EXTEND":"1"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:C3", "EXTEND":"1"}))
- self.ui_test.execute_dialog_through_command(".uno:Copy")
- xDialog = self.xUITest.getTopFocusWindow()
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ # mark a range with a single cell left our and copy to clipboard
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B1", "EXTEND":"1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B3:B3", "EXTEND":"1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:C3", "EXTEND":"1"}))
+ self.ui_test.execute_dialog_through_command(".uno:Copy")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests9/tdf125440.py b/sc/qa/uitest/calc_tests9/tdf125440.py
index 82accfb11942..75c82d18e592 100644
--- a/sc/qa/uitest/calc_tests9/tdf125440.py
+++ b/sc/qa/uitest/calc_tests9/tdf125440.py
@@ -22,7 +22,7 @@ class Tdf1254400(UITestCase):
# Close the document
self.xUITest.executeCommand(".uno:CloseDoc")
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
diff --git a/sc/qa/uitest/calc_tests9/tdf133629.py b/sc/qa/uitest/calc_tests9/tdf133629.py
index 2b13645420ec..4362219e3ee4 100644
--- a/sc/qa/uitest/calc_tests9/tdf133629.py
+++ b/sc/qa/uitest/calc_tests9/tdf133629.py
@@ -11,55 +11,53 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf133629(UITestCase):
def test_tdf133629(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- self.ui_test.execute_dialog_through_command(".uno:Insert")
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("ok")
- xOKButton.executeAction("CLICK", tuple())
-
- self.xUITest.executeCommand(".uno:TableSelectAll")
-
- self.xUITest.executeCommand(".uno:SelectAll")
-
- # Check selection
- self.assertIsNotNone(getattr(document.CurrentSelection, 'Sheet1.A1:AMJ1048576'))
- self.assertIsNotNone(getattr(document.CurrentSelection, 'Sheet1.A2:AMJ1048576'))
-
- self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "5")
-
- xPresets = xDialog.getChild("presets")
- xPresets.executeAction("CHOOSE", mkPropertyValues({"POS": "4"}))
-
- # Change width
- xLineWidth = xDialog.getChild("linewidthmf")
- xLineWidth.executeAction("UP", tuple())
- xLineWidth.executeAction("UP", tuple())
- self.assertEqual("1.25 pt", get_state_as_dict(xLineWidth)['Text'])
-
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
-
- # Without the fix in place, this test would have crash here
-
- xA1Sheet1 = document.Sheets[0].getCellRangeByName("A1")
- self.assertEqual(44, xA1Sheet1.BottomBorder.OuterLineWidth)
- self.assertEqual(44, xA1Sheet1.TopBorder.OuterLineWidth)
- self.assertEqual(44, xA1Sheet1.LeftBorder.OuterLineWidth)
- self.assertEqual(44, xA1Sheet1.RightBorder.OuterLineWidth)
-
- xA1Sheet2 = document.Sheets[1].getCellRangeByName("A1")
- self.assertEqual(44, xA1Sheet2.BottomBorder.OuterLineWidth)
- self.assertEqual(44, xA1Sheet2.TopBorder.OuterLineWidth)
- self.assertEqual(44, xA1Sheet2.LeftBorder.OuterLineWidth)
- self.assertEqual(44, xA1Sheet2.RightBorder.OuterLineWidth)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ self.ui_test.execute_dialog_through_command(".uno:Insert")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKButton = xDialog.getChild("ok")
+ xOKButton.executeAction("CLICK", tuple())
+
+ self.xUITest.executeCommand(".uno:TableSelectAll")
+
+ self.xUITest.executeCommand(".uno:SelectAll")
+
+ # Check selection
+ self.assertIsNotNone(getattr(document.CurrentSelection, 'Sheet1.A1:AMJ1048576'))
+ self.assertIsNotNone(getattr(document.CurrentSelection, 'Sheet1.A2:AMJ1048576'))
+
+ self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "5")
+
+ xPresets = xDialog.getChild("presets")
+ xPresets.executeAction("CHOOSE", mkPropertyValues({"POS": "4"}))
+
+ # Change width
+ xLineWidth = xDialog.getChild("linewidthmf")
+ xLineWidth.executeAction("UP", tuple())
+ xLineWidth.executeAction("UP", tuple())
+ self.assertEqual("1.25 pt", get_state_as_dict(xLineWidth)['Text'])
+
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+
+ # Without the fix in place, this test would have crash here
+
+ xA1Sheet1 = document.Sheets[0].getCellRangeByName("A1")
+ self.assertEqual(44, xA1Sheet1.BottomBorder.OuterLineWidth)
+ self.assertEqual(44, xA1Sheet1.TopBorder.OuterLineWidth)
+ self.assertEqual(44, xA1Sheet1.LeftBorder.OuterLineWidth)
+ self.assertEqual(44, xA1Sheet1.RightBorder.OuterLineWidth)
+
+ xA1Sheet2 = document.Sheets[1].getCellRangeByName("A1")
+ self.assertEqual(44, xA1Sheet2.BottomBorder.OuterLineWidth)
+ self.assertEqual(44, xA1Sheet2.TopBorder.OuterLineWidth)
+ self.assertEqual(44, xA1Sheet2.LeftBorder.OuterLineWidth)
+ self.assertEqual(44, xA1Sheet2.RightBorder.OuterLineWidth)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests9/tdf141244.py b/sc/qa/uitest/calc_tests9/tdf141244.py
index 402215fdf333..c4755545b512 100644
--- a/sc/qa/uitest/calc_tests9/tdf141244.py
+++ b/sc/qa/uitest/calc_tests9/tdf141244.py
@@ -13,31 +13,29 @@ class tdf141244(UITestCase):
def test_tdf141244(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- calcDoc = self.xUITest.getTopFocusWindow()
- gridwin = calcDoc.getChild("grid_window")
+ calcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = calcDoc.getChild("grid_window")
- enter_text_to_cell(gridwin, "A1", '=DDE("soffice";"data1.ods";"sheet1.A1")')
+ enter_text_to_cell(gridwin, "A1", '=DDE("soffice";"data1.ods";"sheet1.A1")')
- self.ui_test.execute_dialog_through_command(".uno:EditLinks")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:EditLinks")
+ xDialog = self.xUITest.getTopFocusWindow()
- xLinks = xDialog.getChild("TB_LINKS")
- self.assertEqual(1, len(xLinks.getChildren()))
+ xLinks = xDialog.getChild("TB_LINKS")
+ self.assertEqual(1, len(xLinks.getChildren()))
- xChangeBtn = xDialog.getChild("CHANGE_SOURCE")
+ xChangeBtn = xDialog.getChild("CHANGE_SOURCE")
- with self.ui_test.execute_blocking_action(xChangeBtn.executeAction, args=('CLICK', ()), close_button="cancel") as dialog:
- self.assertEqual("soffice", get_state_as_dict(dialog.getChild("app"))['Text'])
- self.assertEqual("data1.ods", get_state_as_dict(dialog.getChild("file"))['Text'])
- self.assertEqual("sheet1.A1", get_state_as_dict(dialog.getChild("category"))['Text'])
+ with self.ui_test.execute_blocking_action(xChangeBtn.executeAction, args=('CLICK', ()), close_button="cancel") as dialog:
+ self.assertEqual("soffice", get_state_as_dict(dialog.getChild("app"))['Text'])
+ self.assertEqual("data1.ods", get_state_as_dict(dialog.getChild("file"))['Text'])
+ self.assertEqual("sheet1.A1", get_state_as_dict(dialog.getChild("category"))['Text'])
- # tdf#141770: Without the fix in place, the cancel button wouldn't have worked here
+ # tdf#141770: Without the fix in place, the cancel button wouldn't have worked here
- xClose = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xClose)
-
- self.ui_test.close_doc()
+ xClose = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xClose)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/copyPaste.py b/sc/qa/uitest/chart/copyPaste.py
index 5294022bfdac..c0d90d2069dd 100644
--- a/sc/qa/uitest/chart/copyPaste.py
+++ b/sc/qa/uitest/chart/copyPaste.py
@@ -39,7 +39,7 @@ class CopyPaste(UITestCase):
self.xUITest.executeCommand(".uno:CloseDoc")
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
document = self.ui_test.get_component()
# Rename the sheet to match the same name as the first document
diff --git a/sc/qa/uitest/chart/create_chart.py b/sc/qa/uitest/chart/create_chart.py
index cced0ac63d37..8ac21bbacbcf 100644
--- a/sc/qa/uitest/chart/create_chart.py
+++ b/sc/qa/uitest/chart/create_chart.py
@@ -35,114 +35,103 @@ class CalcChartUIDemo(UITestCase):
def test_cancel_immediately(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.fill_spreadsheet()
+ self.fill_spreadsheet()
- xChartDlg = self.create_insert_chart_dialog();
+ xChartDlg = self.create_insert_chart_dialog();
- xCancelBtn = xChartDlg.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ xCancelBtn = xChartDlg.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_create_from_first_page(self):
- self.ui_test.create_doc_in_start_center("calc")
-
- self.fill_spreadsheet()
+ with self.ui_test.create_doc_in_start_center("calc"):
- xChartDlg = self.create_insert_chart_dialog();
+ self.fill_spreadsheet()
- xOkBtn = xChartDlg.getChild("finish")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xChartDlg = self.create_insert_chart_dialog();
- self.ui_test.close_doc()
+ xOkBtn = xChartDlg.getChild("finish")
+ self.ui_test.close_dialog_through_button(xOkBtn)
def test_create_from_second_page(self):
- self.ui_test.create_doc_in_start_center("calc")
-
- self.fill_spreadsheet()
+ with self.ui_test.create_doc_in_start_center("calc"):
- xChartDlg = self.create_insert_chart_dialog();
+ self.fill_spreadsheet()
- xNextBtn = xChartDlg.getChild("next")
- xNextBtn.executeAction("CLICK", tuple())
+ xChartDlg = self.create_insert_chart_dialog();
- xDataInRows = xChartDlg.getChild("RB_DATAROWS")
- xDataInRows.executeAction("CLICK", tuple())
+ xNextBtn = xChartDlg.getChild("next")
+ xNextBtn.executeAction("CLICK", tuple())
- xDataInCols = xChartDlg.getChild("RB_DATACOLS")
- xDataInCols.executeAction("CLICK", tuple())
+ xDataInRows = xChartDlg.getChild("RB_DATAROWS")
+ xDataInRows.executeAction("CLICK", tuple())
- xCancelBtn = xChartDlg.getChild("finish")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ xDataInCols = xChartDlg.getChild("RB_DATACOLS")
+ xDataInCols.executeAction("CLICK", tuple())
- self.ui_test.close_doc()
+ xCancelBtn = xChartDlg.getChild("finish")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_deselect_chart(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.fill_spreadsheet()
-
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
+ self.fill_spreadsheet()
- xChartDlg = self.create_insert_chart_dialog();
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
- xNextBtn = xChartDlg.getChild("finish")
- self.ui_test.close_dialog_through_button(xNextBtn)
+ xChartDlg = self.create_insert_chart_dialog();
- xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ xNextBtn = xChartDlg.getChild("finish")
+ self.ui_test.close_dialog_through_button(xNextBtn)
- time.sleep(2)
+ xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
- self.ui_test.close_doc()
+ time.sleep(2)
def test_activate_chart(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.fill_spreadsheet()
+ self.fill_spreadsheet()
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
-
- xChartDlg = self.create_insert_chart_dialog();
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
- xNextBtn = xChartDlg.getChild("finish")
- self.ui_test.close_dialog_through_button(xNextBtn)
+ xChartDlg = self.create_insert_chart_dialog();
- xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ xNextBtn = xChartDlg.getChild("finish")
+ self.ui_test.close_dialog_through_button(xNextBtn)
- xGridWindow.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- xGridWindow.executeAction("ACTIVATE", tuple())
+ xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
- xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ xGridWindow.executeAction("ACTIVATE", tuple())
- self.ui_test.close_doc()
+ xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
def select_chart_element(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.fill_spreadsheet()
+ self.fill_spreadsheet()
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
- xChartDlg = self.create_insert_chart_dialog();
+ xChartDlg = self.create_insert_chart_dialog();
- xNextBtn = xChartDlg.getChild("finish")
- self.ui_test.close_dialog_through_button(xNextBtn)
+ xNextBtn = xChartDlg.getChild("finish")
+ self.ui_test.close_dialog_through_button(xNextBtn)
- xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
- xGridWindow.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- xGridWindow.executeAction("ACTIVATE", tuple())
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ xGridWindow.executeAction("ACTIVATE", tuple())
- xCalcDoc = self.xUITest.getTopFocusWindow()
- self.ui_test.close_doc()
+ xCalcDoc = self.xUITest.getTopFocusWindow()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/edit_chart.py b/sc/qa/uitest/chart/edit_chart.py
index d74a8c2eced3..54eaaabe43bc 100644
--- a/sc/qa/uitest/chart/edit_chart.py
+++ b/sc/qa/uitest/chart/edit_chart.py
@@ -29,41 +29,39 @@ class CalcChartEditUIDemo(UITestCase):
def test_select_secondary_axis(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.fill_spreadsheet()
+ self.fill_spreadsheet()
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
-
- self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
- xChartDlg = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
- xNextBtn = xChartDlg.getChild("finish")
- self.ui_test.close_dialog_through_button(xNextBtn)
+ xChartDlg = self.xUITest.getTopFocusWindow()
- xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ xNextBtn = xChartDlg.getChild("finish")
+ self.ui_test.close_dialog_through_button(xNextBtn)
- xGridWindow.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
- xGridWindow.executeAction("ACTIVATE", tuple())
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
+ xGridWindow.executeAction("ACTIVATE", tuple())
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"}))
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesFormatDlg = self.xUITest.getTopFocusWindow()
- xAxis2 = xSeriesFormatDlg.getChild("RBT_OPT_AXIS_2")
- xAxis2.executeAction("CLICK", tuple())
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"}))
- xCancelBtn = xSeriesFormatDlg.getChild("ok")
- xCancelBtn.executeAction("CLICK", tuple())
+ xSeriesFormatDlg = self.xUITest.getTopFocusWindow()
+ xAxis2 = xSeriesFormatDlg.getChild("RBT_OPT_AXIS_2")
+ xAxis2.executeAction("CLICK", tuple())
- xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ xCancelBtn = xSeriesFormatDlg.getChild("ok")
+ xCancelBtn.executeAction("CLICK", tuple())
- self.ui_test.close_doc()
+ xGridWindow.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf107097.py b/sc/qa/uitest/chart/tdf107097.py
index 09db67f197cc..65764422ae21 100644
--- a/sc/qa/uitest/chart/tdf107097.py
+++ b/sc/qa/uitest/chart/tdf107097.py
@@ -33,7 +33,7 @@ class tdf107097(UITestCase):
self.xUITest.executeCommand(".uno:CloseDoc")
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
document = self.ui_test.get_component()
diff --git a/sc/qa/uitest/chart/tdf120348.py b/sc/qa/uitest/chart/tdf120348.py
index 0685ab7c0f63..2b6236a9f3ba 100644
--- a/sc/qa/uitest/chart/tdf120348.py
+++ b/sc/qa/uitest/chart/tdf120348.py
@@ -32,7 +32,7 @@ class tdf120348(UITestCase):
self.xUITest.executeCommand(".uno:CloseDoc")
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
document = self.ui_test.get_component()
diff --git a/sc/qa/uitest/chart/tdf124295.py b/sc/qa/uitest/chart/tdf124295.py
index a3fda3f03b46..849f7c35f78a 100644
--- a/sc/qa/uitest/chart/tdf124295.py
+++ b/sc/qa/uitest/chart/tdf124295.py
@@ -15,22 +15,20 @@ class tdf124295(UITestCase):
def test_tdf124295(self):
# Open spreadsheet and insert chart
- self.ui_test.create_doc_in_start_center("calc")
- self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
- xChartDlg = self.xUITest.getTopFocusWindow()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
+ xChartDlg = self.xUITest.getTopFocusWindow()
- # Click 3D look check button
- x3DCheckBtn = xChartDlg.getChild("3dlook")
- x3DCheckBtn.executeAction("CLICK", tuple())
+ # Click 3D look check button
+ x3DCheckBtn = xChartDlg.getChild("3dlook")
+ x3DCheckBtn.executeAction("CLICK", tuple())
- x3DSchemeLstBox = xChartDlg.getChild("3dscheme")
- # Without the fix in place, this test would have failed with:
- # AssertionError: 'Realistic' != ''
- self.assertEqual("Realistic", get_state_as_dict(x3DSchemeLstBox)["SelectEntryText"])
+ x3DSchemeLstBox = xChartDlg.getChild("3dscheme")
+ # Without the fix in place, this test would have failed with:
+ # AssertionError: 'Realistic' != ''
+ self.assertEqual("Realistic", get_state_as_dict(x3DSchemeLstBox)["SelectEntryText"])
- xCancelBtn = xChartDlg.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ xCancelBtn = xChartDlg.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf131715.py b/sc/qa/uitest/chart/tdf131715.py
index 380aac21e964..3845f076e5ba 100644
--- a/sc/qa/uitest/chart/tdf131715.py
+++ b/sc/qa/uitest/chart/tdf131715.py
@@ -10,19 +10,18 @@ from uitest.uihelper.common import select_pos
class tdf131715(UITestCase):
def test_tdf131715(self):
- self.ui_test.create_doc_in_start_center("calc")
- self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
- xChartDlg = self.xUITest.getTopFocusWindow()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
+ xChartDlg = self.xUITest.getTopFocusWindow()
- xWizard = xChartDlg.getChild('Wizard')
+ xWizard = xChartDlg.getChild('Wizard')
- for i in range(10):
- #without the fix in place, it would crash here
- select_pos(xWizard, "2")
+ for i in range(10):
+ #without the fix in place, it would crash here
+ select_pos(xWizard, "2")
- self.assertEqual(get_state_as_dict(xWizard)['CurrentStep'], "2")
+ self.assertEqual(get_state_as_dict(xWizard)['CurrentStep'], "2")
- xOkBtn = xChartDlg.getChild("finish")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xChartDlg.getChild("finish")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.ui_test.close_doc()
diff --git a/sc/qa/uitest/chart/tdf136011.py b/sc/qa/uitest/chart/tdf136011.py
index a523b8ecaa0e..96fe00f2602a 100644
--- a/sc/qa/uitest/chart/tdf136011.py
+++ b/sc/qa/uitest/chart/tdf136011.py
@@ -38,7 +38,7 @@ class tdf136011(UITestCase):
self.xUITest.executeCommand(".uno:CloseDoc")
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
document = self.ui_test.get_component()
diff --git a/sc/qa/uitest/chart/tdf46885.py b/sc/qa/uitest/chart/tdf46885.py
index c629058d605b..95e7b199854d 100644
--- a/sc/qa/uitest/chart/tdf46885.py
+++ b/sc/qa/uitest/chart/tdf46885.py
@@ -15,41 +15,38 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf46885(UITestCase):
def test_tdf46885_crash_chart_no_cell_selected_nextButton(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, "A10", "col1")
- #When you start a new chart and have one empty cell selected LibO will crash when you select the Next>> button.
- self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
- xChartDlg = self.xUITest.getTopFocusWindow()
- xNextBtn = xChartDlg.getChild("next")
- xNextBtn.executeAction("CLICK", tuple())
- xOkBtn = xChartDlg.getChild("finish")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ with 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, "A10", "col1")
+ #When you start a new chart and have one empty cell selected LibO will crash when you select the Next>> button.
+ self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
+ xChartDlg = self.xUITest.getTopFocusWindow()
+ xNextBtn = xChartDlg.getChild("next")
+ xNextBtn.executeAction("CLICK", tuple())
+ xOkBtn = xChartDlg.getChild("finish")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- #verify, we didn't crash
- self.assertEqual(get_cell_by_position(document, 0, 0, 9).getString(), "col1")
-
- self.ui_test.close_doc()
+ #verify, we didn't crash
+ self.assertEqual(get_cell_by_position(document, 0, 0, 9).getString(), "col1")
def test_tdf46885_crash_chart_multiple_empty_cells_selected(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, "A10", "col1")
- #If you select multiple empty cells and then start a new chart LibO will crash immediately.
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C4"}))
- self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
- xChartDlg = self.xUITest.getTopFocusWindow()
- xNextBtn = xChartDlg.getChild("next")
- xNextBtn.executeAction("CLICK", tuple())
- xOkBtn = xChartDlg.getChild("finish")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ with 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, "A10", "col1")
+ #If you select multiple empty cells and then start a new chart LibO will crash immediately.
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C4"}))
+ self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
+ xChartDlg = self.xUITest.getTopFocusWindow()
+ xNextBtn = xChartDlg.getChild("next")
+ xNextBtn.executeAction("CLICK", tuple())
+ xOkBtn = xChartDlg.getChild("finish")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- #verify, we didn't crash
- self.assertEqual(get_cell_by_position(document, 0, 0, 9).getString(), "col1")
+ #verify, we didn't crash
+ self.assertEqual(get_cell_by_position(document, 0, 0, 9).getString(), "col1")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf62057.py b/sc/qa/uitest/chart/tdf62057.py
index 6cb1ef8cdd21..530f530de012 100644
--- a/sc/qa/uitest/chart/tdf62057.py
+++ b/sc/qa/uitest/chart/tdf62057.py
@@ -35,7 +35,7 @@ class tdf62057(UITestCase):
self.xUITest.executeCommand(".uno:CloseDoc")
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
document = self.ui_test.get_component()
diff --git a/sc/qa/uitest/chart/tdf98690.py b/sc/qa/uitest/chart/tdf98690.py
index f99009206bb4..8d0fd5ebd50b 100644
--- a/sc/qa/uitest/chart/tdf98690.py
+++ b/sc/qa/uitest/chart/tdf98690.py
@@ -21,7 +21,7 @@ class tdf98690(UITestCase):
self.xUITest.executeCommand(".uno:CloseDoc")
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
document = self.ui_test.get_component()
diff --git a/sc/qa/uitest/conditional_format/tdf105351.py b/sc/qa/uitest/conditional_format/tdf105351.py
index 53e68a343a86..58e2d2ab3bd6 100644
--- a/sc/qa/uitest/conditional_format/tdf105351.py
+++ b/sc/qa/uitest/conditional_format/tdf105351.py
@@ -15,50 +15,48 @@ from uitest.debug import sleep
#Bug 105351 - FORMATTING: Unable to change Data Bar conditional formatting
class tdf105351(UITestCase):
def test_tdf105351_cond_format_data_bar(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()
- #2. Set the value of cell A1 to 5
- enter_text_to_cell(gridwin, "A1", "5")
- #3. Select cell A1, then choose from the menus Format -> Conditional Formatting -> Data Bar
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataBarFormatDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xcolscalemin = xDialog.getChild("colscalemin")
- xedcolscalemin = xDialog.getChild("edcolscalemin")
- xcolscalemax = xDialog.getChild("colscalemax")
- xedcolscalemax = xDialog.getChild("edcolscalemax")
- #4. In the conditional formatting window, select the dropdown on the left that says "Automatic"
- #and change it to "Value". In the text field below it enter 0.
- #5. Select the dropdown on the right that says "Automatic" and change it to "Value". In the text field below it enter 10
- select_by_text(xcolscalemin, "Value")
- xedcolscalemin.executeAction("TYPE", mkPropertyValues({"TEXT":"0"}))
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #2. Set the value of cell A1 to 5
+ enter_text_to_cell(gridwin, "A1", "5")
+ #3. Select cell A1, then choose from the menus Format -> Conditional Formatting -> Data Bar
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataBarFormatDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xcolscalemin = xDialog.getChild("colscalemin")
+ xedcolscalemin = xDialog.getChild("edcolscalemin")
+ xcolscalemax = xDialog.getChild("colscalemax")
+ xedcolscalemax = xDialog.getChild("edcolscalemax")
+ #4. In the conditional formatting window, select the dropdown on the left that says "Automatic"
+ #and change it to "Value". In the text field below it enter 0.
+ #5. Select the dropdown on the right that says "Automatic" and change it to "Value". In the text field below it enter 10
+ select_by_text(xcolscalemin, "Value")
+ xedcolscalemin.executeAction("TYPE", mkPropertyValues({"TEXT":"0"}))
- select_by_text(xcolscalemax, "Value")
- xedcolscalemax.executeAction("TYPE", mkPropertyValues({"TEXT":"10"}))
+ select_by_text(xcolscalemax, "Value")
+ xedcolscalemax.executeAction("TYPE", mkPropertyValues({"TEXT":"10"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify : The conditions set for cell A1 should be shown and editable.
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataBarFormatDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xcolscalemin = xDialog.getChild("colscalemin")
- xedcolscalemin = xDialog.getChild("edcolscalemin")
- xcolscalemax = xDialog.getChild("colscalemax")
- xedcolscalemax = xDialog.getChild("edcolscalemax")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify : The conditions set for cell A1 should be shown and editable.
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataBarFormatDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xcolscalemin = xDialog.getChild("colscalemin")
+ xedcolscalemin = xDialog.getChild("edcolscalemin")
+ xcolscalemax = xDialog.getChild("colscalemax")
+ xedcolscalemax = xDialog.getChild("edcolscalemax")
- self.assertEqual(get_state_as_dict(xcolscalemin)["SelectEntryText"], "Value")
- self.assertEqual(get_state_as_dict(xedcolscalemin)["Text"], "0")
- self.assertEqual(get_state_as_dict(xcolscalemax)["SelectEntryText"], "Value")
- self.assertEqual(get_state_as_dict(xedcolscalemax)["Text"], "10")
- #editable - change value and then verify
- xedcolscalemax.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- self.assertEqual(get_state_as_dict(xedcolscalemax)["Text"], "110")
+ self.assertEqual(get_state_as_dict(xcolscalemin)["SelectEntryText"], "Value")
+ self.assertEqual(get_state_as_dict(xedcolscalemin)["Text"], "0")
+ self.assertEqual(get_state_as_dict(xcolscalemax)["SelectEntryText"], "Value")
+ self.assertEqual(get_state_as_dict(xedcolscalemax)["Text"], "10")
+ #editable - change value and then verify
+ xedcolscalemax.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ self.assertEqual(get_state_as_dict(xedcolscalemax)["Text"], "110")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ xOKBtn = xDialog.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/tdf105411.py b/sc/qa/uitest/conditional_format/tdf105411.py
index 8f08c2f22fb5..6d796dbe2324 100644
--- a/sc/qa/uitest/conditional_format/tdf105411.py
+++ b/sc/qa/uitest/conditional_format/tdf105411.py
@@ -11,25 +11,23 @@ class tdf105411(UITestCase):
def test_delete_conditional_format(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.ui_test.execute_modeless_dialog_through_command(".uno:ConditionalFormatDialog")
+ self.ui_test.execute_modeless_dialog_through_command(".uno:ConditionalFormatDialog")
- xCondFormatDlg = self.xUITest.getTopFocusWindow()
+ xCondFormatDlg = self.xUITest.getTopFocusWindow()
- xDeleteBtn = xCondFormatDlg.getChild("delete")
- xDeleteBtn.executeAction("CLICK", tuple())
+ xDeleteBtn = xCondFormatDlg.getChild("delete")
+ xDeleteBtn.executeAction("CLICK", tuple())
- xCondFormatDlg = self.xUITest.getTopFocusWindow()
+ xCondFormatDlg = self.xUITest.getTopFocusWindow()
- xDeleteBtn = xCondFormatDlg.getChild("add")
- xDeleteBtn.executeAction("CLICK", tuple())
+ xDeleteBtn = xCondFormatDlg.getChild("add")
+ xDeleteBtn.executeAction("CLICK", tuple())
- xCondFormatDlg = self.xUITest.getTopFocusWindow()
+ xCondFormatDlg = self.xUITest.getTopFocusWindow()
- xOkBtn = xCondFormatDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- self.ui_test.close_doc()
+ xOkBtn = xCondFormatDlg.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/tdf105466.py b/sc/qa/uitest/conditional_format/tdf105466.py
index fa7db7e49698..5165dde15335 100644
--- a/sc/qa/uitest/conditional_format/tdf105466.py
+++ b/sc/qa/uitest/conditional_format/tdf105466.py
@@ -15,21 +15,19 @@ class tdf105466(UITestCase):
@unittest.skip("issue with floating windows")
def test_changing_conditional_format(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.ui_test.execute_modeless_dialog_through_command(".uno:ConditionalFormatDialog")
+ self.ui_test.execute_modeless_dialog_through_command(".uno:ConditionalFormatDialog")
- for i in range(0,4):
- with self.subTest(i = i):
- xCondFormatDlg = self.xUITest.getTopFocusWindow()
- xTypeLstBox = xCondFormatDlg.getChild("type")
- xTypeLstBox.executeAction("SELECT", mkPropertyValues({"POS": str(i)}))
+ for i in range(0,4):
+ with self.subTest(i = i):
+ xCondFormatDlg = self.xUITest.getTopFocusWindow()
+ xTypeLstBox = xCondFormatDlg.getChild("type")
+ xTypeLstBox.executeAction("SELECT", mkPropertyValues({"POS": str(i)}))
- xCondFormatDlg = self.xUITest.getTopFocusWindow()
- xOkBtn = xCondFormatDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- self.ui_test.close_doc()
+ xCondFormatDlg = self.xUITest.getTopFocusWindow()
+ xOkBtn = xCondFormatDlg.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/tdf117899.py b/sc/qa/uitest/conditional_format/tdf117899.py
index bec007993e6c..3f6b1544c44c 100644
--- a/sc/qa/uitest/conditional_format/tdf117899.py
+++ b/sc/qa/uitest/conditional_format/tdf117899.py
@@ -42,26 +42,23 @@ class Tdf117899(UITestCase):
with TemporaryDirectory() as tempdir:
xFilePath = os.path.join(tempdir, "tdf117899-temp.ods")
- self.ui_test.create_doc_in_start_center("writer")
+ with self.ui_test.create_doc_in_start_center("writer"):
- # Paste as an OLE spreadsheet
- formatProperty = mkPropertyValues({"SelectedFormat": 85})
- self.xUITest.executeCommandWithParameters(".uno:ClipboardFormatItems", formatProperty)
+ # Paste as an OLE spreadsheet
+ formatProperty = mkPropertyValues({"SelectedFormat": 85})
+ self.xUITest.executeCommandWithParameters(".uno:ClipboardFormatItems", formatProperty)
- # Save Copy as
- self.ui_test.execute_dialog_through_command(".uno:ObjectMenue?VerbID:short=-8")
- xDialog = self.xUITest.getTopFocusWindow()
+ # Save Copy as
+ self.ui_test.execute_dialog_through_command(".uno:ObjectMenue?VerbID:short=-8")
+ xDialog = self.xUITest.getTopFocusWindow()
- xFileName = xDialog.getChild("file_name")
- xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": xFilePath}))
+ xFileName = xDialog.getChild("file_name")
+ xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": xFilePath}))
- xOpenBtn = xDialog.getChild("open")
- self.ui_test.close_dialog_through_button(xOpenBtn)
-
- # Close the Writer document
- self.ui_test.close_doc()
+ xOpenBtn = xDialog.getChild("open")
+ self.ui_test.close_dialog_through_button(xOpenBtn)
with self.ui_test.load_file(systemPathToFileUrl(xFilePath)):
diff --git a/sc/qa/uitest/function_wizard/function_wizard.py b/sc/qa/uitest/function_wizard/function_wizard.py
index 13b83350927f..e4315e0985c7 100644
--- a/sc/qa/uitest/function_wizard/function_wizard.py
+++ b/sc/qa/uitest/function_wizard/function_wizard.py
@@ -12,18 +12,16 @@ from uitest.framework import UITestCase
class FunctionWizardTest(UITestCase):
# tdf#98427
def test_open_function_wizard(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
+ self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
- xFunctionDlg = self.xUITest.getTopFocusWindow()
+ xFunctionDlg = self.xUITest.getTopFocusWindow()
- xArrayChkBox = xFunctionDlg.getChild("array")
- xArrayChkBox.executeAction("CLICK", tuple())
+ xArrayChkBox = xFunctionDlg.getChild("array")
+ xArrayChkBox.executeAction("CLICK", tuple())
- xCancelBtn = xFunctionDlg.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ xCancelBtn = xFunctionDlg.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/function_wizard/tdf132173.py b/sc/qa/uitest/function_wizard/tdf132173.py
index d74f7dc744ca..d1c467e7a77f 100644
--- a/sc/qa/uitest/function_wizard/tdf132173.py
+++ b/sc/qa/uitest/function_wizard/tdf132173.py
@@ -11,23 +11,21 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf132173(UITestCase):
def test_tdf132173(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xFormula = xDialog.getChild("ed_formula")
- xFormula.executeAction("TYPE", mkPropertyValues({"TEXT": 'FIND({"A";"B";"C"},"SAMPLE TEXT")'}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xFormula = xDialog.getChild("ed_formula")
+ xFormula.executeAction("TYPE", mkPropertyValues({"TEXT": 'FIND({"A";"B";"C"},"SAMPLE TEXT")'}))
- self.assertEqual(get_state_as_dict(xFormula)["Text"], '=FIND({"A";"B";"C"},"SAMPLE TEXT")')
+ self.assertEqual(get_state_as_dict(xFormula)["Text"], '=FIND({"A";"B";"C"},"SAMPLE TEXT")')
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- #Without the fix in place, cell's value would have been #NAME?
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "2")
-
- self.ui_test.close_doc()
+ #Without the fix in place, cell's value would have been #NAME?
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "2")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/hide_cols/tdf95306.py b/sc/qa/uitest/hide_cols/tdf95306.py
index 63f976849ee3..cb1c2195ab26 100644
--- a/sc/qa/uitest/hide_cols/tdf95306.py
+++ b/sc/qa/uitest/hide_cols/tdf95306.py
@@ -20,23 +20,21 @@ def get_column_hidden(doc, index):
class HideDisjointColumns(UITestCase):
def test_hide_columns(self):
- self.ui_test.create_doc_in_start_center("calc")
- xTopWindow = self.xUITest.getTopFocusWindow()
-
- gridwin = xTopWindow.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1", "EXTEND":"true"}))
-
- doc = self.ui_test.get_component()
- self.assertFalse(get_column_hidden(doc, 1))
- self.assertFalse(get_column_hidden(doc, 3))
- self.ui_test._xUITest.executeCommand(".uno:HideColumn")
- self.assertTrue(get_column_hidden(doc, 1))
- self.assertTrue(get_column_hidden(doc, 3))
- self.ui_test._xUITest.executeCommand(".uno:Undo")
- self.assertFalse(get_column_hidden(doc, 1))
- self.assertFalse(get_column_hidden(doc, 3))
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xTopWindow = self.xUITest.getTopFocusWindow()
+
+ gridwin = xTopWindow.getChild("grid_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1", "EXTEND":"true"}))
+
+ doc = self.ui_test.get_component()
+ self.assertFalse(get_column_hidden(doc, 1))
+ self.assertFalse(get_column_hidden(doc, 3))
+ self.ui_test._xUITest.executeCommand(".uno:HideColumn")
+ self.assertTrue(get_column_hidden(doc, 1))
+ self.assertTrue(get_column_hidden(doc, 3))
+ self.ui_test._xUITest.executeCommand(".uno:Undo")
+ self.assertFalse(get_column_hidden(doc, 1))
+ self.assertFalse(get_column_hidden(doc, 3))
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/inputLine/tdf54197.py b/sc/qa/uitest/inputLine/tdf54197.py
index 54f2c5f56861..dabab33555d9 100644
--- a/sc/qa/uitest/inputLine/tdf54197.py
+++ b/sc/qa/uitest/inputLine/tdf54197.py
@@ -18,21 +18,19 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf54197(UITestCase):
def test_tdf54197_CTRL_D_input_line_change(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- # 1. go to cell A1 enter any text
- enter_text_to_cell(gridwin, "A1", "t")
- # 2. go to cell A2 press Ctrl+D
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
- self.xUITest.executeCommand(".uno:FillDown")
- # The same text as above is displayed at cell A2, BUT input line is still blank
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "t")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "t")
- xInputWin = xCalcDoc.getChild("sc_input_window")
- self.assertEqual(get_state_as_dict(xInputWin)["Text"], "t")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ # 1. go to cell A1 enter any text
+ enter_text_to_cell(gridwin, "A1", "t")
+ # 2. go to cell A2 press Ctrl+D
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+ self.xUITest.executeCommand(".uno:FillDown")
+ # The same text as above is displayed at cell A2, BUT input line is still blank
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "t")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "t")
+ xInputWin = xCalcDoc.getChild("sc_input_window")
+ self.assertEqual(get_state_as_dict(xInputWin)["Text"], "t")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/inputLine/tdf67346.py b/sc/qa/uitest/inputLine/tdf67346.py
index 324d8ca6384c..fa7dbca3e653 100644
--- a/sc/qa/uitest/inputLine/tdf67346.py
+++ b/sc/qa/uitest/inputLine/tdf67346.py
@@ -18,28 +18,26 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf67346(UITestCase):
def test_tdf67346_undo_paste_text_input_line(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()
- # type 'Apple' in A1
- enter_text_to_cell(gridwin, "A1", "Apple")
- # input line: copy the text from there
- xInputWin = xCalcDoc.getChild("sc_input_window")
- xInputWin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- self.xUITest.executeCommand(".uno:Copy")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
- # Ctrl-V
- self.xUITest.executeCommand(".uno:Paste")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Apple")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Apple")
- self.assertEqual(get_state_as_dict(xInputWin)["Text"], "Apple")
- #Ctrl-Z
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Apple")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "")
- self.assertEqual(get_state_as_dict(xInputWin)["Text"], "")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ # type 'Apple' in A1
+ enter_text_to_cell(gridwin, "A1", "Apple")
+ # input line: copy the text from there
+ xInputWin = xCalcDoc.getChild("sc_input_window")
+ xInputWin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+ # Ctrl-V
+ self.xUITest.executeCommand(".uno:Paste")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Apple")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Apple")
+ self.assertEqual(get_state_as_dict(xInputWin)["Text"], "Apple")
+ #Ctrl-Z
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Apple")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "")
+ self.assertEqual(get_state_as_dict(xInputWin)["Text"], "")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/key_f4/f4.py b/sc/qa/uitest/key_f4/f4.py
index ede0b2fdef9c..fb40fe4ec631 100644
--- a/sc/qa/uitest/key_f4/f4.py
+++ b/sc/qa/uitest/key_f4/f4.py
@@ -15,121 +15,118 @@ from uitest.uihelper.calc import enter_text_to_cell
class keyF4(UITestCase):
def test_f4(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #enter data
- enter_text_to_cell(gridwin, "A1", "1")
- enter_text_to_cell(gridwin, "A2", "2")
- enter_text_to_cell(gridwin, "A3", "3")
- enter_text_to_cell(gridwin, "B1", "=A1")
- enter_text_to_cell(gridwin, "B2", "=A2")
- enter_text_to_cell(gridwin, "B3", "=A3")
- #select B1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- #F4
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getFormula(), "=$A$1")
- #F4
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getFormula(), "=A$1")
- #F4
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getFormula(), "=$A1")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #enter data
+ enter_text_to_cell(gridwin, "A1", "1")
+ enter_text_to_cell(gridwin, "A2", "2")
+ enter_text_to_cell(gridwin, "A3", "3")
+ enter_text_to_cell(gridwin, "B1", "=A1")
+ enter_text_to_cell(gridwin, "B2", "=A2")
+ enter_text_to_cell(gridwin, "B3", "=A3")
+ #select B1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ #F4
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getFormula(), "=$A$1")
+ #F4
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getFormula(), "=A$1")
+ #F4
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getFormula(), "=$A1")
- #non continuous select
- #enter data
- enter_text_to_cell(gridwin, "C1", "=A1")
- enter_text_to_cell(gridwin, "C2", "=A2")
- enter_text_to_cell(gridwin, "C3", "=A3")
+ #non continuous select
+ #enter data
+ enter_text_to_cell(gridwin, "C1", "=A1")
+ enter_text_to_cell(gridwin, "C2", "=A2")
+ enter_text_to_cell(gridwin, "C3", "=A3")
- #select C1 and C3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C3", "EXTEND":"1"}))
- #F4
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getFormula(), "=$A$1")
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getFormula(), "=$A$3")
- #F4
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getFormula(), "=A$1")
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getFormula(), "=A$3")
- #F4
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getFormula(), "=$A1")
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getFormula(), "=$A3")
-
- self.ui_test.close_doc()
+ #select C1 and C3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C3", "EXTEND":"1"}))
+ #F4
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getFormula(), "=$A$1")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getFormula(), "=$A$3")
+ #F4
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getFormula(), "=A$1")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getFormula(), "=A$3")
+ #F4
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getFormula(), "=$A1")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getFormula(), "=$A3")
def test_tdf39650_F4_R1C1(self):
#Bug 39650 - Shift+F4 conversion from relative to absolute does not work for R1C1 syntax
- 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()
- #* Tools --> Options --> Calc --> Formula --> Syntax = Excel R1C1
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #* Tools --> Options --> Calc --> Formula --> Syntax = Excel R1C1
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xCalcEntry = xPages.getChild('3') # Calc
- xCalcEntry.executeAction("EXPAND", tuple())
- xCalcFormulaEntry = xCalcEntry.getChild('4')
- xCalcFormulaEntry.executeAction("SELECT", tuple()) #Formula
+ xPages = xDialogOpt.getChild("pages")
+ xCalcEntry = xPages.getChild('3') # Calc
+ xCalcEntry.executeAction("EXPAND", tuple())
+ xCalcFormulaEntry = xCalcEntry.getChild('4')
+ xCalcFormulaEntry.executeAction("SELECT", tuple()) #Formula
- formulasyntax = xDialogOpt.getChild("formulasyntax")
- #Excel R1C1
- select_by_text(formulasyntax, "Excel R1C1")
+ formulasyntax = xDialogOpt.getChild("formulasyntax")
+ #Excel R1C1
+ select_by_text(formulasyntax, "Excel R1C1")
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #In cell R3C3 enter "xxx".
- enter_text_to_cell(gridwin, "C3", "xxx")
- # In cell R2C2 type = and then click on the xxx in R3C3.
- enter_text_to_cell(gridwin, "B2", "=R[1]C[1]")
- # With cell R2C2 still selected, type Shift-F4.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
+ #In cell R3C3 enter "xxx".
+ enter_text_to_cell(gridwin, "C3", "xxx")
+ # In cell R2C2 type = and then click on the xxx in R3C3.
+ enter_text_to_cell(gridwin, "B2", "=R[1]C[1]")
+ # With cell R2C2 still selected, type Shift-F4.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
- #F4
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
+ #F4
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
- #This should change the formula in R2C2 from =R[1]C[1] to =R3C3.
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "xxx")
- enter_text_to_cell(gridwin, "A1", "=FORMULA(R[1]C[1])")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "=R3C3")
+ #This should change the formula in R2C2 from =R[1]C[1] to =R3C3.
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "xxx")
+ enter_text_to_cell(gridwin, "A1", "=FORMULA(R[1]C[1])")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "=R3C3")
- #Give it back Tools --> Options --> Calc --> Formula --> Syntax = Calc A1
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
+ #Give it back Tools --> Options --> Calc --> Formula --> Syntax = Calc A1
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xCalcEntry = xPages.getChild('3') # Calc
- xCalcEntry.executeAction("EXPAND", tuple())
- xCalcFormulaEntry = xCalcEntry.getChild('4')
- xCalcFormulaEntry.executeAction("SELECT", tuple()) #Formula
+ xPages = xDialogOpt.getChild("pages")
+ xCalcEntry = xPages.getChild('3') # Calc
+ xCalcEntry.executeAction("EXPAND", tuple())
+ xCalcFormulaEntry = xCalcEntry.getChild('4')
+ xCalcFormulaEntry.executeAction("SELECT", tuple()) #Formula
- formulasyntax = xDialogOpt.getChild("formulasyntax")
- #Excel R1C1
- select_by_text(formulasyntax, "Calc A1")
+ formulasyntax = xDialogOpt.getChild("formulasyntax")
+ #Excel R1C1
+ select_by_text(formulasyntax, "Calc A1")
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.close_doc()
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/manual_tests/calc.py b/sc/qa/uitest/manual_tests/calc.py
index 247f7028e2ae..506e2b8000ac 100644
--- a/sc/qa/uitest/manual_tests/calc.py
+++ b/sc/qa/uitest/manual_tests/calc.py
@@ -16,155 +16,147 @@ class ManualCalcTests(UITestCase):
# http://manual-test.libreoffice.org/manage/case/189/
def test_define_database_range(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- # Select range A1:D10
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D10"}))
-
- # Execute "Define DB Range dialog"
- self.ui_test.execute_modeless_dialog_through_command(".uno:DefineDBName")
+ # Select range A1:D10
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D10"}))
- xDefineNameDlg = self.xUITest.getTopFocusWindow()
+ # Execute "Define DB Range dialog"
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DefineDBName")
- xEntryBox = xDefineNameDlg.getChild("entry")
- type_text(xEntryBox, "my_database")
+ xDefineNameDlg = self.xUITest.getTopFocusWindow()
- xOkBtn = xDefineNameDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xEntryBox = xDefineNameDlg.getChild("entry")
+ type_text(xEntryBox, "my_database")
- # Deselect range
- xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ xOkBtn = xDefineNameDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- # Execute "Select DB Range dialog"
- self.ui_test.execute_dialog_through_command(".uno:SelectDB")
- xSelectNameDlg = self.xUITest.getTopFocusWindow()
+ # Deselect range
+ xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- xListBox = xSelectNameDlg.getChild("treeview")
- xListBoxState = get_state_as_dict(xListBox)
- self.assertEqual(xListBoxState["SelectionCount"], "1")
- self.assertEqual(xListBoxState["SelectEntryText"], "my_database")
+ # Execute "Select DB Range dialog"
+ self.ui_test.execute_dialog_through_command(".uno:SelectDB")
+ xSelectNameDlg = self.xUITest.getTopFocusWindow()
- xOkBtn = xSelectNameDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xListBox = xSelectNameDlg.getChild("treeview")
+ xListBoxState = get_state_as_dict(xListBox)
+ self.assertEqual(xListBoxState["SelectionCount"], "1")
+ self.assertEqual(xListBoxState["SelectEntryText"], "my_database")
- # Assert that the correct range has been selected
- gridWinState = get_state_as_dict(xGridWin)
- self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A1:Sheet1.D10")
+ xOkBtn = xSelectNameDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.ui_test.close_doc()
+ # Assert that the correct range has been selected
+ gridWinState = get_state_as_dict(xGridWin)
+ self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A1:Sheet1.D10")
# http://manual-test.libreoffice.org/manage/case/190/
def test_sort_data(self):
- self.ui_test.create_doc_in_start_center("calc")
-
- # Insert data
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- enter_text_to_cell(xGridWin, "B1", "3")
- enter_text_to_cell(xGridWin, "B2", "25")
- enter_text_to_cell(xGridWin, "B3", "17")
- enter_text_to_cell(xGridWin, "B4", "9")
- enter_text_to_cell(xGridWin, "B5", "19")
- enter_text_to_cell(xGridWin, "B6", "0")
- enter_text_to_cell(xGridWin, "B7", "107")
- enter_text_to_cell(xGridWin, "B8", "89")
- enter_text_to_cell(xGridWin, "B9", "8")
- enter_text_to_cell(xGridWin, "B10", "33")
-
- xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B10"}))
-
- # Execute "Sort" dialog
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xSortDlg = self.xUITest.getTopFocusWindow()
-
- xOkBtn = xSortDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- document = self.ui_test.get_component()
-
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 8)
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 9)
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 17)
- self.assertEqual(get_cell_by_position(document, 0, 1, 5).getValue(), 19)
- self.assertEqual(get_cell_by_position(document, 0, 1, 6).getValue(), 25)
- self.assertEqual(get_cell_by_position(document, 0, 1, 7).getValue(), 33)
- self.assertEqual(get_cell_by_position(document, 0, 1, 8).getValue(), 89)
- self.assertEqual(get_cell_by_position(document, 0, 1, 9).getValue(), 107)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+
+ # Insert data
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ enter_text_to_cell(xGridWin, "B1", "3")
+ enter_text_to_cell(xGridWin, "B2", "25")
+ enter_text_to_cell(xGridWin, "B3", "17")
+ enter_text_to_cell(xGridWin, "B4", "9")
+ enter_text_to_cell(xGridWin, "B5", "19")
+ enter_text_to_cell(xGridWin, "B6", "0")
+ enter_text_to_cell(xGridWin, "B7", "107")
+ enter_text_to_cell(xGridWin, "B8", "89")
+ enter_text_to_cell(xGridWin, "B9", "8")
+ enter_text_to_cell(xGridWin, "B10", "33")
+
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B10"}))
+
+ # Execute "Sort" dialog
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xSortDlg = self.xUITest.getTopFocusWindow()
+
+ xOkBtn = xSortDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ document = self.ui_test.get_component()
+
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 8)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 9)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 17)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 5).getValue(), 19)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 6).getValue(), 25)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 7).getValue(), 33)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 8).getValue(), 89)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 9).getValue(), 107)
# http://manual-test.libreoffice.org/manage/case/191/
def test_validation(self):
- self.ui_test.create_doc_in_start_center("calc")
-
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C10"}))
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xValidationDlg = self.xUITest.getTopFocusWindow()
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C10"}))
- xAllowList = xValidationDlg.getChild("allow")
- xAllowList.executeAction("SELECT", mkPropertyValues({"POS": "1"}))
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xValidationDlg = self.xUITest.getTopFocusWindow()
- xData = xValidationDlg.getChild("data")
- xData.executeAction("SELECT", mkPropertyValues({"POS": "5"}))
+ xAllowList = xValidationDlg.getChild("allow")
+ xAllowList.executeAction("SELECT", mkPropertyValues({"POS": "1"}))
- xVal = xValidationDlg.getChild("max")
- xVal.executeAction("TYPE", mkPropertyValues({"TEXT":"0"}))
+ xData = xValidationDlg.getChild("data")
+ xData.executeAction("SELECT", mkPropertyValues({"POS": "5"}))
- xOkBtn = xValidationDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xVal = xValidationDlg.getChild("max")
+ xVal.executeAction("TYPE", mkPropertyValues({"TEXT":"0"}))
- def enter_text(cell, text):
- enter_text_to_cell(xGridWin, cell, text)
+ xOkBtn = xValidationDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- with self.ui_test.execute_blocking_action(enter_text, args=("A1", "abc")):
- pass
- with self.ui_test.execute_blocking_action(enter_text, args=("B6", "2.18")):
- pass
+ def enter_text(cell, text):
+ enter_text_to_cell(xGridWin, cell, text)
- enter_text_to_cell(xGridWin, "C2", "24")
+ with self.ui_test.execute_blocking_action(enter_text, args=("A1", "abc")):
+ pass
+ with self.ui_test.execute_blocking_action(enter_text, args=("B6", "2.18")):
+ pass
- self.ui_test.close_doc()
+ enter_text_to_cell(xGridWin, "C2", "24")
# http://manual-test.libreoffice.org/manage/case/187/
def test_transpose(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- enter_text_to_cell(xGridWin, "B3", "abcd")
- enter_text_to_cell(xGridWin, "B4", "edfg")
- enter_text_to_cell(xGridWin, "C3", "35")
- enter_text_to_cell(xGridWin, "C4", "5678")
-
- xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C10"}))
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ enter_text_to_cell(xGridWin, "B3", "abcd")
+ enter_text_to_cell(xGridWin, "B4", "edfg")
+ enter_text_to_cell(xGridWin, "C3", "35")
+ enter_text_to_cell(xGridWin, "C4", "5678")
- self.xUITest.executeCommand(".uno:Cut")
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C10"}))
- xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Cut")
- self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- xPasteSpecialDlg = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
- xAllChkBox = xPasteSpecialDlg.getChild("paste_all")
- xAllChkBox.executeAction("CLICK", tuple())
+ xPasteSpecialDlg = self.xUITest.getTopFocusWindow()
- xTransposeChkBox = xPasteSpecialDlg.getChild("transpose")
- xTransposeChkBox.executeAction("CLICK", tuple())
+ xAllChkBox = xPasteSpecialDlg.getChild("paste_all")
+ xAllChkBox.executeAction("CLICK", tuple())
- xOkBtn = xPasteSpecialDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xTransposeChkBox = xPasteSpecialDlg.getChild("transpose")
+ xTransposeChkBox.executeAction("CLICK", tuple())
- document = self.ui_test.get_component()
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getString(), "abcd")
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 35)
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getString(), "edfg")
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 5678)
+ xOkBtn = xPasteSpecialDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.ui_test.close_doc()
+ document = self.ui_test.get_component()
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getString(), "abcd")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 35)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getString(), "edfg")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 5678)
# http://manual-test.libreoffice.org/manage/case/151/
def test_cell_recalc(self):
@@ -185,41 +177,39 @@ class ManualCalcTests(UITestCase):
# http://manual-test.libreoffice.org/manage/case/143/
def test_random_numbers(self):
- self.ui_test.create_doc_in_start_center("calc")
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
-
- xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A10"}))
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
- xRandomNumberDlg = self.xUITest.getTopFocusWindow()
- xDistributionLstBox = xRandomNumberDlg.getChild("distribution-combo")
- xDistributionLstBox.executeAction("SELECT", mkPropertyValues({"POS": "1"}))
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A10"}))
- xMin = xRandomNumberDlg.getChild("parameter1-spin")
- xMin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
- xMin.executeAction("TYPE", mkPropertyValues({"TEXT": "-2"}))
- xMax = xRandomNumberDlg.getChild("parameter2-spin")
- xMax.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
- xMax.executeAction("TYPE", mkPropertyValues({"TEXT": "10"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:RandomNumberGeneratorDialog")
+ xRandomNumberDlg = self.xUITest.getTopFocusWindow()
+ xDistributionLstBox = xRandomNumberDlg.getChild("distribution-combo")
+ xDistributionLstBox.executeAction("SELECT", mkPropertyValues({"POS": "1"}))
- xApplyBtn = xRandomNumberDlg.getChild("apply")
- xApplyBtn.executeAction("CLICK", tuple())
+ xMin = xRandomNumberDlg.getChild("parameter1-spin")
+ xMin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
+ xMin.executeAction("TYPE", mkPropertyValues({"TEXT": "-2"}))
+ xMax = xRandomNumberDlg.getChild("parameter2-spin")
+ xMax.executeAction("TYPE", mkPropertyValues({"KEYCODE": "CTRL+A"}))
+ xMax.executeAction("TYPE", mkPropertyValues({"TEXT": "10"}))
- doc = self.ui_test.get_component()
+ xApplyBtn = xRandomNumberDlg.getChild("apply")
+ xApplyBtn.executeAction("CLICK", tuple())
- def check_random_values():
- for i in range(1, 9):
- val = get_cell_by_position(doc, 0, 0, i).getValue()
- self.assertTrue(val <= 10 and val >= -2)
+ doc = self.ui_test.get_component()
- check_random_values()
+ def check_random_values():
+ for i in range(1, 9):
+ val = get_cell_by_position(doc, 0, 0, i).getValue()
+ self.assertTrue(val <= 10 and val >= -2)
- xOkBtn = xRandomNumberDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ check_random_values()
- # we might want to check that clicking 'ok' actually changes the values
- check_random_values()
+ xOkBtn = xRandomNumberDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- self.ui_test.close_doc()
+ # we might want to check that clicking 'ok' actually changes the values
+ check_random_values()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/manual_tests/more_calc.py b/sc/qa/uitest/manual_tests/more_calc.py
index 08aeb654e449..bc389be56a0d 100644
--- a/sc/qa/uitest/manual_tests/more_calc.py
+++ b/sc/qa/uitest/manual_tests/more_calc.py
@@ -21,32 +21,31 @@ class ManualCalcTests(UITestCase):
# This test is to check that paste special combined with some options and link is ok.
# Refers to tdf#84810
- self.ui_test.create_doc_in_start_center("calc")
-
- # Write text to cell A1
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- enter_text_to_cell(xGridWin, "A1", "abcd")
-
- # Copy cell A1 to clipboard
- xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:Copy")
-
- # Set cursor to cell A3
- xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
-
- # Choose Paste Special Options and paste data
- self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
- xPasteSpecialDlg = self.xUITest.getTopFocusWindow()
- xAllChkBox = xPasteSpecialDlg.getChild("paste_all")
- xAllChkBox.executeAction("CLICK", tuple())
- xLinkChkBox = xPasteSpecialDlg.getChild("link")
- xLinkChkBox.executeAction("CLICK", tuple())
- xOkBtn = xPasteSpecialDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- # Assert successful paste
- document = self.ui_test.get_component()
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "abcd")
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+
+ # Write text to cell A1
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ enter_text_to_cell(xGridWin, "A1", "abcd")
+
+ # Copy cell A1 to clipboard
+ xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+
+ # Set cursor to cell A3
+ xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+
+ # Choose Paste Special Options and paste data
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xPasteSpecialDlg = self.xUITest.getTopFocusWindow()
+ xAllChkBox = xPasteSpecialDlg.getChild("paste_all")
+ xAllChkBox.executeAction("CLICK", tuple())
+ xLinkChkBox = xPasteSpecialDlg.getChild("link")
+ xLinkChkBox.executeAction("CLICK", tuple())
+ xOkBtn = xPasteSpecialDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ # Assert successful paste
+ document = self.ui_test.get_component()
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "abcd")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/options/tdf122977.py b/sc/qa/uitest/options/tdf122977.py
index b81adbc2616a..417427ad8928 100644
--- a/sc/qa/uitest/options/tdf122977.py
+++ b/sc/qa/uitest/options/tdf122977.py
@@ -15,47 +15,45 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class chartDefaultColors(UITestCase):
def test_tdf122977_crash_chart_default_colors_options(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()
-
- #Go to Tools -> Options -> Charts -> Default Colors
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
-
- xPages = xDialogOpt.getChild("pages")
- xChartEntry = xPages.getChild('5') # Charts
- xChartEntry.executeAction("EXPAND", tuple())
- xChartGeneralEntry = xChartEntry.getChild('0')
- xChartGeneralEntry.executeAction("SELECT", tuple()) #Default Colors
- xColors = xDialogOpt.getChild("colors")
- xAdd = xDialogOpt.getChild("add")
- xDelete = xDialogOpt.getChild("delete")
- xDefault = xDialogOpt.getChild("default")
-
- #click Default - reset
- xDefault.executeAction("CLICK", tuple())
- nrDefaultColors = get_state_as_dict(xColors)["Children"]
- nrDefaultColors1 = int(nrDefaultColors) + 1
- xAdd.executeAction("CLICK", tuple()) #add new color
- self.assertEqual(get_state_as_dict(xColors)["Children"], str(nrDefaultColors1))
-
- #delete new color
- with self.ui_test.execute_blocking_action(xDelete.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
-
- self.assertEqual(get_state_as_dict(xColors)["Children"], nrDefaultColors)
-
- xAdd.executeAction("CLICK", tuple()) #add new color
- self.assertEqual(get_state_as_dict(xColors)["Children"], str(nrDefaultColors1))
- #click Default
- xDefault.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(xColors)["Children"], nrDefaultColors)
-
- xCancelBtn = xDialogOpt.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ #Go to Tools -> Options -> Charts -> Default Colors
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+
+ xPages = xDialogOpt.getChild("pages")
+ xChartEntry = xPages.getChild('5') # Charts
+ xChartEntry.executeAction("EXPAND", tuple())
+ xChartGeneralEntry = xChartEntry.getChild('0')
+ xChartGeneralEntry.executeAction("SELECT", tuple()) #Default Colors
+ xColors = xDialogOpt.getChild("colors")
+ xAdd = xDialogOpt.getChild("add")
+ xDelete = xDialogOpt.getChild("delete")
+ xDefault = xDialogOpt.getChild("default")
+
+ #click Default - reset
+ xDefault.executeAction("CLICK", tuple())
+ nrDefaultColors = get_state_as_dict(xColors)["Children"]
+ nrDefaultColors1 = int(nrDefaultColors) + 1
+ xAdd.executeAction("CLICK", tuple()) #add new color
+ self.assertEqual(get_state_as_dict(xColors)["Children"], str(nrDefaultColors1))
+
+ #delete new color
+ with self.ui_test.execute_blocking_action(xDelete.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ self.assertEqual(get_state_as_dict(xColors)["Children"], nrDefaultColors)
+
+ xAdd.executeAction("CLICK", tuple()) #add new color
+ self.assertEqual(get_state_as_dict(xColors)["Children"], str(nrDefaultColors1))
+ #click Default
+ xDefault.executeAction("CLICK", tuple())
+ self.assertEqual(get_state_as_dict(xColors)["Children"], nrDefaultColors)
+
+ xCancelBtn = xDialogOpt.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/protect/protectSheet.py b/sc/qa/uitest/protect/protectSheet.py
index 90030b5322e7..4f24e9e68fca 100644
--- a/sc/qa/uitest/protect/protectSheet.py
+++ b/sc/qa/uitest/protect/protectSheet.py
@@ -16,47 +16,45 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class protectSheet(UITestCase):
def test_protect_sheet(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 password - lock
- self.ui_test.execute_dialog_through_command(".uno:Protect")
- xDialog = self.xUITest.getTopFocusWindow()
- xprotect = xDialog.getChild("protect")
- xpassword1 = xDialog.getChild("password1")
- xpassword2 = xDialog.getChild("password2")
-
- if (get_state_as_dict(xprotect)["Selected"]) == "false":
- xprotect.executeAction("CLICK", tuple())
- xpassword1.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
- xpassword2.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
-
- xOKBtn = xDialog.getChild("ok")
-# self.ui_test.close_dialog_through_button(xOKBtn)
- xOKBtn.executeAction("CLICK", tuple())
- #Unlock
-
- self.ui_test.execute_dialog_through_command(".uno:Protect")
- xDialog = self.xUITest.getTopFocusWindow()
- xpass1ed = xDialog.getChild("pass1ed")
-
- xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify - the sheet is unlocked
- enter_text_to_cell(gridwin, "B2", "A")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "A")
-
- # test cancel button
- self.ui_test.execute_dialog_through_command(".uno:Protect")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
- enter_text_to_cell(gridwin, "B2", "B")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "B")
-
- self.ui_test.close_doc()
+ with 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 password - lock
+ self.ui_test.execute_dialog_through_command(".uno:Protect")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xprotect = xDialog.getChild("protect")
+ xpassword1 = xDialog.getChild("password1")
+ xpassword2 = xDialog.getChild("password2")
+
+ if (get_state_as_dict(xprotect)["Selected"]) == "false":
+ xprotect.executeAction("CLICK", tuple())
+ xpassword1.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+ xpassword2.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+
+ xOKBtn = xDialog.getChild("ok")
+ # self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn.executeAction("CLICK", tuple())
+ #Unlock
+
+ self.ui_test.execute_dialog_through_command(".uno:Protect")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xpass1ed = xDialog.getChild("pass1ed")
+
+ xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify - the sheet is unlocked
+ enter_text_to_cell(gridwin, "B2", "A")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "A")
+
+ # test cancel button
+ self.ui_test.execute_dialog_through_command(".uno:Protect")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+ enter_text_to_cell(gridwin, "B2", "B")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "B")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/protect/protectSpreadsheet.py b/sc/qa/uitest/protect/protectSpreadsheet.py
index c0b78943fa05..7aa53f19fbc8 100644
--- a/sc/qa/uitest/protect/protectSpreadsheet.py
+++ b/sc/qa/uitest/protect/protectSpreadsheet.py
@@ -16,31 +16,29 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class protectSpreadsheet(UITestCase):
def test_protect_spreadsheet(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 password
- self.ui_test.execute_dialog_through_command(".uno:ToolProtectionDocument")
- xDialog = self.xUITest.getTopFocusWindow()
- xpass1ed = xDialog.getChild("pass1ed")
- xconfirm1ed = xDialog.getChild("confirm1ed")
+ with 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 password
+ self.ui_test.execute_dialog_through_command(".uno:ToolProtectionDocument")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xpass1ed = xDialog.getChild("pass1ed")
+ xconfirm1ed = xDialog.getChild("confirm1ed")
- xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
- xconfirm1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+ xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+ xconfirm1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.ui_test.execute_dialog_through_command(".uno:ToolProtectionDocument")
- xDialog = self.xUITest.getTopFocusWindow()
- xpass1ed = xDialog.getChild("pass1ed")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.ui_test.execute_dialog_through_command(".uno:ToolProtectionDocument")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xpass1ed = xDialog.getChild("pass1ed")
- xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
+ xpass1ed.executeAction("TYPE", mkPropertyValues({"TEXT":"aa"}))
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/range_name/create_range_name.py b/sc/qa/uitest/range_name/create_range_name.py
index 989532bf5643..135df5153312 100644
--- a/sc/qa/uitest/range_name/create_range_name.py
+++ b/sc/qa/uitest/range_name/create_range_name.py
@@ -17,171 +17,165 @@ class CreateRangeNameTest(UITestCase):
def test_create_range_name(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- calcDoc = self.xUITest.getTopFocusWindow()
- xPosWindow = calcDoc.getChild('pos_window')
- self.assertEqual('A1', get_state_as_dict(xPosWindow)['Text'])
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xPosWindow = calcDoc.getChild('pos_window')
+ self.assertEqual('A1', get_state_as_dict(xPosWindow)['Text'])
- self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
- xAddNameDlg = self.xUITest.getTopFocusWindow()
+ xAddNameDlg = self.xUITest.getTopFocusWindow()
- xEdit = xAddNameDlg.getChild("edit")
- type_text(xEdit, "globalRangeName")
+ xEdit = xAddNameDlg.getChild("edit")
+ type_text(xEdit, "globalRangeName")
- xAddBtn = xAddNameDlg.getChild("add")
- self.ui_test.close_dialog_through_button(xAddBtn)
+ xAddBtn = xAddNameDlg.getChild("add")
+ self.ui_test.close_dialog_through_button(xAddBtn)
- self.assertEqual('globalRangeName', get_state_as_dict(xPosWindow)['Text'])
-
- self.ui_test.close_doc()
+ self.assertEqual('globalRangeName', get_state_as_dict(xPosWindow)['Text'])
def test_create_range_name_from_ui(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("calc"):
- enter_text_to_cell(gridwin, "A1", "1")
- enter_text_to_cell(gridwin, "B1", "1")
- enter_text_to_cell(gridwin, "C1", "1")
+ calcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = calcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C1"}))
- xPosWindow = calcDoc.getChild('pos_window')
- self.assertEqual('A1:C1', get_state_as_dict(xPosWindow)['Text'])
+ enter_text_to_cell(gridwin, "A1", "1")
+ enter_text_to_cell(gridwin, "B1", "1")
+ enter_text_to_cell(gridwin, "C1", "1")
- xPosWindow.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xPosWindow.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xPosWindow.executeAction("TYPE", mkPropertyValues({"TEXT":"RANGE1"}))
- xPosWindow.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C1"}))
+ xPosWindow = calcDoc.getChild('pos_window')
+ self.assertEqual('A1:C1', get_state_as_dict(xPosWindow)['Text'])
- self.assertEqual('RANGE1', get_state_as_dict(xPosWindow)['Text'])
+ xPosWindow.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xPosWindow.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xPosWindow.executeAction("TYPE", mkPropertyValues({"TEXT":"RANGE1"}))
+ xPosWindow.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
- calcDoc = self.xUITest.getTopFocusWindow()
- gridwin = calcDoc.getChild("grid_window")
+ self.assertEqual('RANGE1', get_state_as_dict(xPosWindow)['Text'])
- document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A2", "=SUM(RANGE1)")
- self.assertEqual(3.0, get_cell_by_position(document, 0, 0, 1).getValue())
+ calcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = calcDoc.getChild("grid_window")
- # Change the name
- self.ui_test.execute_dialog_through_command(".uno:DefineName")
- xDialog = self.xUITest.getTopFocusWindow()
- xNamesList = xDialog.getChild('names')
- self.assertEqual(1, len(xNamesList.getChildren()))
+ document = self.ui_test.get_component()
+ enter_text_to_cell(gridwin, "A2", "=SUM(RANGE1)")
+ self.assertEqual(3.0, get_cell_by_position(document, 0, 0, 1).getValue())
- xName = xDialog.getChild('name')
- self.assertEqual( 'RANGE1', get_state_as_dict(xName)["Text"])
+ # Change the name
+ self.ui_test.execute_dialog_through_command(".uno:DefineName")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xNamesList = xDialog.getChild('names')
+ self.assertEqual(1, len(xNamesList.getChildren()))
- xName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xName.executeAction("TYPE", mkPropertyValues({"TEXT":"RANGE2"}))
+ xName = xDialog.getChild('name')
+ self.assertEqual( 'RANGE1', get_state_as_dict(xName)["Text"])
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xName.executeAction("TYPE", mkPropertyValues({"TEXT":"RANGE2"}))
- # tdf#87474 check the formula is updated after changing the name
- self.assertEqual("=SUM(RANGE2)", get_cell_by_position(document, 0, 0, 1).getFormula())
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.xUITest.executeCommand(".uno:Undo")
+ # tdf#87474 check the formula is updated after changing the name
+ self.assertEqual("=SUM(RANGE2)", get_cell_by_position(document, 0, 0, 1).getFormula())
- self.assertEqual("=SUM(RANGE1)", get_cell_by_position(document, 0, 0, 1).getFormula())
+ self.xUITest.executeCommand(".uno:Undo")
- self.ui_test.close_doc()
+ self.assertEqual("=SUM(RANGE1)", get_cell_by_position(document, 0, 0, 1).getFormula())
def test_create_local_range_name(self):
- self.ui_test.create_doc_in_start_center("calc")
-
- calcDoc = self.xUITest.getTopFocusWindow()
- xPosWindow = calcDoc.getChild('pos_window')
- self.assertEqual('A1', get_state_as_dict(xPosWindow)['Text'])
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xPosWindow = calcDoc.getChild('pos_window')
+ self.assertEqual('A1', get_state_as_dict(xPosWindow)['Text'])
- xAddNameDlg = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
- xEdit = xAddNameDlg.getChild("edit")
- type_text(xEdit, "localRangeName")
+ xAddNameDlg = self.xUITest.getTopFocusWindow()
- xScope = xAddNameDlg.getChild("scope")
- select_pos(xScope, "1")
+ xEdit = xAddNameDlg.getChild("edit")
+ type_text(xEdit, "localRangeName")
- xAddBtn = xAddNameDlg.getChild("add")
- self.ui_test.close_dialog_through_button(xAddBtn)
+ xScope = xAddNameDlg.getChild("scope")
+ select_pos(xScope, "1")
- # tdf#67007: Without the fix in place, this test would have failed with
- # AssertionError: 'localRangeName' != 'A1'
- # Additionally, newly check a sheet-local scoped name has " (sheetname)" appended.
- self.assertEqual('localRangeName (Sheet1)', get_state_as_dict(xPosWindow)['Text'])
+ xAddBtn = xAddNameDlg.getChild("add")
+ self.ui_test.close_dialog_through_button(xAddBtn)
- gridwin = calcDoc.getChild("grid_window")
- enter_text_to_cell(gridwin, "A1", "1")
+ # tdf#67007: Without the fix in place, this test would have failed with
+ # AssertionError: 'localRangeName' != 'A1'
+ # Additionally, newly check a sheet-local scoped name has " (sheetname)" appended.
+ self.assertEqual('localRangeName (Sheet1)', get_state_as_dict(xPosWindow)['Text'])
- # Use the name range in the current sheet
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ gridwin = calcDoc.getChild("grid_window")
+ enter_text_to_cell(gridwin, "A1", "1")
- self.ui_test.execute_dialog_through_command(".uno:InsertName")
- xDialog = self.xUITest.getTopFocusWindow()
+ # Use the name range in the current sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- xCtrl = xDialog.getChild('ctrl')
- self.assertEqual(1, len(xCtrl.getChildren()))
- self.assertEqual("localRangeName\t$Sheet1.$A$1\tSheet1", get_state_as_dict(xCtrl.getChild('0'))['Text'])
- xCtrl.getChild('0').executeAction("SELECT", tuple())
+ self.ui_test.execute_dialog_through_command(".uno:InsertName")
+ xDialog = self.xUITest.getTopFocusWindow()
- xPasteBtn = xDialog.getChild("paste")
- self.ui_test.close_dialog_through_button(xPasteBtn)
+ xCtrl = xDialog.getChild('ctrl')
+ self.assertEqual(1, len(xCtrl.getChildren()))
+ self.assertEqual("localRangeName\t$Sheet1.$A$1\tSheet1", get_state_as_dict(xCtrl.getChild('0'))['Text'])
+ xCtrl.getChild('0').executeAction("SELECT", tuple())
- # use return key to paste the name range
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xPasteBtn = xDialog.getChild("paste")
+ self.ui_test.close_dialog_through_button(xPasteBtn)
- document = self.ui_test.get_component()
- self.assertEqual("1", get_cell_by_position(document, 0, 1, 0).getString())
- self.assertEqual("=localRangeName", get_cell_by_position(document, 0, 1, 0).getFormula())
+ # use return key to paste the name range
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- # Insert a new sheet
- self.ui_test.execute_dialog_through_command(".uno:Insert")
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("ok")
- xOKButton.executeAction("CLICK", tuple())
+ document = self.ui_test.get_component()
+ self.assertEqual("1", get_cell_by_position(document, 0, 1, 0).getString())
+ self.assertEqual("=localRangeName", get_cell_by_position(document, 0, 1, 0).getFormula())
- # Use the name range in the new sheet
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ # Insert a new sheet
+ self.ui_test.execute_dialog_through_command(".uno:Insert")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKButton = xDialog.getChild("ok")
+ xOKButton.executeAction("CLICK", tuple())
- self.ui_test.execute_dialog_through_command(".uno:InsertName")
- xDialog = self.xUITest.getTopFocusWindow()
+ # Use the name range in the new sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- xCtrl = xDialog.getChild('ctrl')
- self.assertEqual(1, len(xCtrl.getChildren()))
- self.assertEqual("localRangeName\t$Sheet1.$A$1\tSheet1", get_state_as_dict(xCtrl.getChild('0'))['Text'])
- xCtrl.getChild('0').executeAction("SELECT", tuple())
+ self.ui_test.execute_dialog_through_command(".uno:InsertName")
+ xDialog = self.xUITest.getTopFocusWindow()
- xPasteBtn = xDialog.getChild("paste")
- self.ui_test.close_dialog_through_button(xPasteBtn)
+ xCtrl = xDialog.getChild('ctrl')
+ self.assertEqual(1, len(xCtrl.getChildren()))
+ self.assertEqual("localRangeName\t$Sheet1.$A$1\tSheet1", get_state_as_dict(xCtrl.getChild('0'))['Text'])
+ xCtrl.getChild('0').executeAction("SELECT", tuple())
- # use return key to paste the name range
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ xPasteBtn = xDialog.getChild("paste")
+ self.ui_test.close_dialog_through_button(xPasteBtn)
- # tdf#137896: Without the fix in place, this test would have failed with
- # AssertionError: '1' != '#NAME?'
- self.assertEqual("1", get_cell_by_position(document, 0, 1, 0).getString())
+ # use return key to paste the name range
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- # and AssertionError: '=Sheet1.localRangeName' != '=localrangename'
- self.assertEqual("=Sheet1.localRangeName", get_cell_by_position(document, 0, 1, 0).getFormula())
+ # tdf#137896: Without the fix in place, this test would have failed with
+ # AssertionError: '1' != '#NAME?'
+ self.assertEqual("1", get_cell_by_position(document, 0, 1, 0).getString())
- self.ui_test.execute_dialog_through_command(".uno:DefineName")
- xDialog = self.xUITest.getTopFocusWindow()
+ # and AssertionError: '=Sheet1.localRangeName' != '=localrangename'
+ self.assertEqual("=Sheet1.localRangeName", get_cell_by_position(document, 0, 1, 0).getFormula())
- # tdf#138851: Without the fix in place, this test would have failed with
- # AssertionError: 'Sheet1' != 'Document (Global)'
- xScope = xDialog.getChild("scope")
- self.assertEqual("Sheet1", get_state_as_dict(xScope)['SelectEntryText'])
+ self.ui_test.execute_dialog_through_command(".uno:DefineName")
+ xDialog = self.xUITest.getTopFocusWindow()
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ # tdf#138851: Without the fix in place, this test would have failed with
+ # AssertionError: 'Sheet1' != 'Document (Global)'
+ xScope = xDialog.getChild("scope")
+ self.assertEqual("Sheet1", get_state_as_dict(xScope)['SelectEntryText'])
- self.ui_test.close_doc()
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/range_name/tdf137617.py b/sc/qa/uitest/range_name/tdf137617.py
index 54c458823fe6..db90aa93128b 100644
--- a/sc/qa/uitest/range_name/tdf137617.py
+++ b/sc/qa/uitest/range_name/tdf137617.py
@@ -15,98 +15,96 @@ class tdf137617(UITestCase):
def test_tdf137617(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- calcDoc = self.xUITest.getTopFocusWindow()
- gridwin = calcDoc.getChild("grid_window")
+ calcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = calcDoc.getChild("grid_window")
- enter_text_to_cell(gridwin, "A1", "Result1")
- enter_text_to_cell(gridwin, "A2", "Result2")
+ enter_text_to_cell(gridwin, "A1", "Result1")
+ enter_text_to_cell(gridwin, "A2", "Result2")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B2"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B2"}))
- self.ui_test.execute_dialog_through_command(".uno:CreateNames")
+ self.ui_test.execute_dialog_through_command(".uno:CreateNames")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- # Only left is selected
- self.assertEqual('true', get_state_as_dict(xDialog.getChild('left'))['Selected'])
- self.assertEqual('false', get_state_as_dict(xDialog.getChild('right'))['Selected'])
- self.assertEqual('false', get_state_as_dict(xDialog.getChild('bottom'))['Selected'])
- self.assertEqual('false', get_state_as_dict(xDialog.getChild('top'))['Selected'])
+ # Only left is selected
+ self.assertEqual('true', get_state_as_dict(xDialog.getChild('left'))['Selected'])
+ self.assertEqual('false', get_state_as_dict(xDialog.getChild('right'))['Selected'])
+ self.assertEqual('false', get_state_as_dict(xDialog.getChild('bottom'))['Selected'])
+ self.assertEqual('false', get_state_as_dict(xDialog.getChild('top'))['Selected'])
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- xPosWindow = calcDoc.getChild('pos_window')
- self.assertEqual('Result1', get_state_as_dict(xPosWindow)['Text'])
+ xPosWindow = calcDoc.getChild('pos_window')
+ self.assertEqual('Result1', get_state_as_dict(xPosWindow)['Text'])
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
- self.assertEqual('Result2', get_state_as_dict(xPosWindow)['Text'])
+ self.assertEqual('Result2', get_state_as_dict(xPosWindow)['Text'])
- # Change formula syntax to "Excel R1C1"
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
- xDialogOpt = self.xUITest.getTopFocusWindow()
+ # Change formula syntax to "Excel R1C1"
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
+ xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xCalcEntry = xPages.getChild('3')
- xCalcEntry.executeAction("EXPAND", tuple())
- xCalcFormulaEntry = xCalcEntry.getChild('4')
- xCalcFormulaEntry.executeAction("SELECT", tuple())
+ xPages = xDialogOpt.getChild("pages")
+ xCalcEntry = xPages.getChild('3')
+ xCalcEntry.executeAction("EXPAND", tuple())
+ xCalcFormulaEntry = xCalcEntry.getChild('4')
+ xCalcFormulaEntry.executeAction("SELECT", tuple())
- xFormulaSyntax = xDialogOpt.getChild('formulasyntax')
- select_by_text(xFormulaSyntax, "Excel R1C1")
+ xFormulaSyntax = xDialogOpt.getChild('formulasyntax')
+ select_by_text(xFormulaSyntax, "Excel R1C1")
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- enter_text_to_cell(gridwin, "C1", "Result3")
- enter_text_to_cell(gridwin, "D1", "Result4")
+ enter_text_to_cell(gridwin, "C1", "Result3")
+ enter_text_to_cell(gridwin, "D1", "Result4")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:D2"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:D2"}))
- self.ui_test.execute_dialog_through_command(".uno:CreateNames")
+ self.ui_test.execute_dialog_through_command(".uno:CreateNames")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- # Only top is selected
- self.assertEqual('false', get_state_as_dict(xDialog.getChild('left'))['Selected'])
- self.assertEqual('false', get_state_as_dict(xDialog.getChild('right'))['Selected'])
- self.assertEqual('false', get_state_as_dict(xDialog.getChild('bottom'))['Selected'])
- self.assertEqual('true', get_state_as_dict(xDialog.getChild('top'))['Selected'])
+ # Only top is selected
+ self.assertEqual('false', get_state_as_dict(xDialog.getChild('left'))['Selected'])
+ self.assertEqual('false', get_state_as_dict(xDialog.getChild('right'))['Selected'])
+ self.assertEqual('false', get_state_as_dict(xDialog.getChild('bottom'))['Selected'])
+ self.assertEqual('true', get_state_as_dict(xDialog.getChild('top'))['Selected'])
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C2"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C2"}))
- # Without the fix in place, this test would have failed with
- # AssertionError: 'Result3' != 'R2C3'
- self.assertEqual('Result3', get_state_as_dict(xPosWindow)['Text'])
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'Result3' != 'R2C3'
+ self.assertEqual('Result3', get_state_as_dict(xPosWindow)['Text'])
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D2"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D2"}))
- self.assertEqual('Result4', get_state_as_dict(xPosWindow)['Text'])
+ self.assertEqual('Result4', get_state_as_dict(xPosWindow)['Text'])
- # Change formula syntax back to "Calc A1"
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
- xDialogOpt = self.xUITest.getTopFocusWindow()
+ # Change formula syntax back to "Calc A1"
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
+ xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xCalcEntry = xPages.getChild('3')
- xCalcEntry.executeAction("EXPAND", tuple())
- xCalcFormulaEntry = xCalcEntry.getChild('4')
- xCalcFormulaEntry.executeAction("SELECT", tuple())
+ xPages = xDialogOpt.getChild("pages")
+ xCalcEntry = xPages.getChild('3')
+ xCalcEntry.executeAction("EXPAND", tuple())
+ xCalcFormulaEntry = xCalcEntry.getChild('4')
+ xCalcFormulaEntry.executeAction("SELECT", tuple())
- xFormulaSyntax = xDialogOpt.getChild('formulasyntax')
- select_by_text(xFormulaSyntax, "Calc A1")
+ xFormulaSyntax = xDialogOpt.getChild('formulasyntax')
+ select_by_text(xFormulaSyntax, "Calc A1")
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/range_name/tdf138822.py b/sc/qa/uitest/range_name/tdf138822.py
index 361cc379e828..cd0a5bb220ed 100644
--- a/sc/qa/uitest/range_name/tdf138822.py
+++ b/sc/qa/uitest/range_name/tdf138822.py
@@ -11,53 +11,51 @@ from uitest.uihelper.common import type_text
class tdf138822(UITestCase):
def test_tdf138822(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- calcDoc = self.xUITest.getTopFocusWindow()
- xPosWindow = calcDoc.getChild('pos_window')
- self.assertEqual('A1', get_state_as_dict(xPosWindow)['Text'])
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xPosWindow = calcDoc.getChild('pos_window')
+ self.assertEqual('A1', get_state_as_dict(xPosWindow)['Text'])
- self.ui_test.execute_modeless_dialog_through_command(".uno:DefineName")
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DefineName")
- xManageNamesDialog = self.xUITest.getTopFocusWindow()
+ xManageNamesDialog = self.xUITest.getTopFocusWindow()
- xAddBtn = xManageNamesDialog.getChild("add")
- self.ui_test.close_dialog_through_button(xAddBtn)
+ xAddBtn = xManageNamesDialog.getChild("add")
+ self.ui_test.close_dialog_through_button(xAddBtn)
- xDefineNamesDialog = self.xUITest.getTopFocusWindow()
+ xDefineNamesDialog = self.xUITest.getTopFocusWindow()
- xAddBtn = xDefineNamesDialog.getChild("add")
- self.assertEqual("false", get_state_as_dict(xAddBtn)['Enabled'])
+ xAddBtn = xDefineNamesDialog.getChild("add")
+ self.assertEqual("false", get_state_as_dict(xAddBtn)['Enabled'])
- xEdit = xDefineNamesDialog.getChild("edit")
- type_text(xEdit, "rangeName")
+ xEdit = xDefineNamesDialog.getChild("edit")
+ type_text(xEdit, "rangeName")
- self.assertEqual("true", get_state_as_dict(xAddBtn)['Enabled'])
+ self.assertEqual("true", get_state_as_dict(xAddBtn)['Enabled'])
- self.ui_test.close_dialog_through_button(xAddBtn)
+ self.ui_test.close_dialog_through_button(xAddBtn)
- xManageNamesDialog = self.xUITest.getTopFocusWindow()
+ xManageNamesDialog = self.xUITest.getTopFocusWindow()
- xNamesList = xManageNamesDialog.getChild('names')
- self.assertEqual(1, len(xNamesList.getChildren()))
- self.assertEqual(get_state_as_dict(xNamesList.getChild('0'))["Text"], "rangeName\t$Sheet1.$A$1\tDocument (Global)")
+ xNamesList = xManageNamesDialog.getChild('names')
+ self.assertEqual(1, len(xNamesList.getChildren()))
+ self.assertEqual(get_state_as_dict(xNamesList.getChild('0'))["Text"], "rangeName\t$Sheet1.$A$1\tDocument (Global)")
- xCancelBtn = xManageNamesDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ xCancelBtn = xManageNamesDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
- # Open the dialog again
- self.ui_test.execute_modeless_dialog_through_command(".uno:DefineName")
+ # Open the dialog again
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DefineName")
- xManageNamesDialog = self.xUITest.getTopFocusWindow()
- xNamesList = xManageNamesDialog.getChild('names')
+ xManageNamesDialog = self.xUITest.getTopFocusWindow()
+ xNamesList = xManageNamesDialog.getChild('names')
- # Without the fix in place, this test would have failed with
- # AssertionError: 0 != 1
- self.assertEqual(0, len(xNamesList.getChildren()))
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 0 != 1
+ self.assertEqual(0, len(xNamesList.getChildren()))
- xOkBtn = xManageNamesDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- self.ui_test.close_doc()
+ xOkBtn = xManageNamesDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/range_name/tdf86214.py b/sc/qa/uitest/range_name/tdf86214.py
index 48817e0bcc64..4130bbca108e 100644
--- a/sc/qa/uitest/range_name/tdf86214.py
+++ b/sc/qa/uitest/range_name/tdf86214.py
@@ -15,46 +15,44 @@ class InvalidNames(UITestCase):
def test_invalid_names(self):
- self.ui_test.create_doc_in_start_center("calc")
+ with self.ui_test.create_doc_in_start_center("calc"):
- self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AddName")
- xAddNameDlg = self.xUITest.getTopFocusWindow()
+ xAddNameDlg = self.xUITest.getTopFocusWindow()
- invalid_names = ["A1", "12", "1.2", "A1:B2", "test.a", \
- "test+", "test-", "test*", "test!abc", "test#", \
- "test^", "test°", "test$", "test§", "test%", \
- "test&", "test/", "test(", "test)", "test[", "test]", \
- "test\\", "test`", "test´", "test'", "test~", "test<", \
- "tst>", "test|", "test:t", "test;z"]
+ invalid_names = ["A1", "12", "1.2", "A1:B2", "test.a", \
+ "test+", "test-", "test*", "test!abc", "test#", \
+ "test^", "test°", "test$", "test§", "test%", \
+ "test&", "test/", "test(", "test)", "test[", "test]", \
+ "test\\", "test`", "test´", "test'", "test~", "test<", \
+ "tst>", "test|", "test:t", "test;z"]
- xLabel = xAddNameDlg.getChild("label")
- xAddBtn = xAddNameDlg.getChild("add")
- xEdit = xAddNameDlg.getChild("edit")
+ xLabel = xAddNameDlg.getChild("label")
+ xAddBtn = xAddNameDlg.getChild("add")
+ xEdit = xAddNameDlg.getChild("edit")
- success_text = get_state_as_dict(xLabel)["Text"]
+ success_text = get_state_as_dict(xLabel)["Text"]
- for name in invalid_names:
- with self.subTest(name = name):
- select_all(xEdit)
- type_text(xEdit, name)
+ for name in invalid_names:
+ with self.subTest(name = name):
+ select_all(xEdit)
+ type_text(xEdit, name)
- # tdf#132869 - Without the fix in place, this test would have failed with
- # - Expected: "Invalid name. Start with a letter, use only letters, numbers and underscore."
- # - Actual : ""
- self.assertNotEqual(success_text, get_state_as_dict(xEdit)["QuickHelpText"])
- self.assertEqual(get_state_as_dict(xAddBtn)["Enabled"], "false")
+ # tdf#132869 - Without the fix in place, this test would have failed with
+ # - Expected: "Invalid name. Start with a letter, use only letters, numbers and underscore."
+ # - Actual : ""
+ self.assertNotEqual(success_text, get_state_as_dict(xEdit)["QuickHelpText"])
+ self.assertEqual(get_state_as_dict(xAddBtn)["Enabled"], "false")
- select_all(xEdit)
- type_text(xEdit, "valid_name")
+ select_all(xEdit)
+ type_text(xEdit, "valid_name")
- self.assertEqual(success_text, get_state_as_dict(xLabel)["Text"])
- self.assertEqual(success_text, get_state_as_dict(xEdit)["QuickHelpText"])
- self.assertEqual(get_state_as_dict(xAddBtn)["Enabled"], "true")
+ self.assertEqual(success_text, get_state_as_dict(xLabel)["Text"])
+ self.assertEqual(success_text, get_state_as_dict(xEdit)["QuickHelpText"])
+ self.assertEqual(get_state_as_dict(xAddBtn)["Enabled"], "true")
- self.ui_test.close_dialog_through_button(xAddBtn)
-
- self.ui_test.close_doc()
+ self.ui_test.close_dialog_through_button(xAddBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/search_replace/tdf132097.py b/sc/qa/uitest/search_replace/tdf132097.py
index 5585befb6da3..104737d23793 100644
--- a/sc/qa/uitest/search_replace/tdf132097.py
+++ b/sc/qa/uitest/search_replace/tdf132097.py
@@ -11,29 +11,27 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf132097(UITestCase):
def test_tdf132097(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCols = xDialog.getChild('cols')
- xSearchTerm = xDialog.getChild("searchterm")
- xBackSearch = xDialog.getChild("backsearch")
- xSeachLabel = xDialog.getChild("searchlabel")
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCols = xDialog.getChild('cols')
+ xSearchTerm = xDialog.getChild("searchterm")
+ xBackSearch = xDialog.getChild("backsearch")
+ xSeachLabel = xDialog.getChild("searchlabel")
- xCols.executeAction("CLICK", tuple())
- xSearchTerm.executeAction("TYPE", mkPropertyValues({"TEXT":"TEST"}))
+ xCols.executeAction("CLICK", tuple())
+ xSearchTerm.executeAction("TYPE", mkPropertyValues({"TEXT":"TEST"}))
- for i in range(10):
- # without the fix in place it would crash here.
- # Sometimes it doesn't crash at first so try a few times to be sure
- xBackSearch.executeAction("CLICK", tuple())
+ for i in range(10):
+ # without the fix in place it would crash here.
+ # Sometimes it doesn't crash at first so try a few times to be sure
+ xBackSearch.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(xSeachLabel)["Text"], "Search key not found")
+ self.assertEqual(get_state_as_dict(xSeachLabel)["Text"], "Search key not found")
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
-
- self.ui_test.close_doc()
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/search_replace/tdf39917.py b/sc/qa/uitest/search_replace/tdf39917.py
index 456e4a4acf12..011ed267bb15 100644
--- a/sc/qa/uitest/search_replace/tdf39917.py
+++ b/sc/qa/uitest/search_replace/tdf39917.py
@@ -18,91 +18,90 @@ from uitest.debug import sleep
class tdf39917(UITestCase):
def test_tdf39917_find_replace_R1C1(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()
- #* Tools --> Options --> Calc --> Formula --> Syntax = Excel R1C1
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #* Tools --> Options --> Calc --> Formula --> Syntax = Excel R1C1
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xCalcEntry = xPages.getChild('3') # Calc
- xCalcEntry.executeAction("EXPAND", tuple())
- xCalcFormulaEntry = xCalcEntry.getChild('4')
- xCalcFormulaEntry.executeAction("SELECT", tuple()) #Formula
+ xPages = xDialogOpt.getChild("pages")
+ xCalcEntry = xPages.getChild('3') # Calc
+ xCalcEntry.executeAction("EXPAND", tuple())
+ xCalcFormulaEntry = xCalcEntry.getChild('4')
+ xCalcFormulaEntry.executeAction("SELECT", tuple()) #Formula
- formulasyntax = xDialogOpt.getChild("formulasyntax")
- #Excel R1C1
- select_by_text(formulasyntax, "Excel R1C1")
+ formulasyntax = xDialogOpt.getChild("formulasyntax")
+ #Excel R1C1
+ select_by_text(formulasyntax, "Excel R1C1")
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #1. Create a workbook with 3 sheets: Page1, Page2, Page3.
- # 2. Tools -> Options -> LibreOffice Calc -> Formula: Set syntax to Excel A1
- # 5. Fill fields:
+ #1. Create a workbook with 3 sheets: Page1, Page2, Page3.
+ # 2. Tools -> Options -> LibreOffice Calc -> Formula: Set syntax to Excel A1
+ # 5. Fill fields:
- self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
- xDialog = self.xUITest.getTopFocusWindow()
- after = xDialog.getChild("after")
- after.executeAction("CLICK", tuple())
- nameed = xDialog.getChild("nameed")
- nameed.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- nameed.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- nameed.executeAction("TYPE", mkPropertyValues({"TEXT":"Page2"}))
- xOKButton = xDialog.getChild("ok")
- xOKButton.executeAction("CLICK", tuple())
- self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
- xDialog = self.xUITest.getTopFocusWindow()
- after = xDialog.getChild("after")
- after.executeAction("CLICK", tuple())
- nameed = xDialog.getChild("nameed")
- nameed.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- nameed.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- nameed.executeAction("TYPE", mkPropertyValues({"TEXT":"Page3"}))
- xOKButton = xDialog.getChild("ok")
- xOKButton.executeAction("CLICK", tuple())
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RIGHT"}))
- # 3. Type in (for example) B4: =Page2!B4
- enter_text_to_cell(gridwin, "B4", "=Page2!RC")
- # 4. Edit -> Find and Replace
- # Find: Page2
- # Replace: Page3
- # 6. Press Replace all
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- searchterm = xDialog.getChild("searchterm")
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"Page2"}))
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"Page3"})) #replace textbox
- replace = xDialog.getChild("replace")
- replace.executeAction("CLICK", tuple())
- replace.executeAction("CLICK", tuple())
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
+ self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
+ xDialog = self.xUITest.getTopFocusWindow()
+ after = xDialog.getChild("after")
+ after.executeAction("CLICK", tuple())
+ nameed = xDialog.getChild("nameed")
+ nameed.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ nameed.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ nameed.executeAction("TYPE", mkPropertyValues({"TEXT":"Page2"}))
+ xOKButton = xDialog.getChild("ok")
+ xOKButton.executeAction("CLICK", tuple())
+ self.ui_test.execute_dialog_through_command(".uno:Insert") #insert sheet
+ xDialog = self.xUITest.getTopFocusWindow()
+ after = xDialog.getChild("after")
+ after.executeAction("CLICK", tuple())
+ nameed = xDialog.getChild("nameed")
+ nameed.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ nameed.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ nameed.executeAction("TYPE", mkPropertyValues({"TEXT":"Page3"}))
+ xOKButton = xDialog.getChild("ok")
+ xOKButton.executeAction("CLICK", tuple())
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RIGHT"}))
+ # 3. Type in (for example) B4: =Page2!B4
+ enter_text_to_cell(gridwin, "B4", "=Page2!RC")
+ # 4. Edit -> Find and Replace
+ # Find: Page2
+ # Replace: Page3
+ # 6. Press Replace all
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ searchterm = xDialog.getChild("searchterm")
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"Page2"}))
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"Page3"})) #replace textbox
+ replace = xDialog.getChild("replace")
+ replace.executeAction("CLICK", tuple())
+ replace.executeAction("CLICK", tuple())
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
- #verify
- enter_text_to_cell(gridwin, "A1", "=FORMULA(R[3]C[1])")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "=Page3!RC")
- #Give it back Tools --> Options --> Calc --> Formula --> Syntax = Calc A1
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
+ #verify
+ enter_text_to_cell(gridwin, "A1", "=FORMULA(R[3]C[1])")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "=Page3!RC")
+ #Give it back Tools --> Options --> Calc --> Formula --> Syntax = Calc A1
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xCalcEntry = xPages.getChild('3') # Calc
- xCalcEntry.executeAction("EXPAND", tuple())
- xCalcFormulaEntry = xCalcEntry.getChild('4')
- xCalcFormulaEntry.executeAction("SELECT", tuple()) #Formula
+ xPages = xDialogOpt.getChild("pages")
+ xCalcEntry = xPages.getChild('3') # Calc
+ xCalcEntry.executeAction("EXPAND", tuple())
+ xCalcFormulaEntry = xCalcEntry.getChild('4')
+ xCalcFormulaEntry.executeAction("SELECT", tuple()) #Formula
- formulasyntax = xDialogOpt.getChild("formulasyntax")
- #Excel R1C1
- select_by_text(formulasyntax, "Calc A1")
+ formulasyntax = xDialogOpt.getChild("formulasyntax")
+ #Excel R1C1
+ select_by_text(formulasyntax, "Calc A1")
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/search_replace/tdf44398.py b/sc/qa/uitest/search_replace/tdf44398.py
index c44305cb01d1..0925293b9b06 100644
--- a/sc/qa/uitest/search_replace/tdf44398.py
+++ b/sc/qa/uitest/search_replace/tdf44398.py
@@ -17,77 +17,74 @@ from uitest.debug import sleep
class tdf44398(UITestCase):
def test_tdf44398_find_replace_regexp(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("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- # 1. A1 => 123456
- enter_text_to_cell(gridwin, "A1", "123456")
- # 2. ctrl-h, in dialog
- # Search: ([0-9])
- # Replace: $1
- # check regular expression
- # hit replace all
+ # 1. A1 => 123456
+ enter_text_to_cell(gridwin, "A1", "123456")
+ # 2. ctrl-h, in dialog
+ # Search: ([0-9])
+ # Replace: $1
+ # check regular expression
+ # hit replace all
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- searchterm = xDialog.getChild("searchterm")
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"([0-9])"}))
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"$1"})) #replace textbox
- regexp = xDialog.getChild("regexp")
- regexp.executeAction("CLICK", tuple()) #regular expressions
- replaceall = xDialog.getChild("replaceall")
- replaceall.executeAction("CLICK", tuple())
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
-
- #verify 3. A1 => 123456
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "123456")
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ searchterm = xDialog.getChild("searchterm")
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"([0-9])"}))
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"$1"})) #replace textbox
+ regexp = xDialog.getChild("regexp")
+ regexp.executeAction("CLICK", tuple()) #regular expressions
+ replaceall = xDialog.getChild("replaceall")
+ replaceall.executeAction("CLICK", tuple())
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
- self.ui_test.close_doc()
+ #verify 3. A1 => 123456
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "123456")
def test_tdf44398_find_replace_regexp_string(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("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- # 1. A1 => VarNumberA
- enter_text_to_cell(gridwin, "A1", "VarNumberA")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RIGHT"}))
- # 2. ctrl-h, in dialog
- # Search: ([A-Z])
- # Replace: <space>$1
- # check regular expression
- # check case
- # hit replace all
+ # 1. A1 => VarNumberA
+ enter_text_to_cell(gridwin, "A1", "VarNumberA")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RIGHT"}))
+ # 2. ctrl-h, in dialog
+ # Search: ([A-Z])
+ # Replace: <space>$1
+ # check regular expression
+ # check case
+ # hit replace all
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- searchterm = xDialog.getChild("searchterm")
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"([A-Z])"}))
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":" $1"})) #replace textbox
- regexp = xDialog.getChild("regexp")
- if (get_state_as_dict(regexp)["Selected"]) == "false":
- regexp.executeAction("CLICK", tuple()) #regular expressions
- matchcase = xDialog.getChild("matchcase")
- matchcase.executeAction("CLICK", tuple()) #case
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ searchterm = xDialog.getChild("searchterm")
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"([A-Z])"}))
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":" $1"})) #replace textbox
+ regexp = xDialog.getChild("regexp")
+ if (get_state_as_dict(regexp)["Selected"]) == "false":
+ regexp.executeAction("CLICK", tuple()) #regular expressions
+ matchcase = xDialog.getChild("matchcase")
+ matchcase.executeAction("CLICK", tuple()) #case
- replaceall = xDialog.getChild("replaceall")
- replaceall.executeAction("CLICK", tuple())
+ replaceall = xDialog.getChild("replaceall")
+ replaceall.executeAction("CLICK", tuple())
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
- #verify A1 => ' Var Number A'
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), " Var Number A")
+ #verify A1 => ' Var Number A'
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), " Var Number A")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/search_replace/tdf57523.py b/sc/qa/uitest/search_replace/tdf57523.py
index 36159dd7133a..7b6eed088f9c 100644
--- a/sc/qa/uitest/search_replace/tdf57523.py
+++ b/sc/qa/uitest/search_replace/tdf57523.py
@@ -13,42 +13,40 @@ from uitest.uihelper.common import get_state_as_dict
class tdf57523(UITestCase):
def test_tdf57523(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("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "AAA")
- enter_text_to_cell(gridwin, "A4", "AAA")
+ enter_text_to_cell(gridwin, "A1", "AAA")
+ enter_text_to_cell(gridwin, "A4", "AAA")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- searchterm = xDialog.getChild("searchterm")
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"^$"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ searchterm = xDialog.getChild("searchterm")
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"^$"}))
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"BBB"}))
- regexp = xDialog.getChild("regexp")
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"BBB"}))
+ regexp = xDialog.getChild("regexp")
- if get_state_as_dict(regexp)['Selected'] == 'false':
- regexp.executeAction("CLICK", tuple())
- self.assertEqual("true", get_state_as_dict(regexp)['Selected'])
+ if get_state_as_dict(regexp)['Selected'] == 'false':
+ regexp.executeAction("CLICK", tuple())
+ self.assertEqual("true", get_state_as_dict(regexp)['Selected'])
- replaceall = xDialog.getChild("replaceall")
- replaceall.executeAction("CLICK", tuple())
+ replaceall = xDialog.getChild("replaceall")
+ replaceall.executeAction("CLICK", tuple())
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
- # Without the fix in place, this test would have failed with
- # AssertionError: '' != 'BBB'
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "BBB")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "BBB")
-
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '' != 'BBB'
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "BBB")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "BBB")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/signatureLine/insertSignatureLine.py b/sc/qa/uitest/signatureLine/insertSignatureLine.py
index 51a321b34a64..93d725bbc99f 100644
--- a/sc/qa/uitest/signatureLine/insertSignatureLine.py
+++ b/sc/qa/uitest/signatureLine/insertSignatureLine.py
@@ -15,85 +15,82 @@ from com.sun.star.lang import IndexOutOfBoundsException
class insertSignatureLineCalc(UITestCase):
def test_insert_signature_line_calc(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- # cancel the dialog without doing anything
- self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xName = xDialog.getChild("edit_name")
- xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
-
- xCloseBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCloseBtn)
- with self.assertRaises(IndexOutOfBoundsException):
- document.Sheets.getByIndex(0).DrawPage.getByIndex(0)
-
- # set the signature line
- self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xName = xDialog.getChild("edit_name")
- xTitle = xDialog.getChild("edit_title")
- xEmail = xDialog.getChild("edit_email")
- xComment = xDialog.getChild("checkbox_can_add_comments")
- xInstructions = xDialog.getChild("edit_instructions")
-
- xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
- xTitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Title"}))
- xEmail.executeAction("TYPE", mkPropertyValues({"TEXT":"Email"}))
- xComment.executeAction("CLICK", tuple())
- xInstructions.executeAction("TYPE", mkPropertyValues({"TEXT":"Instructions"}))
- xOKBtn = xDialog.getChild("ok")
- xOKBtn.executeAction("CLICK", tuple())
-
- #check the signature Line in the document
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerName, "Name")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerEmail, "Email")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineCanAddComment, False)
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineShowSignDate, True)
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSigningInstructions, "Instructions")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ # cancel the dialog without doing anything
+ self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xName = xDialog.getChild("edit_name")
+ xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
+
+ xCloseBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCloseBtn)
+ with self.assertRaises(IndexOutOfBoundsException):
+ document.Sheets.getByIndex(0).DrawPage.getByIndex(0)
+
+ # set the signature line
+ self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xName = xDialog.getChild("edit_name")
+ xTitle = xDialog.getChild("edit_title")
+ xEmail = xDialog.getChild("edit_email")
+ xComment = xDialog.getChild("checkbox_can_add_comments")
+ xInstructions = xDialog.getChild("edit_instructions")
+
+ xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
+ xTitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Title"}))
+ xEmail.executeAction("TYPE", mkPropertyValues({"TEXT":"Email"}))
+ xComment.executeAction("CLICK", tuple())
+ xInstructions.executeAction("TYPE", mkPropertyValues({"TEXT":"Instructions"}))
+ xOKBtn = xDialog.getChild("ok")
+ xOKBtn.executeAction("CLICK", tuple())
+
+ #check the signature Line in the document
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerName, "Name")
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerEmail, "Email")
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineCanAddComment, False)
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineShowSignDate, True)
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSigningInstructions, "Instructions")
def test_insert_signature_line2_calc(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xName = xDialog.getChild("edit_name")
- xTitle = xDialog.getChild("edit_title")
- xEmail = xDialog.getChild("edit_email")
- xComment = xDialog.getChild("checkbox_can_add_comments")
- xDate = xDialog.getChild("checkbox_show_sign_date")
- xInstructions = xDialog.getChild("edit_instructions")
-
- xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
- xTitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Title"}))
- xEmail.executeAction("TYPE", mkPropertyValues({"TEXT":"Email"}))
- xDate.executeAction("CLICK", tuple())
- xComment.executeAction("CLICK", tuple())
- xInstructions.executeAction("TYPE", mkPropertyValues({"TEXT":"Instructions"}))
- xOKBtn = xDialog.getChild("ok")
- xOKBtn.executeAction("CLICK", tuple())
-
- #check the signature Line in the document
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerName, "Name")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerEmail, "Email")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineCanAddComment, False)
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineShowSignDate, False)
- self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSigningInstructions, "Instructions")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ self.ui_test.execute_dialog_through_command(".uno:InsertSignatureLine")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xName = xDialog.getChild("edit_name")
+ xTitle = xDialog.getChild("edit_title")
+ xEmail = xDialog.getChild("edit_email")
+ xComment = xDialog.getChild("checkbox_can_add_comments")
+ xDate = xDialog.getChild("checkbox_show_sign_date")
+ xInstructions = xDialog.getChild("edit_instructions")
+
+ xName.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"})) #set the signature line
+ xTitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Title"}))
+ xEmail.executeAction("TYPE", mkPropertyValues({"TEXT":"Email"}))
+ xDate.executeAction("CLICK", tuple())
+ xComment.executeAction("CLICK", tuple())
+ xInstructions.executeAction("TYPE", mkPropertyValues({"TEXT":"Instructions"}))
+ xOKBtn = xDialog.getChild("ok")
+ xOKBtn.executeAction("CLICK", tuple())
+
+ #check the signature Line in the document
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerName, "Name")
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerEmail, "Email")
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSuggestedSignerTitle, "Title")
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineCanAddComment, False)
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineShowSignDate, False)
+ self.assertEqual(document.Sheets.getByIndex(0).DrawPage.getByIndex(0).SignatureLineSigningInstructions, "Instructions")
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/naturalSort.py b/sc/qa/uitest/sort/naturalSort.py
index bd583a3c9a2c..bd182f9a016f 100644
--- a/sc/qa/uitest/sort/naturalSort.py
+++ b/sc/qa/uitest/sort/naturalSort.py
@@ -18,96 +18,93 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class CalcNaturalSorting(UITestCase):
def test_natural_sorting_rows(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #enter data
- enter_text_to_cell(gridwin, "A1", "MW100SSMOU456.996JIL4")
- enter_text_to_cell(gridwin, "A2", "MW180SSMOU456.996JIL4")
- enter_text_to_cell(gridwin, "A3", "MW110SSMOU456.993JIL4")
- enter_text_to_cell(gridwin, "A4", "MW180SSMOU456.994JIL4")
- enter_text_to_cell(gridwin, "A5", "MW101SSMOU456.996JIL4")
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xNatural = xDialog.getChild("naturalsort")
- xNatural.executeAction("CLICK", tuple())
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "MW100SSMOU456.996JIL4")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "MW101SSMOU456.996JIL4")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "MW110SSMOU456.993JIL4")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "MW180SSMOU456.994JIL4")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "MW180SSMOU456.996JIL4")
- #UNDO
- self.xUITest.executeCommand(".uno:Undo")
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "MW100SSMOU456.996JIL4")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "MW180SSMOU456.996JIL4")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "MW110SSMOU456.993JIL4")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "MW180SSMOU456.994JIL4")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "MW101SSMOU456.996JIL4")
- #enter data
- enter_text_to_cell(gridwin, "D1", "MW-2")
- enter_text_to_cell(gridwin, "D2", "MW-20")
- enter_text_to_cell(gridwin, "D3", "MW-1")
- enter_text_to_cell(gridwin, "D4", "MW-18")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D1:D4"}))
-
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- xNatural = xDialog.getChild("naturalsort")
- if (get_state_as_dict(xNatural)["Selected"]) == "false":
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #enter data
+ enter_text_to_cell(gridwin, "A1", "MW100SSMOU456.996JIL4")
+ enter_text_to_cell(gridwin, "A2", "MW180SSMOU456.996JIL4")
+ enter_text_to_cell(gridwin, "A3", "MW110SSMOU456.993JIL4")
+ enter_text_to_cell(gridwin, "A4", "MW180SSMOU456.994JIL4")
+ enter_text_to_cell(gridwin, "A5", "MW101SSMOU456.996JIL4")
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xNatural = xDialog.getChild("naturalsort")
xNatural.executeAction("CLICK", tuple())
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "MW100SSMOU456.996JIL4")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "MW101SSMOU456.996JIL4")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "MW110SSMOU456.993JIL4")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "MW180SSMOU456.994JIL4")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "MW180SSMOU456.996JIL4")
+ #UNDO
+ self.xUITest.executeCommand(".uno:Undo")
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "MW100SSMOU456.996JIL4")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "MW180SSMOU456.996JIL4")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "MW110SSMOU456.993JIL4")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "MW180SSMOU456.994JIL4")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "MW101SSMOU456.996JIL4")
+ #enter data
+ enter_text_to_cell(gridwin, "D1", "MW-2")
+ enter_text_to_cell(gridwin, "D2", "MW-20")
+ enter_text_to_cell(gridwin, "D3", "MW-1")
+ enter_text_to_cell(gridwin, "D4", "MW-18")
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "MW-1")
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getString(), "MW-2")
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "MW-18")
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getString(), "MW-20")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D1:D4"}))
- self.ui_test.close_doc()
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ xNatural = xDialog.getChild("naturalsort")
+ if (get_state_as_dict(xNatural)["Selected"]) == "false":
+ xNatural.executeAction("CLICK", tuple())
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "MW-1")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getString(), "MW-2")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "MW-18")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getString(), "MW-20")
def test_natural_sorting_columns(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #enter data
- enter_text_to_cell(gridwin, "A1", "MW-2")
- enter_text_to_cell(gridwin, "B1", "MW-20")
- enter_text_to_cell(gridwin, "C1", "MW-1")
- enter_text_to_cell(gridwin, "D1", "MW-18")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #enter data
+ enter_text_to_cell(gridwin, "A1", "MW-2")
+ enter_text_to_cell(gridwin, "B1", "MW-20")
+ enter_text_to_cell(gridwin, "C1", "MW-1")
+ enter_text_to_cell(gridwin, "D1", "MW-18")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:D1"}))
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- xleftright = xDialog.getChild("leftright")
- select_pos(xTabs, "1")
- xNatural = xDialog.getChild("naturalsort")
- xleftright.executeAction("CLICK", tuple())
- if (get_state_as_dict(xNatural)["Selected"]) == "false":
- xNatural.executeAction("CLICK", tuple())
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ xleftright = xDialog.getChild("leftright")
+ select_pos(xTabs, "1")
+ xNatural = xDialog.getChild("naturalsort")
+ xleftright.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xNatural)["Selected"]) == "false":
+ xNatural.executeAction("CLICK", tuple())
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "MW-1")
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "MW-2")
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "MW-18")
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "MW-20")
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "MW-1")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "MW-2")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "MW-18")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "MW-20")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/sorting.py b/sc/qa/uitest/sort/sorting.py
index 59c00c7b258a..91a2458b12b8 100644
--- a/sc/qa/uitest/sort/sorting.py
+++ b/sc/qa/uitest/sort/sorting.py
@@ -18,286 +18,277 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class CalcSorting(UITestCase):
def test_Sortingbuttons_detect_columnheaders(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #In column A enter: Number; 3; 4; 6; 2 / In column B enter: Misc; s; d; f; g
- enter_text_to_cell(gridwin, "A1", "Number")
- enter_text_to_cell(gridwin, "A2", "3")
- enter_text_to_cell(gridwin, "A3", "4")
- enter_text_to_cell(gridwin, "A4", "6")
- enter_text_to_cell(gridwin, "A5", "2")
- enter_text_to_cell(gridwin, "B1", "Misc")
- enter_text_to_cell(gridwin, "B2", "s")
- enter_text_to_cell(gridwin, "B3", "d")
- enter_text_to_cell(gridwin, "B4", "f")
- enter_text_to_cell(gridwin, "B5", "g")
- #Select cell A3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- #Press toolbarbutton for descending sorting .uno:SortDescending
- self.xUITest.executeCommand(".uno:SortDescending")
- #Verify that cell A1 still contains "Number" and B1 "Misc"
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number")
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc")
- #UNDO
- self.xUITest.executeCommand(".uno:Undo")
- #Select cell B3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
- #Press toolbar button for ascending sorting
- self.xUITest.executeCommand(".uno:SortAscending")
- #Verify that cell A1 still contains "Number" and B1 "Misc"
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number")
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc")
- #UNDO
- self.xUITest.executeCommand(".uno:Undo")
- #Select cell A3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- #Open sort dialog by DATA - SORT /Switch to tabpage Options
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- #Verify that option "Range contains column labels" is set
- xHeader = xDialog.getChild("header")
- self.assertEqual(get_state_as_dict(xHeader)["Selected"], "true")
- #Cancel dialog
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
- #Select Range A1:B5
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B5"}))
- #Press toolbarbutton for descending sorting
- self.xUITest.executeCommand(".uno:SortDescending")
- #Verify that cell A1 still contains "Number" and B1 "Misc"
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number")
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc")
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #In column A enter: Number; 3; 4; 6; 2 / In column B enter: Misc; s; d; f; g
+ enter_text_to_cell(gridwin, "A1", "Number")
+ enter_text_to_cell(gridwin, "A2", "3")
+ enter_text_to_cell(gridwin, "A3", "4")
+ enter_text_to_cell(gridwin, "A4", "6")
+ enter_text_to_cell(gridwin, "A5", "2")
+ enter_text_to_cell(gridwin, "B1", "Misc")
+ enter_text_to_cell(gridwin, "B2", "s")
+ enter_text_to_cell(gridwin, "B3", "d")
+ enter_text_to_cell(gridwin, "B4", "f")
+ enter_text_to_cell(gridwin, "B5", "g")
+ #Select cell A3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ #Press toolbarbutton for descending sorting .uno:SortDescending
+ self.xUITest.executeCommand(".uno:SortDescending")
+ #Verify that cell A1 still contains "Number" and B1 "Misc"
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc")
+ #UNDO
+ self.xUITest.executeCommand(".uno:Undo")
+ #Select cell B3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
+ #Press toolbar button for ascending sorting
+ self.xUITest.executeCommand(".uno:SortAscending")
+ #Verify that cell A1 still contains "Number" and B1 "Misc"
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc")
+ #UNDO
+ self.xUITest.executeCommand(".uno:Undo")
+ #Select cell A3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ #Open sort dialog by DATA - SORT /Switch to tabpage Options
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ #Verify that option "Range contains column labels" is set
+ xHeader = xDialog.getChild("header")
+ self.assertEqual(get_state_as_dict(xHeader)["Selected"], "true")
+ #Cancel dialog
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+ #Select Range A1:B5
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B5"}))
+ #Press toolbarbutton for descending sorting
+ self.xUITest.executeCommand(".uno:SortDescending")
+ #Verify that cell A1 still contains "Number" and B1 "Misc"
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc")
def test_Sortingbuttons_list_has_not_columnheaders(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #In column A enter: 5; 3; 4; 6; 2 / In column B enter: e; s; d; f; g
- enter_text_to_cell(gridwin, "A1", "5")
- enter_text_to_cell(gridwin, "A2", "3")
- enter_text_to_cell(gridwin, "A3", "4")
- enter_text_to_cell(gridwin, "A4", "6")
- enter_text_to_cell(gridwin, "A5", "2")
- enter_text_to_cell(gridwin, "B1", "e")
- enter_text_to_cell(gridwin, "B2", "s")
- enter_text_to_cell(gridwin, "B3", "d")
- enter_text_to_cell(gridwin, "B4", "f")
- enter_text_to_cell(gridwin, "B5", "g")
- #Select cell A3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- #Press toolbar button for ascending sorting
- self.xUITest.executeCommand(".uno:SortAscending")
- #Verify that cell A1 no longer contains "5" and B1 no longer contains "e"
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() != "5", True)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString() != "e", True)
- #UNDO
- self.xUITest.executeCommand(".uno:Undo")
- #Select cell B3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
- #Open sort dialog by DATA - SORT /Switch to tabpage Options
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- #Verify that option "Range contains column labels" is not set
- xHeader = xDialog.getChild("header")
- self.assertEqual(get_state_as_dict(xHeader)["Selected"], "false")
- #Cancel dialog
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #In column A enter: 5; 3; 4; 6; 2 / In column B enter: e; s; d; f; g
+ enter_text_to_cell(gridwin, "A1", "5")
+ enter_text_to_cell(gridwin, "A2", "3")
+ enter_text_to_cell(gridwin, "A3", "4")
+ enter_text_to_cell(gridwin, "A4", "6")
+ enter_text_to_cell(gridwin, "A5", "2")
+ enter_text_to_cell(gridwin, "B1", "e")
+ enter_text_to_cell(gridwin, "B2", "s")
+ enter_text_to_cell(gridwin, "B3", "d")
+ enter_text_to_cell(gridwin, "B4", "f")
+ enter_text_to_cell(gridwin, "B5", "g")
+ #Select cell A3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ #Press toolbar button for ascending sorting
+ self.xUITest.executeCommand(".uno:SortAscending")
+ #Verify that cell A1 no longer contains "5" and B1 no longer contains "e"
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString() != "5", True)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString() != "e", True)
+ #UNDO
+ self.xUITest.executeCommand(".uno:Undo")
+ #Select cell B3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
+ #Open sort dialog by DATA - SORT /Switch to tabpage Options
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ #Verify that option "Range contains column labels" is not set
+ xHeader = xDialog.getChild("header")
+ self.assertEqual(get_state_as_dict(xHeader)["Selected"], "false")
+ #Cancel dialog
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
def test_Sorting_default_to_selected_column(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #In column A enter: Number; 3; 4; 6; 2 / In column B enter: Misc; s; d; f; g
- enter_text_to_cell(gridwin, "A1", "Number")
- enter_text_to_cell(gridwin, "A2", "3")
- enter_text_to_cell(gridwin, "A3", "4")
- enter_text_to_cell(gridwin, "A4", "6")
- enter_text_to_cell(gridwin, "A5", "2")
- enter_text_to_cell(gridwin, "B1", "Misc")
- enter_text_to_cell(gridwin, "B2", "s")
- enter_text_to_cell(gridwin, "B3", "d")
- enter_text_to_cell(gridwin, "B4", "f")
- enter_text_to_cell(gridwin, "B5", "g")
- #Select cell A3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- #Press toolbarbutton for descending sorting .uno:SortDescending
- self.xUITest.executeCommand(".uno:SortDescending")
- #Verify that the sortorder was determined for column A (Number;2;3;4;6)
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getValue(), 2)
- #UNDO
- self.xUITest.executeCommand(".uno:Undo")
- #Select cell B3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
- #Press toolbar button for ascending sorting
- self.xUITest.executeCommand(".uno:SortAscending")
- #Verify that the sortorder was determined for column B (Misc;s;g;f;d)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "d")
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "f")
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "g")
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getString(), "s")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #In column A enter: Number; 3; 4; 6; 2 / In column B enter: Misc; s; d; f; g
+ enter_text_to_cell(gridwin, "A1", "Number")
+ enter_text_to_cell(gridwin, "A2", "3")
+ enter_text_to_cell(gridwin, "A3", "4")
+ enter_text_to_cell(gridwin, "A4", "6")
+ enter_text_to_cell(gridwin, "A5", "2")
+ enter_text_to_cell(gridwin, "B1", "Misc")
+ enter_text_to_cell(gridwin, "B2", "s")
+ enter_text_to_cell(gridwin, "B3", "d")
+ enter_text_to_cell(gridwin, "B4", "f")
+ enter_text_to_cell(gridwin, "B5", "g")
+ #Select cell A3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ #Press toolbarbutton for descending sorting .uno:SortDescending
+ self.xUITest.executeCommand(".uno:SortDescending")
+ #Verify that the sortorder was determined for column A (Number;2;3;4;6)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getValue(), 2)
+ #UNDO
+ self.xUITest.executeCommand(".uno:Undo")
+ #Select cell B3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
+ #Press toolbar button for ascending sorting
+ self.xUITest.executeCommand(".uno:SortAscending")
+ #Verify that the sortorder was determined for column B (Misc;s;g;f;d)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "d")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "f")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "g")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getString(), "s")
def test_Sorting_default_to_selected_TAB_A_column(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #In column A enter: Number; 3; 4; 6; 2 / In column B enter: Misc; s; d; f; g
- enter_text_to_cell(gridwin, "A1", "Number")
- enter_text_to_cell(gridwin, "A2", "3")
- enter_text_to_cell(gridwin, "A3", "4")
- enter_text_to_cell(gridwin, "A4", "6")
- enter_text_to_cell(gridwin, "A5", "2")
- enter_text_to_cell(gridwin, "B1", "Misc")
- enter_text_to_cell(gridwin, "B2", "s")
- enter_text_to_cell(gridwin, "B3", "d")
- enter_text_to_cell(gridwin, "B4", "f")
- enter_text_to_cell(gridwin, "B5", "g")
- #Select Range A1:B5
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B5"}))
- #Move the active cell inside the range to column A by using the TAB key
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
- #Press toolbar button for ascending sorting
- self.xUITest.executeCommand(".uno:SortAscending")
- #Verify that the sortorder was determined for column A (Number;2;3;4;6)
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getValue(), 6)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #In column A enter: Number; 3; 4; 6; 2 / In column B enter: Misc; s; d; f; g
+ enter_text_to_cell(gridwin, "A1", "Number")
+ enter_text_to_cell(gridwin, "A2", "3")
+ enter_text_to_cell(gridwin, "A3", "4")
+ enter_text_to_cell(gridwin, "A4", "6")
+ enter_text_to_cell(gridwin, "A5", "2")
+ enter_text_to_cell(gridwin, "B1", "Misc")
+ enter_text_to_cell(gridwin, "B2", "s")
+ enter_text_to_cell(gridwin, "B3", "d")
+ enter_text_to_cell(gridwin, "B4", "f")
+ enter_text_to_cell(gridwin, "B5", "g")
+ #Select Range A1:B5
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B5"}))
+ #Move the active cell inside the range to column A by using the TAB key
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+ #Press toolbar button for ascending sorting
+ self.xUITest.executeCommand(".uno:SortAscending")
+ #Verify that the sortorder was determined for column A (Number;2;3;4;6)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Number")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getValue(), 6)
def test_Sorting_default_to_selected_TAB_B_column(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #In column A enter: Number; 3; 4; 6; 2 / In column B enter: Misc; s; d; f; g
- enter_text_to_cell(gridwin, "A1", "Number")
- enter_text_to_cell(gridwin, "A2", "3")
- enter_text_to_cell(gridwin, "A3", "4")
- enter_text_to_cell(gridwin, "A4", "6")
- enter_text_to_cell(gridwin, "A5", "2")
- enter_text_to_cell(gridwin, "B1", "Misc")
- enter_text_to_cell(gridwin, "B2", "s")
- enter_text_to_cell(gridwin, "B3", "d")
- enter_text_to_cell(gridwin, "B4", "f")
- enter_text_to_cell(gridwin, "B5", "g")
- #Select Range A1:B5
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B5"}))
- #Move the active cell inside the range to column B by using the TAB key
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
- #Press toolbar button for ascending sorting
- self.xUITest.executeCommand(".uno:SortAscending")
- #Verify that the sortorder was determined for column B (Misc;d;f;g;s)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "d")
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "f")
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "g")
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getString(), "s")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #In column A enter: Number; 3; 4; 6; 2 / In column B enter: Misc; s; d; f; g
+ enter_text_to_cell(gridwin, "A1", "Number")
+ enter_text_to_cell(gridwin, "A2", "3")
+ enter_text_to_cell(gridwin, "A3", "4")
+ enter_text_to_cell(gridwin, "A4", "6")
+ enter_text_to_cell(gridwin, "A5", "2")
+ enter_text_to_cell(gridwin, "B1", "Misc")
+ enter_text_to_cell(gridwin, "B2", "s")
+ enter_text_to_cell(gridwin, "B3", "d")
+ enter_text_to_cell(gridwin, "B4", "f")
+ enter_text_to_cell(gridwin, "B5", "g")
+ #Select Range A1:B5
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B5"}))
+ #Move the active cell inside the range to column B by using the TAB key
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+ #Press toolbar button for ascending sorting
+ self.xUITest.executeCommand(".uno:SortAscending")
+ #Verify that the sortorder was determined for column B (Misc;d;f;g;s)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Misc")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "d")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "f")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "g")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getString(), "s")
def test_Sorting_sort_criteria(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #In column A enter: Number; 3; 4; 6; 2 / In column B enter: Misc; s; d; f; g
- enter_text_to_cell(gridwin, "A1", "Number")
- enter_text_to_cell(gridwin, "A2", "3")
- enter_text_to_cell(gridwin, "A3", "4")
- enter_text_to_cell(gridwin, "A4", "6")
- enter_text_to_cell(gridwin, "A5", "2")
- enter_text_to_cell(gridwin, "B1", "Misc")
- enter_text_to_cell(gridwin, "B2", "s")
- enter_text_to_cell(gridwin, "B3", "d")
- enter_text_to_cell(gridwin, "B4", "f")
- enter_text_to_cell(gridwin, "B5", "g")
- #Select cell A3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- #Verify that the first sort criteria is set to "Number(ascending)"
- xSortKey1 = xDialog.getChild("sortlb")
- xAsc = xDialog.getChild("up")
- self.assertEqual(get_state_as_dict(xSortKey1)["SelectEntryText"], "Number")
- self.assertEqual(get_state_as_dict(xAsc)["Checked"], "true")
- #Cancel dialog
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
- #Select cell B3
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- #Verify that the first sort criteria is set to "Misc (ascending)"
- xSortKey1 = xDialog.getChild("sortlb")
- xAsc = xDialog.getChild("up")
- self.assertEqual(get_state_as_dict(xSortKey1)["SelectEntryText"], "Misc")
- self.assertEqual(get_state_as_dict(xAsc)["Checked"], "true")
- #Cancel dialog
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
- #Select Range A1:B5
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B5"}))
- #Move the active cell inside the range to column A by using the TAB key
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- #Verify that the first sort criteria is set to "Number(ascending)"
- xSortKey1 = xDialog.getChild("sortlb")
- xAsc = xDialog.getChild("up")
- self.assertEqual(get_state_as_dict(xSortKey1)["SelectEntryText"], "Number")
- self.assertEqual(get_state_as_dict(xAsc)["Checked"], "true")
- #Cancel dialog
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
- #Select Range A1:B5
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B5"}))
- #Move the active cell inside the range to column B by using the TAB key
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- #Verify that the first sort criteria is set to "Misc (ascending)"
- xSortKey1 = xDialog.getChild("sortlb")
- xAsc = xDialog.getChild("up")
- self.assertEqual(get_state_as_dict(xSortKey1)["SelectEntryText"], "Misc")
- self.assertEqual(get_state_as_dict(xAsc)["Checked"], "true")
- #Cancel dialog
- xCanc = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCanc)
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #In column A enter: Number; 3; 4; 6; 2 / In column B enter: Misc; s; d; f; g
+ enter_text_to_cell(gridwin, "A1", "Number")
+ enter_text_to_cell(gridwin, "A2", "3")
+ enter_text_to_cell(gridwin, "A3", "4")
+ enter_text_to_cell(gridwin, "A4", "6")
+ enter_text_to_cell(gridwin, "A5", "2")
+ enter_text_to_cell(gridwin, "B1", "Misc")
+ enter_text_to_cell(gridwin, "B2", "s")
+ enter_text_to_cell(gridwin, "B3", "d")
+ enter_text_to_cell(gridwin, "B4", "f")
+ enter_text_to_cell(gridwin, "B5", "g")
+ #Select cell A3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ #Verify that the first sort criteria is set to "Number(ascending)"
+ xSortKey1 = xDialog.getChild("sortlb")
+ xAsc = xDialog.getChild("up")
+ self.assertEqual(get_state_as_dict(xSortKey1)["SelectEntryText"], "Number")
+ self.assertEqual(get_state_as_dict(xAsc)["Checked"], "true")
+ #Cancel dialog
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+ #Select cell B3
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ #Verify that the first sort criteria is set to "Misc (ascending)"
+ xSortKey1 = xDialog.getChild("sortlb")
+ xAsc = xDialog.getChild("up")
+ self.assertEqual(get_state_as_dict(xSortKey1)["SelectEntryText"], "Misc")
+ self.assertEqual(get_state_as_dict(xAsc)["Checked"], "true")
+ #Cancel dialog
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+ #Select Range A1:B5
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B5"}))
+ #Move the active cell inside the range to column A by using the TAB key
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ #Verify that the first sort criteria is set to "Number(ascending)"
+ xSortKey1 = xDialog.getChild("sortlb")
+ xAsc = xDialog.getChild("up")
+ self.assertEqual(get_state_as_dict(xSortKey1)["SelectEntryText"], "Number")
+ self.assertEqual(get_state_as_dict(xAsc)["Checked"], "true")
+ #Cancel dialog
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
+ #Select Range A1:B5
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B5"}))
+ #Move the active cell inside the range to column B by using the TAB key
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ #Verify that the first sort criteria is set to "Misc (ascending)"
+ xSortKey1 = xDialog.getChild("sortlb")
+ xAsc = xDialog.getChild("up")
+ self.assertEqual(get_state_as_dict(xSortKey1)["SelectEntryText"], "Misc")
+ self.assertEqual(get_state_as_dict(xAsc)["Checked"], "true")
+ #Cancel dialog
+ xCanc = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCanc)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/subtotals.py b/sc/qa/uitest/sort/subtotals.py
index 1445a1d87dc2..5066d1d6dea9 100644
--- a/sc/qa/uitest/sort/subtotals.py
+++ b/sc/qa/uitest/sort/subtotals.py
@@ -17,36 +17,34 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class Subtotals(UITestCase):
def test_tdf114720(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- XcalcDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- gridwin = XcalcDoc.getChild("grid_window")
-
- enter_text_to_cell(gridwin, "A1", "1")
- enter_text_to_cell(gridwin, "A2", "1")
- enter_text_to_cell(gridwin, "A3", "1")
- enter_text_to_cell(gridwin, "A4", "1")
- enter_text_to_cell(gridwin, "A5", "1")
- enter_text_to_cell(gridwin, "A6", "1")
- enter_text_to_cell(gridwin, "A7", "1")
- enter_text_to_cell(gridwin, "A8", "1")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A9"}))
-
- self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 0, 8).getString(), "")
-
- # check cancel button
- self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ XcalcDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ gridwin = XcalcDoc.getChild("grid_window")
+
+ enter_text_to_cell(gridwin, "A1", "1")
+ enter_text_to_cell(gridwin, "A2", "1")
+ enter_text_to_cell(gridwin, "A3", "1")
+ enter_text_to_cell(gridwin, "A4", "1")
+ enter_text_to_cell(gridwin, "A5", "1")
+ enter_text_to_cell(gridwin, "A6", "1")
+ enter_text_to_cell(gridwin, "A7", "1")
+ enter_text_to_cell(gridwin, "A8", "1")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A9"}))
+
+ self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 8).getString(), "")
+
+ # check cancel button
+ self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_tdf88792(self):
with self.ui_test.load_file(get_url_for_data_file("tdf88792.ods")) as calc_doc:
diff --git a/sc/qa/uitest/sort/tdf100517.py b/sc/qa/uitest/sort/tdf100517.py
index defbb4a47cc6..b4daacccac92 100644
--- a/sc/qa/uitest/sort/tdf100517.py
+++ b/sc/qa/uitest/sort/tdf100517.py
@@ -30,51 +30,49 @@ class tdf100517(UITestCase):
self.ui_test.close_dialog_through_button(xOk)
def test_tdf100517(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("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "Text 2")
- enter_text_to_cell(gridwin, "A2", "Text 3")
- enter_text_to_cell(gridwin, "A3", "Text 1")
+ enter_text_to_cell(gridwin, "A1", "Text 2")
+ enter_text_to_cell(gridwin, "A2", "Text 3")
+ enter_text_to_cell(gridwin, "A3", "Text 1")
- for i in ['B1', 'B2', 'B3']:
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": i}))
- xArgs = mkPropertyValues({"Text": i})
+ for i in ['B1', 'B2', 'B3']:
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": i}))
+ xArgs = mkPropertyValues({"Text": i})
- self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs)
+ self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs)
- self.execute_sort_dialog(gridwin, "true")
+ self.execute_sort_dialog(gridwin, "true")
- self.assertEqual("Text 1", get_cell_by_position(document, 0, 0, 0).getString())
- self.assertEqual("Text 2", get_cell_by_position(document, 0, 0, 1).getString())
- self.assertEqual("Text 3", get_cell_by_position(document, 0, 0, 2).getString())
+ self.assertEqual("Text 1", get_cell_by_position(document, 0, 0, 0).getString())
+ self.assertEqual("Text 2", get_cell_by_position(document, 0, 0, 1).getString())
+ self.assertEqual("Text 3", get_cell_by_position(document, 0, 0, 2).getString())
- self.assertEqual("B3", get_cell_by_position(document, 0, 1, 0).Annotation.String)
- self.assertEqual("B1", get_cell_by_position(document, 0, 1, 1).Annotation.String)
- self.assertEqual("B2", get_cell_by_position(document, 0, 1, 2).Annotation.String)
+ self.assertEqual("B3", get_cell_by_position(document, 0, 1, 0).Annotation.String)
+ self.assertEqual("B1", get_cell_by_position(document, 0, 1, 1).Annotation.String)
+ self.assertEqual("B2", get_cell_by_position(document, 0, 1, 2).Annotation.String)
- self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual("Text 2", get_cell_by_position(document, 0, 0, 0).getString())
- self.assertEqual("Text 3", get_cell_by_position(document, 0, 0, 1).getString())
- self.assertEqual("Text 1", get_cell_by_position(document, 0, 0, 2).getString())
+ self.assertEqual("Text 2", get_cell_by_position(document, 0, 0, 0).getString())
+ self.assertEqual("Text 3", get_cell_by_position(document, 0, 0, 1).getString())
+ self.assertEqual("Text 1", get_cell_by_position(document, 0, 0, 2).getString())
- self.assertEqual("B1", get_cell_by_position(document, 0, 1, 0).Annotation.String)
- self.assertEqual("B2", get_cell_by_position(document, 0, 1, 1).Annotation.String)
- self.assertEqual("B3", get_cell_by_position(document, 0, 1, 2).Annotation.String)
+ self.assertEqual("B1", get_cell_by_position(document, 0, 1, 0).Annotation.String)
+ self.assertEqual("B2", get_cell_by_position(document, 0, 1, 1).Annotation.String)
+ self.assertEqual("B3", get_cell_by_position(document, 0, 1, 2).Annotation.String)
- self.execute_sort_dialog(gridwin, "false")
+ self.execute_sort_dialog(gridwin, "false")
- self.assertEqual("Text 1", get_cell_by_position(document, 0, 0, 0).getString())
- self.assertEqual("Text 2", get_cell_by_position(document, 0, 0, 1).getString())
- self.assertEqual("Text 3", get_cell_by_position(document, 0, 0, 2).getString())
+ self.assertEqual("Text 1", get_cell_by_position(document, 0, 0, 0).getString())
+ self.assertEqual("Text 2", get_cell_by_position(document, 0, 0, 1).getString())
+ self.assertEqual("Text 3", get_cell_by_position(document, 0, 0, 2).getString())
- self.assertEqual("B1", get_cell_by_position(document, 0, 1, 0).Annotation.String)
- self.assertEqual("B2", get_cell_by_position(document, 0, 1, 1).Annotation.String)
- self.assertEqual("B3", get_cell_by_position(document, 0, 1, 2).Annotation.String)
-
- self.ui_test.close_doc()
+ self.assertEqual("B1", get_cell_by_position(document, 0, 1, 0).Annotation.String)
+ self.assertEqual("B2", get_cell_by_position(document, 0, 1, 1).Annotation.String)
+ self.assertEqual("B3", get_cell_by_position(document, 0, 1, 2).Annotation.String)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/tdf126678.py b/sc/qa/uitest/sort/tdf126678.py
index 0d63c8c35dd0..4c7e360957eb 100644
--- a/sc/qa/uitest/sort/tdf126678.py
+++ b/sc/qa/uitest/sort/tdf126678.py
@@ -30,46 +30,44 @@ class tdf126678(UITestCase):
self.ui_test.close_dialog_through_button(xOk)
def test_tdf126678(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("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "Text 2")
- enter_text_to_cell(gridwin, "A2", "Text 3")
- enter_text_to_cell(gridwin, "A3", "Text 1")
+ enter_text_to_cell(gridwin, "A1", "Text 2")
+ enter_text_to_cell(gridwin, "A2", "Text 3")
+ enter_text_to_cell(gridwin, "A3", "Text 1")
- # Set the background of the corresponding cell
- colorProperty = mkPropertyValues({"BackgroundColor": 16776960})
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
- self.xUITest.executeCommandWithParameters(".uno:BackgroundColor", colorProperty)
+ # Set the background of the corresponding cell
+ colorProperty = mkPropertyValues({"BackgroundColor": 16776960})
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
+ self.xUITest.executeCommandWithParameters(".uno:BackgroundColor", colorProperty)
- self.execute_sort_dialog(gridwin, "false")
+ self.execute_sort_dialog(gridwin, "false")
- self.assertEqual("Text 1", get_cell_by_position(document, 0, 0, 0).getString())
- self.assertEqual("Text 2", get_cell_by_position(document, 0, 0, 1).getString())
- self.assertEqual("Text 3", get_cell_by_position(document, 0, 0, 2).getString())
+ self.assertEqual("Text 1", get_cell_by_position(document, 0, 0, 0).getString())
+ self.assertEqual("Text 2", get_cell_by_position(document, 0, 0, 1).getString())
+ self.assertEqual("Text 3", get_cell_by_position(document, 0, 0, 2).getString())
- # Sorting without option "including formats" does not include cells with cell formats
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).CellBackColor, -1)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).CellBackColor, 16776960)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).CellBackColor, -1)
+ # Sorting without option "including formats" does not include cells with cell formats
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).CellBackColor, -1)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).CellBackColor, 16776960)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).CellBackColor, -1)
- self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
- self.execute_sort_dialog(gridwin, "true")
+ self.execute_sort_dialog(gridwin, "true")
- self.assertEqual("Text 1", get_cell_by_position(document, 0, 0, 0).getString())
- self.assertEqual("Text 2", get_cell_by_position(document, 0, 0, 1).getString())
- self.assertEqual("Text 3", get_cell_by_position(document, 0, 0, 2).getString())
+ self.assertEqual("Text 1", get_cell_by_position(document, 0, 0, 0).getString())
+ self.assertEqual("Text 2", get_cell_by_position(document, 0, 0, 1).getString())
+ self.assertEqual("Text 3", get_cell_by_position(document, 0, 0, 2).getString())
- # Sorting with option "including formats" includes all cells with visible cell formats
- # tdf126678 - Without the fix in place, the test would have failed with
- # AssertionError: -1 != 16776960
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).CellBackColor, -1)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).CellBackColor, -1)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).CellBackColor, 16776960)
-
- self.ui_test.close_doc()
+ # Sorting with option "including formats" includes all cells with visible cell formats
+ # tdf126678 - Without the fix in place, the test would have failed with
+ # AssertionError: -1 != 16776960
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).CellBackColor, -1)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).CellBackColor, -1)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).CellBackColor, 16776960)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/tdf53482.py b/sc/qa/uitest/sort/tdf53482.py
index 2058f1888f93..c9d5093e8fba 100644
--- a/sc/qa/uitest/sort/tdf53482.py
+++ b/sc/qa/uitest/sort/tdf53482.py
@@ -48,42 +48,40 @@ class tdf53482(UITestCase):
self.assertEqual(get_cell_by_position(document, 0, 6, 123).getString(), "13")
def test_tdf53482_Range_contains_column_headings(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #In column A enter: Misc; s; d; f; g
- enter_text_to_cell(gridwin, "A1", "Misc")
- enter_text_to_cell(gridwin, "A2", "s")
- enter_text_to_cell(gridwin, "A3", "d")
- enter_text_to_cell(gridwin, "A4", "f")
- enter_text_to_cell(gridwin, "A5", "g")
- #1. Highlight cells to be sorted
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
- #2. Click Data menu, Sort
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- #3. On Options tab, tick 'Range contains column labels'
- xHeader = xDialog.getChild("header")
- xHeader.executeAction("CLICK", tuple())
- if (get_state_as_dict(xHeader)["Selected"]) == "false":
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #In column A enter: Misc; s; d; f; g
+ enter_text_to_cell(gridwin, "A1", "Misc")
+ enter_text_to_cell(gridwin, "A2", "s")
+ enter_text_to_cell(gridwin, "A3", "d")
+ enter_text_to_cell(gridwin, "A4", "f")
+ enter_text_to_cell(gridwin, "A5", "g")
+ #1. Highlight cells to be sorted
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ #2. Click Data menu, Sort
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ #3. On Options tab, tick 'Range contains column labels'
+ xHeader = xDialog.getChild("header")
xHeader.executeAction("CLICK", tuple())
- #4. On Sort Criteria tab, set appropriate criteria
- select_pos(xTabs, "0")
- xDown = xDialog.getChild("down")
- xDown.executeAction("CLICK", tuple())
- #5. Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #6. Expected behavior: Ignore column labels when sorting
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Misc")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "s")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "g")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "f")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "d")
-
- self.ui_test.close_doc()
+ if (get_state_as_dict(xHeader)["Selected"]) == "false":
+ xHeader.executeAction("CLICK", tuple())
+ #4. On Sort Criteria tab, set appropriate criteria
+ select_pos(xTabs, "0")
+ xDown = xDialog.getChild("down")
+ xDown.executeAction("CLICK", tuple())
+ #5. Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #6. Expected behavior: Ignore column labels when sorting
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Misc")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "s")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "g")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "f")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "d")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/tdf91305.py b/sc/qa/uitest/sort/tdf91305.py
index 340efdb3a531..ffb79b332fb6 100644
--- a/sc/qa/uitest/sort/tdf91305.py
+++ b/sc/qa/uitest/sort/tdf91305.py
@@ -18,123 +18,119 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf91305(UITestCase):
def test_tdf91305_sort_text_cells_rows(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #In column A enter texts
- enter_text_to_cell(gridwin, "A1", "cc")
- enter_text_to_cell(gridwin, "A2", "ff")
- enter_text_to_cell(gridwin, "A3", "aa")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #In column A enter texts
+ enter_text_to_cell(gridwin, "A1", "cc")
+ enter_text_to_cell(gridwin, "A2", "ff")
+ enter_text_to_cell(gridwin, "A3", "aa")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
- #Press toolbarbutton for ascending sorting .uno:SortAsc
- self.xUITest.executeCommand(".uno:SortAscending")
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "aa")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "cc")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "ff")
- #Press toolbarbutton for descending sorting .uno:SortDescending
- self.xUITest.executeCommand(".uno:SortDescending")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "ff")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "cc")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "aa")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
+ #Press toolbarbutton for ascending sorting .uno:SortAsc
+ self.xUITest.executeCommand(".uno:SortAscending")
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "aa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "cc")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "ff")
+ #Press toolbarbutton for descending sorting .uno:SortDescending
+ self.xUITest.executeCommand(".uno:SortDescending")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "ff")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "cc")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "aa")
def test_tdf91305_sort_text_cells_columns(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #In column A enter texts
- enter_text_to_cell(gridwin, "A1", "cc")
- enter_text_to_cell(gridwin, "B1", "ff")
- enter_text_to_cell(gridwin, "C1", "aa")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #In column A enter texts
+ enter_text_to_cell(gridwin, "A1", "cc")
+ enter_text_to_cell(gridwin, "B1", "ff")
+ enter_text_to_cell(gridwin, "C1", "aa")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C1"}))
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- xleftright = xDialog.getChild("leftright")
- select_pos(xTabs, "1")
- xleftright.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "aa")
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "cc")
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "ff")
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- xleftright = xDialog.getChild("leftright")
- xdown = xDialog.getChild("down")
- select_pos(xTabs, "1")
- xleftright.executeAction("CLICK", tuple())
- select_pos(xTabs, "0")
- xdown.executeAction("CLICK", tuple())
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "ff")
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "cc")
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "aa")
- self.ui_test.close_doc()
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C1"}))
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ xleftright = xDialog.getChild("leftright")
+ select_pos(xTabs, "1")
+ xleftright.executeAction("CLICK", tuple())
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "aa")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "cc")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "ff")
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ xleftright = xDialog.getChild("leftright")
+ xdown = xDialog.getChild("down")
+ select_pos(xTabs, "1")
+ xleftright.executeAction("CLICK", tuple())
+ select_pos(xTabs, "0")
+ xdown.executeAction("CLICK", tuple())
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "ff")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "cc")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "aa")
#comment 6 - Additional sub-bugs:
def test_tdf91305_sort_text_cells_rows(self):
#Selecting some empty cells and pressing SORT causes empty cells to move below.
#No matter if you sort from A to Z or from Z to A.
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #In column A enter text
- enter_text_to_cell(gridwin, "A5", "ff")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- #sorting
- self.xUITest.executeCommand(".uno:SortAscending")
- self.xUITest.executeCommand(".uno:SortDescending")
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "ff")
- # Assert that the correct range has been selected
- gridWinState = get_state_as_dict(gridwin)
- self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A1:Sheet1.A4")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #In column A enter text
+ enter_text_to_cell(gridwin, "A5", "ff")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ #sorting
+ self.xUITest.executeCommand(".uno:SortAscending")
+ self.xUITest.executeCommand(".uno:SortDescending")
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "ff")
+ # Assert that the correct range has been selected
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A1:Sheet1.A4")
#2) Placing digit to the header position and running set of sorts will make digit to be on 2nd or last position.
def test_tdf91305_sort_text_cells_1st_row_digit(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #In column A enter texts
- enter_text_to_cell(gridwin, "A1", "1")
- enter_text_to_cell(gridwin, "A2", "ff")
- enter_text_to_cell(gridwin, "A3", "aa")
- enter_text_to_cell(gridwin, "A4", "cc")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #In column A enter texts
+ enter_text_to_cell(gridwin, "A1", "1")
+ enter_text_to_cell(gridwin, "A2", "ff")
+ enter_text_to_cell(gridwin, "A3", "aa")
+ enter_text_to_cell(gridwin, "A4", "cc")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- #Press toolbarbutton for ascending sorting .uno:SortAsc
- self.xUITest.executeCommand(".uno:SortAscending")
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "1")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "aa")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "cc")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "ff")
- #Press toolbarbutton for descending sorting .uno:SortDescending
- self.xUITest.executeCommand(".uno:SortDescending")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "ff")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "cc")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "aa")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "1")
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "1")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "aa")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "cc")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "ff")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ #Press toolbarbutton for ascending sorting .uno:SortAsc
+ self.xUITest.executeCommand(".uno:SortAscending")
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "1")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "aa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "cc")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "ff")
+ #Press toolbarbutton for descending sorting .uno:SortDescending
+ self.xUITest.executeCommand(".uno:SortDescending")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "ff")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "cc")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "aa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "1")
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "1")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "aa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "cc")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "ff")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/tdf99773.py b/sc/qa/uitest/sort/tdf99773.py
index 099788fa1428..1dbde186930f 100644
--- a/sc/qa/uitest/sort/tdf99773.py
+++ b/sc/qa/uitest/sort/tdf99773.py
@@ -17,36 +17,35 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf99773(UITestCase):
def test_tdf99773_natural_sorting_space(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #enter data
- enter_text_to_cell(gridwin, "A1", "A 11")
- enter_text_to_cell(gridwin, "A2", "A 2")
- enter_text_to_cell(gridwin, "A3", "B 2")
- enter_text_to_cell(gridwin, "A4", "A 5")
- enter_text_to_cell(gridwin, "A5", "A 50")
- enter_text_to_cell(gridwin, "A6", "B 20")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #enter data
+ enter_text_to_cell(gridwin, "A1", "A 11")
+ enter_text_to_cell(gridwin, "A2", "A 2")
+ enter_text_to_cell(gridwin, "A3", "B 2")
+ enter_text_to_cell(gridwin, "A4", "A 5")
+ enter_text_to_cell(gridwin, "A5", "A 50")
+ enter_text_to_cell(gridwin, "A6", "B 20")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A6"}))
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- xNatural = xDialog.getChild("naturalsort")
- if (get_state_as_dict(xNatural)["Selected"]) == "false":
- xNatural.executeAction("CLICK", tuple())
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A 2")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "A 5")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "A 11")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "A 50")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "B 2")
- self.assertEqual(get_cell_by_position(document, 0, 0, 5).getString(), "B 20")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A6"}))
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ xNatural = xDialog.getChild("naturalsort")
+ if (get_state_as_dict(xNatural)["Selected"]) == "false":
+ xNatural.executeAction("CLICK", tuple())
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A 2")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "A 5")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "A 11")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "A 50")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "B 2")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 5).getString(), "B 20")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/anova.py b/sc/qa/uitest/statistics/anova.py
index 579b9d29014d..0b0fd8579342 100644
--- a/sc/qa/uitest/statistics/anova.py
+++ b/sc/qa/uitest/statistics/anova.py
@@ -16,132 +16,131 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class anova(UITestCase):
def test_statistic_anova(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "Maths")
- enter_text_to_cell(gridwin, "A2", "47")
- enter_text_to_cell(gridwin, "A3", "36")
- enter_text_to_cell(gridwin, "A4", "40")
- enter_text_to_cell(gridwin, "A5", "39")
- enter_text_to_cell(gridwin, "A7", "47")
- enter_text_to_cell(gridwin, "A8", "29")
- enter_text_to_cell(gridwin, "A9", "27")
- enter_text_to_cell(gridwin, "A10", "57")
- enter_text_to_cell(gridwin, "A11", "56")
- enter_text_to_cell(gridwin, "A12", "57")
- enter_text_to_cell(gridwin, "A13", "26")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "Maths")
+ enter_text_to_cell(gridwin, "A2", "47")
+ enter_text_to_cell(gridwin, "A3", "36")
+ enter_text_to_cell(gridwin, "A4", "40")
+ enter_text_to_cell(gridwin, "A5", "39")
+ enter_text_to_cell(gridwin, "A7", "47")
+ enter_text_to_cell(gridwin, "A8", "29")
+ enter_text_to_cell(gridwin, "A9", "27")
+ enter_text_to_cell(gridwin, "A10", "57")
+ enter_text_to_cell(gridwin, "A11", "56")
+ enter_text_to_cell(gridwin, "A12", "57")
+ enter_text_to_cell(gridwin, "A13", "26")
- enter_text_to_cell(gridwin, "B1", "Physics")
- enter_text_to_cell(gridwin, "B2", "67")
- enter_text_to_cell(gridwin, "B3", "68")
- enter_text_to_cell(gridwin, "B4", "65")
- enter_text_to_cell(gridwin, "B5", "64")
- enter_text_to_cell(gridwin, "B6", "38")
- enter_text_to_cell(gridwin, "B7", "84")
- enter_text_to_cell(gridwin, "B8", "80")
- enter_text_to_cell(gridwin, "B9", "49")
- enter_text_to_cell(gridwin, "B10", "49")
- enter_text_to_cell(gridwin, "B11", "33")
+ enter_text_to_cell(gridwin, "B1", "Physics")
+ enter_text_to_cell(gridwin, "B2", "67")
+ enter_text_to_cell(gridwin, "B3", "68")
+ enter_text_to_cell(gridwin, "B4", "65")
+ enter_text_to_cell(gridwin, "B5", "64")
+ enter_text_to_cell(gridwin, "B6", "38")
+ enter_text_to_cell(gridwin, "B7", "84")
+ enter_text_to_cell(gridwin, "B8", "80")
+ enter_text_to_cell(gridwin, "B9", "49")
+ enter_text_to_cell(gridwin, "B10", "49")
+ enter_text_to_cell(gridwin, "B11", "33")
- enter_text_to_cell(gridwin, "C1", "Biology")
- enter_text_to_cell(gridwin, "C2", "33")
- enter_text_to_cell(gridwin, "C3", "42")
- enter_text_to_cell(gridwin, "C4", "44")
- enter_text_to_cell(gridwin, "C5", "60")
- enter_text_to_cell(gridwin, "C6", "43")
- enter_text_to_cell(gridwin, "C7", "62")
- enter_text_to_cell(gridwin, "C8", "51")
- enter_text_to_cell(gridwin, "C9", "40")
- enter_text_to_cell(gridwin, "C10", "12")
- enter_text_to_cell(gridwin, "C11", "60")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:C13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:AnalysisOfVarianceDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xradiotwofactor = xDialog.getChild("radio-two-factor")
- xradiosinglefactor = xDialog.getChild("radio-single-factor")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
- xalphaspin = xDialog.getChild("alpha-spin")
+ enter_text_to_cell(gridwin, "C1", "Biology")
+ enter_text_to_cell(gridwin, "C2", "33")
+ enter_text_to_cell(gridwin, "C3", "42")
+ enter_text_to_cell(gridwin, "C4", "44")
+ enter_text_to_cell(gridwin, "C5", "60")
+ enter_text_to_cell(gridwin, "C6", "43")
+ enter_text_to_cell(gridwin, "C7", "62")
+ enter_text_to_cell(gridwin, "C8", "51")
+ enter_text_to_cell(gridwin, "C9", "40")
+ enter_text_to_cell(gridwin, "C10", "12")
+ enter_text_to_cell(gridwin, "C11", "60")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:C13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AnalysisOfVarianceDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xradiotwofactor = xDialog.getChild("radio-two-factor")
+ xradiosinglefactor = xDialog.getChild("radio-single-factor")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+ xalphaspin = xDialog.getChild("alpha-spin")
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$2:$C$13"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
- xradiosinglefactor.executeAction("CLICK", tuple())
- xalphaspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xalphaspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xalphaspin.executeAction("TYPE", mkPropertyValues({"TEXT":"0.05"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "ANOVA - Single Factor")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Alpha")
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "Groups")
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString(), "Column 1")
- self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString(), "Column 2")
- self.assertEqual(get_cell_by_position(document, 0, 5, 6).getString(), "Column 3")
- self.assertEqual(get_cell_by_position(document, 0, 5, 8).getString(), "Source of Variation")
- self.assertEqual(get_cell_by_position(document, 0, 5, 9).getString(), "Between Groups")
- self.assertEqual(get_cell_by_position(document, 0, 5, 10).getString(), "Within Groups")
- self.assertEqual(get_cell_by_position(document, 0, 5, 11).getString(), "Total")
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$2:$C$13"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
+ xradiosinglefactor.executeAction("CLICK", tuple())
+ xalphaspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xalphaspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xalphaspin.executeAction("TYPE", mkPropertyValues({"TEXT":"0.05"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "ANOVA - Single Factor")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Alpha")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "Groups")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString(), "Column 1")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString(), "Column 2")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 6).getString(), "Column 3")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 8).getString(), "Source of Variation")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 9).getString(), "Between Groups")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 10).getString(), "Within Groups")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 11).getString(), "Total")
- self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 0.05)
- self.assertEqual(get_cell_by_position(document, 0, 6, 3).getString(), "Count")
- self.assertEqual(get_cell_by_position(document, 0, 6, 4).getValue(), 11)
- self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue(), 10)
- self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue(), 10)
- self.assertEqual(get_cell_by_position(document, 0, 6, 8).getString(), "SS")
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 9).getValue(),11), 1876.56832844575)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 10).getValue(),10), 6025.1090909091)
- #bug 80583
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 11).getValue(),11), 7901.67741935484)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 0.05)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 3).getString(), "Count")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 4).getValue(), 11)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue(), 10)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue(), 10)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 8).getString(), "SS")
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 9).getValue(),11), 1876.56832844575)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 10).getValue(),10), 6025.1090909091)
+ #bug 80583
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 11).getValue(),11), 7901.67741935484)
- self.assertEqual(get_cell_by_position(document, 0, 7, 3).getString(), "Sum")
- self.assertEqual(get_cell_by_position(document, 0, 7, 4).getValue(), 461)
- self.assertEqual(get_cell_by_position(document, 0, 7, 5).getValue(), 597)
- self.assertEqual(get_cell_by_position(document, 0, 7, 6).getValue(), 447)
- self.assertEqual(get_cell_by_position(document, 0, 7, 8).getString(), "df")
- self.assertEqual(get_cell_by_position(document, 0, 7, 9).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 7, 10).getValue(), 28)
- self.assertEqual(get_cell_by_position(document, 0, 7, 11).getValue(), 30)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 3).getString(), "Sum")
+ self.assertEqual(get_cell_by_position(document, 0, 7, 4).getValue(), 461)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 5).getValue(), 597)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 6).getValue(), 447)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 8).getString(), "df")
+ self.assertEqual(get_cell_by_position(document, 0, 7, 9).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 10).getValue(), 28)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 11).getValue(), 30)
- self.assertEqual(get_cell_by_position(document, 0, 8, 3).getString(), "Mean")
- self.assertEqual(round(get_cell_by_position(document, 0, 8, 4).getValue(), 12), 41.909090909091)
- self.assertEqual(get_cell_by_position(document, 0, 8, 5).getValue(), 59.7)
- self.assertEqual(get_cell_by_position(document, 0, 8, 6).getValue(), 44.7)
- self.assertEqual(get_cell_by_position(document, 0, 8, 8).getString(), "MS")
- self.assertEqual(round(get_cell_by_position(document, 0, 8, 9).getValue(),11), 938.28416422287)
- self.assertEqual(round(get_cell_by_position(document, 0, 8, 10).getValue(),11), 215.18246753247)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 3).getString(), "Mean")
+ self.assertEqual(round(get_cell_by_position(document, 0, 8, 4).getValue(), 12), 41.909090909091)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 5).getValue(), 59.7)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 6).getValue(), 44.7)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 8).getString(), "MS")
+ self.assertEqual(round(get_cell_by_position(document, 0, 8, 9).getValue(),11), 938.28416422287)
+ self.assertEqual(round(get_cell_by_position(document, 0, 8, 10).getValue(),11), 215.18246753247)
- self.assertEqual(get_cell_by_position(document, 0, 9, 3).getString(), "Variance")
- self.assertEqual(round(get_cell_by_position(document, 0, 9, 4).getValue(),11), 139.49090909091)
- self.assertEqual(round(get_cell_by_position(document, 0, 9, 5).getValue(),12), 287.122222222222)
- self.assertEqual(round(get_cell_by_position(document, 0, 9, 6).getValue(),12), 227.344444444444)
- self.assertEqual(get_cell_by_position(document, 0, 9, 8).getString(), "F")
- self.assertEqual(round(get_cell_by_position(document, 0, 9, 9).getValue(),13), 4.3604117704492)
+ self.assertEqual(get_cell_by_position(document, 0, 9, 3).getString(), "Variance")
+ self.assertEqual(round(get_cell_by_position(document, 0, 9, 4).getValue(),11), 139.49090909091)
+ self.assertEqual(round(get_cell_by_position(document, 0, 9, 5).getValue(),12), 287.122222222222)
+ self.assertEqual(round(get_cell_by_position(document, 0, 9, 6).getValue(),12), 227.344444444444)
+ self.assertEqual(get_cell_by_position(document, 0, 9, 8).getString(), "F")
+ self.assertEqual(round(get_cell_by_position(document, 0, 9, 9).getValue(),13), 4.3604117704492)
- self.assertEqual(get_cell_by_position(document, 0, 10, 8).getString(), "P-value")
- self.assertEqual(round(get_cell_by_position(document, 0, 10, 9).getValue(),14), 0.02246149518798)
+ self.assertEqual(get_cell_by_position(document, 0, 10, 8).getString(), "P-value")
+ self.assertEqual(round(get_cell_by_position(document, 0, 10, 9).getValue(),14), 0.02246149518798)
- self.assertEqual(get_cell_by_position(document, 0, 11, 8).getString(), "F critical")
- self.assertEqual(round(get_cell_by_position(document, 0, 11, 9).getValue(),13), 3.3403855582378)
+ self.assertEqual(get_cell_by_position(document, 0, 11, 8).getString(), "F critical")
+ self.assertEqual(round(get_cell_by_position(document, 0, 11, 9).getValue(),13), 3.3403855582378)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:AnalysisOfVarianceDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ # test cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AnalysisOfVarianceDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/chiSquare.py b/sc/qa/uitest/statistics/chiSquare.py
index 5016e71f861c..03ead882bc8f 100644
--- a/sc/qa/uitest/statistics/chiSquare.py
+++ b/sc/qa/uitest/statistics/chiSquare.py
@@ -16,80 +16,78 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class chiSquare(UITestCase):
def test_chiSquare(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "28")
- enter_text_to_cell(gridwin, "A2", "26")
- enter_text_to_cell(gridwin, "A3", "31")
- enter_text_to_cell(gridwin, "A4", "23")
- enter_text_to_cell(gridwin, "A5", "20")
- enter_text_to_cell(gridwin, "A6", "27")
- enter_text_to_cell(gridwin, "A7", "28")
- enter_text_to_cell(gridwin, "A8", "14")
- enter_text_to_cell(gridwin, "A9", "4")
- enter_text_to_cell(gridwin, "A10", "0")
- enter_text_to_cell(gridwin, "A11", "2")
- enter_text_to_cell(gridwin, "A12", "8")
- enter_text_to_cell(gridwin, "A13", "9")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "28")
+ enter_text_to_cell(gridwin, "A2", "26")
+ enter_text_to_cell(gridwin, "A3", "31")
+ enter_text_to_cell(gridwin, "A4", "23")
+ enter_text_to_cell(gridwin, "A5", "20")
+ enter_text_to_cell(gridwin, "A6", "27")
+ enter_text_to_cell(gridwin, "A7", "28")
+ enter_text_to_cell(gridwin, "A8", "14")
+ enter_text_to_cell(gridwin, "A9", "4")
+ enter_text_to_cell(gridwin, "A10", "0")
+ enter_text_to_cell(gridwin, "A11", "2")
+ enter_text_to_cell(gridwin, "A12", "8")
+ enter_text_to_cell(gridwin, "A13", "9")
- enter_text_to_cell(gridwin, "B1", "19")
- enter_text_to_cell(gridwin, "B2", "13")
- enter_text_to_cell(gridwin, "B3", "12")
- enter_text_to_cell(gridwin, "B4", "5")
- enter_text_to_cell(gridwin, "B5", "34")
- enter_text_to_cell(gridwin, "B6", "31")
- enter_text_to_cell(gridwin, "B7", "31")
- enter_text_to_cell(gridwin, "B8", "12")
- enter_text_to_cell(gridwin, "B9", "24")
- enter_text_to_cell(gridwin, "B10", "23")
- enter_text_to_cell(gridwin, "B11", "19")
- enter_text_to_cell(gridwin, "B12", "10")
- enter_text_to_cell(gridwin, "B13", "33")
+ enter_text_to_cell(gridwin, "B1", "19")
+ enter_text_to_cell(gridwin, "B2", "13")
+ enter_text_to_cell(gridwin, "B3", "12")
+ enter_text_to_cell(gridwin, "B4", "5")
+ enter_text_to_cell(gridwin, "B5", "34")
+ enter_text_to_cell(gridwin, "B6", "31")
+ enter_text_to_cell(gridwin, "B7", "31")
+ enter_text_to_cell(gridwin, "B8", "12")
+ enter_text_to_cell(gridwin, "B9", "24")
+ enter_text_to_cell(gridwin, "B10", "23")
+ enter_text_to_cell(gridwin, "B11", "19")
+ enter_text_to_cell(gridwin, "B12", "10")
+ enter_text_to_cell(gridwin, "B13", "33")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:ChiSquareTestDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:ChiSquareTestDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$13"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"F1"}))
- xgroupedbycolumnsradio.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Test of Independence (Chi-Square)")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Alpha")
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$13"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"F1"}))
+ xgroupedbycolumnsradio.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Test of Independence (Chi-Square)")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Alpha")
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "df")
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "P-value")
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString(), "Test Statistic")
- self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString(), "Critical Value")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "df")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "P-value")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString(), "Test Statistic")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString(), "Critical Value")
- self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 0.05)
- self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue(), 12)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 4).getValue(),12), 91.687005584173)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 5).getValue(),12), 21.026069817483)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 0.05)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue(), 12)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 4).getValue(),12), 91.687005584173)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 5).getValue(),12), 21.026069817483)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:ChiSquareTestDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ # test cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:ChiSquareTestDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/correlation.py b/sc/qa/uitest/statistics/correlation.py
index a005e7830c40..5a4b2a2e59a3 100644
--- a/sc/qa/uitest/statistics/correlation.py
+++ b/sc/qa/uitest/statistics/correlation.py
@@ -16,187 +16,184 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class correlation(UITestCase):
def test_statistic_correlation_column(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "Maths")
- enter_text_to_cell(gridwin, "A2", "47")
- enter_text_to_cell(gridwin, "A3", "36")
- enter_text_to_cell(gridwin, "A4", "40")
- enter_text_to_cell(gridwin, "A5", "39")
- enter_text_to_cell(gridwin, "A7", "47")
- enter_text_to_cell(gridwin, "A8", "29")
- enter_text_to_cell(gridwin, "A9", "27")
- enter_text_to_cell(gridwin, "A10", "57")
- enter_text_to_cell(gridwin, "A11", "56")
- enter_text_to_cell(gridwin, "A12", "57")
- enter_text_to_cell(gridwin, "A13", "26")
-
- enter_text_to_cell(gridwin, "B1", "Physics")
- enter_text_to_cell(gridwin, "B2", "67")
- enter_text_to_cell(gridwin, "B3", "68")
- enter_text_to_cell(gridwin, "B4", "65")
- enter_text_to_cell(gridwin, "B5", "64")
- enter_text_to_cell(gridwin, "B6", "38")
- enter_text_to_cell(gridwin, "B7", "84")
- enter_text_to_cell(gridwin, "B8", "80")
- enter_text_to_cell(gridwin, "B9", "49")
- enter_text_to_cell(gridwin, "B10", "49")
- enter_text_to_cell(gridwin, "B11", "33")
-
- enter_text_to_cell(gridwin, "C1", "Biology")
- enter_text_to_cell(gridwin, "C2", "33")
- enter_text_to_cell(gridwin, "C3", "42")
- enter_text_to_cell(gridwin, "C4", "44")
- enter_text_to_cell(gridwin, "C5", "60")
- enter_text_to_cell(gridwin, "C6", "43")
- enter_text_to_cell(gridwin, "C7", "62")
- enter_text_to_cell(gridwin, "C8", "51")
- enter_text_to_cell(gridwin, "C9", "40")
- enter_text_to_cell(gridwin, "C10", "12")
- enter_text_to_cell(gridwin, "C11", "60")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:CorrelationDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
-
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$C$13"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
- xgroupedbyrowsradio.executeAction("CLICK", tuple())
- xgroupedbycolumnsradio.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Correlations")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Column 1")
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Column 2")
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "Column 3")
-
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "Column 1")
- self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 1)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 2).getValue(),14), -0.40292549168204)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 3).getValue(),14), -0.21076428363645)
-
- self.assertEqual(get_cell_by_position(document, 0, 7, 0).getString(), "Column 2")
- self.assertEqual(get_cell_by_position(document, 0, 7, 2).getValue(), 1)
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 3).getValue(),14), 0.23097140475091)
-
- self.assertEqual(get_cell_by_position(document, 0, 8, 0).getString(), "Column 3")
- self.assertEqual(get_cell_by_position(document, 0, 8, 3).getValue(), 1)
-
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
-
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:CorrelationDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "Maths")
+ enter_text_to_cell(gridwin, "A2", "47")
+ enter_text_to_cell(gridwin, "A3", "36")
+ enter_text_to_cell(gridwin, "A4", "40")
+ enter_text_to_cell(gridwin, "A5", "39")
+ enter_text_to_cell(gridwin, "A7", "47")
+ enter_text_to_cell(gridwin, "A8", "29")
+ enter_text_to_cell(gridwin, "A9", "27")
+ enter_text_to_cell(gridwin, "A10", "57")
+ enter_text_to_cell(gridwin, "A11", "56")
+ enter_text_to_cell(gridwin, "A12", "57")
+ enter_text_to_cell(gridwin, "A13", "26")
+
+ enter_text_to_cell(gridwin, "B1", "Physics")
+ enter_text_to_cell(gridwin, "B2", "67")
+ enter_text_to_cell(gridwin, "B3", "68")
+ enter_text_to_cell(gridwin, "B4", "65")
+ enter_text_to_cell(gridwin, "B5", "64")
+ enter_text_to_cell(gridwin, "B6", "38")
+ enter_text_to_cell(gridwin, "B7", "84")
+ enter_text_to_cell(gridwin, "B8", "80")
+ enter_text_to_cell(gridwin, "B9", "49")
+ enter_text_to_cell(gridwin, "B10", "49")
+ enter_text_to_cell(gridwin, "B11", "33")
+
+ enter_text_to_cell(gridwin, "C1", "Biology")
+ enter_text_to_cell(gridwin, "C2", "33")
+ enter_text_to_cell(gridwin, "C3", "42")
+ enter_text_to_cell(gridwin, "C4", "44")
+ enter_text_to_cell(gridwin, "C5", "60")
+ enter_text_to_cell(gridwin, "C6", "43")
+ enter_text_to_cell(gridwin, "C7", "62")
+ enter_text_to_cell(gridwin, "C8", "51")
+ enter_text_to_cell(gridwin, "C9", "40")
+ enter_text_to_cell(gridwin, "C10", "12")
+ enter_text_to_cell(gridwin, "C11", "60")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:CorrelationDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$C$13"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
+ xgroupedbyrowsradio.executeAction("CLICK", tuple())
+ xgroupedbycolumnsradio.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Correlations")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Column 1")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Column 2")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "Column 3")
+
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "Column 1")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 1)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 2).getValue(),14), -0.40292549168204)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 3).getValue(),14), -0.21076428363645)
+
+ self.assertEqual(get_cell_by_position(document, 0, 7, 0).getString(), "Column 2")
+ self.assertEqual(get_cell_by_position(document, 0, 7, 2).getValue(), 1)
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 3).getValue(),14), 0.23097140475091)
+
+ self.assertEqual(get_cell_by_position(document, 0, 8, 0).getString(), "Column 3")
+ self.assertEqual(get_cell_by_position(document, 0, 8, 3).getValue(), 1)
+
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+
+ # test cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:CorrelationDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_statistic_correlation_row(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "Maths")
- enter_text_to_cell(gridwin, "A2", "Physics")
- enter_text_to_cell(gridwin, "A3", "Biology")
-
- enter_text_to_cell(gridwin, "B1", "47")
- enter_text_to_cell(gridwin, "B2", "67")
- enter_text_to_cell(gridwin, "B3", "33")
-
- enter_text_to_cell(gridwin, "C1", "36")
- enter_text_to_cell(gridwin, "C2", "68")
- enter_text_to_cell(gridwin, "C3", "42")
-
- enter_text_to_cell(gridwin, "D1", "40")
- enter_text_to_cell(gridwin, "D2", "65")
- enter_text_to_cell(gridwin, "D3", "44")
-
- enter_text_to_cell(gridwin, "E1", "39")
- enter_text_to_cell(gridwin, "E2", "64")
- enter_text_to_cell(gridwin, "E3", "60")
-
- enter_text_to_cell(gridwin, "F2", "38")
- enter_text_to_cell(gridwin, "F3", "43")
-
- enter_text_to_cell(gridwin, "G1", "47")
- enter_text_to_cell(gridwin, "G2", "84")
- enter_text_to_cell(gridwin, "G3", "62")
-
- enter_text_to_cell(gridwin, "H1", "29")
- enter_text_to_cell(gridwin, "H2", "80")
- enter_text_to_cell(gridwin, "H3", "51")
-
- enter_text_to_cell(gridwin, "I1", "27")
- enter_text_to_cell(gridwin, "I2", "49")
- enter_text_to_cell(gridwin, "I3", "40")
-
- enter_text_to_cell(gridwin, "J1", "57")
- enter_text_to_cell(gridwin, "J2", "49")
- enter_text_to_cell(gridwin, "J3", "12")
-
- enter_text_to_cell(gridwin, "K1", "56")
- enter_text_to_cell(gridwin, "K2", "33")
- enter_text_to_cell(gridwin, "K3", "60")
-
- enter_text_to_cell(gridwin, "L1", "57")
-
- enter_text_to_cell(gridwin, "M1", "26")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:M3"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:CorrelationDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
-
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$M$3"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$A$7"}))
- xgroupedbyrowsradio.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 6).getString(), "Correlations")
- self.assertEqual(get_cell_by_position(document, 0, 0, 7).getString(), "Row 1")
- self.assertEqual(get_cell_by_position(document, 0, 0, 8).getString(), "Row 2")
- self.assertEqual(get_cell_by_position(document, 0, 0, 9).getString(), "Row 3")
-
- self.assertEqual(get_cell_by_position(document, 0, 1, 6).getString(), "Row 1")
- self.assertEqual(get_cell_by_position(document, 0, 1, 7).getValue(), 1)
- self.assertEqual(round(get_cell_by_position(document, 0, 1, 8).getValue(),15), -0.402925491682042)
- self.assertEqual(round(get_cell_by_position(document, 0, 1, 9).getValue(),15), -0.210764283636454)
-
- self.assertEqual(get_cell_by_position(document, 0, 2, 6).getString(), "Row 2")
- self.assertEqual(get_cell_by_position(document, 0, 2, 8).getValue(), 1)
- self.assertEqual(round(get_cell_by_position(document, 0, 2, 9).getValue(),14), 0.23097140475091)
-
- self.assertEqual(get_cell_by_position(document, 0, 3, 6).getString(), "Row 3")
- self.assertEqual(get_cell_by_position(document, 0, 3, 9).getValue(), 1)
-
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "Maths")
+ enter_text_to_cell(gridwin, "A2", "Physics")
+ enter_text_to_cell(gridwin, "A3", "Biology")
+
+ enter_text_to_cell(gridwin, "B1", "47")
+ enter_text_to_cell(gridwin, "B2", "67")
+ enter_text_to_cell(gridwin, "B3", "33")
+
+ enter_text_to_cell(gridwin, "C1", "36")
+ enter_text_to_cell(gridwin, "C2", "68")
+ enter_text_to_cell(gridwin, "C3", "42")
+
+ enter_text_to_cell(gridwin, "D1", "40")
+ enter_text_to_cell(gridwin, "D2", "65")
+ enter_text_to_cell(gridwin, "D3", "44")
+
+ enter_text_to_cell(gridwin, "E1", "39")
+ enter_text_to_cell(gridwin, "E2", "64")
+ enter_text_to_cell(gridwin, "E3", "60")
+
+ enter_text_to_cell(gridwin, "F2", "38")
+ enter_text_to_cell(gridwin, "F3", "43")
+
+ enter_text_to_cell(gridwin, "G1", "47")
+ enter_text_to_cell(gridwin, "G2", "84")
+ enter_text_to_cell(gridwin, "G3", "62")
+
+ enter_text_to_cell(gridwin, "H1", "29")
+ enter_text_to_cell(gridwin, "H2", "80")
+ enter_text_to_cell(gridwin, "H3", "51")
+
+ enter_text_to_cell(gridwin, "I1", "27")
+ enter_text_to_cell(gridwin, "I2", "49")
+ enter_text_to_cell(gridwin, "I3", "40")
+
+ enter_text_to_cell(gridwin, "J1", "57")
+ enter_text_to_cell(gridwin, "J2", "49")
+ enter_text_to_cell(gridwin, "J3", "12")
+
+ enter_text_to_cell(gridwin, "K1", "56")
+ enter_text_to_cell(gridwin, "K2", "33")
+ enter_text_to_cell(gridwin, "K3", "60")
+
+ enter_text_to_cell(gridwin, "L1", "57")
+
+ enter_text_to_cell(gridwin, "M1", "26")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:M3"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:CorrelationDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$M$3"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$A$7"}))
+ xgroupedbyrowsradio.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 6).getString(), "Correlations")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 7).getString(), "Row 1")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 8).getString(), "Row 2")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 9).getString(), "Row 3")
+
+ self.assertEqual(get_cell_by_position(document, 0, 1, 6).getString(), "Row 1")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 7).getValue(), 1)
+ self.assertEqual(round(get_cell_by_position(document, 0, 1, 8).getValue(),15), -0.402925491682042)
+ self.assertEqual(round(get_cell_by_position(document, 0, 1, 9).getValue(),15), -0.210764283636454)
+
+ self.assertEqual(get_cell_by_position(document, 0, 2, 6).getString(), "Row 2")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 8).getValue(), 1)
+ self.assertEqual(round(get_cell_by_position(document, 0, 2, 9).getValue(),14), 0.23097140475091)
+
+ self.assertEqual(get_cell_by_position(document, 0, 3, 6).getString(), "Row 3")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 9).getValue(), 1)
+
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/covariance.py b/sc/qa/uitest/statistics/covariance.py
index 3787a458648e..2f101c5a6a52 100644
--- a/sc/qa/uitest/statistics/covariance.py
+++ b/sc/qa/uitest/statistics/covariance.py
@@ -16,185 +16,182 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class covariance(UITestCase):
def test_statistic_covariance_column(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "Maths")
- enter_text_to_cell(gridwin, "A2", "47")
- enter_text_to_cell(gridwin, "A3", "36")
- enter_text_to_cell(gridwin, "A4", "40")
- enter_text_to_cell(gridwin, "A5", "39")
- enter_text_to_cell(gridwin, "A7", "47")
- enter_text_to_cell(gridwin, "A8", "29")
- enter_text_to_cell(gridwin, "A9", "27")
- enter_text_to_cell(gridwin, "A10", "57")
- enter_text_to_cell(gridwin, "A11", "56")
- enter_text_to_cell(gridwin, "A12", "57")
- enter_text_to_cell(gridwin, "A13", "26")
-
- enter_text_to_cell(gridwin, "B1", "Physics")
- enter_text_to_cell(gridwin, "B2", "67")
- enter_text_to_cell(gridwin, "B3", "68")
- enter_text_to_cell(gridwin, "B4", "65")
- enter_text_to_cell(gridwin, "B5", "64")
- enter_text_to_cell(gridwin, "B6", "38")
- enter_text_to_cell(gridwin, "B7", "84")
- enter_text_to_cell(gridwin, "B8", "80")
- enter_text_to_cell(gridwin, "B9", "49")
- enter_text_to_cell(gridwin, "B10", "49")
- enter_text_to_cell(gridwin, "B11", "33")
-
- enter_text_to_cell(gridwin, "C1", "Biology")
- enter_text_to_cell(gridwin, "C2", "33")
- enter_text_to_cell(gridwin, "C3", "42")
- enter_text_to_cell(gridwin, "C4", "44")
- enter_text_to_cell(gridwin, "C5", "60")
- enter_text_to_cell(gridwin, "C6", "43")
- enter_text_to_cell(gridwin, "C7", "62")
- enter_text_to_cell(gridwin, "C8", "51")
- enter_text_to_cell(gridwin, "C9", "40")
- enter_text_to_cell(gridwin, "C10", "12")
- enter_text_to_cell(gridwin, "C11", "60")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:CovarianceDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
-
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$C$13"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
- xgroupedbycolumnsradio.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Covariances")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Column 1")
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Column 2")
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "Column 3")
-
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "Column 1")
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 1).getValue(),11), 126.80991735537)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 2).getValue(),12), -61.444444444444)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 3).getValue()), -32)
-
- self.assertEqual(get_cell_by_position(document, 0, 7, 0).getString(), "Column 2")
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 2).getValue(),2), 258.41)
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 3).getValue(),2), 53.11)
-
- self.assertEqual(get_cell_by_position(document, 0, 8, 0).getString(), "Column 3")
- self.assertEqual(round(get_cell_by_position(document, 0, 8, 3).getValue(),2), 204.61)
-
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
-
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:CovarianceDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "Maths")
+ enter_text_to_cell(gridwin, "A2", "47")
+ enter_text_to_cell(gridwin, "A3", "36")
+ enter_text_to_cell(gridwin, "A4", "40")
+ enter_text_to_cell(gridwin, "A5", "39")
+ enter_text_to_cell(gridwin, "A7", "47")
+ enter_text_to_cell(gridwin, "A8", "29")
+ enter_text_to_cell(gridwin, "A9", "27")
+ enter_text_to_cell(gridwin, "A10", "57")
+ enter_text_to_cell(gridwin, "A11", "56")
+ enter_text_to_cell(gridwin, "A12", "57")
+ enter_text_to_cell(gridwin, "A13", "26")
+
+ enter_text_to_cell(gridwin, "B1", "Physics")
+ enter_text_to_cell(gridwin, "B2", "67")
+ enter_text_to_cell(gridwin, "B3", "68")
+ enter_text_to_cell(gridwin, "B4", "65")
+ enter_text_to_cell(gridwin, "B5", "64")
+ enter_text_to_cell(gridwin, "B6", "38")
+ enter_text_to_cell(gridwin, "B7", "84")
+ enter_text_to_cell(gridwin, "B8", "80")
+ enter_text_to_cell(gridwin, "B9", "49")
+ enter_text_to_cell(gridwin, "B10", "49")
+ enter_text_to_cell(gridwin, "B11", "33")
+
+ enter_text_to_cell(gridwin, "C1", "Biology")
+ enter_text_to_cell(gridwin, "C2", "33")
+ enter_text_to_cell(gridwin, "C3", "42")
+ enter_text_to_cell(gridwin, "C4", "44")
+ enter_text_to_cell(gridwin, "C5", "60")
+ enter_text_to_cell(gridwin, "C6", "43")
+ enter_text_to_cell(gridwin, "C7", "62")
+ enter_text_to_cell(gridwin, "C8", "51")
+ enter_text_to_cell(gridwin, "C9", "40")
+ enter_text_to_cell(gridwin, "C10", "12")
+ enter_text_to_cell(gridwin, "C11", "60")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:CovarianceDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$C$13"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
+ xgroupedbycolumnsradio.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Covariances")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Column 1")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Column 2")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "Column 3")
+
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "Column 1")
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 1).getValue(),11), 126.80991735537)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 2).getValue(),12), -61.444444444444)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 3).getValue()), -32)
+
+ self.assertEqual(get_cell_by_position(document, 0, 7, 0).getString(), "Column 2")
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 2).getValue(),2), 258.41)
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 3).getValue(),2), 53.11)
+
+ self.assertEqual(get_cell_by_position(document, 0, 8, 0).getString(), "Column 3")
+ self.assertEqual(round(get_cell_by_position(document, 0, 8, 3).getValue(),2), 204.61)
+
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+
+ # test cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:CovarianceDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_statistic_covariance_row(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "Maths")
- enter_text_to_cell(gridwin, "A2", "Physics")
- enter_text_to_cell(gridwin, "A3", "Biology")
-
- enter_text_to_cell(gridwin, "B1", "47")
- enter_text_to_cell(gridwin, "B2", "67")
- enter_text_to_cell(gridwin, "B3", "33")
-
- enter_text_to_cell(gridwin, "C1", "36")
- enter_text_to_cell(gridwin, "C2", "68")
- enter_text_to_cell(gridwin, "C3", "42")
-
- enter_text_to_cell(gridwin, "D1", "40")
- enter_text_to_cell(gridwin, "D2", "65")
- enter_text_to_cell(gridwin, "D3", "44")
-
- enter_text_to_cell(gridwin, "E1", "39")
- enter_text_to_cell(gridwin, "E2", "64")
- enter_text_to_cell(gridwin, "E3", "60")
-
- enter_text_to_cell(gridwin, "F2", "38")
- enter_text_to_cell(gridwin, "F3", "43")
-
- enter_text_to_cell(gridwin, "G1", "47")
- enter_text_to_cell(gridwin, "G2", "84")
- enter_text_to_cell(gridwin, "G3", "62")
-
- enter_text_to_cell(gridwin, "H1", "29")
- enter_text_to_cell(gridwin, "H2", "80")
- enter_text_to_cell(gridwin, "H3", "51")
-
- enter_text_to_cell(gridwin, "I1", "27")
- enter_text_to_cell(gridwin, "I2", "49")
- enter_text_to_cell(gridwin, "I3", "40")
-
- enter_text_to_cell(gridwin, "J1", "57")
- enter_text_to_cell(gridwin, "J2", "49")
- enter_text_to_cell(gridwin, "J3", "12")
-
- enter_text_to_cell(gridwin, "K1", "56")
- enter_text_to_cell(gridwin, "K2", "33")
- enter_text_to_cell(gridwin, "K3", "60")
-
- enter_text_to_cell(gridwin, "L1", "57")
-
- enter_text_to_cell(gridwin, "M1", "26")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:M3"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:CovarianceDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
-
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$M$3"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$A$7"}))
- xgroupedbyrowsradio.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 6).getString(), "Covariances")
- self.assertEqual(get_cell_by_position(document, 0, 0, 7).getString(), "Row 1")
- self.assertEqual(get_cell_by_position(document, 0, 0, 8).getString(), "Row 2")
- self.assertEqual(get_cell_by_position(document, 0, 0, 9).getString(), "Row 3")
-
- self.assertEqual(get_cell_by_position(document, 0, 1, 6).getString(), "Row 1")
- self.assertEqual(round(get_cell_by_position(document, 0, 1, 7).getValue(),10), 126.8099173554)
- self.assertEqual(round(get_cell_by_position(document, 0, 1, 8).getValue(),12), -61.444444444444)
- self.assertEqual(round(get_cell_by_position(document, 0, 1, 9).getValue()), -32)
-
- self.assertEqual(get_cell_by_position(document, 0, 2, 6).getString(), "Row 2")
- self.assertEqual(round(get_cell_by_position(document, 0, 2, 8).getValue(),2), 258.41)
- self.assertEqual(round(get_cell_by_position(document, 0, 2, 9).getValue(),2), 53.11)
-
- self.assertEqual(get_cell_by_position(document, 0, 3, 6).getString(), "Row 3")
- self.assertEqual(round(get_cell_by_position(document, 0, 3, 9).getValue(),2), 204.61)
-
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "Maths")
+ enter_text_to_cell(gridwin, "A2", "Physics")
+ enter_text_to_cell(gridwin, "A3", "Biology")
+
+ enter_text_to_cell(gridwin, "B1", "47")
+ enter_text_to_cell(gridwin, "B2", "67")
+ enter_text_to_cell(gridwin, "B3", "33")
+
+ enter_text_to_cell(gridwin, "C1", "36")
+ enter_text_to_cell(gridwin, "C2", "68")
+ enter_text_to_cell(gridwin, "C3", "42")
+
+ enter_text_to_cell(gridwin, "D1", "40")
+ enter_text_to_cell(gridwin, "D2", "65")
+ enter_text_to_cell(gridwin, "D3", "44")
+
+ enter_text_to_cell(gridwin, "E1", "39")
+ enter_text_to_cell(gridwin, "E2", "64")
+ enter_text_to_cell(gridwin, "E3", "60")
+
+ enter_text_to_cell(gridwin, "F2", "38")
+ enter_text_to_cell(gridwin, "F3", "43")
+
+ enter_text_to_cell(gridwin, "G1", "47")
+ enter_text_to_cell(gridwin, "G2", "84")
+ enter_text_to_cell(gridwin, "G3", "62")
+
+ enter_text_to_cell(gridwin, "H1", "29")
+ enter_text_to_cell(gridwin, "H2", "80")
+ enter_text_to_cell(gridwin, "H3", "51")
+
+ enter_text_to_cell(gridwin, "I1", "27")
+ enter_text_to_cell(gridwin, "I2", "49")
+ enter_text_to_cell(gridwin, "I3", "40")
+
+ enter_text_to_cell(gridwin, "J1", "57")
+ enter_text_to_cell(gridwin, "J2", "49")
+ enter_text_to_cell(gridwin, "J3", "12")
+
+ enter_text_to_cell(gridwin, "K1", "56")
+ enter_text_to_cell(gridwin, "K2", "33")
+ enter_text_to_cell(gridwin, "K3", "60")
+
+ enter_text_to_cell(gridwin, "L1", "57")
+
+ enter_text_to_cell(gridwin, "M1", "26")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:M3"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:CovarianceDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$M$3"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$A$7"}))
+ xgroupedbyrowsradio.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 6).getString(), "Covariances")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 7).getString(), "Row 1")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 8).getString(), "Row 2")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 9).getString(), "Row 3")
+
+ self.assertEqual(get_cell_by_position(document, 0, 1, 6).getString(), "Row 1")
+ self.assertEqual(round(get_cell_by_position(document, 0, 1, 7).getValue(),10), 126.8099173554)
+ self.assertEqual(round(get_cell_by_position(document, 0, 1, 8).getValue(),12), -61.444444444444)
+ self.assertEqual(round(get_cell_by_position(document, 0, 1, 9).getValue()), -32)
+
+ self.assertEqual(get_cell_by_position(document, 0, 2, 6).getString(), "Row 2")
+ self.assertEqual(round(get_cell_by_position(document, 0, 2, 8).getValue(),2), 258.41)
+ self.assertEqual(round(get_cell_by_position(document, 0, 2, 9).getValue(),2), 53.11)
+
+ self.assertEqual(get_cell_by_position(document, 0, 3, 6).getString(), "Row 3")
+ self.assertEqual(round(get_cell_by_position(document, 0, 3, 9).getValue(),2), 204.61)
+
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/descriptiveStatistics.py b/sc/qa/uitest/statistics/descriptiveStatistics.py
index b0fe011fee66..1de1b6253d06 100644
--- a/sc/qa/uitest/statistics/descriptiveStatistics.py
+++ b/sc/qa/uitest/statistics/descriptiveStatistics.py
@@ -16,148 +16,147 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class descriptiveStatistics(UITestCase):
def test_descriptive_statistics(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "Math")
- enter_text_to_cell(gridwin, "A2", "47")
- enter_text_to_cell(gridwin, "A3", "36")
- enter_text_to_cell(gridwin, "A4", "40")
- enter_text_to_cell(gridwin, "A5", "39")
- enter_text_to_cell(gridwin, "A7", "47")
- enter_text_to_cell(gridwin, "A8", "29")
- enter_text_to_cell(gridwin, "A9", "27")
- enter_text_to_cell(gridwin, "A10", "57")
- enter_text_to_cell(gridwin, "A11", "56")
- enter_text_to_cell(gridwin, "A12", "57")
- enter_text_to_cell(gridwin, "A13", "26")
-
-
- enter_text_to_cell(gridwin, "B1", "Physics")
- enter_text_to_cell(gridwin, "B2", "67")
- enter_text_to_cell(gridwin, "B3", "68")
- enter_text_to_cell(gridwin, "B4", "65")
- enter_text_to_cell(gridwin, "B5", "64")
- enter_text_to_cell(gridwin, "B6", "38")
- enter_text_to_cell(gridwin, "B7", "84")
- enter_text_to_cell(gridwin, "B8", "80")
- enter_text_to_cell(gridwin, "B9", "49")
- enter_text_to_cell(gridwin, "B10", "49")
- enter_text_to_cell(gridwin, "B11", "33")
-
- enter_text_to_cell(gridwin, "C1", "Biology")
- enter_text_to_cell(gridwin, "C2", "33")
- enter_text_to_cell(gridwin, "C3", "42")
- enter_text_to_cell(gridwin, "C4", "44")
- enter_text_to_cell(gridwin, "C5", "60")
- enter_text_to_cell(gridwin, "C6", "43")
- enter_text_to_cell(gridwin, "C7", "62")
- enter_text_to_cell(gridwin, "C8", "51")
- enter_text_to_cell(gridwin, "C9", "40")
- enter_text_to_cell(gridwin, "C10", "12")
- enter_text_to_cell(gridwin, "C11", "60")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DescriptiveStatisticsDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
-
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
-
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$C$13"}))
-
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$F$1"}))
-
- xgroupedbyrowsradio.executeAction("CLICK", tuple())
- xgroupedbycolumnsradio.executeAction("CLICK", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString() , "Mean")
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString() , "Standard Error")
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString() , "Mode")
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString() , "Median")
- self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString() , "First Quartile")
- self.assertEqual(get_cell_by_position(document, 0, 5, 6).getString() , "Third Quartile")
- self.assertEqual(get_cell_by_position(document, 0, 5, 7).getString() , "Variance")
- self.assertEqual(get_cell_by_position(document, 0, 5, 8).getString() , "Standard Deviation")
- self.assertEqual(get_cell_by_position(document, 0, 5, 9).getString() , "Kurtosis")
- self.assertEqual(get_cell_by_position(document, 0, 5, 10).getString() , "Skewness")
- self.assertEqual(get_cell_by_position(document, 0, 5, 11).getString() , "Range")
- self.assertEqual(get_cell_by_position(document, 0, 5, 12).getString() , "Minimum")
- self.assertEqual(get_cell_by_position(document, 0, 5, 13).getString() , "Maximum")
- self.assertEqual(get_cell_by_position(document, 0, 5, 14).getString() , "Sum")
- self.assertEqual(get_cell_by_position(document, 0, 5, 15).getString() , "Count")
-
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString() , "Math")
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 1).getValue(),12) , 41.909090909091)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 2).getValue(),13) , 3.5610380137731)
- self.assertEqual(get_cell_by_position(document, 0, 6, 3).getValue() , 47)
- self.assertEqual(get_cell_by_position(document, 0, 6, 4).getValue() , 40)
- self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue() , 32.5)
- self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue() , 51.5)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 7).getValue(),11) , 139.49090909091)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 8).getValue(),12) , 11.810626955878)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 9).getValue(),13) , -1.4621677980825)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 10).getValue(),14) , 0.01524095329036)
- self.assertEqual(get_cell_by_position(document, 0, 6, 11).getValue() , 31)
- self.assertEqual(get_cell_by_position(document, 0, 6, 12).getValue() , 26)
- self.assertEqual(get_cell_by_position(document, 0, 6, 13).getValue() , 57)
- self.assertEqual(get_cell_by_position(document, 0, 6, 14).getValue() , 461)
- self.assertEqual(get_cell_by_position(document, 0, 6, 15).getValue() , 11)
-
- self.assertEqual(get_cell_by_position(document, 0, 7, 0).getString() , "Physics")
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 1).getValue(),1) , 59.7)
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 2).getValue(),14) , 5.35837869343164)
- self.assertEqual(get_cell_by_position(document, 0, 7, 3).getValue() , 49)
- self.assertEqual(get_cell_by_position(document, 0, 7, 4).getValue() , 64.5)
- self.assertEqual(get_cell_by_position(document, 0, 7, 5).getValue() , 49)
- self.assertEqual(get_cell_by_position(document, 0, 7, 6).getValue() , 67.75)
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 7).getValue(),11) , 287.12222222222)
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 8).getValue(),12) , 16.944681236961)
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 9).getValue(),14) , -0.94159887458526)
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 10).getValue(),13) , -0.2226426904338)
- self.assertEqual(get_cell_by_position(document, 0, 7, 11).getValue() , 51)
- self.assertEqual(get_cell_by_position(document, 0, 7, 12).getValue() , 33)
- self.assertEqual(get_cell_by_position(document, 0, 7, 13).getValue() , 84)
- self.assertEqual(get_cell_by_position(document, 0, 7, 14).getValue() , 597)
- self.assertEqual(get_cell_by_position(document, 0, 7, 15).getValue() , 10)
-
- self.assertEqual(get_cell_by_position(document, 0, 8, 0).getString() , "Biology")
- self.assertEqual(get_cell_by_position(document, 0, 8, 1).getValue() , 44.7)
- self.assertEqual(round(get_cell_by_position(document, 0, 8, 2).getValue(),13) , 4.7680650629416)
- self.assertEqual(get_cell_by_position(document, 0, 8, 3).getValue() , 60)
- self.assertEqual(get_cell_by_position(document, 0, 8, 4).getValue() , 43.5)
- self.assertEqual(get_cell_by_position(document, 0, 8, 5).getValue() , 40.5)
- self.assertEqual(get_cell_by_position(document, 0, 8, 6).getValue() , 57.75)
- self.assertEqual(round(get_cell_by_position(document, 0, 8, 7).getValue(),11) , 227.34444444444)
- self.assertEqual(round(get_cell_by_position(document, 0, 8, 8).getValue(),11) , 15.07794563077)
- self.assertEqual(round(get_cell_by_position(document, 0, 8, 9).getValue(),12) , 1.418052718986)
- self.assertEqual(round(get_cell_by_position(document, 0, 8, 10).getValue(),14) , -0.97668033725691)
- self.assertEqual(get_cell_by_position(document, 0, 8, 11).getValue() , 50)
- self.assertEqual(get_cell_by_position(document, 0, 8, 12).getValue() , 12)
- self.assertEqual(get_cell_by_position(document, 0, 8, 13).getValue() , 62)
- self.assertEqual(get_cell_by_position(document, 0, 8, 14).getValue() , 447)
- self.assertEqual(get_cell_by_position(document, 0, 8, 15).getValue() , 10)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
-
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:DescriptiveStatisticsDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "Math")
+ enter_text_to_cell(gridwin, "A2", "47")
+ enter_text_to_cell(gridwin, "A3", "36")
+ enter_text_to_cell(gridwin, "A4", "40")
+ enter_text_to_cell(gridwin, "A5", "39")
+ enter_text_to_cell(gridwin, "A7", "47")
+ enter_text_to_cell(gridwin, "A8", "29")
+ enter_text_to_cell(gridwin, "A9", "27")
+ enter_text_to_cell(gridwin, "A10", "57")
+ enter_text_to_cell(gridwin, "A11", "56")
+ enter_text_to_cell(gridwin, "A12", "57")
+ enter_text_to_cell(gridwin, "A13", "26")
+
+
+ enter_text_to_cell(gridwin, "B1", "Physics")
+ enter_text_to_cell(gridwin, "B2", "67")
+ enter_text_to_cell(gridwin, "B3", "68")
+ enter_text_to_cell(gridwin, "B4", "65")
+ enter_text_to_cell(gridwin, "B5", "64")
+ enter_text_to_cell(gridwin, "B6", "38")
+ enter_text_to_cell(gridwin, "B7", "84")
+ enter_text_to_cell(gridwin, "B8", "80")
+ enter_text_to_cell(gridwin, "B9", "49")
+ enter_text_to_cell(gridwin, "B10", "49")
+ enter_text_to_cell(gridwin, "B11", "33")
+
+ enter_text_to_cell(gridwin, "C1", "Biology")
+ enter_text_to_cell(gridwin, "C2", "33")
+ enter_text_to_cell(gridwin, "C3", "42")
+ enter_text_to_cell(gridwin, "C4", "44")
+ enter_text_to_cell(gridwin, "C5", "60")
+ enter_text_to_cell(gridwin, "C6", "43")
+ enter_text_to_cell(gridwin, "C7", "62")
+ enter_text_to_cell(gridwin, "C8", "51")
+ enter_text_to_cell(gridwin, "C9", "40")
+ enter_text_to_cell(gridwin, "C10", "12")
+ enter_text_to_cell(gridwin, "C11", "60")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DescriptiveStatisticsDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$C$13"}))
+
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$F$1"}))
+
+ xgroupedbyrowsradio.executeAction("CLICK", tuple())
+ xgroupedbycolumnsradio.executeAction("CLICK", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString() , "Mean")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString() , "Standard Error")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString() , "Mode")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString() , "Median")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString() , "First Quartile")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 6).getString() , "Third Quartile")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 7).getString() , "Variance")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 8).getString() , "Standard Deviation")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 9).getString() , "Kurtosis")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 10).getString() , "Skewness")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 11).getString() , "Range")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 12).getString() , "Minimum")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 13).getString() , "Maximum")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 14).getString() , "Sum")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 15).getString() , "Count")
+
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString() , "Math")
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 1).getValue(),12) , 41.909090909091)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 2).getValue(),13) , 3.5610380137731)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 3).getValue() , 47)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 4).getValue() , 40)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue() , 32.5)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue() , 51.5)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 7).getValue(),11) , 139.49090909091)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 8).getValue(),12) , 11.810626955878)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 9).getValue(),13) , -1.4621677980825)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 10).getValue(),14) , 0.01524095329036)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 11).getValue() , 31)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 12).getValue() , 26)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 13).getValue() , 57)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 14).getValue() , 461)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 15).getValue() , 11)
+
+ self.assertEqual(get_cell_by_position(document, 0, 7, 0).getString() , "Physics")
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 1).getValue(),1) , 59.7)
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 2).getValue(),14) , 5.35837869343164)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 3).getValue() , 49)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 4).getValue() , 64.5)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 5).getValue() , 49)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 6).getValue() , 67.75)
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 7).getValue(),11) , 287.12222222222)
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 8).getValue(),12) , 16.944681236961)
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 9).getValue(),14) , -0.94159887458526)
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 10).getValue(),13) , -0.2226426904338)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 11).getValue() , 51)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 12).getValue() , 33)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 13).getValue() , 84)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 14).getValue() , 597)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 15).getValue() , 10)
+
+ self.assertEqual(get_cell_by_position(document, 0, 8, 0).getString() , "Biology")
+ self.assertEqual(get_cell_by_position(document, 0, 8, 1).getValue() , 44.7)
+ self.assertEqual(round(get_cell_by_position(document, 0, 8, 2).getValue(),13) , 4.7680650629416)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 3).getValue() , 60)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 4).getValue() , 43.5)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 5).getValue() , 40.5)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 6).getValue() , 57.75)
+ self.assertEqual(round(get_cell_by_position(document, 0, 8, 7).getValue(),11) , 227.34444444444)
+ self.assertEqual(round(get_cell_by_position(document, 0, 8, 8).getValue(),11) , 15.07794563077)
+ self.assertEqual(round(get_cell_by_position(document, 0, 8, 9).getValue(),12) , 1.418052718986)
+ self.assertEqual(round(get_cell_by_position(document, 0, 8, 10).getValue(),14) , -0.97668033725691)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 11).getValue() , 50)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 12).getValue() , 12)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 13).getValue() , 62)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 14).getValue() , 447)
+ self.assertEqual(get_cell_by_position(document, 0, 8, 15).getValue() , 10)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+
+ # test cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DescriptiveStatisticsDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/exponentialSmoothing.py b/sc/qa/uitest/statistics/exponentialSmoothing.py
index 7ea2c23ec62f..9f539989b16e 100644
--- a/sc/qa/uitest/statistics/exponentialSmoothing.py
+++ b/sc/qa/uitest/statistics/exponentialSmoothing.py
@@ -16,174 +16,171 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class exponentialSmoothing(UITestCase):
def test_exponential_smoothing_column(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "1")
- enter_text_to_cell(gridwin, "A2", "0")
- enter_text_to_cell(gridwin, "A3", "0")
- enter_text_to_cell(gridwin, "A4", "0")
- enter_text_to_cell(gridwin, "A5", "0")
- enter_text_to_cell(gridwin, "A7", "0")
- enter_text_to_cell(gridwin, "A8", "0")
- enter_text_to_cell(gridwin, "A9", "0")
- enter_text_to_cell(gridwin, "A10", "0")
- enter_text_to_cell(gridwin, "A11", "0")
- enter_text_to_cell(gridwin, "A12", "0")
- enter_text_to_cell(gridwin, "A13", "0")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "1")
+ enter_text_to_cell(gridwin, "A2", "0")
+ enter_text_to_cell(gridwin, "A3", "0")
+ enter_text_to_cell(gridwin, "A4", "0")
+ enter_text_to_cell(gridwin, "A5", "0")
+ enter_text_to_cell(gridwin, "A7", "0")
+ enter_text_to_cell(gridwin, "A8", "0")
+ enter_text_to_cell(gridwin, "A9", "0")
+ enter_text_to_cell(gridwin, "A10", "0")
+ enter_text_to_cell(gridwin, "A11", "0")
+ enter_text_to_cell(gridwin, "A12", "0")
+ enter_text_to_cell(gridwin, "A13", "0")
- enter_text_to_cell(gridwin, "B1", "0")
- enter_text_to_cell(gridwin, "B2", "0")
- enter_text_to_cell(gridwin, "B3", "1")
- enter_text_to_cell(gridwin, "B4", "0")
- enter_text_to_cell(gridwin, "B5", "0")
- enter_text_to_cell(gridwin, "B6", "0")
- enter_text_to_cell(gridwin, "B7", "0")
- enter_text_to_cell(gridwin, "B8", "0")
- enter_text_to_cell(gridwin, "B9", "0")
- enter_text_to_cell(gridwin, "B10", "0")
- enter_text_to_cell(gridwin, "B11", "0")
- enter_text_to_cell(gridwin, "B12", "0")
- enter_text_to_cell(gridwin, "B13", "0")
+ enter_text_to_cell(gridwin, "B1", "0")
+ enter_text_to_cell(gridwin, "B2", "0")
+ enter_text_to_cell(gridwin, "B3", "1")
+ enter_text_to_cell(gridwin, "B4", "0")
+ enter_text_to_cell(gridwin, "B5", "0")
+ enter_text_to_cell(gridwin, "B6", "0")
+ enter_text_to_cell(gridwin, "B7", "0")
+ enter_text_to_cell(gridwin, "B8", "0")
+ enter_text_to_cell(gridwin, "B9", "0")
+ enter_text_to_cell(gridwin, "B10", "0")
+ enter_text_to_cell(gridwin, "B11", "0")
+ enter_text_to_cell(gridwin, "B12", "0")
+ enter_text_to_cell(gridwin, "B13", "0")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:ExponentialSmoothingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
- xmoothingfactorspin = xDialog.getChild("smoothing-factor-spin")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:ExponentialSmoothingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+ xmoothingfactorspin = xDialog.getChild("smoothing-factor-spin")
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$13"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
- xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"TEXT":"0.5"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Alpha")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 0.5)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Column 1")
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 5, 5).getValue(), 0.5)
- self.assertEqual(get_cell_by_position(document, 0, 5, 6).getValue(), 0.25)
- self.assertEqual(get_cell_by_position(document, 0, 5, 7).getValue(), 0.125)
- self.assertEqual(get_cell_by_position(document, 0, 5, 8).getValue(), 0.0625)
- self.assertEqual(get_cell_by_position(document, 0, 5, 9).getValue(), 0.03125)
- self.assertEqual(get_cell_by_position(document, 0, 5, 10).getValue(), 0.015625)
- self.assertEqual(get_cell_by_position(document, 0, 5, 11).getValue(), 0.0078125)
- self.assertEqual(get_cell_by_position(document, 0, 5, 12).getValue(), 0.00390625)
- self.assertEqual(get_cell_by_position(document, 0, 5, 13).getValue(), 0.001953125)
- self.assertEqual(get_cell_by_position(document, 0, 5, 14).getValue(), 0.0009765625)
- self.assertEqual(get_cell_by_position(document, 0, 5, 15).getValue(), 0.00048828125)
- self.assertEqual(get_cell_by_position(document, 0, 5, 16).getValue(), 0.000244140625)
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$13"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
+ xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"TEXT":"0.5"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Alpha")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 0.5)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Column 1")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 5).getValue(), 0.5)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 6).getValue(), 0.25)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 7).getValue(), 0.125)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 8).getValue(), 0.0625)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 9).getValue(), 0.03125)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 10).getValue(), 0.015625)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 11).getValue(), 0.0078125)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 12).getValue(), 0.00390625)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 13).getValue(), 0.001953125)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 14).getValue(), 0.0009765625)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 15).getValue(), 0.00048828125)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 16).getValue(), 0.000244140625)
- self.assertEqual(get_cell_by_position(document, 0, 6, 2).getString(), "Column 2")
- self.assertEqual(get_cell_by_position(document, 0, 6, 3).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 4).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue(), 0.5)
- self.assertEqual(get_cell_by_position(document, 0, 6, 7).getValue(), 0.25)
- self.assertEqual(get_cell_by_position(document, 0, 6, 8).getValue(), 0.125)
- self.assertEqual(get_cell_by_position(document, 0, 6, 9).getValue(), 0.0625)
- self.assertEqual(get_cell_by_position(document, 0, 6, 10).getValue(), 0.03125)
- self.assertEqual(get_cell_by_position(document, 0, 6, 11).getValue(), 0.015625)
- self.assertEqual(get_cell_by_position(document, 0, 6, 12).getValue(), 0.0078125)
- self.assertEqual(get_cell_by_position(document, 0, 6, 13).getValue(), 0.00390625)
- self.assertEqual(get_cell_by_position(document, 0, 6, 14).getValue(), 0.001953125)
- self.assertEqual(get_cell_by_position(document, 0, 6, 15).getValue(), 0.0009765625)
- self.assertEqual(get_cell_by_position(document, 0, 6, 16).getValue(), 0.00048828125)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 2).getString(), "Column 2")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 3).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 4).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue(), 0.5)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 7).getValue(), 0.25)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 8).getValue(), 0.125)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 9).getValue(), 0.0625)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 10).getValue(), 0.03125)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 11).getValue(), 0.015625)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 12).getValue(), 0.0078125)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 13).getValue(), 0.00390625)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 14).getValue(), 0.001953125)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 15).getValue(), 0.0009765625)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 16).getValue(), 0.00048828125)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:ExponentialSmoothingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ # test cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:ExponentialSmoothingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_exponential_smoothing_row(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "1")
- enter_text_to_cell(gridwin, "A2", "0")
- enter_text_to_cell(gridwin, "A3", "0")
- enter_text_to_cell(gridwin, "A4", "0")
- enter_text_to_cell(gridwin, "A5", "0")
- enter_text_to_cell(gridwin, "A7", "0")
- enter_text_to_cell(gridwin, "A8", "0")
- enter_text_to_cell(gridwin, "A9", "0")
- enter_text_to_cell(gridwin, "A10", "0")
- enter_text_to_cell(gridwin, "A11", "0")
- enter_text_to_cell(gridwin, "A12", "0")
- enter_text_to_cell(gridwin, "A13", "0")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "1")
+ enter_text_to_cell(gridwin, "A2", "0")
+ enter_text_to_cell(gridwin, "A3", "0")
+ enter_text_to_cell(gridwin, "A4", "0")
+ enter_text_to_cell(gridwin, "A5", "0")
+ enter_text_to_cell(gridwin, "A7", "0")
+ enter_text_to_cell(gridwin, "A8", "0")
+ enter_text_to_cell(gridwin, "A9", "0")
+ enter_text_to_cell(gridwin, "A10", "0")
+ enter_text_to_cell(gridwin, "A11", "0")
+ enter_text_to_cell(gridwin, "A12", "0")
+ enter_text_to_cell(gridwin, "A13", "0")
- enter_text_to_cell(gridwin, "B1", "0")
- enter_text_to_cell(gridwin, "B2", "0")
- enter_text_to_cell(gridwin, "B3", "1")
- enter_text_to_cell(gridwin, "B4", "0")
- enter_text_to_cell(gridwin, "B5", "0")
- enter_text_to_cell(gridwin, "B6", "0")
- enter_text_to_cell(gridwin, "B7", "0")
- enter_text_to_cell(gridwin, "B8", "0")
- enter_text_to_cell(gridwin, "B9", "0")
- enter_text_to_cell(gridwin, "B10", "0")
- enter_text_to_cell(gridwin, "B11", "0")
- enter_text_to_cell(gridwin, "B12", "0")
- enter_text_to_cell(gridwin, "B13", "0")
+ enter_text_to_cell(gridwin, "B1", "0")
+ enter_text_to_cell(gridwin, "B2", "0")
+ enter_text_to_cell(gridwin, "B3", "1")
+ enter_text_to_cell(gridwin, "B4", "0")
+ enter_text_to_cell(gridwin, "B5", "0")
+ enter_text_to_cell(gridwin, "B6", "0")
+ enter_text_to_cell(gridwin, "B7", "0")
+ enter_text_to_cell(gridwin, "B8", "0")
+ enter_text_to_cell(gridwin, "B9", "0")
+ enter_text_to_cell(gridwin, "B10", "0")
+ enter_text_to_cell(gridwin, "B11", "0")
+ enter_text_to_cell(gridwin, "B12", "0")
+ enter_text_to_cell(gridwin, "B13", "0")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:ExponentialSmoothingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
- xmoothingfactorspin = xDialog.getChild("smoothing-factor-spin")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:ExponentialSmoothingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+ xmoothingfactorspin = xDialog.getChild("smoothing-factor-spin")
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$13"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
- xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"TEXT":"0.5"}))
- xgroupedbyrowsradio.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Alpha")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 0.5)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Row 1")
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 5, 5).getValue(), 0.5)
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$13"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
+ xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xmoothingfactorspin.executeAction("TYPE", mkPropertyValues({"TEXT":"0.5"}))
+ xgroupedbyrowsradio.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Alpha")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 0.5)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Row 1")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 5).getValue(), 0.5)
- self.assertEqual(get_cell_by_position(document, 0, 6, 2).getString(), "Row 2")
- self.assertEqual(get_cell_by_position(document, 0, 6, 3).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 4).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue(), 0)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 2).getString(), "Row 2")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 3).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 4).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue(), 0)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/fTest.py b/sc/qa/uitest/statistics/fTest.py
index 1f2762c4f796..b3beb09d83ed 100644
--- a/sc/qa/uitest/statistics/fTest.py
+++ b/sc/qa/uitest/statistics/fTest.py
@@ -16,106 +16,104 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tTest(UITestCase):
def test_fTest_column(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "28")
- enter_text_to_cell(gridwin, "A2", "26")
- enter_text_to_cell(gridwin, "A3", "31")
- enter_text_to_cell(gridwin, "A4", "23")
- enter_text_to_cell(gridwin, "A5", "20")
- enter_text_to_cell(gridwin, "A6", "27")
- enter_text_to_cell(gridwin, "A7", "28")
- enter_text_to_cell(gridwin, "A8", "14")
- enter_text_to_cell(gridwin, "A9", "4")
- enter_text_to_cell(gridwin, "A10", "0")
- enter_text_to_cell(gridwin, "A11", "2")
- enter_text_to_cell(gridwin, "A12", "8")
- enter_text_to_cell(gridwin, "A13", "9")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "28")
+ enter_text_to_cell(gridwin, "A2", "26")
+ enter_text_to_cell(gridwin, "A3", "31")
+ enter_text_to_cell(gridwin, "A4", "23")
+ enter_text_to_cell(gridwin, "A5", "20")
+ enter_text_to_cell(gridwin, "A6", "27")
+ enter_text_to_cell(gridwin, "A7", "28")
+ enter_text_to_cell(gridwin, "A8", "14")
+ enter_text_to_cell(gridwin, "A9", "4")
+ enter_text_to_cell(gridwin, "A10", "0")
+ enter_text_to_cell(gridwin, "A11", "2")
+ enter_text_to_cell(gridwin, "A12", "8")
+ enter_text_to_cell(gridwin, "A13", "9")
- enter_text_to_cell(gridwin, "B1", "19")
- enter_text_to_cell(gridwin, "B2", "13")
- enter_text_to_cell(gridwin, "B3", "12")
- enter_text_to_cell(gridwin, "B4", "5")
- enter_text_to_cell(gridwin, "B5", "34")
- enter_text_to_cell(gridwin, "B6", "31")
- enter_text_to_cell(gridwin, "B7", "31")
- enter_text_to_cell(gridwin, "B8", "12")
- enter_text_to_cell(gridwin, "B9", "24")
- enter_text_to_cell(gridwin, "B10", "23")
- enter_text_to_cell(gridwin, "B11", "19")
- enter_text_to_cell(gridwin, "B12", "10")
- enter_text_to_cell(gridwin, "B13", "33")
+ enter_text_to_cell(gridwin, "B1", "19")
+ enter_text_to_cell(gridwin, "B2", "13")
+ enter_text_to_cell(gridwin, "B3", "12")
+ enter_text_to_cell(gridwin, "B4", "5")
+ enter_text_to_cell(gridwin, "B5", "34")
+ enter_text_to_cell(gridwin, "B6", "31")
+ enter_text_to_cell(gridwin, "B7", "31")
+ enter_text_to_cell(gridwin, "B8", "12")
+ enter_text_to_cell(gridwin, "B9", "24")
+ enter_text_to_cell(gridwin, "B10", "23")
+ enter_text_to_cell(gridwin, "B11", "19")
+ enter_text_to_cell(gridwin, "B12", "10")
+ enter_text_to_cell(gridwin, "B13", "33")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:FTestDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xvariable1rangeedit = xDialog.getChild("variable1-range-edit")
- xvariable2rangeedit = xDialog.getChild("variable2-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:FTestDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvariable1rangeedit = xDialog.getChild("variable1-range-edit")
+ xvariable2rangeedit = xDialog.getChild("variable2-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
- xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$13"}))
- xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$B$1:$B$13"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"F1"}))
- xgroupedbycolumnsradio.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "F-test")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Alpha")
+ xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$13"}))
+ xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$B$1:$B$13"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"F1"}))
+ xgroupedbycolumnsradio.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "F-test")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Alpha")
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "Mean")
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString(), "Variance")
- self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString(), "Observations")
- self.assertEqual(get_cell_by_position(document, 0, 5, 6).getString(), "df")
- self.assertEqual(get_cell_by_position(document, 0, 5, 7).getString(), "F")
- self.assertEqual(get_cell_by_position(document, 0, 5, 8).getString(), "P (F<=f) right-tail")
- self.assertEqual(get_cell_by_position(document, 0, 5, 9).getString(), "F Critical right-tail")
- self.assertEqual(get_cell_by_position(document, 0, 5, 10).getString(), "P (F<=f) left-tail")
- self.assertEqual(get_cell_by_position(document, 0, 5, 11).getString(), "F Critical left-tail")
- self.assertEqual(get_cell_by_position(document, 0, 5, 12).getString(), "P two-tail")
- self.assertEqual(get_cell_by_position(document, 0, 5, 13).getString(), "F Critical two-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "Mean")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString(), "Variance")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString(), "Observations")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 6).getString(), "df")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 7).getString(), "F")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 8).getString(), "P (F<=f) right-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 9).getString(), "F Critical right-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 10).getString(), "P (F<=f) left-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 11).getString(), "F Critical left-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 12).getString(), "P two-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 13).getString(), "F Critical two-tail")
- self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 0.05)
- self.assertEqual(get_cell_by_position(document, 0, 6, 2).getString(), "Variable 1")
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 3).getValue(),12), 16.923076923077)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 4).getValue(),12), 125.076923076923)
- self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue(), 13)
- self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue(), 12)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 7).getValue(),12), 1.324463752376)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 8).getValue(),12), 0.317061414639)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 9).getValue(),12), 2.686637112496)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 10).getValue(),12), 0.682938585361)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 12).getValue(),12), 0.634122829279)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 13).getValue(),12), 0.305131354874)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 0.05)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 2).getString(), "Variable 1")
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 3).getValue(),12), 16.923076923077)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 4).getValue(),12), 125.076923076923)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue(), 13)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue(), 12)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 7).getValue(),12), 1.324463752376)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 8).getValue(),12), 0.317061414639)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 9).getValue(),12), 2.686637112496)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 10).getValue(),12), 0.682938585361)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 12).getValue(),12), 0.634122829279)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 13).getValue(),12), 0.305131354874)
- self.assertEqual(get_cell_by_position(document, 0, 7, 2).getString(), "Variable 2")
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 3).getValue(),12), 20.461538461538)
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 4).getValue(),12), 94.435897435897)
- self.assertEqual(get_cell_by_position(document, 0, 7, 5).getValue(), 13)
- self.assertEqual(get_cell_by_position(document, 0, 7, 6).getValue(), 12)
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 13).getValue(),12), 3.277277094033)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 7, 2).getString(), "Variable 2")
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 3).getValue(),12), 20.461538461538)
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 4).getValue(),12), 94.435897435897)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 5).getValue(), 13)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 6).getValue(), 12)
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 13).getValue(),12), 3.277277094033)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:FTestDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ # test cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:FTestDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/movingAverage.py b/sc/qa/uitest/statistics/movingAverage.py
index 9f94aaf29856..6cb4934f7764 100644
--- a/sc/qa/uitest/statistics/movingAverage.py
+++ b/sc/qa/uitest/statistics/movingAverage.py
@@ -16,167 +16,163 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class movingAverage(UITestCase):
def test_moving_average_column(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "1")
- enter_text_to_cell(gridwin, "A2", "0")
- enter_text_to_cell(gridwin, "A3", "0")
- enter_text_to_cell(gridwin, "A4", "0")
- enter_text_to_cell(gridwin, "A5", "0")
- enter_text_to_cell(gridwin, "A7", "0")
- enter_text_to_cell(gridwin, "A8", "0")
- enter_text_to_cell(gridwin, "A9", "0")
- enter_text_to_cell(gridwin, "A10", "0")
- enter_text_to_cell(gridwin, "A11", "0")
- enter_text_to_cell(gridwin, "A12", "0")
- enter_text_to_cell(gridwin, "A13", "0")
-
- enter_text_to_cell(gridwin, "B1", "0")
- enter_text_to_cell(gridwin, "B2", "0")
- enter_text_to_cell(gridwin, "B3", "1")
- enter_text_to_cell(gridwin, "B4", "0")
- enter_text_to_cell(gridwin, "B5", "0")
- enter_text_to_cell(gridwin, "B6", "0")
- enter_text_to_cell(gridwin, "B7", "0")
- enter_text_to_cell(gridwin, "B8", "0")
- enter_text_to_cell(gridwin, "B9", "0")
- enter_text_to_cell(gridwin, "B10", "0")
- enter_text_to_cell(gridwin, "B11", "0")
- enter_text_to_cell(gridwin, "B12", "0")
- enter_text_to_cell(gridwin, "B13", "0")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:MovingAverageDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
- xintervalspin = xDialog.getChild("interval-spin")
-
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$13"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
- xintervalspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xintervalspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xintervalspin.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Column 1")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "#N/A")
- self.assertEqual(round(get_cell_by_position(document, 0, 5, 2).getValue(),8), 0.33333333)
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 5).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 6).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 7).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 8).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 9).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 10).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 11).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 12).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 13).getString(), "#N/A")
-
-
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "Column 2")
- self.assertEqual(get_cell_by_position(document, 0, 6, 1).getString(), "#N/A")
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 2).getValue(),8), 0.33333333)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 3).getValue(),8), 0.33333333)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 4).getValue(),8), 0.33333333)
- self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 7).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 9).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 10).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 11).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 12).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 13).getString(), "#N/A")
-
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
-
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:MovingAverageDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "1")
+ enter_text_to_cell(gridwin, "A2", "0")
+ enter_text_to_cell(gridwin, "A3", "0")
+ enter_text_to_cell(gridwin, "A4", "0")
+ enter_text_to_cell(gridwin, "A5", "0")
+ enter_text_to_cell(gridwin, "A7", "0")
+ enter_text_to_cell(gridwin, "A8", "0")
+ enter_text_to_cell(gridwin, "A9", "0")
+ enter_text_to_cell(gridwin, "A10", "0")
+ enter_text_to_cell(gridwin, "A11", "0")
+ enter_text_to_cell(gridwin, "A12", "0")
+ enter_text_to_cell(gridwin, "A13", "0")
+
+ enter_text_to_cell(gridwin, "B1", "0")
+ enter_text_to_cell(gridwin, "B2", "0")
+ enter_text_to_cell(gridwin, "B3", "1")
+ enter_text_to_cell(gridwin, "B4", "0")
+ enter_text_to_cell(gridwin, "B5", "0")
+ enter_text_to_cell(gridwin, "B6", "0")
+ enter_text_to_cell(gridwin, "B7", "0")
+ enter_text_to_cell(gridwin, "B8", "0")
+ enter_text_to_cell(gridwin, "B9", "0")
+ enter_text_to_cell(gridwin, "B10", "0")
+ enter_text_to_cell(gridwin, "B11", "0")
+ enter_text_to_cell(gridwin, "B12", "0")
+ enter_text_to_cell(gridwin, "B13", "0")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:MovingAverageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+ xintervalspin = xDialog.getChild("interval-spin")
+
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$13"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
+ xintervalspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xintervalspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xintervalspin.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Column 1")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "#N/A")
+ self.assertEqual(round(get_cell_by_position(document, 0, 5, 2).getValue(),8), 0.33333333)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 5).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 6).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 7).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 8).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 9).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 10).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 11).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 12).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 13).getString(), "#N/A")
+
+
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "Column 2")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 1).getString(), "#N/A")
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 2).getValue(),8), 0.33333333)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 3).getValue(),8), 0.33333333)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 4).getValue(),8), 0.33333333)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 5).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 7).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 9).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 10).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 11).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 12).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 13).getString(), "#N/A")
+
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+
+ # test cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:MovingAverageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_moving_average_row(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "1")
- enter_text_to_cell(gridwin, "A2", "0")
- enter_text_to_cell(gridwin, "A3", "0")
- enter_text_to_cell(gridwin, "A4", "0")
- enter_text_to_cell(gridwin, "A5", "0")
- enter_text_to_cell(gridwin, "A7", "0")
- enter_text_to_cell(gridwin, "A8", "0")
- enter_text_to_cell(gridwin, "A9", "0")
- enter_text_to_cell(gridwin, "A10", "0")
- enter_text_to_cell(gridwin, "A11", "0")
- enter_text_to_cell(gridwin, "A12", "0")
- enter_text_to_cell(gridwin, "A13", "0")
-
- enter_text_to_cell(gridwin, "B1", "0")
- enter_text_to_cell(gridwin, "B2", "0")
- enter_text_to_cell(gridwin, "B3", "1")
- enter_text_to_cell(gridwin, "B4", "0")
- enter_text_to_cell(gridwin, "B5", "0")
- enter_text_to_cell(gridwin, "B6", "0")
- enter_text_to_cell(gridwin, "B7", "0")
- enter_text_to_cell(gridwin, "B8", "0")
- enter_text_to_cell(gridwin, "B9", "0")
- enter_text_to_cell(gridwin, "B10", "0")
- enter_text_to_cell(gridwin, "B11", "0")
- enter_text_to_cell(gridwin, "B12", "0")
- enter_text_to_cell(gridwin, "B13", "0")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:MovingAverageDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
- xintervalspin = xDialog.getChild("interval-spin")
-
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$13"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
- xintervalspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xintervalspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xintervalspin.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
- xgroupedbyrowsradio.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Row 1")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "#N/A")
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "#N/A")
-
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "Row 2")
- self.assertEqual(get_cell_by_position(document, 0, 6, 1).getString(), "#N/A")
- self.assertEqual(get_cell_by_position(document, 0, 6, 2).getString(), "#N/A")
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "1")
+ enter_text_to_cell(gridwin, "A2", "0")
+ enter_text_to_cell(gridwin, "A3", "0")
+ enter_text_to_cell(gridwin, "A4", "0")
+ enter_text_to_cell(gridwin, "A5", "0")
+ enter_text_to_cell(gridwin, "A7", "0")
+ enter_text_to_cell(gridwin, "A8", "0")
+ enter_text_to_cell(gridwin, "A9", "0")
+ enter_text_to_cell(gridwin, "A10", "0")
+ enter_text_to_cell(gridwin, "A11", "0")
+ enter_text_to_cell(gridwin, "A12", "0")
+ enter_text_to_cell(gridwin, "A13", "0")
+
+ enter_text_to_cell(gridwin, "B1", "0")
+ enter_text_to_cell(gridwin, "B2", "0")
+ enter_text_to_cell(gridwin, "B3", "1")
+ enter_text_to_cell(gridwin, "B4", "0")
+ enter_text_to_cell(gridwin, "B5", "0")
+ enter_text_to_cell(gridwin, "B6", "0")
+ enter_text_to_cell(gridwin, "B7", "0")
+ enter_text_to_cell(gridwin, "B8", "0")
+ enter_text_to_cell(gridwin, "B9", "0")
+ enter_text_to_cell(gridwin, "B10", "0")
+ enter_text_to_cell(gridwin, "B11", "0")
+ enter_text_to_cell(gridwin, "B12", "0")
+ enter_text_to_cell(gridwin, "B13", "0")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:MovingAverageDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+ xintervalspin = xDialog.getChild("interval-spin")
+
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$13"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$F$1"}))
+ xintervalspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xintervalspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xintervalspin.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
+ xgroupedbyrowsradio.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Row 1")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "#N/A")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "#N/A")
+
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "Row 2")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 1).getString(), "#N/A")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 2).getString(), "#N/A")
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/regression.py b/sc/qa/uitest/statistics/regression.py
index 0102df1f8f92..769014d5babf 100644
--- a/sc/qa/uitest/statistics/regression.py
+++ b/sc/qa/uitest/statistics/regression.py
@@ -103,12 +103,10 @@ class regression(UITestCase):
self.ui_test.close_dialog_through_button(xOKBtn)
def test_regression_cancel(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- self.ui_test.execute_modeless_dialog_through_command(".uno:RegressionDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ self.ui_test.execute_modeless_dialog_through_command(".uno:RegressionDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/sampling.py b/sc/qa/uitest/statistics/sampling.py
index dd3fd2698c5b..3ea6c1e1ecd4 100644
--- a/sc/qa/uitest/statistics/sampling.py
+++ b/sc/qa/uitest/statistics/sampling.py
@@ -16,100 +16,99 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class sampling(UITestCase):
def test_statistic_sampling(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "11")
- enter_text_to_cell(gridwin, "A2", "12")
- enter_text_to_cell(gridwin, "A3", "13")
- enter_text_to_cell(gridwin, "A4", "14")
- enter_text_to_cell(gridwin, "A5", "15")
- enter_text_to_cell(gridwin, "A6", "16")
- enter_text_to_cell(gridwin, "A7", "17")
- enter_text_to_cell(gridwin, "A8", "18")
- enter_text_to_cell(gridwin, "A9", "19")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "11")
+ enter_text_to_cell(gridwin, "A2", "12")
+ enter_text_to_cell(gridwin, "A3", "13")
+ enter_text_to_cell(gridwin, "A4", "14")
+ enter_text_to_cell(gridwin, "A5", "15")
+ enter_text_to_cell(gridwin, "A6", "16")
+ enter_text_to_cell(gridwin, "A7", "17")
+ enter_text_to_cell(gridwin, "A8", "18")
+ enter_text_to_cell(gridwin, "A9", "19")
- enter_text_to_cell(gridwin, "B1", "21")
- enter_text_to_cell(gridwin, "B2", "22")
- enter_text_to_cell(gridwin, "B3", "23")
- enter_text_to_cell(gridwin, "B4", "24")
- enter_text_to_cell(gridwin, "B5", "25")
- enter_text_to_cell(gridwin, "B6", "26")
- enter_text_to_cell(gridwin, "B7", "27")
- enter_text_to_cell(gridwin, "B8", "28")
- enter_text_to_cell(gridwin, "B9", "29")
+ enter_text_to_cell(gridwin, "B1", "21")
+ enter_text_to_cell(gridwin, "B2", "22")
+ enter_text_to_cell(gridwin, "B3", "23")
+ enter_text_to_cell(gridwin, "B4", "24")
+ enter_text_to_cell(gridwin, "B5", "25")
+ enter_text_to_cell(gridwin, "B6", "26")
+ enter_text_to_cell(gridwin, "B7", "27")
+ enter_text_to_cell(gridwin, "B8", "28")
+ enter_text_to_cell(gridwin, "B9", "29")
- enter_text_to_cell(gridwin, "C1", "31")
- enter_text_to_cell(gridwin, "C2", "32")
- enter_text_to_cell(gridwin, "C3", "33")
- enter_text_to_cell(gridwin, "C4", "34")
- enter_text_to_cell(gridwin, "C5", "35")
- enter_text_to_cell(gridwin, "C6", "36")
- enter_text_to_cell(gridwin, "C7", "37")
- enter_text_to_cell(gridwin, "C8", "38")
- enter_text_to_cell(gridwin, "C9", "39")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C9"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:SamplingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xinputrangeedit = xDialog.getChild("input-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xrandommethodradio = xDialog.getChild("random-method-radio")
- xsamplesizespin = xDialog.getChild("sample-size-spin")
- xperiodicmethodradio = xDialog.getChild("periodic-method-radio")
- xperiodspin = xDialog.getChild("period-spin")
+ enter_text_to_cell(gridwin, "C1", "31")
+ enter_text_to_cell(gridwin, "C2", "32")
+ enter_text_to_cell(gridwin, "C3", "33")
+ enter_text_to_cell(gridwin, "C4", "34")
+ enter_text_to_cell(gridwin, "C5", "35")
+ enter_text_to_cell(gridwin, "C6", "36")
+ enter_text_to_cell(gridwin, "C7", "37")
+ enter_text_to_cell(gridwin, "C8", "38")
+ enter_text_to_cell(gridwin, "C9", "39")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C9"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SamplingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xinputrangeedit = xDialog.getChild("input-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xrandommethodradio = xDialog.getChild("random-method-radio")
+ xsamplesizespin = xDialog.getChild("sample-size-spin")
+ xperiodicmethodradio = xDialog.getChild("periodic-method-radio")
+ xperiodspin = xDialog.getChild("period-spin")
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$C$9"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xinputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$C$9"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$F$1"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$F$1"}))
- xperiodicmethodradio.executeAction("CLICK", tuple())
+ xperiodicmethodradio.executeAction("CLICK", tuple())
- xperiodspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xperiodspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xperiodspin.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 12)
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue() , 14)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue() , 16)
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue() , 18)
+ xperiodspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xperiodspin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xperiodspin.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 12)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue() , 14)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue() , 16)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue() , 18)
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getValue(), 22)
- self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue() , 24)
- self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue() , 26)
- self.assertEqual(get_cell_by_position(document, 0, 6, 3).getValue() , 28)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getValue(), 22)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue() , 24)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue() , 26)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 3).getValue() , 28)
- self.assertEqual(get_cell_by_position(document, 0, 7, 0).getValue(), 32)
- self.assertEqual(get_cell_by_position(document, 0, 7, 1).getValue() , 34)
- self.assertEqual(get_cell_by_position(document, 0, 7, 2).getValue() , 36)
- self.assertEqual(get_cell_by_position(document, 0, 7, 3).getValue() , 38)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue() , 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue() , 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue() , 0)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 0).getValue(), 32)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 1).getValue() , 34)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 2).getValue() , 36)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 3).getValue() , 38)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue() , 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue() , 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue() , 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue() , 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue() , 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 3).getValue() , 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue() , 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue() , 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 3).getValue() , 0)
- self.assertEqual(get_cell_by_position(document, 0, 7, 0).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 7, 1).getValue() , 0)
- self.assertEqual(get_cell_by_position(document, 0, 7, 2).getValue() , 0)
- self.assertEqual(get_cell_by_position(document, 0, 7, 3).getValue() , 0)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 0).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 1).getValue() , 0)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 2).getValue() , 0)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 3).getValue() , 0)
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:SamplingDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ # test cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SamplingDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/tTest.py b/sc/qa/uitest/statistics/tTest.py
index 035bb4ef6d89..34eaab786c2c 100644
--- a/sc/qa/uitest/statistics/tTest.py
+++ b/sc/qa/uitest/statistics/tTest.py
@@ -16,107 +16,105 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tTest(UITestCase):
def test_tTest_column(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "28")
- enter_text_to_cell(gridwin, "A2", "26")
- enter_text_to_cell(gridwin, "A3", "31")
- enter_text_to_cell(gridwin, "A4", "23")
- enter_text_to_cell(gridwin, "A5", "20")
- enter_text_to_cell(gridwin, "A6", "27")
- enter_text_to_cell(gridwin, "A7", "28")
- enter_text_to_cell(gridwin, "A8", "14")
- enter_text_to_cell(gridwin, "A9", "4")
- enter_text_to_cell(gridwin, "A10", "0")
- enter_text_to_cell(gridwin, "A11", "2")
- enter_text_to_cell(gridwin, "A12", "8")
- enter_text_to_cell(gridwin, "A13", "9")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "28")
+ enter_text_to_cell(gridwin, "A2", "26")
+ enter_text_to_cell(gridwin, "A3", "31")
+ enter_text_to_cell(gridwin, "A4", "23")
+ enter_text_to_cell(gridwin, "A5", "20")
+ enter_text_to_cell(gridwin, "A6", "27")
+ enter_text_to_cell(gridwin, "A7", "28")
+ enter_text_to_cell(gridwin, "A8", "14")
+ enter_text_to_cell(gridwin, "A9", "4")
+ enter_text_to_cell(gridwin, "A10", "0")
+ enter_text_to_cell(gridwin, "A11", "2")
+ enter_text_to_cell(gridwin, "A12", "8")
+ enter_text_to_cell(gridwin, "A13", "9")
- enter_text_to_cell(gridwin, "B1", "19")
- enter_text_to_cell(gridwin, "B2", "13")
- enter_text_to_cell(gridwin, "B3", "12")
- enter_text_to_cell(gridwin, "B4", "5")
- enter_text_to_cell(gridwin, "B5", "34")
- enter_text_to_cell(gridwin, "B6", "31")
- enter_text_to_cell(gridwin, "B7", "31")
- enter_text_to_cell(gridwin, "B8", "12")
- enter_text_to_cell(gridwin, "B9", "24")
- enter_text_to_cell(gridwin, "B10", "23")
- enter_text_to_cell(gridwin, "B11", "19")
- enter_text_to_cell(gridwin, "B12", "10")
- enter_text_to_cell(gridwin, "B13", "33")
+ enter_text_to_cell(gridwin, "B1", "19")
+ enter_text_to_cell(gridwin, "B2", "13")
+ enter_text_to_cell(gridwin, "B3", "12")
+ enter_text_to_cell(gridwin, "B4", "5")
+ enter_text_to_cell(gridwin, "B5", "34")
+ enter_text_to_cell(gridwin, "B6", "31")
+ enter_text_to_cell(gridwin, "B7", "31")
+ enter_text_to_cell(gridwin, "B8", "12")
+ enter_text_to_cell(gridwin, "B9", "24")
+ enter_text_to_cell(gridwin, "B10", "23")
+ enter_text_to_cell(gridwin, "B11", "19")
+ enter_text_to_cell(gridwin, "B12", "10")
+ enter_text_to_cell(gridwin, "B13", "33")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:TTestDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xvariable1rangeedit = xDialog.getChild("variable1-range-edit")
- xvariable2rangeedit = xDialog.getChild("variable2-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:TTestDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvariable1rangeedit = xDialog.getChild("variable1-range-edit")
+ xvariable2rangeedit = xDialog.getChild("variable2-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
- xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$13"}))
- xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$B$1:$B$13"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"F1"}))
- xgroupedbycolumnsradio.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Paired t-test")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Alpha")
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Hypothesized Mean Difference")
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString(), "Mean")
- self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString(), "Variance")
- self.assertEqual(get_cell_by_position(document, 0, 5, 6).getString(), "Observations")
- self.assertEqual(get_cell_by_position(document, 0, 5, 7).getString(), "Pearson Correlation")
- self.assertEqual(get_cell_by_position(document, 0, 5, 8).getString(), "Observed Mean Difference")
- self.assertEqual(get_cell_by_position(document, 0, 5, 9).getString(), "Variance of the Differences")
- self.assertEqual(get_cell_by_position(document, 0, 5, 10).getString(), "df")
- self.assertEqual(get_cell_by_position(document, 0, 5, 11).getString(), "t Stat")
- self.assertEqual(get_cell_by_position(document, 0, 5, 12).getString(), "P (T<=t) one-tail")
- self.assertEqual(get_cell_by_position(document, 0, 5, 13).getString(), "t Critical one-tail")
- self.assertEqual(get_cell_by_position(document, 0, 5, 14).getString(), "P (T<=t) two-tail")
- self.assertEqual(get_cell_by_position(document, 0, 5, 15).getString(), "t Critical two-tail")
+ xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$13"}))
+ xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$B$1:$B$13"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"F1"}))
+ xgroupedbycolumnsradio.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "Paired t-test")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Alpha")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Hypothesized Mean Difference")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString(), "Mean")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString(), "Variance")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 6).getString(), "Observations")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 7).getString(), "Pearson Correlation")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 8).getString(), "Observed Mean Difference")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 9).getString(), "Variance of the Differences")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 10).getString(), "df")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 11).getString(), "t Stat")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 12).getString(), "P (T<=t) one-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 13).getString(), "t Critical one-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 14).getString(), "P (T<=t) two-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 15).getString(), "t Critical two-tail")
- self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 0.05)
- self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 3).getString(), "Variable 1")
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 4).getValue(),12), 16.923076923077)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 5).getValue(),12), 125.076923076923)
- self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue(), 13)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 7).getValue(),12), -0.061753977175)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 8).getValue(),12), -3.538461538462)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 9).getValue(),12), 232.935897435897)
- self.assertEqual(get_cell_by_position(document, 0, 6, 10).getValue(), 12)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 11).getValue(),12), -0.835926213674)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 12).getValue(),12), 0.209765144211)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 13).getValue(),12), 1.782287555649)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 14).getValue(),12), 0.419530288422)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 15).getValue(),12), 2.178812829667)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 0.05)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 3).getString(), "Variable 1")
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 4).getValue(),12), 16.923076923077)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 5).getValue(),12), 125.076923076923)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 6).getValue(), 13)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 7).getValue(),12), -0.061753977175)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 8).getValue(),12), -3.538461538462)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 9).getValue(),12), 232.935897435897)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 10).getValue(), 12)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 11).getValue(),12), -0.835926213674)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 12).getValue(),12), 0.209765144211)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 13).getValue(),12), 1.782287555649)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 14).getValue(),12), 0.419530288422)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 15).getValue(),12), 2.178812829667)
- self.assertEqual(get_cell_by_position(document, 0, 7, 3).getString(), "Variable 2")
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 4).getValue(),12), 20.461538461538)
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 5).getValue(),12), 94.435897435897)
- self.assertEqual(get_cell_by_position(document, 0, 7, 6).getValue(), 13)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 7, 3).getString(), "Variable 2")
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 4).getValue(),12), 20.461538461538)
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 5).getValue(),12), 94.435897435897)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 6).getValue(), 13)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:TTestDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ # test cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:TTestDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/zTest.py b/sc/qa/uitest/statistics/zTest.py
index a7f791e1a898..ea44d9f0cee9 100644
--- a/sc/qa/uitest/statistics/zTest.py
+++ b/sc/qa/uitest/statistics/zTest.py
@@ -16,97 +16,95 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class zTest(UITestCase):
def test_zTest_column(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()
- #fill data
- enter_text_to_cell(gridwin, "A1", "28")
- enter_text_to_cell(gridwin, "A2", "26")
- enter_text_to_cell(gridwin, "A3", "31")
- enter_text_to_cell(gridwin, "A4", "23")
- enter_text_to_cell(gridwin, "A5", "20")
- enter_text_to_cell(gridwin, "A6", "27")
- enter_text_to_cell(gridwin, "A7", "28")
- enter_text_to_cell(gridwin, "A8", "14")
- enter_text_to_cell(gridwin, "A9", "4")
- enter_text_to_cell(gridwin, "A10", "0")
- enter_text_to_cell(gridwin, "A11", "2")
- enter_text_to_cell(gridwin, "A12", "8")
- enter_text_to_cell(gridwin, "A13", "9")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "28")
+ enter_text_to_cell(gridwin, "A2", "26")
+ enter_text_to_cell(gridwin, "A3", "31")
+ enter_text_to_cell(gridwin, "A4", "23")
+ enter_text_to_cell(gridwin, "A5", "20")
+ enter_text_to_cell(gridwin, "A6", "27")
+ enter_text_to_cell(gridwin, "A7", "28")
+ enter_text_to_cell(gridwin, "A8", "14")
+ enter_text_to_cell(gridwin, "A9", "4")
+ enter_text_to_cell(gridwin, "A10", "0")
+ enter_text_to_cell(gridwin, "A11", "2")
+ enter_text_to_cell(gridwin, "A12", "8")
+ enter_text_to_cell(gridwin, "A13", "9")
- enter_text_to_cell(gridwin, "B1", "19")
- enter_text_to_cell(gridwin, "B2", "13")
- enter_text_to_cell(gridwin, "B3", "12")
- enter_text_to_cell(gridwin, "B4", "5")
- enter_text_to_cell(gridwin, "B5", "34")
- enter_text_to_cell(gridwin, "B6", "31")
- enter_text_to_cell(gridwin, "B7", "31")
- enter_text_to_cell(gridwin, "B8", "12")
- enter_text_to_cell(gridwin, "B9", "24")
- enter_text_to_cell(gridwin, "B10", "23")
- enter_text_to_cell(gridwin, "B11", "19")
- enter_text_to_cell(gridwin, "B12", "10")
- enter_text_to_cell(gridwin, "B13", "33")
+ enter_text_to_cell(gridwin, "B1", "19")
+ enter_text_to_cell(gridwin, "B2", "13")
+ enter_text_to_cell(gridwin, "B3", "12")
+ enter_text_to_cell(gridwin, "B4", "5")
+ enter_text_to_cell(gridwin, "B5", "34")
+ enter_text_to_cell(gridwin, "B6", "31")
+ enter_text_to_cell(gridwin, "B7", "31")
+ enter_text_to_cell(gridwin, "B8", "12")
+ enter_text_to_cell(gridwin, "B9", "24")
+ enter_text_to_cell(gridwin, "B10", "23")
+ enter_text_to_cell(gridwin, "B11", "19")
+ enter_text_to_cell(gridwin, "B12", "10")
+ enter_text_to_cell(gridwin, "B13", "33")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:ZTestDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xvariable1rangeedit = xDialog.getChild("variable1-range-edit")
- xvariable2rangeedit = xDialog.getChild("variable2-range-edit")
- xoutputrangeedit = xDialog.getChild("output-range-edit")
- xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
- xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B13"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:ZTestDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvariable1rangeedit = xDialog.getChild("variable1-range-edit")
+ xvariable2rangeedit = xDialog.getChild("variable2-range-edit")
+ xoutputrangeedit = xDialog.getChild("output-range-edit")
+ xgroupedbyrowsradio = xDialog.getChild("groupedby-rows-radio")
+ xgroupedbycolumnsradio = xDialog.getChild("groupedby-columns-radio")
- xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$13"}))
- xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$B$1:$B$13"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"F1"}))
- xgroupedbycolumnsradio.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "z-test")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Alpha")
+ xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvariable1rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$A$13"}))
+ xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xvariable2rangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$B$1:$B$13"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xoutputrangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"F1"}))
+ xgroupedbycolumnsradio.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "z-test")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "Alpha")
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Hypothesized Mean Difference")
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString(), "Known Variance")
- self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString(), "Mean")
- self.assertEqual(get_cell_by_position(document, 0, 5, 6).getString(), "Observations")
- self.assertEqual(get_cell_by_position(document, 0, 5, 7).getString(), "Observed Mean Difference")
- self.assertEqual(get_cell_by_position(document, 0, 5, 8).getString(), "z")
- self.assertEqual(get_cell_by_position(document, 0, 5, 9).getString(), "P (Z<=z) one-tail")
- self.assertEqual(get_cell_by_position(document, 0, 5, 10).getString(), "z Critical one-tail")
- self.assertEqual(get_cell_by_position(document, 0, 5, 11).getString(), "P (Z<=z) two-tail")
- self.assertEqual(get_cell_by_position(document, 0, 5, 12).getString(), "z Critical two-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "Hypothesized Mean Difference")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getString(), "Known Variance")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 5).getString(), "Mean")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 6).getString(), "Observations")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 7).getString(), "Observed Mean Difference")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 8).getString(), "z")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 9).getString(), "P (Z<=z) one-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 10).getString(), "z Critical one-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 11).getString(), "P (Z<=z) two-tail")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 12).getString(), "z Critical two-tail")
- self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 0.05)
- self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 6, 3).getString(), "Variable 1")
- self.assertEqual(get_cell_by_position(document, 0, 6, 4).getValue(), 0)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 5).getValue(),12), 16.923076923077)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 10).getValue(),12), 1.644853626951)
- self.assertEqual(round(get_cell_by_position(document, 0, 6, 12).getValue(),12), 1.959963984540)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 0.05)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 3).getString(), "Variable 1")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 4).getValue(), 0)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 5).getValue(),12), 16.923076923077)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 10).getValue(),12), 1.644853626951)
+ self.assertEqual(round(get_cell_by_position(document, 0, 6, 12).getValue(),12), 1.959963984540)
- self.assertEqual(get_cell_by_position(document, 0, 7, 3).getString(), "Variable 2")
- self.assertEqual(get_cell_by_position(document, 0, 7, 4).getValue(), 0)
- self.assertEqual(round(get_cell_by_position(document, 0, 7, 5).getValue(),12), 20.461538461538)
- self.assertEqual(get_cell_by_position(document, 0, 7, 6).getValue(), 13)
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 7, 3).getString(), "Variable 2")
+ self.assertEqual(get_cell_by_position(document, 0, 7, 4).getValue(), 0)
+ self.assertEqual(round(get_cell_by_position(document, 0, 7, 5).getValue(),12), 20.461538461538)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 6).getValue(), 13)
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "")
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:ZTestDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ # test cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:ZTestDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/textCase/textCase.py b/sc/qa/uitest/textCase/textCase.py
index d3823f1dacc6..61085e831218 100644
--- a/sc/qa/uitest/textCase/textCase.py
+++ b/sc/qa/uitest/textCase/textCase.py
@@ -13,117 +13,116 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class textCase(UITestCase):
def test_text_case_switch(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- #enter data
- enter_text_to_cell(gridwin, "A1", "hello world")
- enter_text_to_cell(gridwin, "A2", "libre office")
- enter_text_to_cell(gridwin, "A4", "free suite")
- #select
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
- #Capitalize every word - CommandSent Name:.uno:ChangeCaseToTitleCase
- self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello World")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre Office")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free Suite")
-
- #Sentence case - CommandSent Name:.uno:ChangeCaseToSentenceCase
- self.xUITest.executeCommand(".uno:ChangeCaseToSentenceCase")
-
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello world")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre office")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free suite")
-
- #toggle case - CommandSent Name:.uno:ChangeCaseToToggleCase
- self.xUITest.executeCommand(".uno:ChangeCaseToToggleCase")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "hELLO WORLD")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "lIBRE OFFICE")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "fREE SUITE")
-
- #uppercase = CommandSent Name:.uno:ChangeCaseToUpper
- self.xUITest.executeCommand(".uno:ChangeCaseToUpper")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "HELLO WORLD")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "LIBRE OFFICE")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "FREE SUITE")
-
- #lowercase - CommandSent Name:.uno:ChangeCaseToLower
- self.xUITest.executeCommand(".uno:ChangeCaseToLower")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "hello world")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "libre office")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "free suite")
-
- #cycle case = CommandSent Name:.uno:ChangeCaseRotateCase
- self.xUITest.executeCommand(".uno:ChangeCaseRotateCase")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello World")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre Office")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free Suite")
-
- #select non continuous range
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B2"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A4:A5", "EXTEND":"1"}))
-
- #lowercase - CommandSent Name:.uno:ChangeCaseToLower
- self.xUITest.executeCommand(".uno:ChangeCaseToLower")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "hello world")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "libre office")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "free suite")
-
- #Capitalize every word - CommandSent Name:.uno:ChangeCaseToTitleCase
- self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello World")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre Office")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free Suite")
-
- #Sentence case - CommandSent Name:.uno:ChangeCaseToSentenceCase
- self.xUITest.executeCommand(".uno:ChangeCaseToSentenceCase")
-
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello world")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre office")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free suite")
-
- #toggle case - CommandSent Name:.uno:ChangeCaseToToggleCase
- self.xUITest.executeCommand(".uno:ChangeCaseToToggleCase")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "hELLO WORLD")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "lIBRE OFFICE")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "fREE SUITE")
-
- #uppercase = CommandSent Name:.uno:ChangeCaseToUpper
- self.xUITest.executeCommand(".uno:ChangeCaseToUpper")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "HELLO WORLD")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "LIBRE OFFICE")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "FREE SUITE")
-
- #lowercase - CommandSent Name:.uno:ChangeCaseToLower
- self.xUITest.executeCommand(".uno:ChangeCaseToLower")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "hello world")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "libre office")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "free suite")
-
- #cycle case = CommandSent Name:.uno:ChangeCaseRotateCase
- self.xUITest.executeCommand(".uno:ChangeCaseRotateCase")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello world")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre office")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free suite")
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ #enter data
+ enter_text_to_cell(gridwin, "A1", "hello world")
+ enter_text_to_cell(gridwin, "A2", "libre office")
+ enter_text_to_cell(gridwin, "A4", "free suite")
+ #select
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ #Capitalize every word - CommandSent Name:.uno:ChangeCaseToTitleCase
+ self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello World")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre Office")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free Suite")
+
+ #Sentence case - CommandSent Name:.uno:ChangeCaseToSentenceCase
+ self.xUITest.executeCommand(".uno:ChangeCaseToSentenceCase")
+
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello world")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre office")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free suite")
+
+ #toggle case - CommandSent Name:.uno:ChangeCaseToToggleCase
+ self.xUITest.executeCommand(".uno:ChangeCaseToToggleCase")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "hELLO WORLD")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "lIBRE OFFICE")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "fREE SUITE")
+
+ #uppercase = CommandSent Name:.uno:ChangeCaseToUpper
+ self.xUITest.executeCommand(".uno:ChangeCaseToUpper")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "HELLO WORLD")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "LIBRE OFFICE")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "FREE SUITE")
+
+ #lowercase - CommandSent Name:.uno:ChangeCaseToLower
+ self.xUITest.executeCommand(".uno:ChangeCaseToLower")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "hello world")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "libre office")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "free suite")
+
+ #cycle case = CommandSent Name:.uno:ChangeCaseRotateCase
+ self.xUITest.executeCommand(".uno:ChangeCaseRotateCase")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello World")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre Office")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free Suite")
+
+ #select non continuous range
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B2"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A4:A5", "EXTEND":"1"}))
+
+ #lowercase - CommandSent Name:.uno:ChangeCaseToLower
+ self.xUITest.executeCommand(".uno:ChangeCaseToLower")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "hello world")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "libre office")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "free suite")
+
+ #Capitalize every word - CommandSent Name:.uno:ChangeCaseToTitleCase
+ self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello World")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre Office")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free Suite")
+
+ #Sentence case - CommandSent Name:.uno:ChangeCaseToSentenceCase
+ self.xUITest.executeCommand(".uno:ChangeCaseToSentenceCase")
+
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello world")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre office")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free suite")
+
+ #toggle case - CommandSent Name:.uno:ChangeCaseToToggleCase
+ self.xUITest.executeCommand(".uno:ChangeCaseToToggleCase")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "hELLO WORLD")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "lIBRE OFFICE")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "fREE SUITE")
+
+ #uppercase = CommandSent Name:.uno:ChangeCaseToUpper
+ self.xUITest.executeCommand(".uno:ChangeCaseToUpper")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "HELLO WORLD")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "LIBRE OFFICE")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "FREE SUITE")
+
+ #lowercase - CommandSent Name:.uno:ChangeCaseToLower
+ self.xUITest.executeCommand(".uno:ChangeCaseToLower")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "hello world")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "libre office")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "free suite")
+
+ #cycle case = CommandSent Name:.uno:ChangeCaseRotateCase
+ self.xUITest.executeCommand(".uno:ChangeCaseRotateCase")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Hello world")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Libre office")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "Free suite")
def test_tdf119155_Capitalize_Every_Word(self):
#Bug 119155 - Freeze after command format->text->Capitalize Every Word
diff --git a/sc/qa/uitest/validity/tdf138134.py b/sc/qa/uitest/validity/tdf138134.py
index 1bbdc443d60e..9147a263c862 100644
--- a/sc/qa/uitest/validity/tdf138134.py
+++ b/sc/qa/uitest/validity/tdf138134.py
@@ -15,46 +15,44 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class DetectiveCircle(UITestCase):
def test_delete_circle_at_formula(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- enter_text_to_cell(gridwin, "A1", "1")
- enter_text_to_cell(gridwin, "A2", "3")
- enter_text_to_cell(gridwin, "A3", "=SUM(A1:A2)")
-
- #Select the cells to be validated
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- #Apply Data > Validity ... > Whole Numbers
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- xdata = xDialog.getChild("data")
- xmin = xDialog.getChild("min")
- xmax = xDialog.getChild("max")
-
- select_by_text(xallow, "Whole Numbers")
- xallowempty.executeAction("CLICK", tuple())
- select_by_text(xdata, "equal")
- xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"5"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.xUITest.executeCommand(".uno:ShowInvalid")
-
- detectiveCircle1 = document.Sheets.getByName("Sheet1").DrawPage.getCount()
- #There should be 1 detective circle object!
- self.assertEqual(detectiveCircle1, 1)
-
- enter_text_to_cell(gridwin, "A1", "2")
-
- detectiveCircle2 = document.Sheets.getByName("Sheet1").DrawPage.getCount()
- #There should not be a detective circle object!
- self.assertEqual(detectiveCircle2, 0)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ enter_text_to_cell(gridwin, "A1", "1")
+ enter_text_to_cell(gridwin, "A2", "3")
+ enter_text_to_cell(gridwin, "A3", "=SUM(A1:A2)")
+
+ #Select the cells to be validated
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ #Apply Data > Validity ... > Whole Numbers
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ xdata = xDialog.getChild("data")
+ xmin = xDialog.getChild("min")
+ xmax = xDialog.getChild("max")
+
+ select_by_text(xallow, "Whole Numbers")
+ xallowempty.executeAction("CLICK", tuple())
+ select_by_text(xdata, "equal")
+ xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"5"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.xUITest.executeCommand(".uno:ShowInvalid")
+
+ detectiveCircle1 = document.Sheets.getByName("Sheet1").DrawPage.getCount()
+ #There should be 1 detective circle object!
+ self.assertEqual(detectiveCircle1, 1)
+
+ enter_text_to_cell(gridwin, "A1", "2")
+
+ detectiveCircle2 = document.Sheets.getByName("Sheet1").DrawPage.getCount()
+ #There should not be a detective circle object!
+ self.assertEqual(detectiveCircle2, 0)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/validity/tdf53920.py b/sc/qa/uitest/validity/tdf53920.py
index e1a4fc87efaa..b709d31d8545 100644
--- a/sc/qa/uitest/validity/tdf53920.py
+++ b/sc/qa/uitest/validity/tdf53920.py
@@ -15,63 +15,61 @@ from uitest.debug import sleep
#Bug 53920 - EDITING: Data Validity Cell Range not being applied to multiple selected cells
class tdf53920(UITestCase):
def test_tdf53920_validity_multiple_cells(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #. Provide the desired values in a range of cells
- enter_text_to_cell(gridwin, "C1", "A")
- enter_text_to_cell(gridwin, "C2", "B")
- enter_text_to_cell(gridwin, "C3", "C")
- #Select the cells to be validated
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3", "EXTEND":"1"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A5", "EXTEND":"1"}))
- #Apply Data > Validity ... > Cell Range
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xallow = xDialog.getChild("allow")
- xmin = xDialog.getChild("min")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #. Provide the desired values in a range of cells
+ enter_text_to_cell(gridwin, "C1", "A")
+ enter_text_to_cell(gridwin, "C2", "B")
+ enter_text_to_cell(gridwin, "C3", "C")
+ #Select the cells to be validated
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3", "EXTEND":"1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A5", "EXTEND":"1"}))
+ #Apply Data > Validity ... > Cell Range
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xallow = xDialog.getChild("allow")
+ xmin = xDialog.getChild("min")
- select_by_text(xallow, "Cell range")
- xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$C$1:$C$3"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ select_by_text(xallow, "Cell range")
+ xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$C$1:$C$3"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #Expected behavior: All selected cells validate data.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xallow = xDialog.getChild("allow")
- xmin = xDialog.getChild("min")
- self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Cell range")
- self.assertEqual(get_state_as_dict(xmin)["Text"], "$Sheet1.$C$1:$C$3")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ #Expected behavior: All selected cells validate data.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xallow = xDialog.getChild("allow")
+ xmin = xDialog.getChild("min")
+ self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Cell range")
+ self.assertEqual(get_state_as_dict(xmin)["Text"], "$Sheet1.$C$1:$C$3")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xallow = xDialog.getChild("allow")
- xmin = xDialog.getChild("min")
- self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Cell range")
- self.assertEqual(get_state_as_dict(xmin)["Text"], "$Sheet1.$C$1:$C$3")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xallow = xDialog.getChild("allow")
+ xmin = xDialog.getChild("min")
+ self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Cell range")
+ self.assertEqual(get_state_as_dict(xmin)["Text"], "$Sheet1.$C$1:$C$3")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A5"}))
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xallow = xDialog.getChild("allow")
- xmin = xDialog.getChild("min")
- self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Cell range")
- self.assertEqual(get_state_as_dict(xmin)["Text"], "$Sheet1.$C$1:$C$3")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A5"}))
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xallow = xDialog.getChild("allow")
+ xmin = xDialog.getChild("min")
+ self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Cell range")
+ self.assertEqual(get_state_as_dict(xmin)["Text"], "$Sheet1.$C$1:$C$3")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/validity/tdf65686.py b/sc/qa/uitest/validity/tdf65686.py
index 557701b1dd7f..0fd26b1af72d 100644
--- a/sc/qa/uitest/validity/tdf65686.py
+++ b/sc/qa/uitest/validity/tdf65686.py
@@ -14,45 +14,43 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
#Bug 65686 - EDITING Data > Validity broken (for list entries at least)
class tdf65686(UITestCase):
def test_tdf65686_validity_list(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #- Data > Validity
- #- Select Allow List
- #- Enter Entries Aap Noot Mies
- #- OK
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- minlist = xDialog.getChild("minlist")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #- Data > Validity
+ #- Select Allow List
+ #- Enter Entries Aap Noot Mies
+ #- OK
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ minlist = xDialog.getChild("minlist")
- select_by_text(xallow, "List")
- minlist.executeAction("TYPE", mkPropertyValues({"TEXT":"Aap"}))
- minlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- minlist.executeAction("TYPE", mkPropertyValues({"TEXT":"Noot"}))
- minlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- minlist.executeAction("TYPE", mkPropertyValues({"TEXT":"Mies"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #- again open Data > Validity
- #> there are empty lines in the list Entries
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- minlist = xDialog.getChild("minlist")
+ select_by_text(xallow, "List")
+ minlist.executeAction("TYPE", mkPropertyValues({"TEXT":"Aap"}))
+ minlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ minlist.executeAction("TYPE", mkPropertyValues({"TEXT":"Noot"}))
+ minlist.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ minlist.executeAction("TYPE", mkPropertyValues({"TEXT":"Mies"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #- again open Data > Validity
+ #> there are empty lines in the list Entries
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ minlist = xDialog.getChild("minlist")
- self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "List")
- self.assertEqual(get_state_as_dict(minlist)["Text"], "Aap\nNoot\nMies")
+ self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "List")
+ self.assertEqual(get_state_as_dict(minlist)["Text"], "Aap\nNoot\nMies")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/validity/tdf96698.py b/sc/qa/uitest/validity/tdf96698.py
index a3bd19c2f3ef..4bc5e04579d1 100644
--- a/sc/qa/uitest/validity/tdf96698.py
+++ b/sc/qa/uitest/validity/tdf96698.py
@@ -14,117 +14,115 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
#Bug 96698 - Data => Validity => Custom (like Excel) is missing
class tdf96698(UITestCase):
def test_tdf96698_validity_custom_formula(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()
-
- #A general validity check for the entered new content of the active cell - especially for text
- #with a custom formula like in Excel is not possible.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- xmin = xDialog.getChild("min")
-
- select_by_text(xallow, "Custom")
- xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"ISERROR(FIND(\",\",B2))"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- xmin = xDialog.getChild("min")
-
- self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Custom")
- self.assertEqual(get_state_as_dict(xmin)["Text"], "ISERROR(FIND(\",\",B2))")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- xmin = xDialog.getChild("min")
-
- select_by_text(xallow, "Custom")
- xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"NOT(ISERROR(B3))"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- xmin = xDialog.getChild("min")
-
- self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Custom")
- self.assertEqual(get_state_as_dict(xmin)["Text"], "NOT(ISERROR(B3))")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A7"}))
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- xmin = xDialog.getChild("min")
-
- select_by_text(xallow, "Custom")
- xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"ISERROR(FIND(\",\",A7))"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- xmin = xDialog.getChild("min")
-
- self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Custom")
- self.assertEqual(get_state_as_dict(xmin)["Text"], "ISERROR(FIND(\",\",A7))")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A8"}))
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- xmin = xDialog.getChild("min")
-
- select_by_text(xallow, "Custom")
- xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"NOT(ISERROR(A8))"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- xmin = xDialog.getChild("min")
-
- self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Custom")
- self.assertEqual(get_state_as_dict(xmin)["Text"], "NOT(ISERROR(A8))")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ #A general validity check for the entered new content of the active cell - especially for text
+ #with a custom formula like in Excel is not possible.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ xmin = xDialog.getChild("min")
+
+ select_by_text(xallow, "Custom")
+ xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"ISERROR(FIND(\",\",B2))"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ xmin = xDialog.getChild("min")
+
+ self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Custom")
+ self.assertEqual(get_state_as_dict(xmin)["Text"], "ISERROR(FIND(\",\",B2))")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ xmin = xDialog.getChild("min")
+
+ select_by_text(xallow, "Custom")
+ xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"NOT(ISERROR(B3))"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ xmin = xDialog.getChild("min")
+
+ self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Custom")
+ self.assertEqual(get_state_as_dict(xmin)["Text"], "NOT(ISERROR(B3))")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A7"}))
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ xmin = xDialog.getChild("min")
+
+ select_by_text(xallow, "Custom")
+ xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"ISERROR(FIND(\",\",A7))"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ xmin = xDialog.getChild("min")
+
+ self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Custom")
+ self.assertEqual(get_state_as_dict(xmin)["Text"], "ISERROR(FIND(\",\",A7))")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A8"}))
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ xmin = xDialog.getChild("min")
+
+ select_by_text(xallow, "Custom")
+ xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"NOT(ISERROR(A8))"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ xmin = xDialog.getChild("min")
+
+ self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Custom")
+ self.assertEqual(get_state_as_dict(xmin)["Text"], "NOT(ISERROR(A8))")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/validity/validity.py b/sc/qa/uitest/validity/validity.py
index dc36e96f87df..6215a47c16ed 100644
--- a/sc/qa/uitest/validity/validity.py
+++ b/sc/qa/uitest/validity/validity.py
@@ -14,125 +14,119 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class validity(UITestCase):
def test_validity_tab_criteria(self):
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
-
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- xdata = xDialog.getChild("data")
- xmin = xDialog.getChild("min")
- xmax = xDialog.getChild("max")
-
- select_by_text(xallow, "Whole Numbers")
- xallowempty.executeAction("CLICK", tuple())
- select_by_text(xdata, "valid range")
- xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- xmax.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #reopen and verify
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xallow = xDialog.getChild("allow")
- xallowempty = xDialog.getChild("allowempty")
- xdata = xDialog.getChild("data")
- xmin = xDialog.getChild("min")
- xmax = xDialog.getChild("max")
-
- self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Whole Numbers")
- self.assertEqual(get_state_as_dict(xallowempty)["Selected"], "false")
- self.assertEqual(get_state_as_dict(xdata)["SelectEntryText"], "valid range")
- self.assertEqual(get_state_as_dict(xmin)["Text"], "1")
- self.assertEqual(get_state_as_dict(xmax)["Text"], "2")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ xdata = xDialog.getChild("data")
+ xmin = xDialog.getChild("min")
+ xmax = xDialog.getChild("max")
+
+ select_by_text(xallow, "Whole Numbers")
+ xallowempty.executeAction("CLICK", tuple())
+ select_by_text(xdata, "valid range")
+ xmin.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ xmax.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #reopen and verify
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xallow = xDialog.getChild("allow")
+ xallowempty = xDialog.getChild("allowempty")
+ xdata = xDialog.getChild("data")
+ xmin = xDialog.getChild("min")
+ xmax = xDialog.getChild("max")
+
+ self.assertEqual(get_state_as_dict(xallow)["SelectEntryText"], "Whole Numbers")
+ self.assertEqual(get_state_as_dict(xallowempty)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(xdata)["SelectEntryText"], "valid range")
+ self.assertEqual(get_state_as_dict(xmin)["Text"], "1")
+ self.assertEqual(get_state_as_dict(xmax)["Text"], "2")
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
def test_validity_tab_inputHelp(self):
#validationhelptabpage.ui
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
-
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- xtsbhelp = xDialog.getChild("tsbhelp")
- xtitle = xDialog.getChild("title")
- xinputhelp = xDialog.getChild("inputhelp")
-
- xtsbhelp.executeAction("CLICK", tuple())
- xtitle.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
- xinputhelp.executeAction("TYPE", mkPropertyValues({"TEXT":"B"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #reopen and verify
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- xtsbhelp = xDialog.getChild("tsbhelp")
- xtitle = xDialog.getChild("title")
- xinputhelp = xDialog.getChild("inputhelp")
- # print(get_state_as_dict(xtsbhelp))
- select_pos(xTabs, "1")
- self.assertEqual(get_state_as_dict(xtsbhelp)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xtitle)["Text"], "A")
- self.assertEqual(get_state_as_dict(xinputhelp)["Text"], "B")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ xtsbhelp = xDialog.getChild("tsbhelp")
+ xtitle = xDialog.getChild("title")
+ xinputhelp = xDialog.getChild("inputhelp")
+
+ xtsbhelp.executeAction("CLICK", tuple())
+ xtitle.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
+ xinputhelp.executeAction("TYPE", mkPropertyValues({"TEXT":"B"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #reopen and verify
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ xtsbhelp = xDialog.getChild("tsbhelp")
+ xtitle = xDialog.getChild("title")
+ xinputhelp = xDialog.getChild("inputhelp")
+ # print(get_state_as_dict(xtsbhelp))
+ select_pos(xTabs, "1")
+ self.assertEqual(get_state_as_dict(xtsbhelp)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xtitle)["Text"], "A")
+ self.assertEqual(get_state_as_dict(xinputhelp)["Text"], "B")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
def test_validity_tab_errorAlert(self):
# erroralerttabpage.ui
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
-
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
-
- xactionCB = xDialog.getChild("actionCB")
- xerroralerttitle = xDialog.getChild("erroralert_title")
- xerrorMsg = xDialog.getChild("errorMsg")
-
- select_by_text(xactionCB, "Warning")
- xerroralerttitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Warn"}))
- xerrorMsg.executeAction("TYPE", mkPropertyValues({"TEXT":"Warn2"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #reopen and verify
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "2")
-
- xactionCB = xDialog.getChild("actionCB")
- xerroralerttitle = xDialog.getChild("erroralert_title")
- xerrorMsg = xDialog.getChild("errorMsg")
-
- self.assertEqual(get_state_as_dict(xactionCB)["SelectEntryText"], "Warning")
- self.assertEqual(get_state_as_dict(xerroralerttitle)["Text"], "Warn")
- self.assertEqual(get_state_as_dict(xerrorMsg)["Text"], "Warn2")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+
+ xactionCB = xDialog.getChild("actionCB")
+ xerroralerttitle = xDialog.getChild("erroralert_title")
+ xerrorMsg = xDialog.getChild("errorMsg")
+
+ select_by_text(xactionCB, "Warning")
+ xerroralerttitle.executeAction("TYPE", mkPropertyValues({"TEXT":"Warn"}))
+ xerrorMsg.executeAction("TYPE", mkPropertyValues({"TEXT":"Warn2"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #reopen and verify
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "2")
+
+ xactionCB = xDialog.getChild("actionCB")
+ xerroralerttitle = xDialog.getChild("erroralert_title")
+ xerrorMsg = xDialog.getChild("errorMsg")
+
+ self.assertEqual(get_state_as_dict(xactionCB)["SelectEntryText"], "Warning")
+ self.assertEqual(get_state_as_dict(xerroralerttitle)["Text"], "Warn")
+ self.assertEqual(get_state_as_dict(xerrorMsg)["Text"], "Warn2")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab: