summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-06-21 16:21:30 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-22 14:46:39 +0200
commitbe0a41679fea524e0935dc6617b5e65349812dd1 (patch)
treef14372226d5054c045f954e38ea09da5c412215b /sc
parent14069d84174ca7a4e60db4d75912903e9679b643 (diff)
uitest: guard load_file
Mostly done by a script for motivation, see 89aaa17a0a4413f07da2bc5084b0164f15dc01ac < UITest: introduce guarded context managers > Change-Id: Ia924293dc2a12230fd13f69fd734875ced86be8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117593 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/uitest/autofilter/autofilter.py561
-rw-r--r--sc/qa/uitest/autofilter/autofilterBugs.py298
-rw-r--r--sc/qa/uitest/autofilter/tdf101165.py21
-rw-r--r--sc/qa/uitest/autofilter/tdf117276.py161
-rw-r--r--sc/qa/uitest/autofilter/tdf122260.py46
-rw-r--r--sc/qa/uitest/autofilter/tdf130070.py77
-rw-r--r--sc/qa/uitest/autofilter/tdf140754.py132
-rw-r--r--sc/qa/uitest/autofilter/tdf92767.py72
-rw-r--r--sc/qa/uitest/autofilter/tdf97340.py39
-rw-r--r--sc/qa/uitest/calc_tests/autofill.py208
-rw-r--r--sc/qa/uitest/calc_tests/autosum.py414
-rw-r--r--sc/qa/uitest/calc_tests/mergedRowsColumns.py315
-rw-r--r--sc/qa/uitest/calc_tests/tdf133855.py50
-rw-r--r--sc/qa/uitest/calc_tests2/consolidate.py178
-rw-r--r--sc/qa/uitest/calc_tests2/standardFilter.py233
-rw-r--r--sc/qa/uitest/calc_tests2/tdf114992.py26
-rw-r--r--sc/qa/uitest/calc_tests2/tdf37623.py33
-rw-r--r--sc/qa/uitest/calc_tests3/tdf57274.py41
-rw-r--r--sc/qa/uitest/calc_tests3/tdf62267.py62
-rw-r--r--sc/qa/uitest/calc_tests3/tdf63805.py77
-rw-r--r--sc/qa/uitest/calc_tests3/tdf65856.py136
-rw-r--r--sc/qa/uitest/calc_tests3/tdf69981.py110
-rw-r--r--sc/qa/uitest/calc_tests3/tdf77509.py102
-rw-r--r--sc/qa/uitest/calc_tests4/tdf131170.py56
-rw-r--r--sc/qa/uitest/calc_tests4/tdf138089.py60
-rw-r--r--sc/qa/uitest/calc_tests4/tdf141547.py48
-rw-r--r--sc/qa/uitest/calc_tests4/tdf85403.py34
-rw-r--r--sc/qa/uitest/calc_tests4/tdf85979.py66
-rw-r--r--sc/qa/uitest/calc_tests4/tdf86253.py84
-rw-r--r--sc/qa/uitest/calc_tests4/tdf89958.py82
-rw-r--r--sc/qa/uitest/calc_tests4/tdf99386.py18
-rw-r--r--sc/qa/uitest/calc_tests4/textToColumns.py933
-rw-r--r--sc/qa/uitest/calc_tests4/trackedChanges.py76
-rw-r--r--sc/qa/uitest/calc_tests6/tdf107267.py102
-rw-r--r--sc/qa/uitest/calc_tests6/tdf107869.py136
-rw-r--r--sc/qa/uitest/calc_tests6/tdf118638.py74
-rw-r--r--sc/qa/uitest/calc_tests7/tdf122509.py63
-rw-r--r--sc/qa/uitest/calc_tests7/tdf124818.py21
-rw-r--r--sc/qa/uitest/calc_tests7/tdf124896.py23
-rw-r--r--sc/qa/uitest/calc_tests7/tdf137397.py30
-rw-r--r--sc/qa/uitest/calc_tests7/tdf31805.py45
-rw-r--r--sc/qa/uitest/calc_tests7/tdf91425.py35
-rw-r--r--sc/qa/uitest/calc_tests8/navigator.py207
-rw-r--r--sc/qa/uitest/calc_tests8/tdf114710.py50
-rw-r--r--sc/qa/uitest/calc_tests8/tdf119343.py25
-rw-r--r--sc/qa/uitest/calc_tests8/tdf124829.py21
-rw-r--r--sc/qa/uitest/calc_tests9/forms.py18
-rw-r--r--sc/qa/uitest/calc_tests9/pivotTable.py64
-rw-r--r--sc/qa/uitest/calc_tests9/tdf113571.py31
-rw-r--r--sc/qa/uitest/calc_tests9/tdf124318.py28
-rw-r--r--sc/qa/uitest/calc_tests9/tdf125440.py35
-rw-r--r--sc/qa/uitest/calc_tests9/tdf126673.py52
-rw-r--r--sc/qa/uitest/calc_tests9/tdf130371.py100
-rw-r--r--sc/qa/uitest/calc_tests9/tdf137446.py52
-rw-r--r--sc/qa/uitest/calc_tests9/tdf91217.py34
-rw-r--r--sc/qa/uitest/chart/chartArea.py299
-rw-r--r--sc/qa/uitest/chart/chartAxes.py79
-rw-r--r--sc/qa/uitest/chart/chartDataLabels.py563
-rw-r--r--sc/qa/uitest/chart/chartGrid.py425
-rw-r--r--sc/qa/uitest/chart/chartGrids.py151
-rw-r--r--sc/qa/uitest/chart/chartLegend.py4
-rw-r--r--sc/qa/uitest/chart/chartTitles.py197
-rw-r--r--sc/qa/uitest/chart/chartWall.py329
-rw-r--r--sc/qa/uitest/chart/chartXAxis.py483
-rw-r--r--sc/qa/uitest/chart/chartYAxis.py487
-rw-r--r--sc/qa/uitest/chart/copyPaste.py84
-rw-r--r--sc/qa/uitest/chart/formatDataSeries.py181
-rw-r--r--sc/qa/uitest/chart/tdf101894.py120
-rw-r--r--sc/qa/uitest/chart/tdf107097.py68
-rw-r--r--sc/qa/uitest/chart/tdf120348.py65
-rw-r--r--sc/qa/uitest/chart/tdf122398.py135
-rw-r--r--sc/qa/uitest/chart/tdf123013.py75
-rw-r--r--sc/qa/uitest/chart/tdf123231.py111
-rw-r--r--sc/qa/uitest/chart/tdf123520.py107
-rw-r--r--sc/qa/uitest/chart/tdf124111.py95
-rw-r--r--sc/qa/uitest/chart/tdf129587.py63
-rw-r--r--sc/qa/uitest/chart/tdf133630.py75
-rw-r--r--sc/qa/uitest/chart/tdf134059.py34
-rw-r--r--sc/qa/uitest/chart/tdf136011.py43
-rw-r--r--sc/qa/uitest/chart/tdf43175.py46
-rw-r--r--sc/qa/uitest/chart/tdf62057.py60
-rw-r--r--sc/qa/uitest/chart/tdf62349.py42
-rw-r--r--sc/qa/uitest/chart/tdf93506_trendline.py889
-rw-r--r--sc/qa/uitest/chart/tdf96432.py101
-rw-r--r--sc/qa/uitest/chart/tdf98690.py42
-rw-r--r--sc/qa/uitest/chart/tdf99069.py93
-rw-r--r--sc/qa/uitest/conditional_format/tdf100793.py154
-rw-r--r--sc/qa/uitest/conditional_format/tdf104026.py20
-rw-r--r--sc/qa/uitest/conditional_format/tdf105544.py70
-rw-r--r--sc/qa/uitest/conditional_format/tdf117899.py59
-rw-r--r--sc/qa/uitest/conditional_format/tdf118206.py45
-rw-r--r--sc/qa/uitest/conditional_format/tdf81696.py43
-rw-r--r--sc/qa/uitest/conditional_format/tdf96453.py72
-rw-r--r--sc/qa/uitest/function_wizard/tdf123479.py41
-rw-r--r--sc/qa/uitest/goalSeek/goalSeek.py37
-rw-r--r--sc/qa/uitest/goalSeek/tdf37341.py35
-rw-r--r--sc/qa/uitest/goalSeek/tdf43693.py35
-rw-r--r--sc/qa/uitest/key_f4/tdf102525.py40
-rw-r--r--sc/qa/uitest/manual_tests/calc.py20
-rw-r--r--sc/qa/uitest/pageFormat/tdf123508.py65
-rw-r--r--sc/qa/uitest/range_name/tdf119954.py105
-rw-r--r--sc/qa/uitest/search_replace/replace.py59
-rw-r--r--sc/qa/uitest/search_replace/tdf132783.py28
-rw-r--r--sc/qa/uitest/search_replace/tdf35020.py55
-rw-r--r--sc/qa/uitest/search_replace/tdf39959.py61
-rw-r--r--sc/qa/uitest/search_replace/tdf44861.py62
-rw-r--r--sc/qa/uitest/solver/solver.py59
-rw-r--r--sc/qa/uitest/sort/sorting.py2
-rw-r--r--sc/qa/uitest/sort/stableSorting.py80
-rw-r--r--sc/qa/uitest/sort/subtotals.py230
-rw-r--r--sc/qa/uitest/sort/tdf105301.py54
-rw-r--r--sc/qa/uitest/sort/tdf49531.py79
-rw-r--r--sc/qa/uitest/sort/tdf53482.py58
-rw-r--r--sc/qa/uitest/sort/tdf54018.py54
-rw-r--r--sc/qa/uitest/sort/tdf57465.py54
-rw-r--r--sc/qa/uitest/sort/tdf91305.py2
-rw-r--r--sc/qa/uitest/sort/tdf95192.py54
-rw-r--r--sc/qa/uitest/sort/tdf99208.py84
-rw-r--r--sc/qa/uitest/sort/tdf99627.py54
-rw-r--r--sc/qa/uitest/statistics/regression.py29
-rw-r--r--sc/qa/uitest/statistics/tdf76731.py89
-rw-r--r--sc/qa/uitest/textCase/textCase.py51
-rw-r--r--sc/qa/uitest/validity/tdf137945.py28
123 files changed, 6769 insertions, 7039 deletions
diff --git a/sc/qa/uitest/autofilter/autofilter.py b/sc/qa/uitest/autofilter/autofilter.py
index 060ada717844..1b5bcb1f113f 100644
--- a/sc/qa/uitest/autofilter/autofilter.py
+++ b/sc/qa/uitest/autofilter/autofilter.py
@@ -14,122 +14,116 @@ from uitest.uihelper.calc import enter_text_to_cell
class AutofilterTest(UITestCase):
def test_tdf106214(self):
- doc = self.ui_test.load_file(get_url_for_data_file("autofilter.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("autofilter.ods")) as doc:
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_tree_box")
- xFirstEntry = xTreeList.getChild("0")
+ xTreeList = xCheckListMenu.getChild("check_tree_box")
+ xFirstEntry = xTreeList.getChild("0")
- xFirstEntry.executeAction("CLICK", tuple())
+ xFirstEntry.executeAction("CLICK", tuple())
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.assertFalse(is_row_hidden(doc, 0))
- self.assertFalse(is_row_hidden(doc, 1))
- self.assertFalse(is_row_hidden(doc, 2))
- self.assertTrue(is_row_hidden(doc, 3))
- self.assertFalse(is_row_hidden(doc, 4))
-
- self.ui_test.close_doc()
+ self.assertFalse(is_row_hidden(doc, 0))
+ self.assertFalse(is_row_hidden(doc, 1))
+ self.assertFalse(is_row_hidden(doc, 2))
+ self.assertTrue(is_row_hidden(doc, 3))
+ self.assertFalse(is_row_hidden(doc, 4))
def test_filter_multiple_rows(self):
- doc = self.ui_test.load_file(get_url_for_data_file("autofilter.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("autofilter.ods")) as doc:
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- xFirstEntry = xTreeList.getChild("1")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ xFirstEntry = xTreeList.getChild("1")
- xFirstEntry.executeAction("CLICK", tuple())
+ xFirstEntry.executeAction("CLICK", tuple())
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.assertFalse(is_row_hidden(doc, 0))
- self.assertFalse(is_row_hidden(doc, 1))
- self.assertTrue(is_row_hidden(doc, 2))
- self.assertTrue(is_row_hidden(doc, 3))
- self.assertFalse(is_row_hidden(doc, 4))
+ self.assertFalse(is_row_hidden(doc, 0))
+ self.assertFalse(is_row_hidden(doc, 1))
+ self.assertTrue(is_row_hidden(doc, 2))
+ self.assertTrue(is_row_hidden(doc, 3))
+ self.assertFalse(is_row_hidden(doc, 4))
def test_tdf133160(self):
- doc = self.ui_test.load_file(get_url_for_data_file("tdf133160.ods"))
-
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "3"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- size1 = int(get_state_as_dict(xTreeList)["Size"].split('x')[0])
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "3"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- size2 = int(get_state_as_dict(xTreeList)["Size"].split('x')[0])
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "3", "ROW": "3"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- size3 = int(get_state_as_dict(xTreeList)["Size"].split('x')[0])
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "4", "ROW": "3"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- size4 = int(get_state_as_dict(xTreeList)["Size"].split('x')[0])
-
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.assertTrue(size1 < size2) # for me they were size1=176 size2=212 size3=459 size4=1012
- self.assertTrue(size2 < size3) # size1 is the minimum window width, size2 based on its column width
- self.assertTrue(size3 < size4) # size3 is a long text width
- self.assertTrue(size4 < 1500) # size4 is the maximum window width with a really long text
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf133160.ods")) as doc:
+
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "3"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ size1 = int(get_state_as_dict(xTreeList)["Size"].split('x')[0])
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "3"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ size2 = int(get_state_as_dict(xTreeList)["Size"].split('x')[0])
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "3", "ROW": "3"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ size3 = int(get_state_as_dict(xTreeList)["Size"].split('x')[0])
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "4", "ROW": "3"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ size4 = int(get_state_as_dict(xTreeList)["Size"].split('x')[0])
+
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.assertTrue(size1 < size2) # for me they were size1=176 size2=212 size3=459 size4=1012
+ self.assertTrue(size2 < size3) # size1 is the minimum window width, size2 based on its column width
+ self.assertTrue(size3 < size4) # size3 is a long text width
+ self.assertTrue(size4 < 1500) # size4 is the maximum window width with a really long text
def test_tdf134351(self):
- doc = self.ui_test.load_file(get_url_for_data_file("autofilter.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("autofilter.ods")) as doc:
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_tree_box")
+ xTreeList = xCheckListMenu.getChild("check_tree_box")
- self.assertEqual(2, len(xTreeList.getChildren()))
- self.assertTrue(get_state_as_dict(xTreeList.getChild('0'))['IsSelected'])
- self.assertTrue(get_state_as_dict(xTreeList.getChild('1'))['IsSelected'])
+ self.assertEqual(2, len(xTreeList.getChildren()))
+ self.assertTrue(get_state_as_dict(xTreeList.getChild('0'))['IsSelected'])
+ self.assertTrue(get_state_as_dict(xTreeList.getChild('1'))['IsSelected'])
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.assertFalse(is_row_hidden(doc, 0))
- # Without the fix in place, this test would have failed here
- self.assertFalse(is_row_hidden(doc, 1))
- self.assertFalse(is_row_hidden(doc, 2))
- self.assertFalse(is_row_hidden(doc, 3))
- self.assertFalse(is_row_hidden(doc, 4))
-
- self.ui_test.close_doc()
+ self.assertFalse(is_row_hidden(doc, 0))
+ # Without the fix in place, this test would have failed here
+ self.assertFalse(is_row_hidden(doc, 1))
+ self.assertFalse(is_row_hidden(doc, 2))
+ self.assertFalse(is_row_hidden(doc, 3))
+ self.assertFalse(is_row_hidden(doc, 4))
def test_differentSearches(self):
self.ui_test.create_doc_in_start_center("calc")
@@ -229,165 +223,153 @@ class AutofilterTest(UITestCase):
self.ui_test.close_doc()
def test_tdf116818(self):
- doc = self.ui_test.load_file(get_url_for_data_file("tdf116818.xlsx"))
-
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
-
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_tree_box")
- self.assertEqual(3, len(xTreeList.getChildren()))
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(5, len(xTreeList.getChildren()))
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(3, len(xTreeList.getChildren()))
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf116818.xlsx")) as doc:
+
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_tree_box")
+ self.assertEqual(3, len(xTreeList.getChildren()))
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(5, len(xTreeList.getChildren()))
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(3, len(xTreeList.getChildren()))
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
def test_tdf140469(self):
- doc = self.ui_test.load_file(get_url_for_data_file("tdf140469.xlsx"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf140469.xlsx")) as doc:
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(9, len(xTreeList.getChildren()))
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(9, len(xTreeList.getChildren()))
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
def test_tdf140462(self):
- doc = self.ui_test.load_file(get_url_for_data_file("tdf140462.ods"))
-
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
-
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_tree_box")
- self.assertEqual(3, len(xTreeList.getChildren()))
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(3, len(xTreeList.getChildren()))
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(4, len(xTreeList.getChildren()))
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf140462.ods")) as doc:
+
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_tree_box")
+ self.assertEqual(3, len(xTreeList.getChildren()))
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(3, len(xTreeList.getChildren()))
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(4, len(xTreeList.getChildren()))
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
def test_tdf137626(self):
- doc = self.ui_test.load_file(get_url_for_data_file("tdf137626.xlsx"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf137626.xlsx")) as doc:
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(3, len(xTreeList.getChildren()))
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(3, len(xTreeList.getChildren()))
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
def test_time_value(self):
- doc = self.ui_test.load_file(get_url_for_data_file("time_value.xlsx"))
-
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
-
- 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('1'))['IsChecked'])
- self.assertEqual('true', get_state_as_dict(xTreeList.getChild('2'))['IsChecked'])
- self.assertEqual('false', get_state_as_dict(xTreeList.getChild('3'))['IsChecked'])
- self.assertEqual('true', get_state_as_dict(xTreeList.getChild('4'))['IsChecked'])
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(2, len(xTreeList.getChildren()))
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("time_value.xlsx")) as doc:
+
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+
+ 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('1'))['IsChecked'])
+ self.assertEqual('true', get_state_as_dict(xTreeList.getChild('2'))['IsChecked'])
+ self.assertEqual('false', get_state_as_dict(xTreeList.getChild('3'))['IsChecked'])
+ self.assertEqual('true', get_state_as_dict(xTreeList.getChild('4'))['IsChecked'])
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(2, len(xTreeList.getChildren()))
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
def test_tdf140968(self):
- doc = self.ui_test.load_file(get_url_for_data_file("tdf140968.xlsx"))
-
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
-
- 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("0.000", get_state_as_dict(xTreeList.getChild('0'))['Text'])
- self.assertEqual("0.046", get_state_as_dict(xTreeList.getChild('1'))['Text'])
- self.assertEqual("0.365", get_state_as_dict(xTreeList.getChild('2'))['Text'])
- self.assertEqual("0.500", get_state_as_dict(xTreeList.getChild('3'))['Text'])
- self.assertEqual("0.516", get_state_as_dict(xTreeList.getChild('4'))['Text'])
-
- self.assertEqual('false', get_state_as_dict(xTreeList.getChild('0'))['IsChecked'])
- self.assertEqual('true', get_state_as_dict(xTreeList.getChild('1'))['IsChecked'])
- self.assertEqual('false', get_state_as_dict(xTreeList.getChild('2'))['IsChecked'])
- self.assertEqual('true', get_state_as_dict(xTreeList.getChild('3'))['IsChecked'])
- self.assertEqual('true', get_state_as_dict(xTreeList.getChild('4'))['IsChecked'])
-
- xFirstEntry = xTreeList.getChild("0")
- xFirstEntry.executeAction("CLICK", tuple())
- xFirstEntry = xTreeList.getChild("1")
- xFirstEntry.executeAction("CLICK", tuple())
-
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.assertFalse(is_row_hidden(doc, 0))
- self.assertTrue(is_row_hidden(doc, 1))
- self.assertTrue(is_row_hidden(doc, 2))
- self.assertTrue(is_row_hidden(doc, 3))
- self.assertTrue(is_row_hidden(doc, 4))
- self.assertFalse(is_row_hidden(doc, 5))
- self.assertFalse(is_row_hidden(doc, 6))
- self.assertFalse(is_row_hidden(doc, 7))
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf140968.xlsx")) as doc:
+
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+
+ 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("0.000", get_state_as_dict(xTreeList.getChild('0'))['Text'])
+ self.assertEqual("0.046", get_state_as_dict(xTreeList.getChild('1'))['Text'])
+ self.assertEqual("0.365", get_state_as_dict(xTreeList.getChild('2'))['Text'])
+ self.assertEqual("0.500", get_state_as_dict(xTreeList.getChild('3'))['Text'])
+ self.assertEqual("0.516", get_state_as_dict(xTreeList.getChild('4'))['Text'])
+
+ self.assertEqual('false', get_state_as_dict(xTreeList.getChild('0'))['IsChecked'])
+ self.assertEqual('true', get_state_as_dict(xTreeList.getChild('1'))['IsChecked'])
+ self.assertEqual('false', get_state_as_dict(xTreeList.getChild('2'))['IsChecked'])
+ self.assertEqual('true', get_state_as_dict(xTreeList.getChild('3'))['IsChecked'])
+ self.assertEqual('true', get_state_as_dict(xTreeList.getChild('4'))['IsChecked'])
+
+ xFirstEntry = xTreeList.getChild("0")
+ xFirstEntry.executeAction("CLICK", tuple())
+ xFirstEntry = xTreeList.getChild("1")
+ xFirstEntry.executeAction("CLICK", tuple())
+
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.assertFalse(is_row_hidden(doc, 0))
+ self.assertTrue(is_row_hidden(doc, 1))
+ self.assertTrue(is_row_hidden(doc, 2))
+ self.assertTrue(is_row_hidden(doc, 3))
+ self.assertTrue(is_row_hidden(doc, 4))
+ self.assertFalse(is_row_hidden(doc, 5))
+ self.assertFalse(is_row_hidden(doc, 6))
+ self.assertFalse(is_row_hidden(doc, 7))
def test_tdf142350(self):
self.ui_test.create_doc_in_start_center("calc")
@@ -440,64 +422,61 @@ class AutofilterTest(UITestCase):
self.ui_test.close_doc()
def test_tdf138438(self):
- doc = self.ui_test.load_file(get_url_for_data_file("tdf138438.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf138438.ods")) as doc:
+
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+
+ # Top 10 filer
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "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"}))
+
+ self.assertFalse(is_row_hidden(doc, 0))
+ self.assertTrue(is_row_hidden(doc, 1))
+ self.assertTrue(is_row_hidden(doc, 2))
+ self.assertFalse(is_row_hidden(doc, 3))
+ self.assertFalse(is_row_hidden(doc, 4))
+ self.assertFalse(is_row_hidden(doc, 5))
+ self.assertFalse(is_row_hidden(doc, 6))
+ self.assertTrue(is_row_hidden(doc, 7))
+ self.assertFalse(is_row_hidden(doc, 8))
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ def test_tdf142402(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf140968.xlsx")) as doc:
- # Top 10 filer
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "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"}))
-
- self.assertFalse(is_row_hidden(doc, 0))
- self.assertTrue(is_row_hidden(doc, 1))
- self.assertTrue(is_row_hidden(doc, 2))
- self.assertFalse(is_row_hidden(doc, 3))
- self.assertFalse(is_row_hidden(doc, 4))
- self.assertFalse(is_row_hidden(doc, 5))
- self.assertFalse(is_row_hidden(doc, 6))
- self.assertTrue(is_row_hidden(doc, 7))
- self.assertFalse(is_row_hidden(doc, 8))
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- self.ui_test.close_doc()
+ xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ #Choose Standard Filter... button
+ xMenu = xFloatWindow.getChild("menu")
- def test_tdf142402(self):
- doc = self.ui_test.load_file(get_url_for_data_file("tdf140968.xlsx"))
+ 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":"RETURN"}))
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xval1 = xDialog.getChild("val1")
- xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- #Choose Standard Filter... button
- 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":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"}))
- xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
-
- xDialog = self.xUITest.getTopFocusWindow()
- xval1 = xDialog.getChild("val1")
-
- select_by_text(xval1, "0.365")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertFalse(is_row_hidden(doc, 0))
- self.assertFalse(is_row_hidden(doc, 1))
- self.assertTrue(is_row_hidden(doc, 2))
- self.assertTrue(is_row_hidden(doc, 3))
- self.assertTrue(is_row_hidden(doc, 4))
- self.assertTrue(is_row_hidden(doc, 5))
- self.assertTrue(is_row_hidden(doc, 6))
+ select_by_text(xval1, "0.365")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertFalse(is_row_hidden(doc, 0))
+ self.assertFalse(is_row_hidden(doc, 1))
+ self.assertTrue(is_row_hidden(doc, 2))
+ self.assertTrue(is_row_hidden(doc, 3))
+ self.assertTrue(is_row_hidden(doc, 4))
+ self.assertTrue(is_row_hidden(doc, 5))
+ self.assertTrue(is_row_hidden(doc, 6))
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/autofilterBugs.py b/sc/qa/uitest/autofilter/autofilterBugs.py
index fabde9aabce9..ffb6419690ea 100644
--- a/sc/qa/uitest/autofilter/autofilterBugs.py
+++ b/sc/qa/uitest/autofilter/autofilterBugs.py
@@ -12,20 +12,18 @@ from uitest.uihelper.calc import enter_text_to_cell
class autofilter(UITestCase):
def test_tdf115046(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf115046.ods"))
- document = self.ui_test.get_component()
- #autofilter exist
- self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
-
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
+ with self.ui_test.load_file(get_url_for_data_file("tdf115046.ods")) as calc_doc:
+ document = self.ui_test.get_component()
+ #autofilter exist
+ self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
- xcancBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancBtn)
- #autofilter still exist
- self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
- self.ui_test.close_doc()
+ xcancBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xcancBtn)
+ #autofilter still exist
+ self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
def test_tdf94055(self):
self.ui_test.create_doc_in_start_center("calc")
@@ -59,181 +57,165 @@ class autofilter(UITestCase):
#tdf77479.ods
def test_tdf77479(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf77479.ods"))
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = calcDoc.getChild("grid_window")
- #autofilter exist
- self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
-
- xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:E6"}))
-
- 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.load_file(get_url_for_data_file("tdf77479.ods")) as calc_doc:
+ document = self.ui_test.get_component()
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = calcDoc.getChild("grid_window")
+ #autofilter exist
+ self.assertEqual(document.getPropertyValue("UnnamedDatabaseRanges").getByTable(0).AutoFilter, True)
+
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:E6"}))
+
+ 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)
#112656
def test_tdf112656(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf112656.ods"))
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = calcDoc.getChild("grid_window")
-
- xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xTreeList = xFloatWindow.getChild("check_list_box")
- xFirstEntry = xTreeList.getChild("0")
- xSecondEntry = xTreeList.getChild("1")
- self.assertEqual(get_state_as_dict(xFirstEntry)["Text"], "Fruit")
- self.assertEqual(get_state_as_dict(xSecondEntry)["Text"], "Vegetables")
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf112656.ods")) as calc_doc:
+ document = self.ui_test.get_component()
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = calcDoc.getChild("grid_window")
+
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xTreeList = xFloatWindow.getChild("check_list_box")
+ xFirstEntry = xTreeList.getChild("0")
+ xSecondEntry = xTreeList.getChild("1")
+ self.assertEqual(get_state_as_dict(xFirstEntry)["Text"], "Fruit")
+ self.assertEqual(get_state_as_dict(xSecondEntry)["Text"], "Vegetables")
#tdf81124
def test_tdf81124(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf81124.ods"))
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = calcDoc.getChild("grid_window")
-
- xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
+ with self.ui_test.load_file(get_url_for_data_file("tdf81124.ods")) as calc_doc:
+ document = self.ui_test.get_component()
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = calcDoc.getChild("grid_window")
- xUnselect = xFloatWindow.getChild("unselect_current")
- xUnselect.executeAction("CLICK", tuple())
- xokBtn = xFloatWindow.getChild("ok")
- self.assertEqual(get_state_as_dict(xokBtn)["Enabled"], "false")
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
- xSelect = xFloatWindow.getChild("select_current")
- xSelect.executeAction("CLICK", tuple())
- xokBtn = xFloatWindow.getChild("ok")
- self.assertEqual(get_state_as_dict(xokBtn)["Enabled"], "true")
+ xUnselect = xFloatWindow.getChild("unselect_current")
+ xUnselect.executeAction("CLICK", tuple())
+ xokBtn = xFloatWindow.getChild("ok")
+ self.assertEqual(get_state_as_dict(xokBtn)["Enabled"], "false")
- xCancel = xFloatWindow.getChild("cancel")
- xCancel.executeAction("CLICK", tuple())
+ xSelect = xFloatWindow.getChild("select_current")
+ xSelect.executeAction("CLICK", tuple())
+ xokBtn = xFloatWindow.getChild("ok")
+ self.assertEqual(get_state_as_dict(xokBtn)["Enabled"], "true")
- self.ui_test.close_doc()
+ xCancel = xFloatWindow.getChild("cancel")
+ xCancel.executeAction("CLICK", tuple())
#tdf73565
def test_tdf73565(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf73565.ods"))
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = calcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf73565.ods")) as calc_doc:
+ document = self.ui_test.get_component()
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = calcDoc.getChild("grid_window")
- xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xTreeList = xFloatWindow.getChild("check_tree_box")
- xFirstEntry = xTreeList.getChild("0")
- self.assertEqual(get_state_as_dict(xFirstEntry)["Text"], "2014")
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xTreeList = xFloatWindow.getChild("check_tree_box")
+ xFirstEntry = xTreeList.getChild("0")
+ self.assertEqual(get_state_as_dict(xFirstEntry)["Text"], "2014")
- xCancel = xFloatWindow.getChild("cancel")
- xCancel.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ xCancel = xFloatWindow.getChild("cancel")
+ xCancel.executeAction("CLICK", tuple())
#tdf65505
def test_tdf65505(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf81124.ods"))
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = calcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf81124.ods")) as calc_doc:
+ document = self.ui_test.get_component()
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = calcDoc.getChild("grid_window")
- xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xTreeList = xFloatWindow.getChild("check_list_box")
- xFirstEntry = xTreeList.getChild("0")
- self.assertEqual(get_state_as_dict(xFirstEntry)["Text"], "(empty)")
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xTreeList = xFloatWindow.getChild("check_list_box")
+ xFirstEntry = xTreeList.getChild("0")
+ self.assertEqual(get_state_as_dict(xFirstEntry)["Text"], "(empty)")
- xCancel = xFloatWindow.getChild("cancel")
- xCancel.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ xCancel = xFloatWindow.getChild("cancel")
+ xCancel.executeAction("CLICK", tuple())
#tdf74857
def test_tdf74857(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf74857.ods"))
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = calcDoc.getChild("grid_window")
-
- xGridWindow.executeAction("TYPE", mkPropertyValues({"KEYCODE":"SHIFT+CTRL+DOWN"}))
- # Assert that the correct range has been selected
- gridWinState = get_state_as_dict(xGridWindow)
- self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A1:Sheet1.A25")
+ with self.ui_test.load_file(get_url_for_data_file("tdf74857.ods")) as calc_doc:
+ document = self.ui_test.get_component()
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = calcDoc.getChild("grid_window")
- self.ui_test.close_doc()
+ xGridWindow.executeAction("TYPE", mkPropertyValues({"KEYCODE":"SHIFT+CTRL+DOWN"}))
+ # Assert that the correct range has been selected
+ gridWinState = get_state_as_dict(xGridWindow)
+ self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A1:Sheet1.A25")
#tdf35294
def test_tdf35294(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf35294.ods"))
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = calcDoc.getChild("grid_window")
-
- xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xTreeList = xFloatWindow.getChild("check_list_box")
- x1Entry = xTreeList.getChild("0")
- x2Entry = xTreeList.getChild("1")
- x3Entry = xTreeList.getChild("2")
- x4Entry = xTreeList.getChild("3")
- x5Entry = xTreeList.getChild("4")
- x6Entry = xTreeList.getChild("5")
- x7Entry = xTreeList.getChild("6")
-
- self.assertEqual(get_state_as_dict(x1Entry)["Text"], "a")
- self.assertEqual(get_state_as_dict(x2Entry)["Text"], "á")
- self.assertEqual(get_state_as_dict(x3Entry)["Text"], "b")
- self.assertEqual(get_state_as_dict(x4Entry)["Text"], "č")
- self.assertEqual(get_state_as_dict(x5Entry)["Text"], "é")
- self.assertEqual(get_state_as_dict(x6Entry)["Text"], "ř")
- self.assertEqual(get_state_as_dict(x7Entry)["Text"], "ž")
-
- xCancel = xFloatWindow.getChild("cancel")
- xCancel.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf35294.ods")) as calc_doc:
+ document = self.ui_test.get_component()
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = calcDoc.getChild("grid_window")
+
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xTreeList = xFloatWindow.getChild("check_list_box")
+ x1Entry = xTreeList.getChild("0")
+ x2Entry = xTreeList.getChild("1")
+ x3Entry = xTreeList.getChild("2")
+ x4Entry = xTreeList.getChild("3")
+ x5Entry = xTreeList.getChild("4")
+ x6Entry = xTreeList.getChild("5")
+ x7Entry = xTreeList.getChild("6")
+
+ self.assertEqual(get_state_as_dict(x1Entry)["Text"], "a")
+ self.assertEqual(get_state_as_dict(x2Entry)["Text"], "á")
+ self.assertEqual(get_state_as_dict(x3Entry)["Text"], "b")
+ self.assertEqual(get_state_as_dict(x4Entry)["Text"], "č")
+ self.assertEqual(get_state_as_dict(x5Entry)["Text"], "é")
+ self.assertEqual(get_state_as_dict(x6Entry)["Text"], "ř")
+ self.assertEqual(get_state_as_dict(x7Entry)["Text"], "ž")
+
+ xCancel = xFloatWindow.getChild("cancel")
+ xCancel.executeAction("CLICK", tuple())
#tdf55712
def test_tdf55712(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf55712.ods"))
- document = self.ui_test.get_component()
- calcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = calcDoc.getChild("grid_window")
-
- xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xTreeList = xFloatWindow.getChild("check_list_box")
- x1Entry = xTreeList.getChild("0")
- x2Entry = xTreeList.getChild("1")
- x3Entry = xTreeList.getChild("2")
- x4Entry = xTreeList.getChild("3")
- x5Entry = xTreeList.getChild("4")
- x6Entry = xTreeList.getChild("5")
- x7Entry = xTreeList.getChild("6")
- x8Entry = xTreeList.getChild("7")
- x9Entry = xTreeList.getChild("8")
-
- self.assertEqual(get_state_as_dict(x1Entry)["Text"], "(empty)")
- self.assertEqual(get_state_as_dict(x2Entry)["Text"], "0")
- self.assertEqual(get_state_as_dict(x3Entry)["Text"], "0.1")
- self.assertEqual(get_state_as_dict(x4Entry)["Text"], "0.2")
- self.assertEqual(get_state_as_dict(x5Entry)["Text"], "0.3")
- self.assertEqual(get_state_as_dict(x6Entry)["Text"], "0.5")
- self.assertEqual(get_state_as_dict(x7Entry)["Text"], "0.8")
- self.assertEqual(get_state_as_dict(x8Entry)["Text"], "0.9")
- self.assertEqual(get_state_as_dict(x9Entry)["Text"], "1")
- self.assertEqual(get_state_as_dict(xTreeList)["Children"], "9")
-
- xCancel = xFloatWindow.getChild("cancel")
- xCancel.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf55712.ods")) as calc_doc:
+ document = self.ui_test.get_component()
+ calcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = calcDoc.getChild("grid_window")
+
+ xGridWindow.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xTreeList = xFloatWindow.getChild("check_list_box")
+ x1Entry = xTreeList.getChild("0")
+ x2Entry = xTreeList.getChild("1")
+ x3Entry = xTreeList.getChild("2")
+ x4Entry = xTreeList.getChild("3")
+ x5Entry = xTreeList.getChild("4")
+ x6Entry = xTreeList.getChild("5")
+ x7Entry = xTreeList.getChild("6")
+ x8Entry = xTreeList.getChild("7")
+ x9Entry = xTreeList.getChild("8")
+
+ self.assertEqual(get_state_as_dict(x1Entry)["Text"], "(empty)")
+ self.assertEqual(get_state_as_dict(x2Entry)["Text"], "0")
+ self.assertEqual(get_state_as_dict(x3Entry)["Text"], "0.1")
+ self.assertEqual(get_state_as_dict(x4Entry)["Text"], "0.2")
+ self.assertEqual(get_state_as_dict(x5Entry)["Text"], "0.3")
+ self.assertEqual(get_state_as_dict(x6Entry)["Text"], "0.5")
+ self.assertEqual(get_state_as_dict(x7Entry)["Text"], "0.8")
+ self.assertEqual(get_state_as_dict(x8Entry)["Text"], "0.9")
+ self.assertEqual(get_state_as_dict(x9Entry)["Text"], "1")
+ self.assertEqual(get_state_as_dict(xTreeList)["Children"], "9")
+
+ xCancel = xFloatWindow.getChild("cancel")
+ xCancel.executeAction("CLICK", tuple())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf101165.py b/sc/qa/uitest/autofilter/tdf101165.py
index 1eda0193b69c..e71820e53e0a 100644
--- a/sc/qa/uitest/autofilter/tdf101165.py
+++ b/sc/qa/uitest/autofilter/tdf101165.py
@@ -13,17 +13,16 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf101165(UITestCase):
def test_tdf101165_autofilter(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf101165.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf101165.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xAll = xFloatWindow.getChild("toggle_all")
- xAll.executeAction("CLICK", tuple())
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xAll = xFloatWindow.getChild("toggle_all")
+ xAll.executeAction("CLICK", tuple())
- self.assertEqual(get_cell_by_position(document, 1, 0, 1).getValue(), 6494)
+ self.assertEqual(get_cell_by_position(document, 1, 0, 1).getValue(), 6494)
- self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf117276.py b/sc/qa/uitest/autofilter/tdf117276.py
index 9f2fa71ee69a..fdd5e91b7f83 100644
--- a/sc/qa/uitest/autofilter/tdf117276.py
+++ b/sc/qa/uitest/autofilter/tdf117276.py
@@ -13,85 +13,84 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf117276(UITestCase):
def test_tdf117276_autofilter(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf117276.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- # 1. open attached file
- # 2. open filter of column B (Fabrikat) and deselect (Citroen, Fiat, Ford, Opel, Peugeot, Renault, Tesla)
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
-
- xCitroenEntry = xTreeList.getChild("2")
- xCitroenEntry.executeAction("CLICK", tuple()) #Citroen
- xFiatEntry = xTreeList.getChild("3")
- xFiatEntry.executeAction("CLICK", tuple()) #Fiat
- xFordEntry = xTreeList.getChild("4")
- xFordEntry.executeAction("CLICK", tuple()) #Ford
- xOpelEntry = xTreeList.getChild("6")
- xOpelEntry.executeAction("CLICK", tuple()) #Opel
- xPeugeotEntry = xTreeList.getChild("7")
- xPeugeotEntry.executeAction("CLICK", tuple()) #Peugeot
- xRenaultEntry = xTreeList.getChild("9")
- xRenaultEntry.executeAction("CLICK", tuple()) #Renault
- xTeslaEntry = xTreeList.getChild("10")
- xTeslaEntry.executeAction("CLICK", tuple()) #Tesla
-
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.assertFalse(is_row_hidden(calc_doc, 0))
- self.assertFalse(is_row_hidden(calc_doc, 1))
- self.assertTrue(is_row_hidden(calc_doc, 3))
-
- # 3. open filter of column I (Wert) and deselect 8000 (Values 7000 and 9000 are not shown)
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "8", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
-
- xCitroenEntry = xTreeList.getChild("0")
- xCitroenEntry.executeAction("CLICK", tuple())
-
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.assertFalse(is_row_hidden(calc_doc, 0))
- self.assertFalse(is_row_hidden(calc_doc, 1))
- self.assertTrue(is_row_hidden(calc_doc, 9))
-
- # 4. open filter of column B and select Tesla
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
- xTeslaEntry = xTreeList.getChild("4")
- xTeslaEntry.executeAction("CLICK", tuple()) #Tesla
-
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
- self.assertFalse(is_row_hidden(calc_doc, 0))
- self.assertFalse(is_row_hidden(calc_doc, 1))
- self.assertFalse(is_row_hidden(calc_doc, 21))
-
- # 5. open filter of column I and select 7000 --> 8000 because:new strategy of the filter is implemented
- #(which strings to show and which to hide, when multiple filters are in used).
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "8", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_list_box")
-
- x8000Entry = xTreeList.getChild("1") # check "8000"
- x8000Entry.executeAction("CLICK", tuple())
-
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.assertFalse(is_row_hidden(calc_doc, 0))
- self.assertFalse(is_row_hidden(calc_doc, 1))
- self.assertFalse(is_row_hidden(calc_doc, 7))
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf117276.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ # 1. open attached file
+ # 2. open filter of column B (Fabrikat) and deselect (Citroen, Fiat, Ford, Opel, Peugeot, Renault, Tesla)
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+
+ xCitroenEntry = xTreeList.getChild("2")
+ xCitroenEntry.executeAction("CLICK", tuple()) #Citroen
+ xFiatEntry = xTreeList.getChild("3")
+ xFiatEntry.executeAction("CLICK", tuple()) #Fiat
+ xFordEntry = xTreeList.getChild("4")
+ xFordEntry.executeAction("CLICK", tuple()) #Ford
+ xOpelEntry = xTreeList.getChild("6")
+ xOpelEntry.executeAction("CLICK", tuple()) #Opel
+ xPeugeotEntry = xTreeList.getChild("7")
+ xPeugeotEntry.executeAction("CLICK", tuple()) #Peugeot
+ xRenaultEntry = xTreeList.getChild("9")
+ xRenaultEntry.executeAction("CLICK", tuple()) #Renault
+ xTeslaEntry = xTreeList.getChild("10")
+ xTeslaEntry.executeAction("CLICK", tuple()) #Tesla
+
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.assertFalse(is_row_hidden(calc_doc, 0))
+ self.assertFalse(is_row_hidden(calc_doc, 1))
+ self.assertTrue(is_row_hidden(calc_doc, 3))
+
+ # 3. open filter of column I (Wert) and deselect 8000 (Values 7000 and 9000 are not shown)
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "8", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+
+ xCitroenEntry = xTreeList.getChild("0")
+ xCitroenEntry.executeAction("CLICK", tuple())
+
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.assertFalse(is_row_hidden(calc_doc, 0))
+ self.assertFalse(is_row_hidden(calc_doc, 1))
+ self.assertTrue(is_row_hidden(calc_doc, 9))
+
+ # 4. open filter of column B and select Tesla
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "1", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+ xTeslaEntry = xTreeList.getChild("4")
+ xTeslaEntry.executeAction("CLICK", tuple()) #Tesla
+
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+ self.assertFalse(is_row_hidden(calc_doc, 0))
+ self.assertFalse(is_row_hidden(calc_doc, 1))
+ self.assertFalse(is_row_hidden(calc_doc, 21))
+
+ # 5. open filter of column I and select 7000 --> 8000 because:new strategy of the filter is implemented
+ #(which strings to show and which to hide, when multiple filters are in used).
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "8", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_list_box")
+
+ x8000Entry = xTreeList.getChild("1") # check "8000"
+ x8000Entry.executeAction("CLICK", tuple())
+
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.assertFalse(is_row_hidden(calc_doc, 0))
+ self.assertFalse(is_row_hidden(calc_doc, 1))
+ self.assertFalse(is_row_hidden(calc_doc, 7))
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf122260.py b/sc/qa/uitest/autofilter/tdf122260.py
index 00c141e3195f..fb2c905e3844 100644
--- a/sc/qa/uitest/autofilter/tdf122260.py
+++ b/sc/qa/uitest/autofilter/tdf122260.py
@@ -59,29 +59,27 @@ class tdf122260(UITestCase):
return valuesCount
def test_tdf122260_autofilter(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf122260.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- self.assertIsNotNone(gridwin)
-
- # filter out b1
- self.check_value_in_AutoFilter(gridwin, "1", "0")
- # filter out a2 (as a1 is filtered out a2 is the first item)
- self.check_value_in_AutoFilter(gridwin, "0", "0")
- # return back a2 (as a1 is filtered out a2 is the first item)
- self.check_value_in_AutoFilter(gridwin, "0", "0")
-
- # check rows visibility
- # row-0 is row with headers
- self.assertTrue(is_row_hidden(calc_doc, 1))
- self.assertFalse(is_row_hidden(calc_doc, 2))
- self.assertFalse(is_row_hidden(calc_doc, 3))
- self.assertFalse(is_row_hidden(calc_doc, 4))
-
- # check if "b1" is accessible in filter of the column-b
- # (so all values of the column B are available)
- self.assertEqual(4, self.get_values_count_in_AutoFilter(gridwin, "1"))
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf122260.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ self.assertIsNotNone(gridwin)
+
+ # filter out b1
+ self.check_value_in_AutoFilter(gridwin, "1", "0")
+ # filter out a2 (as a1 is filtered out a2 is the first item)
+ self.check_value_in_AutoFilter(gridwin, "0", "0")
+ # return back a2 (as a1 is filtered out a2 is the first item)
+ self.check_value_in_AutoFilter(gridwin, "0", "0")
+
+ # check rows visibility
+ # row-0 is row with headers
+ self.assertTrue(is_row_hidden(calc_doc, 1))
+ self.assertFalse(is_row_hidden(calc_doc, 2))
+ self.assertFalse(is_row_hidden(calc_doc, 3))
+ self.assertFalse(is_row_hidden(calc_doc, 4))
+
+ # check if "b1" is accessible in filter of the column-b
+ # (so all values of the column B are available)
+ self.assertEqual(4, self.get_values_count_in_AutoFilter(gridwin, "1"))
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf130070.py b/sc/qa/uitest/autofilter/tdf130070.py
index 227355626a75..1ea4b8fbaf9c 100644
--- a/sc/qa/uitest/autofilter/tdf130070.py
+++ b/sc/qa/uitest/autofilter/tdf130070.py
@@ -13,43 +13,42 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf130770(UITestCase):
def test_tdf130770_autofilter(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf130770.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- # 1. open attached file and check initial state
- self.assertFalse(is_row_hidden(calc_doc, 0))
- self.assertFalse(is_row_hidden(calc_doc, 1))
- self.assertTrue(is_row_hidden(calc_doc, 2))
- self.assertFalse(is_row_hidden(calc_doc, 3))
- self.assertFalse(is_row_hidden(calc_doc, 4))
-
- # 2. open filter of column A and cancel
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
-
- xOkBtn = xFloatWindow.getChild("cancel")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.assertFalse(is_row_hidden(calc_doc, 0))
- self.assertFalse(is_row_hidden(calc_doc, 1))
- self.assertTrue(is_row_hidden(calc_doc, 2))
- self.assertFalse(is_row_hidden(calc_doc, 3))
- self.assertFalse(is_row_hidden(calc_doc, 4))
-
- # 3. open filter of column A and just click OK
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
-
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.assertFalse(is_row_hidden(calc_doc, 0))
- self.assertFalse(is_row_hidden(calc_doc, 1))
- self.assertTrue(is_row_hidden(calc_doc, 2))
- self.assertFalse(is_row_hidden(calc_doc, 3))
- self.assertTrue(is_row_hidden(calc_doc, 4)) # filtered out
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf130770.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ # 1. open attached file and check initial state
+ self.assertFalse(is_row_hidden(calc_doc, 0))
+ self.assertFalse(is_row_hidden(calc_doc, 1))
+ self.assertTrue(is_row_hidden(calc_doc, 2))
+ self.assertFalse(is_row_hidden(calc_doc, 3))
+ self.assertFalse(is_row_hidden(calc_doc, 4))
+
+ # 2. open filter of column A and cancel
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+
+ xOkBtn = xFloatWindow.getChild("cancel")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.assertFalse(is_row_hidden(calc_doc, 0))
+ self.assertFalse(is_row_hidden(calc_doc, 1))
+ self.assertTrue(is_row_hidden(calc_doc, 2))
+ self.assertFalse(is_row_hidden(calc_doc, 3))
+ self.assertFalse(is_row_hidden(calc_doc, 4))
+
+ # 3. open filter of column A and just click OK
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.assertFalse(is_row_hidden(calc_doc, 0))
+ self.assertFalse(is_row_hidden(calc_doc, 1))
+ self.assertTrue(is_row_hidden(calc_doc, 2))
+ self.assertFalse(is_row_hidden(calc_doc, 3))
+ self.assertTrue(is_row_hidden(calc_doc, 4)) # filtered out
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf140754.py b/sc/qa/uitest/autofilter/tdf140754.py
index 4d413ac0d85f..186637e303b9 100644
--- a/sc/qa/uitest/autofilter/tdf140754.py
+++ b/sc/qa/uitest/autofilter/tdf140754.py
@@ -13,72 +13,70 @@ class tdf140754(UITestCase):
def test_tdf140754(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf140754.ods"))
-
- #Make sure 'multi-threaded calculation' is enabled
- 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())
- xCalcCalculateEntry = xCalcEntry.getChild('3')
- xCalcCalculateEntry.executeAction("SELECT", tuple())
-
- self.assertEqual('true', get_state_as_dict(xDialogOpt.getChild('threadingenabled'))["Selected"])
-
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- document = self.ui_test.get_component()
-
- self.assertEqual(0, get_cell_by_position(document, 0, 0, 30).getValue())
- self.assertEqual(0, get_cell_by_position(document, 0, 0, 82).getValue())
- self.assertEqual(1, get_cell_by_position(document, 0, 0, 238).getValue())
- self.assertEqual(28, get_cell_by_position(document, 0, 0, 265).getValue())
- self.assertEqual(28, get_cell_by_position(document, 0, 0, 1370).getValue())
-
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xAll = xFloatWindow.getChild("toggle_all")
- xAll.executeAction("CLICK", tuple())
-
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(25, len(xList.getChildren()))
-
- # Without the fix in place, this test would have crashed here
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(0, get_cell_by_position(document, 0, 0, 30).getValue())
- self.assertEqual(1, get_cell_by_position(document, 0, 0, 82).getValue())
- self.assertEqual(39, get_cell_by_position(document, 0, 0, 238).getValue())
- self.assertEqual(66, get_cell_by_position(document, 0, 0, 265).getValue())
- self.assertEqual(282, get_cell_by_position(document, 0, 0, 1370).getValue())
-
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "6", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xAll = xFloatWindow.getChild("toggle_all")
- xAll.executeAction("CLICK", tuple())
-
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xList = xCheckListMenu.getChild("check_list_box")
- self.assertEqual(10, len(xList.getChildren()))
-
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.assertEqual(1, get_cell_by_position(document, 0, 0, 30).getValue())
- self.assertEqual(11, get_cell_by_position(document, 0, 0, 82).getValue())
- self.assertEqual(69, get_cell_by_position(document, 0, 0, 238).getValue())
- self.assertEqual(96, get_cell_by_position(document, 0, 0, 265).getValue())
- self.assertEqual(411, get_cell_by_position(document, 0, 0, 1370).getValue())
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf140754.ods")) as calc_doc:
+
+ #Make sure 'multi-threaded calculation' is enabled
+ 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())
+ xCalcCalculateEntry = xCalcEntry.getChild('3')
+ xCalcCalculateEntry.executeAction("SELECT", tuple())
+
+ self.assertEqual('true', get_state_as_dict(xDialogOpt.getChild('threadingenabled'))["Selected"])
+
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ document = self.ui_test.get_component()
+
+ self.assertEqual(0, get_cell_by_position(document, 0, 0, 30).getValue())
+ self.assertEqual(0, get_cell_by_position(document, 0, 0, 82).getValue())
+ self.assertEqual(1, get_cell_by_position(document, 0, 0, 238).getValue())
+ self.assertEqual(28, get_cell_by_position(document, 0, 0, 265).getValue())
+ self.assertEqual(28, get_cell_by_position(document, 0, 0, 1370).getValue())
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "2", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xAll = xFloatWindow.getChild("toggle_all")
+ xAll.executeAction("CLICK", tuple())
+
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(25, len(xList.getChildren()))
+
+ # Without the fix in place, this test would have crashed here
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(0, get_cell_by_position(document, 0, 0, 30).getValue())
+ self.assertEqual(1, get_cell_by_position(document, 0, 0, 82).getValue())
+ self.assertEqual(39, get_cell_by_position(document, 0, 0, 238).getValue())
+ self.assertEqual(66, get_cell_by_position(document, 0, 0, 265).getValue())
+ self.assertEqual(282, get_cell_by_position(document, 0, 0, 1370).getValue())
+
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "6", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xAll = xFloatWindow.getChild("toggle_all")
+ xAll.executeAction("CLICK", tuple())
+
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xList = xCheckListMenu.getChild("check_list_box")
+ self.assertEqual(10, len(xList.getChildren()))
+
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.assertEqual(1, get_cell_by_position(document, 0, 0, 30).getValue())
+ self.assertEqual(11, get_cell_by_position(document, 0, 0, 82).getValue())
+ self.assertEqual(69, get_cell_by_position(document, 0, 0, 238).getValue())
+ self.assertEqual(96, get_cell_by_position(document, 0, 0, 265).getValue())
+ self.assertEqual(411, get_cell_by_position(document, 0, 0, 1370).getValue())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf92767.py b/sc/qa/uitest/autofilter/tdf92767.py
index e846e0bcfb40..a016d2337f86 100644
--- a/sc/qa/uitest/autofilter/tdf92767.py
+++ b/sc/qa/uitest/autofilter/tdf92767.py
@@ -12,42 +12,40 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class tdf92767(UITestCase):
def test_tdf92767(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf92767.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- for i in range(0,25):
- self.assertFalse(is_row_hidden(calc_doc, i))
-
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
- xTreeList = xFloatWindow.getChild("check_tree_box")
- xFirstEntry = xTreeList.getChild("0")
- self.assertEqual('2015', get_state_as_dict(xFirstEntry)["Text"])
- self.assertEqual('7', get_state_as_dict(xFirstEntry)["Children"])
-
- # Deselect all the options but the last one
- for i in range(6):
- xChild = xFirstEntry.getChild(str(i))
- xChild.executeAction("CLICK", tuple())
- self.assertEqual('false', get_state_as_dict(xChild)['IsChecked'])
-
- xLastChild = xFirstEntry.getChild('6')
- self.assertEqual('true', get_state_as_dict(xLastChild)['IsChecked'])
- self.assertEqual('July', get_state_as_dict(xLastChild)['Text'])
-
- xOkBtn = xFloatWindow.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- for i in range(1,22):
- self.assertTrue(is_row_hidden(calc_doc, i))
-
- # Without the fix in place, this test would have failed here
- self.assertFalse(is_row_hidden(calc_doc, 23))
- self.assertFalse(is_row_hidden(calc_doc, 24))
- self.assertFalse(is_row_hidden(calc_doc, 25))
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf92767.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ for i in range(0,25):
+ self.assertFalse(is_row_hidden(calc_doc, i))
+
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
+ xTreeList = xFloatWindow.getChild("check_tree_box")
+ xFirstEntry = xTreeList.getChild("0")
+ self.assertEqual('2015', get_state_as_dict(xFirstEntry)["Text"])
+ self.assertEqual('7', get_state_as_dict(xFirstEntry)["Children"])
+
+ # Deselect all the options but the last one
+ for i in range(6):
+ xChild = xFirstEntry.getChild(str(i))
+ xChild.executeAction("CLICK", tuple())
+ self.assertEqual('false', get_state_as_dict(xChild)['IsChecked'])
+
+ xLastChild = xFirstEntry.getChild('6')
+ self.assertEqual('true', get_state_as_dict(xLastChild)['IsChecked'])
+ self.assertEqual('July', get_state_as_dict(xLastChild)['Text'])
+
+ xOkBtn = xFloatWindow.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ for i in range(1,22):
+ self.assertTrue(is_row_hidden(calc_doc, i))
+
+ # Without the fix in place, this test would have failed here
+ self.assertFalse(is_row_hidden(calc_doc, 23))
+ self.assertFalse(is_row_hidden(calc_doc, 24))
+ self.assertFalse(is_row_hidden(calc_doc, 25))
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/autofilter/tdf97340.py b/sc/qa/uitest/autofilter/tdf97340.py
index 7ef59bf6b641..f4b58ce5a7d4 100644
--- a/sc/qa/uitest/autofilter/tdf97340.py
+++ b/sc/qa/uitest/autofilter/tdf97340.py
@@ -12,30 +12,29 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf97340(UITestCase):
def test_tdf97340_autofilter(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autofilter.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("autofilter.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
- xFloatWindow = self.xUITest.getFloatWindow()
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"}))
+ xFloatWindow = self.xUITest.getFloatWindow()
- xCheckListMenu = xFloatWindow.getChild("check_list_menu")
- xTreeList = xCheckListMenu.getChild("check_tree_box")
- self.assertEqual(2, len(xTreeList.getChildren()))
- self.assertEqual("2016", get_state_as_dict(xTreeList.getChild('0'))['Text'])
- self.assertEqual("2017", get_state_as_dict(xTreeList.getChild('1'))['Text'])
+ xCheckListMenu = xFloatWindow.getChild("check_list_menu")
+ xTreeList = xCheckListMenu.getChild("check_tree_box")
+ self.assertEqual(2, len(xTreeList.getChildren()))
+ self.assertEqual("2016", get_state_as_dict(xTreeList.getChild('0'))['Text'])
+ self.assertEqual("2017", get_state_as_dict(xTreeList.getChild('1'))['Text'])
- xsearchEdit = xFloatWindow.getChild("search_edit")
- xsearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT":" "}))
- self.assertEqual(0, len(xTreeList.getChildren()))
+ xsearchEdit = xFloatWindow.getChild("search_edit")
+ xsearchEdit.executeAction("TYPE", mkPropertyValues({"TEXT":" "}))
+ self.assertEqual(0, len(xTreeList.getChildren()))
- xsearchEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"}))
+ xsearchEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"}))
- #tdf#133785, without the fix in place, it would have been 0
- self.assertEqual(2, len(xTreeList.getChildren()))
- self.assertEqual("2016", get_state_as_dict(xTreeList.getChild('0'))['Text'])
- self.assertEqual("2017", get_state_as_dict(xTreeList.getChild('1'))['Text'])
+ #tdf#133785, without the fix in place, it would have been 0
+ self.assertEqual(2, len(xTreeList.getChildren()))
+ self.assertEqual("2016", get_state_as_dict(xTreeList.getChild('0'))['Text'])
+ self.assertEqual("2017", get_state_as_dict(xTreeList.getChild('1'))['Text'])
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests/autofill.py b/sc/qa/uitest/calc_tests/autofill.py
index 23f8bd9bac26..57691ef5c499 100644
--- a/sc/qa/uitest/calc_tests/autofill.py
+++ b/sc/qa/uitest/calc_tests/autofill.py
@@ -14,115 +14,113 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class CalcAutofill(UITestCase):
def test_autofill(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autofill.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Select cell A12 and drag the fill handle in the bottom right corner of the cell down to A18
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A12:A18"}))
- self.ui_test.execute_dialog_through_command(".uno:FillSeries")
- xDialog = self.xUITest.getTopFocusWindow()
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #Compare with the content in the right next column
- self.assertEqual(get_cell_by_position(document, 0, 0, 11).getValue(), 18.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 19.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 20.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 14).getValue(), 21.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 15).getValue(), 22.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 16).getValue(), 23.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 17).getValue(), 24.34)
- #Select cell A12 and drag the fill handle in the bottom right corner of the cell up to A6
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A6:A12"}))
- self.ui_test.execute_dialog_through_command(".uno:FillSeries")
- xDialog = self.xUITest.getTopFocusWindow()
- xup = xDialog.getChild("up")
- xincrement = xDialog.getChild("increment")
- xup.executeAction("CLICK", tuple())
- xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xincrement.executeAction("TYPE", mkPropertyValues({"TEXT":"-1"}))
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #Compare with the content in the right next column
- self.assertEqual(get_cell_by_position(document, 0, 0, 5).getValue(), 12.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 6).getValue(), 13.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 14.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 8).getValue(), 15.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 9).getValue(), 16.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 10).getValue(), 17.34)
- self.assertEqual(get_cell_by_position(document, 0, 0, 11).getValue(), 18.34)
+ with self.ui_test.load_file(get_url_for_data_file("autofill.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Select cell A12 and drag the fill handle in the bottom right corner of the cell down to A18
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A12:A18"}))
+ self.ui_test.execute_dialog_through_command(".uno:FillSeries")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #Compare with the content in the right next column
+ self.assertEqual(get_cell_by_position(document, 0, 0, 11).getValue(), 18.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 19.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 20.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 14).getValue(), 21.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 15).getValue(), 22.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 16).getValue(), 23.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 17).getValue(), 24.34)
+ #Select cell A12 and drag the fill handle in the bottom right corner of the cell up to A6
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A6:A12"}))
+ self.ui_test.execute_dialog_through_command(".uno:FillSeries")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xup = xDialog.getChild("up")
+ xincrement = xDialog.getChild("increment")
+ xup.executeAction("CLICK", tuple())
+ xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xincrement.executeAction("TYPE", mkPropertyValues({"TEXT":"-1"}))
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #Compare with the content in the right next column
+ self.assertEqual(get_cell_by_position(document, 0, 0, 5).getValue(), 12.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 6).getValue(), 13.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 14.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 8).getValue(), 15.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 9).getValue(), 16.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 10).getValue(), 17.34)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 11).getValue(), 18.34)
- #Continue with the next cells with grey background
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "M12:M18"}))
- self.ui_test.execute_dialog_through_command(".uno:FillSeries")
- xDialog = self.xUITest.getTopFocusWindow()
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #Compare with the content in the right next column
- self.assertEqual(get_cell_by_position(document, 0, 12, 11).getString(), "12abc40")
- self.assertEqual(get_cell_by_position(document, 0, 12, 12).getString(), "12abc41")
- self.assertEqual(get_cell_by_position(document, 0, 12, 13).getString(), "12abc42")
- self.assertEqual(get_cell_by_position(document, 0, 12, 14).getString(), "12abc43")
- self.assertEqual(get_cell_by_position(document, 0, 12, 15).getString(), "12abc44")
- self.assertEqual(get_cell_by_position(document, 0, 12, 16).getString(), "12abc45")
- self.assertEqual(get_cell_by_position(document, 0, 12, 17).getString(), "12abc46")
+ #Continue with the next cells with grey background
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "M12:M18"}))
+ self.ui_test.execute_dialog_through_command(".uno:FillSeries")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #Compare with the content in the right next column
+ self.assertEqual(get_cell_by_position(document, 0, 12, 11).getString(), "12abc40")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 12).getString(), "12abc41")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 13).getString(), "12abc42")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 14).getString(), "12abc43")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 15).getString(), "12abc44")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 16).getString(), "12abc45")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 17).getString(), "12abc46")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "M6:M12"}))
- self.ui_test.execute_dialog_through_command(".uno:FillSeries")
- xDialog = self.xUITest.getTopFocusWindow()
- xup = xDialog.getChild("up")
- xincrement = xDialog.getChild("increment")
- xup.executeAction("CLICK", tuple())
- xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xincrement.executeAction("TYPE", mkPropertyValues({"TEXT":"-1"}))
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #Compare with the content in the right next column
- self.assertEqual(get_cell_by_position(document, 0, 12, 5).getString(), "12abc34")
- self.assertEqual(get_cell_by_position(document, 0, 12, 6).getString(), "12abc35")
- self.assertEqual(get_cell_by_position(document, 0, 12, 7).getString(), "12abc36")
- self.assertEqual(get_cell_by_position(document, 0, 12, 8).getString(), "12abc37")
- self.assertEqual(get_cell_by_position(document, 0, 12, 9).getString(), "12abc38")
- self.assertEqual(get_cell_by_position(document, 0, 12, 10).getString(), "12abc39")
- self.assertEqual(get_cell_by_position(document, 0, 12, 11).getString(), "12abc40")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "P12:P18"}))
- self.ui_test.execute_dialog_through_command(".uno:FillSeries")
- xDialog = self.xUITest.getTopFocusWindow()
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #Compare with the content in the right next column
- self.assertEqual(get_cell_by_position(document, 0, 15, 11).getString(), "10.64.127.7")
- self.assertEqual(get_cell_by_position(document, 0, 15, 12).getString(), "10.64.127.8")
- self.assertEqual(get_cell_by_position(document, 0, 15, 13).getString(), "10.64.127.9")
- self.assertEqual(get_cell_by_position(document, 0, 15, 14).getString(), "10.64.127.10")
- self.assertEqual(get_cell_by_position(document, 0, 15, 15).getString(), "10.64.127.11")
- self.assertEqual(get_cell_by_position(document, 0, 15, 16).getString(), "10.64.127.12")
- self.assertEqual(get_cell_by_position(document, 0, 15, 17).getString(), "10.64.127.13")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "M6:M12"}))
+ self.ui_test.execute_dialog_through_command(".uno:FillSeries")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xup = xDialog.getChild("up")
+ xincrement = xDialog.getChild("increment")
+ xup.executeAction("CLICK", tuple())
+ xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xincrement.executeAction("TYPE", mkPropertyValues({"TEXT":"-1"}))
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #Compare with the content in the right next column
+ self.assertEqual(get_cell_by_position(document, 0, 12, 5).getString(), "12abc34")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 6).getString(), "12abc35")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 7).getString(), "12abc36")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 8).getString(), "12abc37")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 9).getString(), "12abc38")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 10).getString(), "12abc39")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 11).getString(), "12abc40")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "P6:P12"}))
- self.ui_test.execute_dialog_through_command(".uno:FillSeries")
- xDialog = self.xUITest.getTopFocusWindow()
- xup = xDialog.getChild("up")
- xincrement = xDialog.getChild("increment")
- xup.executeAction("CLICK", tuple())
- xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xincrement.executeAction("TYPE", mkPropertyValues({"TEXT":"-1"}))
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #Compare with the content in the right next column
- self.assertEqual(get_cell_by_position(document, 0, 15, 5).getString(), "10.64.127.1")
- self.assertEqual(get_cell_by_position(document, 0, 15, 6).getString(), "10.64.127.2")
- self.assertEqual(get_cell_by_position(document, 0, 15, 7).getString(), "10.64.127.3")
- self.assertEqual(get_cell_by_position(document, 0, 15, 8).getString(), "10.64.127.4")
- self.assertEqual(get_cell_by_position(document, 0, 15, 9).getString(), "10.64.127.5")
- self.assertEqual(get_cell_by_position(document, 0, 15, 10).getString(), "10.64.127.6")
- self.assertEqual(get_cell_by_position(document, 0, 15, 11).getString(), "10.64.127.7")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "P12:P18"}))
+ self.ui_test.execute_dialog_through_command(".uno:FillSeries")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #Compare with the content in the right next column
+ self.assertEqual(get_cell_by_position(document, 0, 15, 11).getString(), "10.64.127.7")
+ self.assertEqual(get_cell_by_position(document, 0, 15, 12).getString(), "10.64.127.8")
+ self.assertEqual(get_cell_by_position(document, 0, 15, 13).getString(), "10.64.127.9")
+ self.assertEqual(get_cell_by_position(document, 0, 15, 14).getString(), "10.64.127.10")
+ self.assertEqual(get_cell_by_position(document, 0, 15, 15).getString(), "10.64.127.11")
+ self.assertEqual(get_cell_by_position(document, 0, 15, 16).getString(), "10.64.127.12")
+ self.assertEqual(get_cell_by_position(document, 0, 15, 17).getString(), "10.64.127.13")
- self.ui_test.close_doc()
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "P6:P12"}))
+ self.ui_test.execute_dialog_through_command(".uno:FillSeries")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xup = xDialog.getChild("up")
+ xincrement = xDialog.getChild("increment")
+ xup.executeAction("CLICK", tuple())
+ xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xincrement.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xincrement.executeAction("TYPE", mkPropertyValues({"TEXT":"-1"}))
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #Compare with the content in the right next column
+ self.assertEqual(get_cell_by_position(document, 0, 15, 5).getString(), "10.64.127.1")
+ self.assertEqual(get_cell_by_position(document, 0, 15, 6).getString(), "10.64.127.2")
+ self.assertEqual(get_cell_by_position(document, 0, 15, 7).getString(), "10.64.127.3")
+ self.assertEqual(get_cell_by_position(document, 0, 15, 8).getString(), "10.64.127.4")
+ self.assertEqual(get_cell_by_position(document, 0, 15, 9).getString(), "10.64.127.5")
+ self.assertEqual(get_cell_by_position(document, 0, 15, 10).getString(), "10.64.127.6")
+ 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")
diff --git a/sc/qa/uitest/calc_tests/autosum.py b/sc/qa/uitest/calc_tests/autosum.py
index f7c41388c17e..bc493d1977b0 100644
--- a/sc/qa/uitest/calc_tests/autosum.py
+++ b/sc/qa/uitest/calc_tests/autosum.py
@@ -15,269 +15,247 @@ class calcAutosum(UITestCase):
def test_autosum_test1(self):
#Sum on range and Sum on Sum's
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Place the cell cursor on the gray cells located under Point 1.
- #(Multiselection is not possible at this place) and press the Sum Icon in the formula bar.
- #Now hit the enter key and the result should be shown. Do so for each gray cell in this part of the document.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B10"}))
- self.xUITest.executeCommand(".uno:AutoSum")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B13"}))
- self.xUITest.executeCommand(".uno:AutoSum")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B14"}))
- self.xUITest.executeCommand(".uno:AutoSum")
- self.assertEqual(get_cell_by_position(document, 0, 1, 9).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 9).getFormula(), "=SUM(B8:B9)")
- self.assertEqual(get_cell_by_position(document, 0, 1, 12).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 12).getFormula(), "=SUM(B11:B12)")
- self.assertEqual(get_cell_by_position(document, 0, 1, 13).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 1, 13).getFormula(), "=SUM(B13:B13;B10:B10)")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "F8:F14"}))
- self.xUITest.executeCommand(".uno:AutoSum")
- self.assertEqual(get_cell_by_position(document, 0, 5, 13).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 5, 13).getFormula(), "=SUM(F13:F13;F10:F10)")
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Place the cell cursor on the gray cells located under Point 1.
+ #(Multiselection is not possible at this place) and press the Sum Icon in the formula bar.
+ #Now hit the enter key and the result should be shown. Do so for each gray cell in this part of the document.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B10"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B13"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B14"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 9).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 9).getFormula(), "=SUM(B8:B9)")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 12).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 12).getFormula(), "=SUM(B11:B12)")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 13).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 13).getFormula(), "=SUM(B13:B13;B10:B10)")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "F8:F14"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 13).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 13).getFormula(), "=SUM(F13:F13;F10:F10)")
def test_autosum_test2(self):
#Sum on Row and Column
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E25"}))
- self.xUITest.executeCommand(".uno:AutoSum")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E26"}))
- self.xUITest.executeCommand(".uno:AutoSum")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E27"}))
- self.xUITest.executeCommand(".uno:AutoSum")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E28"}))
- self.xUITest.executeCommand(".uno:AutoSum")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E29"}))
- self.xUITest.executeCommand(".uno:AutoSum")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E30"}))
- self.xUITest.executeCommand(".uno:AutoSum")
-
- self.assertEqual(get_cell_by_position(document, 0, 4, 24).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 4, 24).getFormula(), "=SUM(E22:E24)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 25).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 4, 25).getFormula(), "=SUM(B26:D26)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 26).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 4, 26).getFormula(), "=SUM(B27:D27)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 27).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 4, 27).getFormula(), "=SUM(B28:D28)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 28).getValue(), 9)
- self.assertEqual(get_cell_by_position(document, 0, 4, 28).getFormula(), "=SUM(E26:E28)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 29).getValue(), 12)
- self.assertEqual(get_cell_by_position(document, 0, 4, 29).getFormula(), "=SUM(E29:E29;E25:E25)")
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E25"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E26"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E27"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E28"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E29"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E30"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+
+ self.assertEqual(get_cell_by_position(document, 0, 4, 24).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 24).getFormula(), "=SUM(E22:E24)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 25).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 25).getFormula(), "=SUM(B26:D26)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 26).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 26).getFormula(), "=SUM(B27:D27)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 27).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 27).getFormula(), "=SUM(B28:D28)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 28).getValue(), 9)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 28).getFormula(), "=SUM(E26:E28)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 29).getValue(), 12)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 29).getFormula(), "=SUM(E29:E29;E25:E25)")
def test_autosum_test3(self):
#Subtotals on Autosum
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C49"}))
- self.xUITest.executeCommand(".uno:AutoSum")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C49"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
- self.assertEqual(get_cell_by_position(document, 0, 2, 48).getValue(), 20)
- self.assertEqual(get_cell_by_position(document, 0, 2, 48).getFormula(), "=SUBTOTAL(9;C38:C48)")
-
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(document, 0, 2, 48).getValue(), 20)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 48).getFormula(), "=SUBTOTAL(9;C38:C48)")
def test_autosum_test4(self):
#Autosum on column with selected empty cell for result
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B59:B64"}))
- self.xUITest.executeCommand(".uno:AutoSum")
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- self.assertEqual(get_cell_by_position(document, 0, 1, 63).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 1, 63).getFormula(), "=SUM(B59:B63)")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B59:B64"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(document, 0, 1, 63).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 63).getFormula(), "=SUM(B59:B63)")
def test_autosum_test5(self):
#5.Autosum on rows with selected empty cell for result
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B76:E80"}))
- self.xUITest.executeCommand(".uno:AutoSum")
-
- self.assertEqual(get_cell_by_position(document, 0, 4, 75).getValue(), 30)
- self.assertEqual(get_cell_by_position(document, 0, 4, 75).getFormula(), "=SUM(B76:D76)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 76).getValue(), 60)
- self.assertEqual(get_cell_by_position(document, 0, 4, 76).getFormula(), "=SUM(B77:D77)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 77).getValue(), 90)
- self.assertEqual(get_cell_by_position(document, 0, 4, 77).getFormula(), "=SUM(B78:D78)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 78).getValue(), 120)
- self.assertEqual(get_cell_by_position(document, 0, 4, 78).getFormula(), "=SUM(B79:D79)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 79).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 4, 79).getFormula(), "=SUM(B80:D80)")
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B76:E80"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+
+ self.assertEqual(get_cell_by_position(document, 0, 4, 75).getValue(), 30)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 75).getFormula(), "=SUM(B76:D76)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 76).getValue(), 60)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 76).getFormula(), "=SUM(B77:D77)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 77).getValue(), 90)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 77).getFormula(), "=SUM(B78:D78)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 78).getValue(), 120)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 78).getFormula(), "=SUM(B79:D79)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 79).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 79).getFormula(), "=SUM(B80:D80)")
def test_autosum_test6(self):
#6.Subtotal on column with selected empty cell for result
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C92:C101"}))
- self.xUITest.executeCommand(".uno:AutoSum")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C92:C101"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
- self.assertEqual(get_cell_by_position(document, 0, 2, 100).getValue(), 19)
- self.assertEqual(get_cell_by_position(document, 0, 2, 100).getFormula(), "=SUBTOTAL(9;C92:C100)")
-
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(document, 0, 2, 100).getValue(), 19)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 100).getFormula(), "=SUBTOTAL(9;C92:C100)")
def test_autosum_test7(self):
#7.Autosum on column without selected empty cell for result
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B109:B113"}))
- self.xUITest.executeCommand(".uno:AutoSum")
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- self.assertEqual(get_cell_by_position(document, 0, 1, 113).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 1, 113).getFormula(), "=SUM(B109:B113)")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B109:B113"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(document, 0, 1, 113).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 113).getFormula(), "=SUM(B109:B113)")
def test_autosum_test8(self):
#8.Autosum on rows without selected empty cell for result
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B126:D126"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B128:D128", "EXTEND":"1"}))
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B130:D130", "EXTEND":"1"}))
- self.xUITest.executeCommand(".uno:AutoSum")
-
- self.assertEqual(get_cell_by_position(document, 0, 4, 125).getValue(), 30)
- self.assertEqual(get_cell_by_position(document, 0, 4, 125).getFormula(), "=SUM(B126:D126)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 127).getValue(), 90)
- self.assertEqual(get_cell_by_position(document, 0, 4, 127).getFormula(), "=SUM(B128:D128)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 129).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 4, 129).getFormula(), "=SUM(B130:D130)")
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B126:D126"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B128:D128", "EXTEND":"1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B130:D130", "EXTEND":"1"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+
+ self.assertEqual(get_cell_by_position(document, 0, 4, 125).getValue(), 30)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 125).getFormula(), "=SUM(B126:D126)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 127).getValue(), 90)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 127).getFormula(), "=SUM(B128:D128)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 129).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 129).getFormula(), "=SUM(B130:D130)")
def test_autosum_test9(self):
#9.Subtotal on column without selected empty cell for result
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C142:C149"}))
- self.xUITest.executeCommand(".uno:AutoSum")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C142:C149"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
- self.assertEqual(get_cell_by_position(document, 0, 2, 150).getValue(), 19)
- self.assertEqual(get_cell_by_position(document, 0, 2, 150).getFormula(), "=SUBTOTAL(9;C142:C149)")
-
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(document, 0, 2, 150).getValue(), 19)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 150).getFormula(), "=SUBTOTAL(9;C142:C149)")
def test_autosum_test10(self):
#10.Autosum on multiselected columns without selected empty cell for result
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B160:D164"}))
- self.xUITest.executeCommand(".uno:AutoSum")
-
- self.assertEqual(get_cell_by_position(document, 0, 1, 164).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 1, 164).getFormula(), "=SUM(B160:B164)")
- self.assertEqual(get_cell_by_position(document, 0, 2, 164).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 2, 164).getFormula(), "=SUM(C160:C164)")
- self.assertEqual(get_cell_by_position(document, 0, 3, 164).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 3, 164).getFormula(), "=SUM(D160:D164)")
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B160:D164"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+
+ self.assertEqual(get_cell_by_position(document, 0, 1, 164).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 164).getFormula(), "=SUM(B160:B164)")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 164).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 164).getFormula(), "=SUM(C160:C164)")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 164).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 164).getFormula(), "=SUM(D160:D164)")
def test_autosum_test11(self):
#11.Autosum on columns with formula results without selected empty cell for result
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B173:D177"}))
- self.xUITest.executeCommand(".uno:AutoSum")
-
- self.assertEqual(round(get_cell_by_position(document, 0, 1, 177).getValue(),2), 2.55)
- self.assertEqual(get_cell_by_position(document, 0, 1, 177).getFormula(), "=SUM(B173:B177)")
- self.assertEqual(round(get_cell_by_position(document, 0, 2, 177).getValue(),2), -4.91)
- self.assertEqual(get_cell_by_position(document, 0, 2, 177).getFormula(), "=SUM(C173:C177)")
- self.assertEqual(get_cell_by_position(document, 0, 3, 177).getValue(), 5500)
- self.assertEqual(get_cell_by_position(document, 0, 3, 177).getFormula(), "=SUM(D173:D177)")
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B173:D177"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+
+ self.assertEqual(round(get_cell_by_position(document, 0, 1, 177).getValue(),2), 2.55)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 177).getFormula(), "=SUM(B173:B177)")
+ self.assertEqual(round(get_cell_by_position(document, 0, 2, 177).getValue(),2), -4.91)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 177).getFormula(), "=SUM(C173:C177)")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 177).getValue(), 5500)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 177).getFormula(), "=SUM(D173:D177)")
def test_autosum_test12(self):
#12.Autosum on column with filled cell under selected area
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B186:D190"}))
- self.xUITest.executeCommand(".uno:AutoSum")
-
- self.assertEqual(get_cell_by_position(document, 0, 1, 191).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 1, 191).getFormula(), "=SUM(B186:B190)")
- self.assertEqual(get_cell_by_position(document, 0, 2, 191).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 2, 191).getFormula(), "=SUM(C186:C190)")
- self.assertEqual(get_cell_by_position(document, 0, 3, 191).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 3, 191).getFormula(), "=SUM(D186:D190)")
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B186:D190"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+
+ self.assertEqual(get_cell_by_position(document, 0, 1, 191).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 191).getFormula(), "=SUM(B186:B190)")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 191).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 191).getFormula(), "=SUM(C186:C190)")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 191).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 191).getFormula(), "=SUM(D186:D190)")
def test_autosum_test13(self):
#13.Autosum on column and rows with empty cells selected for row and column
- calc_doc = self.ui_test.load_file(get_url_for_data_file("autosum.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B203:E208"}))
- self.xUITest.executeCommand(".uno:AutoSum")
-
- self.assertEqual(get_cell_by_position(document, 0, 1, 207).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 1, 207).getFormula(), "=SUM(B203:B207)")
- self.assertEqual(get_cell_by_position(document, 0, 2, 207).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 2, 207).getFormula(), "=SUM(C203:C207)")
- self.assertEqual(get_cell_by_position(document, 0, 3, 207).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 3, 207).getFormula(), "=SUM(D203:D207)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 207).getValue(), 450)
- self.assertEqual(get_cell_by_position(document, 0, 4, 207).getFormula(), "=SUM(B208:D208)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 202).getValue(), 30)
- self.assertEqual(get_cell_by_position(document, 0, 4, 202).getFormula(), "=SUM(B203:D203)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 203).getValue(), 60)
- self.assertEqual(get_cell_by_position(document, 0, 4, 203).getFormula(), "=SUM(B204:D204)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 204).getValue(), 90)
- self.assertEqual(get_cell_by_position(document, 0, 4, 204).getFormula(), "=SUM(B205:D205)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 205).getValue(), 120)
- self.assertEqual(get_cell_by_position(document, 0, 4, 205).getFormula(), "=SUM(B206:D206)")
- self.assertEqual(get_cell_by_position(document, 0, 4, 206).getValue(), 150)
- self.assertEqual(get_cell_by_position(document, 0, 4, 206).getFormula(), "=SUM(B207:D207)")
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("autosum.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B203:E208"}))
+ self.xUITest.executeCommand(".uno:AutoSum")
+
+ self.assertEqual(get_cell_by_position(document, 0, 1, 207).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 207).getFormula(), "=SUM(B203:B207)")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 207).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 207).getFormula(), "=SUM(C203:C207)")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 207).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 207).getFormula(), "=SUM(D203:D207)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 207).getValue(), 450)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 207).getFormula(), "=SUM(B208:D208)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 202).getValue(), 30)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 202).getFormula(), "=SUM(B203:D203)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 203).getValue(), 60)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 203).getFormula(), "=SUM(B204:D204)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 204).getValue(), 90)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 204).getFormula(), "=SUM(B205:D205)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 205).getValue(), 120)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 205).getFormula(), "=SUM(B206:D206)")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 206).getValue(), 150)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 206).getFormula(), "=SUM(B207:D207)")
# 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 3247f0bc63bd..2bc225d1f84d 100644
--- a/sc/qa/uitest/calc_tests/mergedRowsColumns.py
+++ b/sc/qa/uitest/calc_tests/mergedRowsColumns.py
@@ -13,180 +13,171 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class mergedRowsColumns(UITestCase):
def test_merged_row_delete_tdf105412(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf105412.ods"))
- xTopWindow = self.xUITest.getTopFocusWindow()
- gridwin = xTopWindow.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf105412.ods")) as calc_doc:
+ xTopWindow = self.xUITest.getTopFocusWindow()
+ gridwin = xTopWindow.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A20"}))
- self.xUITest.executeCommand(".uno:SelectRow")
- self.xUITest.executeCommand(".uno:DeleteRows")
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Redo")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A20"}))
+ self.xUITest.executeCommand(".uno:SelectRow")
+ self.xUITest.executeCommand(".uno:DeleteRows")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 18).getString(), "L6")
-
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 18).getString(), "L6")
def test_merged_columns_delete(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf105412.ods"))
- xTopWindow = self.xUITest.getTopFocusWindow()
- gridwin = xTopWindow.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf105412.ods")) as calc_doc:
+ xTopWindow = self.xUITest.getTopFocusWindow()
+ gridwin = xTopWindow.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
- self.xUITest.executeCommand(".uno:SelectColumn")
- self.xUITest.executeCommand(".uno:DeleteColumns")
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Redo")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ self.xUITest.executeCommand(".uno:DeleteColumns")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 18).getString(), "L6")
-
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 18).getString(), "L6")
def test_undo_not_available_merged_cells_tdf37901(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf105412.ods"))
- xTopWindow = self.xUITest.getTopFocusWindow()
- gridwin = xTopWindow.getChild("grid_window")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B2"}))
- self.xUITest.executeCommand(".uno:MergeCells")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getString(), "Key#")
- self.xUITest.executeCommand(".uno:ToggleMergeCells")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getString(), "Key#")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:B2"}))
- self.xUITest.executeCommand(".uno:MergeCells")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getString(), "Key#")
- self.xUITest.executeCommand(".uno:ToggleMergeCells")
- self.xUITest.executeCommand(".uno:Undo")
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf105412.ods")) as calc_doc:
+ xTopWindow = self.xUITest.getTopFocusWindow()
+ gridwin = xTopWindow.getChild("grid_window")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B2"}))
+ self.xUITest.executeCommand(".uno:MergeCells")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getString(), "Key#")
+ self.xUITest.executeCommand(".uno:ToggleMergeCells")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getString(), "Key#")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:B2"}))
+ self.xUITest.executeCommand(".uno:MergeCells")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getString(), "Key#")
+ self.xUITest.executeCommand(".uno:ToggleMergeCells")
+ self.xUITest.executeCommand(".uno:Undo")
def test_calculations_in_merged_cells_tdf51368(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf51368.ods"))
- xTopWindow = self.xUITest.getTopFocusWindow()
- gridwin = xTopWindow.getChild("grid_window")
-
- #move the content of the hidden cells into the first cell
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A11:A12"}))
- self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xMoveCells = xDialog.getChild("move-cells-radio")
- xMoveCells.executeAction("CLICK", tuple())
- self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2 3")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "0")
-
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "3")
-
- #keep the contents of the hidden cells
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A11:A12"}))
- self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xMoveCells = xDialog.getChild("keep-content-radio")
- xMoveCells.executeAction("CLICK", tuple())
- self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 11).getString(), "3")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "3")
-
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "3")
-
- #Empty the contents of the hidden cells
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A11:A12"}))
- self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xMoveCells = xDialog.getChild("move-cells-radio")
- xMoveCells.executeAction("CLICK", tuple())
- self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2 3")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 11).getString(), "")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "0")
-
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "3")
-
- #A21-A22
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A21:A22"}))
- self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xMoveCells = xDialog.getChild("keep-content-radio")
- xMoveCells.executeAction("CLICK", tuple())
- self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 20).getString(), "2")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 21).getString(), "3")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 21).getString(), "2")
-
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 20).getString(), "2")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 21).getString(), "2")
-
- #A30-A32
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A30:A32"}))
- self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xMoveCells = xDialog.getChild("keep-content-radio")
- xMoveCells.executeAction("CLICK", tuple())
- self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 31).getString(), "thisisbad")
-
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 30).getString(), "is")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 31).getString(), "thisisbad")
-
- #J12-K12
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "J12:K12"}))
- self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xMoveCells = xDialog.getChild("keep-content-radio")
- xMoveCells.executeAction("CLICK", tuple())
- self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
- self.assertEqual(get_cell_by_position(calc_doc, 0, 9, 11).getString(), "2")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 11, 11).getString(), "3")
-
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 9, 11).getString(), "2")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 11, 11).getString(), "3")
-
- #J22-K22
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "J22:K22"}))
- self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
- xDialog = self.xUITest.getTopFocusWindow()
-
- xMoveCells = xDialog.getChild("keep-content-radio")
- xMoveCells.executeAction("CLICK", tuple())
- self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
- self.assertEqual(get_cell_by_position(calc_doc, 0, 9, 21).getString(), "2")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 11, 21).getString(), "2")
-
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 9, 21).getString(), "2")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 11, 21).getString(), "2")
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf51368.ods")) as calc_doc:
+ xTopWindow = self.xUITest.getTopFocusWindow()
+ gridwin = xTopWindow.getChild("grid_window")
+
+ #move the content of the hidden cells into the first cell
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A11:A12"}))
+ self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xMoveCells = xDialog.getChild("move-cells-radio")
+ xMoveCells.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2 3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "0")
+
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "3")
+
+ #keep the contents of the hidden cells
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A11:A12"}))
+ self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xMoveCells = xDialog.getChild("keep-content-radio")
+ xMoveCells.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 11).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "3")
+
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "3")
+
+ #Empty the contents of the hidden cells
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A11:A12"}))
+ self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xMoveCells = xDialog.getChild("move-cells-radio")
+ xMoveCells.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2 3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 11).getString(), "")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "0")
+
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 10).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 11).getString(), "3")
+
+ #A21-A22
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A21:A22"}))
+ self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xMoveCells = xDialog.getChild("keep-content-radio")
+ xMoveCells.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 20).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 21).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 21).getString(), "2")
+
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 20).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 21).getString(), "2")
+
+ #A30-A32
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A30:A32"}))
+ self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xMoveCells = xDialog.getChild("keep-content-radio")
+ xMoveCells.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 31).getString(), "thisisbad")
+
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 30).getString(), "is")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 31).getString(), "thisisbad")
+
+ #J12-K12
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "J12:K12"}))
+ self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xMoveCells = xDialog.getChild("keep-content-radio")
+ xMoveCells.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 9, 11).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 11, 11).getString(), "3")
+
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 9, 11).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 11, 11).getString(), "3")
+
+ #J22-K22
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "J22:K22"}))
+ self.ui_test.execute_dialog_through_command(".uno:ToggleMergeCells")
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xMoveCells = xDialog.getChild("keep-content-radio")
+ xMoveCells.executeAction("CLICK", tuple())
+ self.ui_test.close_dialog_through_button(xDialog.getChild("ok"))
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 9, 21).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 11, 21).getString(), "2")
+
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 9, 21).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 11, 21).getString(), "2")
def test_merge_merged_cells_tdf63766(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf105412.ods"))
- xTopWindow = self.xUITest.getTopFocusWindow()
- gridwin = xTopWindow.getChild("grid_window")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C19:F22"}))
- self.xUITest.executeCommand(".uno:ToggleMergeCells")
- self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 18).getString(), "L6")
- self.xUITest.executeCommand(".uno:Undo")
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf105412.ods")) as calc_doc:
+ xTopWindow = self.xUITest.getTopFocusWindow()
+ gridwin = xTopWindow.getChild("grid_window")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C19:F22"}))
+ self.xUITest.executeCommand(".uno:ToggleMergeCells")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 18).getString(), "L6")
+ self.xUITest.executeCommand(".uno:Undo")
def test_move_merged_cells(self):
self.ui_test.create_doc_in_start_center("calc")
diff --git a/sc/qa/uitest/calc_tests/tdf133855.py b/sc/qa/uitest/calc_tests/tdf133855.py
index 8f347e87c080..cd2144c3a134 100644
--- a/sc/qa/uitest/calc_tests/tdf133855.py
+++ b/sc/qa/uitest/calc_tests/tdf133855.py
@@ -13,38 +13,36 @@ class tdf133855(UITestCase):
def test_tdf133855(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf133855.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf133855.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
- results = ['A', 'B', 'C', 'D', 'E', 'F']
+ results = ['A', 'B', 'C', 'D', 'E', 'F']
- # Conditional formatted dropdown list
- for i in range(len(results)):
- gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "6", "ROW": "5"}))
+ # Conditional formatted dropdown list
+ for i in range(len(results)):
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "6", "ROW": "5"}))
- #Select the TreeList UI Object
- xWin = self.xUITest.getTopFocusWindow()
- xlist = xWin.getChild("list")
+ #Select the TreeList UI Object
+ xWin = self.xUITest.getTopFocusWindow()
+ xlist = xWin.getChild("list")
- xListItem = xlist.getChild( str(i) )
- xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
- self.assertEqual(get_cell_by_position(document, 0, 6, 5).getString(), results[i])
+ xListItem = xlist.getChild( str(i) )
+ xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
+ self.assertEqual(get_cell_by_position(document, 0, 6, 5).getString(), results[i])
- # normal dropdown list
- for i in range(len(results)):
- gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "6", "ROW": "6"}))
+ # normal dropdown list
+ for i in range(len(results)):
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("LAUNCH", mkPropertyValues({"SELECTMENU": "", "COL": "6", "ROW": "6"}))
- #Select the TreeList UI Object
- xWin = self.xUITest.getTopFocusWindow()
- xlist = xWin.getChild("list")
+ #Select the TreeList UI Object
+ xWin = self.xUITest.getTopFocusWindow()
+ xlist = xWin.getChild("list")
- xListItem = xlist.getChild( str(i) )
- xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
- self.assertEqual(get_cell_by_position(document, 0, 6, 6).getString(), results[i])
-
- self.ui_test.close_doc()
+ xListItem = xlist.getChild( str(i) )
+ xListItem.executeAction("DOUBLECLICK" , mkPropertyValues({}) )
+ self.assertEqual(get_cell_by_position(document, 0, 6, 6).getString(), results[i])
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests2/consolidate.py b/sc/qa/uitest/calc_tests2/consolidate.py
index 8b47fb6f6d5d..95ddcf3df592 100644
--- a/sc/qa/uitest/calc_tests2/consolidate.py
+++ b/sc/qa/uitest/calc_tests2/consolidate.py
@@ -12,106 +12,104 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class consolidate(UITestCase):
def test_consolidate(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("consolidate.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("consolidate.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataConsolidate")
- xDialog = self.xUITest.getTopFocusWindow()
- xfunc = xDialog.getChild("func")
- xlbdataarea = xDialog.getChild("lbdataarea")
- xadd = xDialog.getChild("add")
- xbyrow = xDialog.getChild("byrow")
- xbycol = xDialog.getChild("bycol")
- xeddestarea = xDialog.getChild("eddestarea")
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataConsolidate")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfunc = xDialog.getChild("func")
+ xlbdataarea = xDialog.getChild("lbdataarea")
+ xadd = xDialog.getChild("add")
+ xbyrow = xDialog.getChild("byrow")
+ xbycol = xDialog.getChild("bycol")
+ xeddestarea = xDialog.getChild("eddestarea")
- select_by_text(xfunc, "Sum")
+ select_by_text(xfunc, "Sum")
- select_by_text(xlbdataarea, "range1")
- xadd.executeAction("CLICK", tuple())
- select_by_text(xlbdataarea, "range2")
- xadd.executeAction("CLICK", tuple())
- propsC = {"TEXT": "range3"}
- actionPropsC = mkPropertyValues(propsC)
- xlbdataarea.executeAction("SELECT", actionPropsC)
- xadd.executeAction("CLICK", tuple())
- xbyrow.executeAction("CLICK", tuple())
- xbycol.executeAction("CLICK", tuple())
- xeddestarea.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xeddestarea.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xeddestarea.executeAction("TYPE", mkPropertyValues({"TEXT":"$Total.$A$2"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 300)
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 303)
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 306)
- self.assertEqual(get_cell_by_position(document, 0, 1, 5).getValue(), 309)
+ select_by_text(xlbdataarea, "range1")
+ xadd.executeAction("CLICK", tuple())
+ select_by_text(xlbdataarea, "range2")
+ xadd.executeAction("CLICK", tuple())
+ propsC = {"TEXT": "range3"}
+ actionPropsC = mkPropertyValues(propsC)
+ xlbdataarea.executeAction("SELECT", actionPropsC)
+ xadd.executeAction("CLICK", tuple())
+ xbyrow.executeAction("CLICK", tuple())
+ xbycol.executeAction("CLICK", tuple())
+ xeddestarea.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xeddestarea.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xeddestarea.executeAction("TYPE", mkPropertyValues({"TEXT":"$Total.$A$2"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 300)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 303)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 306)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 5).getValue(), 309)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 303)
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 306)
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 309)
- self.assertEqual(get_cell_by_position(document, 0, 2, 5).getValue(), 312)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 303)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 306)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 309)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 5).getValue(), 312)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 306)
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 309)
- self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 312)
- self.assertEqual(get_cell_by_position(document, 0, 3, 5).getValue(), 315)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 306)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 309)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 312)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 5).getValue(), 315)
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 309)
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 312)
- self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 315)
- self.assertEqual(get_cell_by_position(document, 0, 4, 5).getValue(), 318)
- #verify dialog
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataConsolidate")
- xDialog = self.xUITest.getTopFocusWindow()
- xfunc = xDialog.getChild("func")
- xlbdataarea = xDialog.getChild("lbdataarea")
- xdelete = xDialog.getChild("delete")
- xbyrow = xDialog.getChild("byrow")
- xbycol = xDialog.getChild("bycol")
- xeddestarea = xDialog.getChild("eddestarea")
- xconsareas = xDialog.getChild("consareas")
- self.assertEqual(get_state_as_dict(xfunc)["SelectEntryText"], "Sum")
- self.assertEqual(get_state_as_dict(xconsareas)["Children"], "3")
- self.assertEqual(get_state_as_dict(xeddestarea)["Text"], "$Total.$A$2")
- self.assertEqual(get_state_as_dict(xbyrow)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xbycol)["Selected"], "true")
- #delete first range
- xFirstEntry = xconsareas.getChild("0")
- xFirstEntry.executeAction("SELECT", tuple())
- xdelete.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(xconsareas)["Children"], "2")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 309)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 312)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 315)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 5).getValue(), 318)
+ #verify dialog
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataConsolidate")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfunc = xDialog.getChild("func")
+ xlbdataarea = xDialog.getChild("lbdataarea")
+ xdelete = xDialog.getChild("delete")
+ xbyrow = xDialog.getChild("byrow")
+ xbycol = xDialog.getChild("bycol")
+ xeddestarea = xDialog.getChild("eddestarea")
+ xconsareas = xDialog.getChild("consareas")
+ self.assertEqual(get_state_as_dict(xfunc)["SelectEntryText"], "Sum")
+ self.assertEqual(get_state_as_dict(xconsareas)["Children"], "3")
+ self.assertEqual(get_state_as_dict(xeddestarea)["Text"], "$Total.$A$2")
+ self.assertEqual(get_state_as_dict(xbyrow)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xbycol)["Selected"], "true")
+ #delete first range
+ xFirstEntry = xconsareas.getChild("0")
+ xFirstEntry.executeAction("SELECT", tuple())
+ xdelete.executeAction("CLICK", tuple())
+ self.assertEqual(get_state_as_dict(xconsareas)["Children"], "2")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 200)
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 202)
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 204)
- self.assertEqual(get_cell_by_position(document, 0, 1, 5).getValue(), 206)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 200)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 202)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 204)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 5).getValue(), 206)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 202)
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 204)
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 206)
- self.assertEqual(get_cell_by_position(document, 0, 2, 5).getValue(), 208)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 202)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 204)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 206)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 5).getValue(), 208)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 204)
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 206)
- self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 208)
- self.assertEqual(get_cell_by_position(document, 0, 3, 5).getValue(), 210)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 204)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 206)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 208)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 5).getValue(), 210)
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 206)
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 208)
- self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 210)
- self.assertEqual(get_cell_by_position(document, 0, 4, 5).getValue(), 212)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 206)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 208)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 210)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 5).getValue(), 212)
- # test cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataConsolidate")
- 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:DataConsolidate")
+ 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/calc_tests2/standardFilter.py b/sc/qa/uitest/calc_tests2/standardFilter.py
index cc719db86c4e..25b6373c7e42 100644
--- a/sc/qa/uitest/calc_tests2/standardFilter.py
+++ b/sc/qa/uitest/calc_tests2/standardFilter.py
@@ -15,128 +15,125 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class standardFilter(UITestCase):
def test_standard_filter(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("standardFilter.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C8"}))
-
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xconnect2 = xDialog.getChild("connect2")
- xfield2 = xDialog.getChild("field2")
- xval2 = xDialog.getChild("val2")
-
- select_by_text(xfield1, "a")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- select_by_text(xconnect2, "OR")
- select_by_text(xfield2, "b")
- xval2.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #3x down - should be on row 9
- 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"], "8")
- #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")
- xconnect2 = xDialog.getChild("connect2")
- xfield2 = xDialog.getChild("field2")
- xval2 = xDialog.getChild("val2")
-
- self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "a")
- self.assertEqual(get_state_as_dict(xfield2)["SelectEntryText"], "b")
- self.assertEqual(get_state_as_dict(xconnect2)["SelectEntryText"], "OR")
- self.assertEqual(get_state_as_dict(xval1)["Text"], "1")
- self.assertEqual(get_state_as_dict(xval2)["Text"], "3")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("standardFilter.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C8"}))
+
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xconnect2 = xDialog.getChild("connect2")
+ xfield2 = xDialog.getChild("field2")
+ xval2 = xDialog.getChild("val2")
+
+ select_by_text(xfield1, "a")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ select_by_text(xconnect2, "OR")
+ select_by_text(xfield2, "b")
+ xval2.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #3x down - should be on row 9
+ 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"], "8")
+ #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")
+ xconnect2 = xDialog.getChild("connect2")
+ xfield2 = xDialog.getChild("field2")
+ xval2 = xDialog.getChild("val2")
+
+ self.assertEqual(get_state_as_dict(xfield1)["SelectEntryText"], "a")
+ self.assertEqual(get_state_as_dict(xfield2)["SelectEntryText"], "b")
+ self.assertEqual(get_state_as_dict(xconnect2)["SelectEntryText"], "OR")
+ self.assertEqual(get_state_as_dict(xval1)["Text"], "1")
+ self.assertEqual(get_state_as_dict(xval2)["Text"], "3")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
def test_standard_filter_copy_result(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("standardFilter.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C8"}))
-
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xconnect2 = xDialog.getChild("connect2")
- xfield2 = xDialog.getChild("field2")
- xval2 = xDialog.getChild("val2")
- xcopyresult = xDialog.getChild("copyresult")
- xedcopyarea = xDialog.getChild("edcopyarea")
- select_by_text(xfield1, "a")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- select_by_text(xconnect2, "OR")
- select_by_text(xfield2, "b")
- xval2.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
- xcopyresult.executeAction("CLICK", tuple())
- xedcopyarea.executeAction("TYPE", mkPropertyValues({"TEXT":"F1"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "a")
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "b")
- self.assertEqual(get_cell_by_position(document, 0, 7, 0).getString(), "c")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 7, 1).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 7, 2).getValue(), 4)
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("standardFilter.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C8"}))
+
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xconnect2 = xDialog.getChild("connect2")
+ xfield2 = xDialog.getChild("field2")
+ xval2 = xDialog.getChild("val2")
+ xcopyresult = xDialog.getChild("copyresult")
+ xedcopyarea = xDialog.getChild("edcopyarea")
+ select_by_text(xfield1, "a")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ select_by_text(xconnect2, "OR")
+ select_by_text(xfield2, "b")
+ xval2.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
+ xcopyresult.executeAction("CLICK", tuple())
+ xedcopyarea.executeAction("TYPE", mkPropertyValues({"TEXT":"F1"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "a")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "b")
+ self.assertEqual(get_cell_by_position(document, 0, 7, 0).getString(), "c")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 7, 2).getValue(), 4)
def test_standard_filter_copy_result_next_sheet(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("standardFilter.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C8"}))
-
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- xfield1 = xDialog.getChild("field1")
- xval1 = xDialog.getChild("val1")
- xconnect2 = xDialog.getChild("connect2")
- xfield2 = xDialog.getChild("field2")
- xval2 = xDialog.getChild("val2")
- xcopyresult = xDialog.getChild("copyresult")
- xedcopyarea = xDialog.getChild("edcopyarea")
- select_by_text(xfield1, "a")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- select_by_text(xconnect2, "OR")
- select_by_text(xfield2, "b")
- xval2.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
- xcopyresult.executeAction("CLICK", tuple())
- xedcopyarea.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet2.$F$1"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.assertEqual(get_cell_by_position(document, 1, 5, 0).getString(), "a")
- self.assertEqual(get_cell_by_position(document, 1, 6, 0).getString(), "b")
- self.assertEqual(get_cell_by_position(document, 1, 7, 0).getString(), "c")
- self.assertEqual(get_cell_by_position(document, 1, 5, 1).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 1, 6, 1).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 1, 7, 1).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 1, 5, 2).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 1, 6, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 1, 7, 2).getValue(), 4)
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("standardFilter.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C8"}))
+
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xfield1 = xDialog.getChild("field1")
+ xval1 = xDialog.getChild("val1")
+ xconnect2 = xDialog.getChild("connect2")
+ xfield2 = xDialog.getChild("field2")
+ xval2 = xDialog.getChild("val2")
+ xcopyresult = xDialog.getChild("copyresult")
+ xedcopyarea = xDialog.getChild("edcopyarea")
+ select_by_text(xfield1, "a")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ select_by_text(xconnect2, "OR")
+ select_by_text(xfield2, "b")
+ xval2.executeAction("TYPE", mkPropertyValues({"TEXT":"3"}))
+ xcopyresult.executeAction("CLICK", tuple())
+ xedcopyarea.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet2.$F$1"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.assertEqual(get_cell_by_position(document, 1, 5, 0).getString(), "a")
+ self.assertEqual(get_cell_by_position(document, 1, 6, 0).getString(), "b")
+ self.assertEqual(get_cell_by_position(document, 1, 7, 0).getString(), "c")
+ self.assertEqual(get_cell_by_position(document, 1, 5, 1).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 1, 6, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 1, 7, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 1, 5, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 1, 6, 2).getValue(), 3)
+ 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")
diff --git a/sc/qa/uitest/calc_tests2/tdf114992.py b/sc/qa/uitest/calc_tests2/tdf114992.py
index 38c5568171f6..eedf7dcba100 100644
--- a/sc/qa/uitest/calc_tests2/tdf114992.py
+++ b/sc/qa/uitest/calc_tests2/tdf114992.py
@@ -11,20 +11,18 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf114992(UITestCase):
def test_tdf114992_delete_sheet_crash(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf114992.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf114992.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- 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.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(), 1)
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(document.Sheets.getCount(), 2)
+ self.assertEqual(document.Sheets.getCount(), 1)
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(document.Sheets.getCount(), 2)
- self.ui_test.close_doc()
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests2/tdf37623.py b/sc/qa/uitest/calc_tests2/tdf37623.py
index fd81c77c7ef0..fcf4d278448a 100644
--- a/sc/qa/uitest/calc_tests2/tdf37623.py
+++ b/sc/qa/uitest/calc_tests2/tdf37623.py
@@ -12,23 +12,22 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf37623(UITestCase):
def test_tdf37623_autofill_rows_hidden(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf37623.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A6"}))
- 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)
+ with self.ui_test.load_file(get_url_for_data_file("tdf37623.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A6"}))
+ 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, 1).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 0, 5).getValue(), 3)
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 5).getValue(), 3)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/tdf57274.py b/sc/qa/uitest/calc_tests3/tdf57274.py
index be5b0abcb760..32b92bc14bcc 100644
--- a/sc/qa/uitest/calc_tests3/tdf57274.py
+++ b/sc/qa/uitest/calc_tests3/tdf57274.py
@@ -14,29 +14,28 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf57274(UITestCase):
def test_tdf57274_tdf116385_row_only(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf57274.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf57274.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #* Source Cells, range B6..E6
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B6:E6"}))
- self.xUITest.executeCommand(".uno:Copy")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B11"}))
- self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
- xDialog = self.xUITest.getTopFocusWindow()
- #We paste here using Paste Special with 'Link' Checkbox activated
- xLink = xDialog.getChild("link")
- xLink.executeAction("CLICK", tuple())
- xOkBtn = xDialog.getChild("ok")
- # self.ui_test.close_dialog_through_button(xOkBtn)
+ #* Source Cells, range B6..E6
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B6:E6"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B11"}))
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #We paste here using Paste Special with 'Link' Checkbox activated
+ xLink = xDialog.getChild("link")
+ xLink.executeAction("CLICK", tuple())
+ xOkBtn = xDialog.getChild("ok")
+ # self.ui_test.close_dialog_through_button(xOkBtn)
- with self.ui_test.execute_blocking_action(xOkBtn.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
+ with self.ui_test.execute_blocking_action(xOkBtn.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
- #we would expect a reference to cell E6 here and a zero being displayed, but the cell is also simply blank.
- self.assertEqual(get_cell_by_position(document, 0, 4, 10).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 4, 10).getFormula(), "=$Sheet1.$E$6")
- self.ui_test.close_doc()
+ #we would expect a reference to cell E6 here and a zero being displayed, but the cell is also simply blank.
+ self.assertEqual(get_cell_by_position(document, 0, 4, 10).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 10).getFormula(), "=$Sheet1.$E$6")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/tdf62267.py b/sc/qa/uitest/calc_tests3/tdf62267.py
index 930c0c262f25..c4c36b150125 100644
--- a/sc/qa/uitest/calc_tests3/tdf62267.py
+++ b/sc/qa/uitest/calc_tests3/tdf62267.py
@@ -15,37 +15,35 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf62267(UITestCase):
def test_tdf62267(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf62267.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- #* Copy A1, then paste special to C1;
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:Copy")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
- xDialog = self.xUITest.getTopFocusWindow()
- #it's the default - text, numbers and dates
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
-
- #--> Cell formatting should stay as before
- self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
-
- xCondFormatMgr = self.xUITest.getTopFocusWindow()
-
- # check that we have exactly 1 conditional format
- xList = xCondFormatMgr.getChild("CONTAINER")
- list_state = get_state_as_dict(xList)
- self.assertEqual(list_state['Children'], '1')
-
- xTreeEntry = xList.getChild('0')
- self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "A1\tCell value = 1")
-
- xCancelBtn = xCondFormatMgr.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf62267.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ #* Copy A1, then paste special to C1;
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #it's the default - text, numbers and dates
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
+
+ #--> Cell formatting should stay as before
+ self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
+
+ xCondFormatMgr = self.xUITest.getTopFocusWindow()
+
+ # check that we have exactly 1 conditional format
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '1')
+
+ xTreeEntry = xList.getChild('0')
+ self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "A1\tCell value = 1")
+
+ xCancelBtn = xCondFormatMgr.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/tdf63805.py b/sc/qa/uitest/calc_tests3/tdf63805.py
index e7b1277d5a7b..8c9332cb4200 100644
--- a/sc/qa/uitest/calc_tests3/tdf63805.py
+++ b/sc/qa/uitest/calc_tests3/tdf63805.py
@@ -15,45 +15,44 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf63805(UITestCase):
def test_tdf63805_autofill_Date_Months(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf63805.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf63805.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #1 - A1: 2012-10-31
- enter_text_to_cell(gridwin, "A1", "2012-10-31")
- #2 - Select A1:A20
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A20"}))
- #3 - Edit -> fill -> Series -> Down - Date-Month-Increment=1 <ok>
- self.ui_test.execute_dialog_through_command(".uno:FillSeries")
- xDialog = self.xUITest.getTopFocusWindow()
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #5 -Expected: All Cells show last day of month / Actual: some months skipped
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 41213)
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 41243)
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 41274)
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 41305)
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getValue(), 41333)
- self.assertEqual(get_cell_by_position(document, 0, 0, 5).getValue(), 41364)
- self.assertEqual(get_cell_by_position(document, 0, 0, 6).getValue(), 41394)
- self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 41425)
- self.assertEqual(get_cell_by_position(document, 0, 0, 8).getValue(), 41455)
- self.assertEqual(get_cell_by_position(document, 0, 0, 9).getValue(), 41486)
- self.assertEqual(get_cell_by_position(document, 0, 0, 10).getValue(), 41517)
- self.assertEqual(get_cell_by_position(document, 0, 0, 11).getValue(), 41547)
- self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 41578)
- self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 41608)
- self.assertEqual(get_cell_by_position(document, 0, 0, 14).getValue(), 41639)
- self.assertEqual(get_cell_by_position(document, 0, 0, 15).getValue(), 41670)
- self.assertEqual(get_cell_by_position(document, 0, 0, 16).getValue(), 41698)
- self.assertEqual(get_cell_by_position(document, 0, 0, 17).getValue(), 41729)
- self.assertEqual(get_cell_by_position(document, 0, 0, 18).getValue(), 41759)
- self.assertEqual(get_cell_by_position(document, 0, 0, 19).getValue(), 41790)
- #4 - undo.
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 41213)
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 0)
- self.ui_test.close_doc()
+ #1 - A1: 2012-10-31
+ enter_text_to_cell(gridwin, "A1", "2012-10-31")
+ #2 - Select A1:A20
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A20"}))
+ #3 - Edit -> fill -> Series -> Down - Date-Month-Increment=1 <ok>
+ self.ui_test.execute_dialog_through_command(".uno:FillSeries")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #5 -Expected: All Cells show last day of month / Actual: some months skipped
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 41213)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 41243)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 41274)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 41305)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getValue(), 41333)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 5).getValue(), 41364)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 6).getValue(), 41394)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 41425)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 8).getValue(), 41455)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 9).getValue(), 41486)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 10).getValue(), 41517)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 11).getValue(), 41547)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 41578)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 41608)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 14).getValue(), 41639)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 15).getValue(), 41670)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 16).getValue(), 41698)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 17).getValue(), 41729)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 18).getValue(), 41759)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 19).getValue(), 41790)
+ #4 - undo.
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 41213)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 0)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/tdf65856.py b/sc/qa/uitest/calc_tests3/tdf65856.py
index 60a95302b6c5..3211d3117b34 100644
--- a/sc/qa/uitest/calc_tests3/tdf65856.py
+++ b/sc/qa/uitest/calc_tests3/tdf65856.py
@@ -12,85 +12,83 @@ from libreoffice.calc.document import get_cell_by_position
class tdf65856(UITestCase):
def test_tdf65856_paste_special_shift_right(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf65856.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf65856.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #- mark D1:E14; copy
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D1:E14"}))
- self.xUITest.executeCommand(".uno:Copy")
- #mark cell D1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
- self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
- xDialog = self.xUITest.getTopFocusWindow()
+ #- mark D1:E14; copy
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D1:E14"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ #mark cell D1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xDialog = self.xUITest.getTopFocusWindow()
- xmove_right = xDialog.getChild("move_right")
- xmove_right.executeAction("CLICK", tuple())
+ xmove_right = xDialog.getChild("move_right")
+ xmove_right.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)
- #check
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "T1")
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "TE1")
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "TES1")
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "TEST1")
- self.assertEqual(get_cell_by_position(document, 0, 4, 0).getString(), "TEST1")
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "TEST1")
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "TEST1")
- self.assertEqual(get_cell_by_position(document, 0, 0, 13).getString(), "T14")
- self.assertEqual(get_cell_by_position(document, 0, 1, 13).getString(), "TE14")
- self.assertEqual(get_cell_by_position(document, 0, 2, 13).getString(), "TES14")
- self.assertEqual(get_cell_by_position(document, 0, 3, 13).getString(), "TEST14")
- self.assertEqual(get_cell_by_position(document, 0, 4, 13).getString(), "TEST14")
- self.assertEqual(get_cell_by_position(document, 0, 5, 13).getString(), "TEST14")
- self.assertEqual(get_cell_by_position(document, 0, 6, 13).getString(), "TEST14")
- self.ui_test.close_doc()
+ #check
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "T1")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "TE1")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "TES1")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 13).getString(), "T14")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 13).getString(), "TE14")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 13).getString(), "TES14")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 13).getString(), "TEST14")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 13).getString(), "TEST14")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 13).getString(), "TEST14")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 13).getString(), "TEST14")
def test_tdf65856_paste_special_shift_right_2(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf65856_2.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf65856_2.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #- select range C2:D4; copy
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C2:D4"}))
- self.xUITest.executeCommand(".uno:Copy")
- #mark cell B2
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
- self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
- xDialog = self.xUITest.getTopFocusWindow()
+ #- select range C2:D4; copy
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C2:D4"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ #mark cell B2
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ xDialog = self.xUITest.getTopFocusWindow()
- xmove_right = xDialog.getChild("move_right")
- xmove_right.executeAction("CLICK", tuple())
+ xmove_right = xDialog.getChild("move_right")
+ xmove_right.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)
- #check
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "1")
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getString(), "1")
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getString(), "1")
- self.assertEqual(get_cell_by_position(document, 0, 4, 1).getString(), "1")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "1")
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "2")
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "2")
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "2")
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getString(), "2")
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "2")
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "3")
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getString(), "3")
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getString(), "3")
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getString(), "3")
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "3")
- self.assertEqual(get_cell_by_position(document, 0, 4, 1).getFormula(), "=D2")
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getFormula(), "=D2")
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getFormula(), "=E3")
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getFormula(), "=E3")
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getFormula(), "=F4")
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getFormula(), "=F4")
- self.ui_test.close_doc()
+ #check
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 1).getFormula(), "=D2")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getFormula(), "=D2")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getFormula(), "=E3")
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getFormula(), "=E3")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getFormula(), "=F4")
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getFormula(), "=F4")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/tdf69981.py b/sc/qa/uitest/calc_tests3/tdf69981.py
index cf4c7eed0c2d..c32476acc056 100644
--- a/sc/qa/uitest/calc_tests3/tdf69981.py
+++ b/sc/qa/uitest/calc_tests3/tdf69981.py
@@ -13,66 +13,64 @@ class tdf69981(UITestCase):
def test_tdf69981_text_to_columns(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf69981.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
+ with self.ui_test.load_file(get_url_for_data_file("tdf69981.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
- xPages = xDialogOpt.getChild("pages")
- xWriterEntry = xPages.getChild('3') # Calc
- xWriterEntry.executeAction("EXPAND", tuple())
- xWriterGeneralEntry = xWriterEntry.getChild('0')
- xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
- xreplwarncb = xDialogOpt.getChild("replwarncb")
- if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
- xreplwarncb.executeAction("CLICK", tuple())
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xPages = xDialogOpt.getChild("pages")
+ xWriterEntry = xPages.getChild('3') # Calc
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xWriterGeneralEntry = xWriterEntry.getChild('0')
+ xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
+ xreplwarncb = xDialogOpt.getChild("replwarncb")
+ if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
+ xreplwarncb.executeAction("CLICK", tuple())
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #Select A2:A7
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A7"}))
- #Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- xtab = xDialog.getChild("tab")
- xcomma = xDialog.getChild("comma")
- xtab.executeAction("CLICK", tuple())
- xcomma.executeAction("CLICK", tuple())
- #Click Ok
- #overwrite warning come up
- #press Ok.
- xOK = xDialog.getChild("ok")
- with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
+ #Select A2:A7
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A7"}))
+ #Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xtab = xDialog.getChild("tab")
+ xcomma = xDialog.getChild("comma")
+ xtab.executeAction("CLICK", tuple())
+ xcomma.executeAction("CLICK", tuple())
+ #Click Ok
+ #overwrite warning come up
+ #press Ok.
+ xOK = xDialog.getChild("ok")
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Original")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "a")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "a")
- self.assertEqual(get_cell_by_position(document, 0, 0, 5).getString(), "a")
- self.assertEqual(get_cell_by_position(document, 0, 0, 6).getString(), "a")
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Original")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "a")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "a")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 5).getString(), "a")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 6).getString(), "a")
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Copy")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "b")
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "b")
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 1, 5).getString(), "b")
- self.assertEqual(get_cell_by_position(document, 0, 1, 6).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Copy")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "b")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "b")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 5).getString(), "b")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 6).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getString(), "c")
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "c")
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getString(), "c")
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 2, 5).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 2, 6).getString(), "c")
-
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getString(), "c")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "c")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getString(), "c")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 5).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 6).getString(), "c")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests3/tdf77509.py b/sc/qa/uitest/calc_tests3/tdf77509.py
index 4d2571c554dc..79e228c180da 100644
--- a/sc/qa/uitest/calc_tests3/tdf77509.py
+++ b/sc/qa/uitest/calc_tests3/tdf77509.py
@@ -13,65 +13,63 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf77509(UITestCase):
def test_tdf77509_consolidate(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf77509.xls"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #1. Open attachment: Consolidate-test.xls
- #2. Select any empty cell, eg. cell D1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
- #3. Tab: Data > Consolidate
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataConsolidate")
- xDialog = self.xUITest.getTopFocusWindow()
+ with self.ui_test.load_file(get_url_for_data_file("tdf77509.xls")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #1. Open attachment: Consolidate-test.xls
+ #2. Select any empty cell, eg. cell D1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ #3. Tab: Data > Consolidate
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataConsolidate")
+ xDialog = self.xUITest.getTopFocusWindow()
- xfunc = xDialog.getChild("func")
- xeddataarea = xDialog.getChild("eddataarea")
- xadd = xDialog.getChild("add")
- xbyrow = xDialog.getChild("byrow")
- xbycol = xDialog.getChild("bycol")
- xeddestarea = xDialog.getChild("eddestarea")
+ xfunc = xDialog.getChild("func")
+ xeddataarea = xDialog.getChild("eddataarea")
+ xadd = xDialog.getChild("add")
+ xbyrow = xDialog.getChild("byrow")
+ xbycol = xDialog.getChild("bycol")
+ xeddestarea = xDialog.getChild("eddestarea")
- select_by_text(xfunc, "Sum")
- #4. Source data ranges: $Sheet1.$A$1:$B$7
- #5. Click 'Add' so that ranges appear in "Consolidation ranges"
- xeddataarea.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$7"}))
- xadd.executeAction("CLICK", tuple())
+ select_by_text(xfunc, "Sum")
+ #4. Source data ranges: $Sheet1.$A$1:$B$7
+ #5. Click 'Add' so that ranges appear in "Consolidation ranges"
+ xeddataarea.executeAction("TYPE", mkPropertyValues({"TEXT":"$Sheet1.$A$1:$B$7"}))
+ xadd.executeAction("CLICK", tuple())
- xConsAreas = xDialog.getChild("consareas")
- self.assertEqual(1, len(xConsAreas.getChildren()))
- self.assertEqual("$Sheet1.$A$1:$B$7", get_state_as_dict(xConsAreas.getChild("0"))['Text'])
+ xConsAreas = xDialog.getChild("consareas")
+ self.assertEqual(1, len(xConsAreas.getChildren()))
+ self.assertEqual("$Sheet1.$A$1:$B$7", get_state_as_dict(xConsAreas.getChild("0"))['Text'])
- #6. Click 'Options' > check 'Row labels' > click OK
- xbyrow.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.assertEqual("A 1", get_cell_by_position(document, 0, 3, 0).getString())
- self.assertEqual("AB 1", get_cell_by_position(document, 0, 3, 1).getString())
- self.assertEqual("AB 12", get_cell_by_position(document, 0, 3, 2).getString())
- self.assertEqual("AB 123", get_cell_by_position(document, 0, 3, 3).getString())
- self.assertEqual("ABC 1", get_cell_by_position(document, 0, 3, 4).getString())
+ #6. Click 'Options' > check 'Row labels' > click OK
+ xbyrow.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #verify
+ self.assertEqual("A 1", get_cell_by_position(document, 0, 3, 0).getString())
+ self.assertEqual("AB 1", get_cell_by_position(document, 0, 3, 1).getString())
+ self.assertEqual("AB 12", get_cell_by_position(document, 0, 3, 2).getString())
+ self.assertEqual("AB 123", get_cell_by_position(document, 0, 3, 3).getString())
+ self.assertEqual("ABC 1", get_cell_by_position(document, 0, 3, 4).getString())
- self.assertEqual(1, get_cell_by_position(document, 0, 4, 0).getValue())
- self.assertEqual(2, get_cell_by_position(document, 0, 4, 1).getValue())
- self.assertEqual(2, get_cell_by_position(document, 0, 4, 2).getValue())
- self.assertEqual(1, get_cell_by_position(document, 0, 4, 3).getValue())
- self.assertEqual(1, get_cell_by_position(document, 0, 4, 4).getValue())
+ self.assertEqual(1, get_cell_by_position(document, 0, 4, 0).getValue())
+ self.assertEqual(2, get_cell_by_position(document, 0, 4, 1).getValue())
+ self.assertEqual(2, get_cell_by_position(document, 0, 4, 2).getValue())
+ self.assertEqual(1, get_cell_by_position(document, 0, 4, 3).getValue())
+ self.assertEqual(1, get_cell_by_position(document, 0, 4, 4).getValue())
- self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual("", get_cell_by_position(document, 0, 3, 0).getString())
- self.assertEqual("", get_cell_by_position(document, 0, 3, 1).getString())
- self.assertEqual("", get_cell_by_position(document, 0, 3, 2).getString())
- self.assertEqual("", get_cell_by_position(document, 0, 3, 3).getString())
- self.assertEqual("", get_cell_by_position(document, 0, 3, 4).getString())
+ self.assertEqual("", get_cell_by_position(document, 0, 3, 0).getString())
+ self.assertEqual("", get_cell_by_position(document, 0, 3, 1).getString())
+ self.assertEqual("", get_cell_by_position(document, 0, 3, 2).getString())
+ self.assertEqual("", get_cell_by_position(document, 0, 3, 3).getString())
+ self.assertEqual("", get_cell_by_position(document, 0, 3, 4).getString())
- self.assertEqual(0, get_cell_by_position(document, 0, 4, 0).getValue())
- self.assertEqual(0, get_cell_by_position(document, 0, 4, 1).getValue())
- self.assertEqual(0, get_cell_by_position(document, 0, 4, 2).getValue())
- self.assertEqual(0, get_cell_by_position(document, 0, 4, 3).getValue())
- self.assertEqual(0, get_cell_by_position(document, 0, 4, 4).getValue())
-
- self.ui_test.close_doc()
+ self.assertEqual(0, get_cell_by_position(document, 0, 4, 0).getValue())
+ self.assertEqual(0, get_cell_by_position(document, 0, 4, 1).getValue())
+ self.assertEqual(0, get_cell_by_position(document, 0, 4, 2).getValue())
+ self.assertEqual(0, get_cell_by_position(document, 0, 4, 3).getValue())
+ self.assertEqual(0, get_cell_by_position(document, 0, 4, 4).getValue())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/tdf131170.py b/sc/qa/uitest/calc_tests4/tdf131170.py
index 87805af1a167..8f558f78fef6 100644
--- a/sc/qa/uitest/calc_tests4/tdf131170.py
+++ b/sc/qa/uitest/calc_tests4/tdf131170.py
@@ -9,42 +9,40 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class tdf131170(UITestCase):
def test_DefineLabelRange(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf131170.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf131170.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- self.ui_test.execute_dialog_through_command(".uno:DefineLabelRange")
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_command(".uno:DefineLabelRange")
+ xDialog = self.xUITest.getTopFocusWindow()
- xRange = xDialog.getChild("range")
- self.assertEqual(4, len(xRange.getChildren()))
- self.assertEqual(get_state_as_dict(xRange.getChild('0'))["Text"].strip(), "--- Column ---")
- self.assertEqual(get_state_as_dict(xRange.getChild('1'))["Text"].strip(), "$Sheet1.$I$6:$K$6 [AA, BB, CC]")
- self.assertEqual(get_state_as_dict(xRange.getChild('2'))["Text"].strip(), "--- Row ---")
- self.assertEqual(get_state_as_dict(xRange.getChild('3'))["Text"].strip(), "$Sheet1.$H$7:$H$9 [X, Y, Z]")
+ xRange = xDialog.getChild("range")
+ self.assertEqual(4, len(xRange.getChildren()))
+ self.assertEqual(get_state_as_dict(xRange.getChild('0'))["Text"].strip(), "--- Column ---")
+ self.assertEqual(get_state_as_dict(xRange.getChild('1'))["Text"].strip(), "$Sheet1.$I$6:$K$6 [AA, BB, CC]")
+ self.assertEqual(get_state_as_dict(xRange.getChild('2'))["Text"].strip(), "--- Row ---")
+ self.assertEqual(get_state_as_dict(xRange.getChild('3'))["Text"].strip(), "$Sheet1.$H$7:$H$9 [X, Y, Z]")
- xDeleteBtn = xDialog.getChild("delete")
+ xDeleteBtn = xDialog.getChild("delete")
- xRange.getChild('1').executeAction("SELECT", tuple())
- with self.ui_test.execute_blocking_action(xDeleteBtn.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
+ xRange.getChild('1').executeAction("SELECT", tuple())
+ with self.ui_test.execute_blocking_action(xDeleteBtn.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
- self.assertEqual(3, len(xRange.getChildren()))
- self.assertEqual(get_state_as_dict(xRange.getChild('0'))["Text"].strip(), "--- Column ---")
- self.assertEqual(get_state_as_dict(xRange.getChild('1'))["Text"].strip(), "--- Row ---")
- self.assertEqual(get_state_as_dict(xRange.getChild('2'))["Text"].strip(), "$Sheet1.$H$7:$H$9 [X, Y, Z]")
+ self.assertEqual(3, len(xRange.getChildren()))
+ self.assertEqual(get_state_as_dict(xRange.getChild('0'))["Text"].strip(), "--- Column ---")
+ self.assertEqual(get_state_as_dict(xRange.getChild('1'))["Text"].strip(), "--- Row ---")
+ self.assertEqual(get_state_as_dict(xRange.getChild('2'))["Text"].strip(), "$Sheet1.$H$7:$H$9 [X, Y, Z]")
- xRange.getChild('2').executeAction("SELECT", tuple())
- with self.ui_test.execute_blocking_action(xDeleteBtn.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
+ xRange.getChild('2').executeAction("SELECT", tuple())
+ with self.ui_test.execute_blocking_action(xDeleteBtn.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
- self.assertEqual(2, len(xRange.getChildren()))
- self.assertEqual(get_state_as_dict(xRange.getChild('0'))["Text"].strip(), "--- Column ---")
- self.assertEqual(get_state_as_dict(xRange.getChild('1'))["Text"].strip(), "--- Row ---")
+ self.assertEqual(2, len(xRange.getChildren()))
+ self.assertEqual(get_state_as_dict(xRange.getChild('0'))["Text"].strip(), "--- Column ---")
+ self.assertEqual(get_state_as_dict(xRange.getChild('1'))["Text"].strip(), "--- Row ---")
- 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/calc_tests4/tdf138089.py b/sc/qa/uitest/calc_tests4/tdf138089.py
index 54e3015b3175..c59838df86db 100644
--- a/sc/qa/uitest/calc_tests4/tdf138089.py
+++ b/sc/qa/uitest/calc_tests4/tdf138089.py
@@ -13,36 +13,34 @@ class tdf138089(UITestCase):
def test_tdf138089(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf138089.xlsx"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
-
- self.assertFalse(is_row_hidden(calc_doc, 0))
- self.assertTrue(is_row_hidden(calc_doc, 1))
- self.assertTrue(is_row_hidden(calc_doc, 2))
- self.assertTrue(is_row_hidden(calc_doc, 3))
- self.assertFalse(is_row_hidden(calc_doc, 4))
- self.assertFalse(is_row_hidden(calc_doc, 5))
- self.assertFalse(is_row_hidden(calc_doc, 6))
-
- # Without the fix in place, this test would have crashed here
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- self.assertEqual("2017-12-01", get_state_as_dict(xDialog.getChild("val1"))['Text'])
- self.assertEqual("过帐日期", get_state_as_dict(xDialog.getChild("field1"))["DisplayText"])
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertFalse(is_row_hidden(calc_doc, 0))
- self.assertTrue(is_row_hidden(calc_doc, 1))
- self.assertTrue(is_row_hidden(calc_doc, 2))
- self.assertTrue(is_row_hidden(calc_doc, 3))
- self.assertFalse(is_row_hidden(calc_doc, 4))
- self.assertFalse(is_row_hidden(calc_doc, 5))
- self.assertTrue(is_row_hidden(calc_doc, 6))
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf138089.xlsx")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+
+ self.assertFalse(is_row_hidden(calc_doc, 0))
+ self.assertTrue(is_row_hidden(calc_doc, 1))
+ self.assertTrue(is_row_hidden(calc_doc, 2))
+ self.assertTrue(is_row_hidden(calc_doc, 3))
+ self.assertFalse(is_row_hidden(calc_doc, 4))
+ self.assertFalse(is_row_hidden(calc_doc, 5))
+ self.assertFalse(is_row_hidden(calc_doc, 6))
+
+ # Without the fix in place, this test would have crashed here
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ self.assertEqual("2017-12-01", get_state_as_dict(xDialog.getChild("val1"))['Text'])
+ self.assertEqual("过帐日期", get_state_as_dict(xDialog.getChild("field1"))["DisplayText"])
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertFalse(is_row_hidden(calc_doc, 0))
+ self.assertTrue(is_row_hidden(calc_doc, 1))
+ self.assertTrue(is_row_hidden(calc_doc, 2))
+ self.assertTrue(is_row_hidden(calc_doc, 3))
+ self.assertFalse(is_row_hidden(calc_doc, 4))
+ self.assertFalse(is_row_hidden(calc_doc, 5))
+ self.assertTrue(is_row_hidden(calc_doc, 6))
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/tdf141547.py b/sc/qa/uitest/calc_tests4/tdf141547.py
index 066507aa9db8..cfe8e1d33cb0 100644
--- a/sc/qa/uitest/calc_tests4/tdf141547.py
+++ b/sc/qa/uitest/calc_tests4/tdf141547.py
@@ -13,30 +13,28 @@ class tdf141547(UITestCase):
def test_tdf141547(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf141547.xlsx"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
-
- self.assertFalse(is_row_hidden(calc_doc, 0))
- for i in range(1, 7):
- self.assertTrue(is_row_hidden(calc_doc, i))
-
- # Without the fix in place, this test would have crashed here
- self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
- xDialog = self.xUITest.getTopFocusWindow()
- self.assertEqual("0", get_state_as_dict(xDialog.getChild("val1"))['Text'])
- self.assertEqual("过帐日期", get_state_as_dict(xDialog.getChild("field1"))["DisplayText"])
- self.assertEqual("Empty", get_state_as_dict(xDialog.getChild("val2"))['Text'])
- self.assertEqual("过帐日期", get_state_as_dict(xDialog.getChild("field2"))["DisplayText"])
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertFalse(is_row_hidden(calc_doc, 0))
- for i in range(1, 7):
- self.assertTrue(is_row_hidden(calc_doc, i))
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf141547.xlsx")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+
+ self.assertFalse(is_row_hidden(calc_doc, 0))
+ for i in range(1, 7):
+ self.assertTrue(is_row_hidden(calc_doc, i))
+
+ # Without the fix in place, this test would have crashed here
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DataFilterStandardFilter")
+ xDialog = self.xUITest.getTopFocusWindow()
+ self.assertEqual("0", get_state_as_dict(xDialog.getChild("val1"))['Text'])
+ self.assertEqual("过帐日期", get_state_as_dict(xDialog.getChild("field1"))["DisplayText"])
+ self.assertEqual("Empty", get_state_as_dict(xDialog.getChild("val2"))['Text'])
+ self.assertEqual("过帐日期", get_state_as_dict(xDialog.getChild("field2"))["DisplayText"])
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertFalse(is_row_hidden(calc_doc, 0))
+ for i in range(1, 7):
+ self.assertTrue(is_row_hidden(calc_doc, i))
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/tdf85403.py b/sc/qa/uitest/calc_tests4/tdf85403.py
index 2e411ada8394..0a2acbd7ce9f 100644
--- a/sc/qa/uitest/calc_tests4/tdf85403.py
+++ b/sc/qa/uitest/calc_tests4/tdf85403.py
@@ -13,25 +13,23 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf85403(UITestCase):
def test_tdf85403_text_to_columns(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf85403.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf85403.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #'123 in A1, SUM(A1) in B1, result is 0 as expected,
- #now select A1 and use data->text to columns->ok and B1 is not updated,
- #putting a new SUM(A1) in C1 will show 123
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- # Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
+ #'123 in A1, SUM(A1) in B1, result is 0 as expected,
+ #now select A1 and use data->text to columns->ok and B1 is not updated,
+ #putting a new SUM(A1) in C1 will show 123
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ # Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 123)
-
- self.ui_test.close_doc()
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 123)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/tdf85979.py b/sc/qa/uitest/calc_tests4/tdf85979.py
index 3a2e9a6a81cd..8482bdb917d0 100644
--- a/sc/qa/uitest/calc_tests4/tdf85979.py
+++ b/sc/qa/uitest/calc_tests4/tdf85979.py
@@ -13,41 +13,39 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf85979(UITestCase):
def test_td85979_text_to_columns(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf85979.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf85979.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #(I selected C1 to C5, then Text to Columns, unselected "Tab" and selected "Space")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:C5"}))
- # 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)
+ #(I selected C1 to C5, then Text to Columns, unselected "Tab" and selected "Space")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:C5"}))
+ # 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, 2, 0).getValue(), 99)
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 9)
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 9)
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 260)
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 10)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 23)
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 23)
- self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 149)
- self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 14)
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 14)
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 16)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 35)
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 35)
-
- self.ui_test.close_doc()
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 99)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 9)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 9)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 260)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 10)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 23)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 23)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 149)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 14)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 14)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 16)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 35)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 35)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/tdf86253.py b/sc/qa/uitest/calc_tests4/tdf86253.py
index a2e004caf3a4..f3047f8fd4f2 100644
--- a/sc/qa/uitest/calc_tests4/tdf86253.py
+++ b/sc/qa/uitest/calc_tests4/tdf86253.py
@@ -11,48 +11,46 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf86253(UITestCase):
def test_tdf86253(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf86253.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- #* Copy A1, then paste special only "formatting" to C1:C17;
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:Copy")
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:C17"}))
- 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)
-
- #--> Cell formatting for C1:C17 is changed. But, if you go to "Format - Conditional Formatting - Manage",
- #you will see that a new formatting condition is created with the range "C1:C6", rather than "C1:C17". This is wrong behavior.
- self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
-
- xCondFormatMgr = self.xUITest.getTopFocusWindow()
-
- # check that we have exactly 1 conditional format and range is C1:C17
- xList = xCondFormatMgr.getChild("CONTAINER")
- list_state = get_state_as_dict(xList)
- self.assertEqual(list_state['Children'], '1')
-
- xTreeEntry = xList.getChild('0')
- self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "A1:A6,C1:C17\tCell value >= 0")
-
- xCancelBtn = xCondFormatMgr.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf86253.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ #* Copy A1, then paste special only "formatting" to C1:C17;
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:C17"}))
+ 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)
+
+ #--> Cell formatting for C1:C17 is changed. But, if you go to "Format - Conditional Formatting - Manage",
+ #you will see that a new formatting condition is created with the range "C1:C6", rather than "C1:C17". This is wrong behavior.
+ self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
+
+ xCondFormatMgr = self.xUITest.getTopFocusWindow()
+
+ # check that we have exactly 1 conditional format and range is C1:C17
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '1')
+
+ xTreeEntry = xList.getChild('0')
+ self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "A1:A6,C1:C17\tCell value >= 0")
+
+ xCancelBtn = xCondFormatMgr.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/tdf89958.py b/sc/qa/uitest/calc_tests4/tdf89958.py
index 0ec1b7dd8284..8935bae5934a 100644
--- a/sc/qa/uitest/calc_tests4/tdf89958.py
+++ b/sc/qa/uitest/calc_tests4/tdf89958.py
@@ -13,50 +13,48 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf89958(UITestCase):
def test_td89958_standard_filter(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf89958.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #select A1-> Column .uno:SelectColumn
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:SelectColumn")
+ with self.ui_test.load_file(get_url_for_data_file("tdf89958.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #select A1-> Column .uno:SelectColumn
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
- #Menu: Data->Filter->Standard Filter ...
- #Field Name "Column A", Condition "Does not end with", Value: "CTORS"
- 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")
+ #Menu: Data->Filter->Standard Filter ...
+ #Field Name "Column A", Condition "Does not end with", Value: "CTORS"
+ 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, "Column A")
- select_by_text(xcond1, "Does not end with")
- xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"CTORS"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ select_by_text(xfield1, "Column A")
+ select_by_text(xcond1, "Does not end with")
+ xval1.executeAction("TYPE", mkPropertyValues({"TEXT":"CTORS"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #Expected behaviours: A2 is not filtered as it does not end with "CTORS".
- 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"], "3")
-# #reopen filter and verify - doesn't works
-# 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"], "Column A")
-# self.assertEqual(get_state_as_dict(xval1)["Text"], "CTORS")
-# 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()
+ #Expected behaviours: A2 is not filtered as it does not end with "CTORS".
+ 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"], "3")
+ # #reopen filter and verify - doesn't works
+ # 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"], "Column A")
+ # self.assertEqual(get_state_as_dict(xval1)["Text"], "CTORS")
+ # 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_tests4/tdf99386.py b/sc/qa/uitest/calc_tests4/tdf99386.py
index 088af0eee505..4df99fb733b8 100644
--- a/sc/qa/uitest/calc_tests4/tdf99386.py
+++ b/sc/qa/uitest/calc_tests4/tdf99386.py
@@ -14,18 +14,16 @@ class tdf99386(UITestCase):
def test_td99386_undo_merged_cell_needs_hard_recalculate(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf99386.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf99386.ods")) as calc_doc:
- 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({"RANGE": "A1:B1"})) #select cells
- self.xUITest.executeCommand(".uno:ToggleMergeCells") # merge cells
- self.xUITest.executeCommand(".uno:Undo")
+ xGridWindow.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B1"})) #select cells
+ self.xUITest.executeCommand(".uno:ToggleMergeCells") # merge cells
+ self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "This")
-
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "This")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests4/textToColumns.py b/sc/qa/uitest/calc_tests4/textToColumns.py
index 5c4bbf6c59af..5231c40dabcb 100644
--- a/sc/qa/uitest/calc_tests4/textToColumns.py
+++ b/sc/qa/uitest/calc_tests4/textToColumns.py
@@ -15,488 +15,481 @@ class CalcTextToColumns(UITestCase):
def test_text_to_columns_dot(self):
#_Dot_as_Separator
- calc_doc = self.ui_test.load_file(get_url_for_data_file("text_to_columns_dot.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
-
- xPages = xDialogOpt.getChild("pages")
- xWriterEntry = xPages.getChild('3') # Calc
- xWriterEntry.executeAction("EXPAND", tuple())
- xWriterGeneralEntry = xWriterEntry.getChild('0')
- xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
- xreplwarncb = xDialogOpt.getChild("replwarncb")
- print(get_state_as_dict(xreplwarncb)["Selected"])
- if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
- xreplwarncb.executeAction("CLICK", tuple())
- print(get_state_as_dict(xreplwarncb)["Selected"])
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Select A1:A5 on Sheet 'Dot_as_Separator'
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
- #Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- #Untag Tab as separator and tag other. Put a dot into the input field next to the other checkbox
- xtab = xDialog.getChild("tab")
- xcomma = xDialog.getChild("comma")
- xsemicolon = xDialog.getChild("semicolon")
- xspace = xDialog.getChild("space")
- 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
- #Does an overwrite warning come up? If not file an Issue.
- #Tag the 'Do not show warning again' checkbox and press Ok.
- xOK = xDialog.getChild("ok")
- with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes") as dialog:
- xask = dialog.getChild("ask")
- xask.executeAction("CLICK", tuple())
-
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
- 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(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
- 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, 4).getString(), "random content")
- #verify setting in options
- 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")
- self.assertEqual(get_state_as_dict(xreplwarncb)["Selected"], "false")
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_dot.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+
+ xPages = xDialogOpt.getChild("pages")
+ xWriterEntry = xPages.getChild('3') # Calc
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xWriterGeneralEntry = xWriterEntry.getChild('0')
+ xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
+ xreplwarncb = xDialogOpt.getChild("replwarncb")
+ print(get_state_as_dict(xreplwarncb)["Selected"])
+ if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
+ xreplwarncb.executeAction("CLICK", tuple())
+ print(get_state_as_dict(xreplwarncb)["Selected"])
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Select A1:A5 on Sheet 'Dot_as_Separator'
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ #Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Untag Tab as separator and tag other. Put a dot into the input field next to the other checkbox
+ xtab = xDialog.getChild("tab")
+ xcomma = xDialog.getChild("comma")
+ xsemicolon = xDialog.getChild("semicolon")
+ xspace = xDialog.getChild("space")
+ 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
+ #Does an overwrite warning come up? If not file an Issue.
+ #Tag the 'Do not show warning again' checkbox and press Ok.
+ xOK = xDialog.getChild("ok")
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes") as dialog:
+ xask = dialog.getChild("ask")
+ xask.executeAction("CLICK", tuple())
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
+ 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(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
+ 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, 4).getString(), "random content")
+ #verify setting in options
+ 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")
+ self.assertEqual(get_state_as_dict(xreplwarncb)["Selected"], "false")
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
def test_text_to_columns_comma(self):
#Comma as Separator
- calc_doc = self.ui_test.load_file(get_url_for_data_file("text_to_columns_comma.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
-
- xPages = xDialogOpt.getChild("pages")
- xWriterEntry = xPages.getChild('3') # Calc
- xWriterEntry.executeAction("EXPAND", tuple())
- xWriterGeneralEntry = xWriterEntry.getChild('0')
- xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
- xreplwarncb = xDialogOpt.getChild("replwarncb")
- print(get_state_as_dict(xreplwarncb)["Selected"])
- if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
- xreplwarncb.executeAction("CLICK", tuple())
- print(get_state_as_dict(xreplwarncb)["Selected"])
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- # Select A1:A5
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
- # Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- # Untag Tab as separator and tag comma.
- xComma = xDialog.getChild("comma")
- if (get_state_as_dict(xComma)["Selected"]) == "false":
- xComma.executeAction("CLICK", tuple())
- # Click Ok
- xOK = xDialog.getChild("ok")
-
- with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
-
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
- 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(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
- 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, 4).getString(), "random content")
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_comma.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+
+ xPages = xDialogOpt.getChild("pages")
+ xWriterEntry = xPages.getChild('3') # Calc
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xWriterGeneralEntry = xWriterEntry.getChild('0')
+ xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
+ xreplwarncb = xDialogOpt.getChild("replwarncb")
+ print(get_state_as_dict(xreplwarncb)["Selected"])
+ if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
+ xreplwarncb.executeAction("CLICK", tuple())
+ print(get_state_as_dict(xreplwarncb)["Selected"])
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ # Select A1:A5
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ # Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # Untag Tab as separator and tag comma.
+ xComma = xDialog.getChild("comma")
+ if (get_state_as_dict(xComma)["Selected"]) == "false":
+ xComma.executeAction("CLICK", tuple())
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
+ 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(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
+ 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, 4).getString(), "random content")
+
def test_text_to_columns_semicolon(self):
#Semicolon as Separator
- calc_doc = self.ui_test.load_file(get_url_for_data_file("text_to_columns_semicolon.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
-
- xPages = xDialogOpt.getChild("pages")
- xWriterEntry = xPages.getChild('3') # Calc
- xWriterEntry.executeAction("EXPAND", tuple())
- xWriterGeneralEntry = xWriterEntry.getChild('0')
- xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
- xreplwarncb = xDialogOpt.getChild("replwarncb")
- if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
- xreplwarncb.executeAction("CLICK", tuple())
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- # Select A1:A5 on Sheet
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
- # Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- # Untag comma as separator and tag Semicolon
- xSemicolon = xDialog.getChild("semicolon")
- if (get_state_as_dict(xSemicolon)["Selected"]) == "false":
- xSemicolon.executeAction("CLICK", tuple())
- # Click Ok
- xOK = xDialog.getChild("ok")
-
- with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
-
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
- 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(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
- 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, 4).getString(), "random content")
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_semicolon.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+
+ xPages = xDialogOpt.getChild("pages")
+ xWriterEntry = xPages.getChild('3') # Calc
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xWriterGeneralEntry = xWriterEntry.getChild('0')
+ xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
+ xreplwarncb = xDialogOpt.getChild("replwarncb")
+ if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
+ xreplwarncb.executeAction("CLICK", tuple())
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ # Select A1:A5 on Sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ # Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # Untag comma as separator and tag Semicolon
+ xSemicolon = xDialog.getChild("semicolon")
+ if (get_state_as_dict(xSemicolon)["Selected"]) == "false":
+ xSemicolon.executeAction("CLICK", tuple())
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
+ 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(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
+ 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, 4).getString(), "random content")
def test_text_to_columns_space(self):
#Space as Separator
- calc_doc = self.ui_test.load_file(get_url_for_data_file("text_to_columns_space.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
-
- xPages = xDialogOpt.getChild("pages")
- xWriterEntry = xPages.getChild('3') # Calc
- xWriterEntry.executeAction("EXPAND", tuple())
- xWriterGeneralEntry = xWriterEntry.getChild('0')
- xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
- xreplwarncb = xDialogOpt.getChild("replwarncb")
- if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
- xreplwarncb.executeAction("CLICK", tuple())
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- # Select A1:A5 on Sheet
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
- # Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- # Untag comma as separator and tag Semicolon
- xSpace = xDialog.getChild("space")
- if (get_state_as_dict(xSpace)["Selected"]) == "false":
- xSpace.executeAction("CLICK", tuple())
- # xspace.executeAction("CLICK", tuple())
- # Click Ok
- xOK = xDialog.getChild("ok")
-
- with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
-
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
- 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(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
- 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, 4).getString(), "random content")
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_space.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+
+ xPages = xDialogOpt.getChild("pages")
+ xWriterEntry = xPages.getChild('3') # Calc
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xWriterGeneralEntry = xWriterEntry.getChild('0')
+ xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
+ xreplwarncb = xDialogOpt.getChild("replwarncb")
+ if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
+ xreplwarncb.executeAction("CLICK", tuple())
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ # Select A1:A5 on Sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ # Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # Untag comma as separator and tag Semicolon
+ xSpace = xDialog.getChild("space")
+ if (get_state_as_dict(xSpace)["Selected"]) == "false":
+ xSpace.executeAction("CLICK", tuple())
+ # xspace.executeAction("CLICK", tuple())
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
+ 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(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
+ 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, 4).getString(), "random content")
def test_text_to_columns_pipe(self):
#Space as Separator
- calc_doc = self.ui_test.load_file(get_url_for_data_file("text_to_columns_pipe.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
-
- xPages = xDialogOpt.getChild("pages")
- xWriterEntry = xPages.getChild('3') # Calc
- xWriterEntry.executeAction("EXPAND", tuple())
- xWriterGeneralEntry = xWriterEntry.getChild('0')
- xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
- xreplwarncb = xDialogOpt.getChild("replwarncb")
- if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
- xreplwarncb.executeAction("CLICK", tuple())
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- # Select A1:A5 on Sheet
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
- # Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- # Untag comma as separator and tag Semicolon
- xtab = xDialog.getChild("tab")
- xcomma = xDialog.getChild("comma")
- xsemicolon = xDialog.getChild("semicolon")
- xspace = xDialog.getChild("space")
- xother = xDialog.getChild("other")
- xinputother = xDialog.getChild("inputother")
- xSpace = xDialog.getChild("space")
- if (get_state_as_dict(xother)["Selected"]) == "false":
- xother.executeAction("CLICK", tuple())
- xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"|"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
-
- with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
-
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
- 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(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
- 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, 4).getString(), "random content")
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_pipe.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+
+ xPages = xDialogOpt.getChild("pages")
+ xWriterEntry = xPages.getChild('3') # Calc
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xWriterGeneralEntry = xWriterEntry.getChild('0')
+ xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
+ xreplwarncb = xDialogOpt.getChild("replwarncb")
+ if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
+ xreplwarncb.executeAction("CLICK", tuple())
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ # Select A1:A5 on Sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ # Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # Untag comma as separator and tag Semicolon
+ xtab = xDialog.getChild("tab")
+ xcomma = xDialog.getChild("comma")
+ xsemicolon = xDialog.getChild("semicolon")
+ xspace = xDialog.getChild("space")
+ xother = xDialog.getChild("other")
+ xinputother = xDialog.getChild("inputother")
+ xSpace = xDialog.getChild("space")
+ if (get_state_as_dict(xother)["Selected"]) == "false":
+ xother.executeAction("CLICK", tuple())
+ xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"|"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
+ 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(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
+ 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, 4).getString(), "random content")
def test_text_to_columns_pipespace(self):
#Space as Separator
- calc_doc = self.ui_test.load_file(get_url_for_data_file("text_to_columns_pipe_space.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
- self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
- xDialogOpt = self.xUITest.getTopFocusWindow()
-
- xPages = xDialogOpt.getChild("pages")
- xWriterEntry = xPages.getChild('3') # Calc
- xWriterEntry.executeAction("EXPAND", tuple())
- xWriterGeneralEntry = xWriterEntry.getChild('0')
- xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
- xreplwarncb = xDialogOpt.getChild("replwarncb")
- if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
- xreplwarncb.executeAction("CLICK", tuple())
- xOKBtn = xDialogOpt.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- # Select A1:A5 on Sheet
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
- # Data - Text to Columns
- self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
- xDialog = self.xUITest.getTopFocusWindow()
- #
- xtab = xDialog.getChild("tab")
- xcomma = xDialog.getChild("comma")
- xsemicolon = xDialog.getChild("semicolon")
- xspace = xDialog.getChild("space")
- xother = xDialog.getChild("other")
- xinputother = xDialog.getChild("inputother")
- if (get_state_as_dict(xspace)["Selected"]) == "false":
- xspace.executeAction("CLICK", tuple())
- if (get_state_as_dict(xother)["Selected"]) == "false":
- xother.executeAction("CLICK", tuple())
- xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"|"}))
- # Click Ok
- xOK = xDialog.getChild("ok")
-
- with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
-
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
- 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(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
- self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
- self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
- self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
- 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, 4).getString(), "random content")
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_pipe_space.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Make sure that tools-options-StarOffice Calc-General-Input settings-Show overwrite warning when pasting data is tagged.
+ self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") #optionsdialog
+ xDialogOpt = self.xUITest.getTopFocusWindow()
+
+ xPages = xDialogOpt.getChild("pages")
+ xWriterEntry = xPages.getChild('3') # Calc
+ xWriterEntry.executeAction("EXPAND", tuple())
+ xWriterGeneralEntry = xWriterEntry.getChild('0')
+ xWriterGeneralEntry.executeAction("SELECT", tuple()) #General / replwarncb
+ xreplwarncb = xDialogOpt.getChild("replwarncb")
+ if (get_state_as_dict(xreplwarncb)["Selected"]) == "false":
+ xreplwarncb.executeAction("CLICK", tuple())
+ xOKBtn = xDialogOpt.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ # Select A1:A5 on Sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ # Data - Text to Columns
+ self.ui_test.execute_dialog_through_command(".uno:TextToColumns")
+ xDialog = self.xUITest.getTopFocusWindow()
+ #
+ xtab = xDialog.getChild("tab")
+ xcomma = xDialog.getChild("comma")
+ xsemicolon = xDialog.getChild("semicolon")
+ xspace = xDialog.getChild("space")
+ xother = xDialog.getChild("other")
+ xinputother = xDialog.getChild("inputother")
+ if (get_state_as_dict(xspace)["Selected"]) == "false":
+ xspace.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xother)["Selected"]) == "false":
+ xother.executeAction("CLICK", tuple())
+ xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"|"}))
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 1)
+ 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(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(document, 0, 6, 0).getString(), "random content")
+ 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, 4).getString(), "random content")
# 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 4203ef728fcb..e9e54206faa7 100644
--- a/sc/qa/uitest/calc_tests4/trackedChanges.py
+++ b/sc/qa/uitest/calc_tests4/trackedChanges.py
@@ -15,31 +15,29 @@ import datetime
class CalcTrackedChanges(UITestCase):
def test_tdf131907(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf131907.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
-
- xChangesList = xTrackDlg.getChild("calcchanges")
- self.assertEqual(1, len(xChangesList.getChildren()))
+ with self.ui_test.load_file(get_url_for_data_file("tdf131907.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
- textStart = "Row inserted \tSheet1.1:1\t \t"
- textEnd = "(Row 1:1 inserted)"
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].startswith(textStart))
- self.assertTrue(get_state_as_dict(xChangesList.getChild('0'))["Text"].endswith(textEnd))
+ xChangesList = xTrackDlg.getChild("calcchanges")
+ self.assertEqual(1, len(xChangesList.getChildren()))
- #it would crash here
- xRejBtn = xTrackDlg.getChild("reject")
- xRejBtn.executeAction("CLICK", tuple())
+ textStart = "Row inserted \tSheet1.1:1\t \t"
+ textEnd = "(Row 1:1 inserted)"
+ 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.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")
+ #it would crash here
+ xRejBtn = xTrackDlg.getChild("reject")
+ xRejBtn.executeAction("CLICK", tuple())
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.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")
- self.ui_test.close_doc()
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
def test_tdf66263_Protect_Records(self):
calc_doc = self.ui_test.create_doc_in_start_center("calc")
@@ -296,31 +294,29 @@ class CalcTrackedChanges(UITestCase):
def test_tdf136062(self):
- self.ui_test.load_file(get_url_for_data_file("tdf136062.ods"))
-
- self.xUITest.getTopFocusWindow()
+ with self.ui_test.load_file(get_url_for_data_file("tdf136062.ods")):
- self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
- xTrackDlg = self.xUITest.getTopFocusWindow()
+ self.xUITest.getTopFocusWindow()
- xChangesList = xTrackDlg.getChild("calcchanges")
- self.assertEqual(1, len(xChangesList.getChildren()))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:AcceptChanges")
+ xTrackDlg = self.xUITest.getTopFocusWindow()
- xRejectAllBtn = xTrackDlg.getChild("rejectall")
- xRejectBtn = xTrackDlg.getChild("reject")
- xAcceptAllBtn = xTrackDlg.getChild("acceptall")
- xAcceptBtn = xTrackDlg.getChild("accept")
+ xChangesList = xTrackDlg.getChild("calcchanges")
+ self.assertEqual(1, len(xChangesList.getChildren()))
- # Without the fix in place, it would have failed with
- # AssertionError: 'R~eject All' != 'R~eject All/Clear formatting'
- self.assertEqual('R~eject All', get_state_as_dict(xRejectAllBtn)['Text'])
- self.assertEqual('~Reject', get_state_as_dict(xRejectBtn)['Text'])
- self.assertEqual('A~ccept All', get_state_as_dict(xAcceptAllBtn)['Text'])
- self.assertEqual('~Accept', get_state_as_dict(xAcceptBtn)['Text'])
+ xRejectAllBtn = xTrackDlg.getChild("rejectall")
+ xRejectBtn = xTrackDlg.getChild("reject")
+ xAcceptAllBtn = xTrackDlg.getChild("acceptall")
+ xAcceptBtn = xTrackDlg.getChild("accept")
- xCancBtn = xTrackDlg.getChild("close")
- xCancBtn.executeAction("CLICK", tuple())
+ # Without the fix in place, it would have failed with
+ # AssertionError: 'R~eject All' != 'R~eject All/Clear formatting'
+ self.assertEqual('R~eject All', get_state_as_dict(xRejectAllBtn)['Text'])
+ self.assertEqual('~Reject', get_state_as_dict(xRejectBtn)['Text'])
+ self.assertEqual('A~ccept All', get_state_as_dict(xAcceptAllBtn)['Text'])
+ self.assertEqual('~Accept', get_state_as_dict(xAcceptBtn)['Text'])
- self.ui_test.close_doc()
+ xCancBtn = xTrackDlg.getChild("close")
+ xCancBtn.executeAction("CLICK", tuple())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/tdf107267.py b/sc/qa/uitest/calc_tests6/tdf107267.py
index e8dd2857a252..8416cb62e2ae 100644
--- a/sc/qa/uitest/calc_tests6/tdf107267.py
+++ b/sc/qa/uitest/calc_tests6/tdf107267.py
@@ -17,62 +17,60 @@ class Subtotals(UITestCase):
def test_tdf107267(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf107267.ods"))
- XcalcDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- gridwin = XcalcDoc.getChild("grid_window")
- # 1. Open the test file
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:F123"}))
- # 2. Data->Subtotals
- self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- # = 1st group = 3. Group by "Person Number", select "shipping time" and use the Max function.
- xGroupBy = xDialog.getChild("group_by")
- select_by_text(xGroupBy, "Person Number")
- # 4. Tick 'Calculate subtotals for' -> "shipping time" - already selected
-# xCheckListMenu = xDialog.getChild("grid1")
-# xTreeList = xCheckListMenu.getChild("columns")
-# x6Entry = xTreeList.getChild("5")
-# xFirstEntry.executeAction("CLICK", tuple())
- #use the Max function
+ with self.ui_test.load_file(get_url_for_data_file("tdf107267.ods")) as calc_doc:
+ XcalcDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ gridwin = XcalcDoc.getChild("grid_window")
+ # 1. Open the test file
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:F123"}))
+ # 2. Data->Subtotals
+ self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ # = 1st group = 3. Group by "Person Number", select "shipping time" and use the Max function.
+ xGroupBy = xDialog.getChild("group_by")
+ select_by_text(xGroupBy, "Person Number")
+ # 4. Tick 'Calculate subtotals for' -> "shipping time" - already selected
+ # xCheckListMenu = xDialog.getChild("grid1")
+ # xTreeList = xCheckListMenu.getChild("columns")
+ # x6Entry = xTreeList.getChild("5")
+ # xFirstEntry.executeAction("CLICK", tuple())
+ #use the Max function
- #= 2nd group =5. Group by "Person Number", select "shipping time" and use the Min function.
- select_pos(xTabs, "1")
- xGroupBy = xDialog.getChild("group_by")
- select_by_text(xGroupBy, "Person Number")
- # 4. Tick 'Calculate subtotals for' -> "shipping time" - already selected
-# xCheckListMenu = xDialog.getChild("grid1")
-# xTreeList = xCheckListMenu.getChild("columns")
-# x6Entry = xTreeList.getChild("5")
-# xFirstEntry.executeAction("CLICK", tuple())
- #use the Min function
+ #= 2nd group =5. Group by "Person Number", select "shipping time" and use the Min function.
+ select_pos(xTabs, "1")
+ xGroupBy = xDialog.getChild("group_by")
+ select_by_text(xGroupBy, "Person Number")
+ # 4. Tick 'Calculate subtotals for' -> "shipping time" - already selected
+ # xCheckListMenu = xDialog.getChild("grid1")
+ # xTreeList = xCheckListMenu.getChild("columns")
+ # x6Entry = xTreeList.getChild("5")
+ # xFirstEntry.executeAction("CLICK", tuple())
+ #use the Min function
- #= 3rd group = Group by "Person Number", select "shipping time" and use the Average function.
- select_pos(xTabs, "2")
- xGroupBy = xDialog.getChild("group_by")
- select_by_text(xGroupBy, "Person Number")
- # 4. Tick 'Calculate subtotals for' -> "shipping time" - already selected
-# xCheckListMenu = xDialog.getChild("grid1")
-# xTreeList = xCheckListMenu.getChild("columns")
-# x6Entry = xTreeList.getChild("5")
-# xFirstEntry.executeAction("CLICK", tuple())
- #use the Average function
+ #= 3rd group = Group by "Person Number", select "shipping time" and use the Average function.
+ select_pos(xTabs, "2")
+ xGroupBy = xDialog.getChild("group_by")
+ select_by_text(xGroupBy, "Person Number")
+ # 4. Tick 'Calculate subtotals for' -> "shipping time" - already selected
+ # xCheckListMenu = xDialog.getChild("grid1")
+ # xTreeList = xCheckListMenu.getChild("columns")
+ # x6Entry = xTreeList.getChild("5")
+ # xFirstEntry.executeAction("CLICK", tuple())
+ #use the Average function
- # 5. Click OK
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ # 5. Click OK
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 141).getString(), "Grand Average")
- self.assertEqual(get_cell_by_position(document, 0, 0, 142).getString(), "Grand Min")
- self.assertEqual(get_cell_by_position(document, 0, 0, 143).getString(), "Grand Max")
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 141).getString(), "Grand Average")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 142).getString(), "Grand Min")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 143).getString(), "Grand Max")
- self.assertEqual(round(get_cell_by_position(document, 0, 5, 141).getValue(), 13), 3.3852459016393)
- self.assertEqual(get_cell_by_position(document, 0, 5, 142).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 5, 143).getValue(), 26)
-
- self.ui_test.close_doc()
+ self.assertEqual(round(get_cell_by_position(document, 0, 5, 141).getValue(), 13), 3.3852459016393)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 142).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 5, 143).getValue(), 26)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests6/tdf107869.py b/sc/qa/uitest/calc_tests6/tdf107869.py
index f07b53e68432..2d4127b0f64c 100644
--- a/sc/qa/uitest/calc_tests6/tdf107869.py
+++ b/sc/qa/uitest/calc_tests6/tdf107869.py
@@ -11,75 +11,73 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf107869(UITestCase):
def test_tdf107869_undo_redo_delete_row_with_comment(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("comments.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #- Delete the row with comment.
- #select row 1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:SelectRow")
- #delete row 1
- self.xUITest.executeCommand(".uno:DeleteRows")
- #A1 should be "B"
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
- #- Undo-redo deletion a few times.
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ with self.ui_test.load_file(get_url_for_data_file("comments.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #- Delete the row with comment.
+ #select row 1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectRow")
+ #delete row 1
+ self.xUITest.executeCommand(".uno:DeleteRows")
+ #A1 should be "B"
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
+ #- Undo-redo deletion a few times.
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "B")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- #select row 1 and 2
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
- self.xUITest.executeCommand(".uno:SelectRow")
- #delete row 1
- self.xUITest.executeCommand(".uno:DeleteRows")
- #A1 should be ""
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
- #- Undo-redo deletion a few times.
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
-
- self.ui_test.close_doc()
+ #select row 1 and 2
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A2"}))
+ self.xUITest.executeCommand(".uno:SelectRow")
+ #delete row 1
+ self.xUITest.executeCommand(".uno:DeleteRows")
+ #A1 should be ""
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
+ #- Undo-redo deletion a few times.
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "A")
+ self.xUITest.executeCommand(".uno:Redo")
+ 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_tests6/tdf118638.py b/sc/qa/uitest/calc_tests6/tdf118638.py
index cc5c97f34a30..bd1151f569f9 100644
--- a/sc/qa/uitest/calc_tests6/tdf118638.py
+++ b/sc/qa/uitest/calc_tests6/tdf118638.py
@@ -16,43 +16,41 @@ class Subtotals(UITestCase):
def test_tdf118638_subtotal_format(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf118638.ods"))
- XcalcDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- gridwin = XcalcDoc.getChild("grid_window")
- # Open the test file
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B15"}))
- #Data->Subtotals
- self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xGroupBy = xDialog.getChild("group_by")
- select_by_text(xGroupBy, "Store Name")
- xCheckListMenu = xDialog.getChild("grid1")
- xTreeList = xCheckListMenu.getChild("columns")
- xEntry = xTreeList.getChild("1")
- xEntry.executeAction("CLICK", tuple())
-
- #use the SUM function
-# xfunctions = xDialog.getChild("functions")
-# propsF = {"TEXT": "Sum"}
-# actionPropsF = mkPropertyValues(propsF)
-# xfunctions.executeAction("SELECT", actionPropsF)
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 15).getString(), "5408 Sum")
- self.assertEqual(get_cell_by_position(document, 0, 0, 16).getString(), "Grand Sum")
-
- self.assertEqual(round(get_cell_by_position(document, 0, 1, 15).getValue(),12), 238.89)
- self.assertEqual(round(get_cell_by_position(document, 0, 1, 16).getValue(),12), 238.89)
-
- self.assertEqual(get_cell_by_position(document, 0, 1, 15).getString(), "$238.89")
- self.assertEqual(get_cell_by_position(document, 0, 1, 16).getString(), "$238.89")
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf118638.ods")) as calc_doc:
+ XcalcDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ gridwin = XcalcDoc.getChild("grid_window")
+ # Open the test file
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B15"}))
+ #Data->Subtotals
+ self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xGroupBy = xDialog.getChild("group_by")
+ select_by_text(xGroupBy, "Store Name")
+ xCheckListMenu = xDialog.getChild("grid1")
+ xTreeList = xCheckListMenu.getChild("columns")
+ xEntry = xTreeList.getChild("1")
+ xEntry.executeAction("CLICK", tuple())
+
+ #use the SUM function
+ # xfunctions = xDialog.getChild("functions")
+ # propsF = {"TEXT": "Sum"}
+ # actionPropsF = mkPropertyValues(propsF)
+ # xfunctions.executeAction("SELECT", actionPropsF)
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 15).getString(), "5408 Sum")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 16).getString(), "Grand Sum")
+
+ self.assertEqual(round(get_cell_by_position(document, 0, 1, 15).getValue(),12), 238.89)
+ self.assertEqual(round(get_cell_by_position(document, 0, 1, 16).getValue(),12), 238.89)
+
+ self.assertEqual(get_cell_by_position(document, 0, 1, 15).getString(), "$238.89")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 16).getString(), "$238.89")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests7/tdf122509.py b/sc/qa/uitest/calc_tests7/tdf122509.py
index e1abea4347a1..5dbb61518ace 100644
--- a/sc/qa/uitest/calc_tests7/tdf122509.py
+++ b/sc/qa/uitest/calc_tests7/tdf122509.py
@@ -15,38 +15,37 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf122509(UITestCase):
def test_tdf122509_format_cell_negative_numbers(self):
#numberingformatpage.ui
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf122509.ods"))
- 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.load_file(get_url_for_data_file("tdf122509.ods")) as calc_doc:
+ 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")
- self.assertEqual(get_state_as_dict(xformatted)["Text"], "#,##0.00 [$USD];[RED]-#,##0.00 [$USD]")
- #click negative
- xnegnumred.executeAction("CLICK", tuple())
- #format check; https://bugs.documentfoundation.org/show_bug.cgi?id=122509#c7
- self.assertEqual(get_state_as_dict(xformatted)["Text"], "#,##0.00 [$USD];-#,##0.00 [$USD]")
- # click negative
- xnegnumred.executeAction("CLICK", tuple())
- #OK
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
- #verify; no crashes
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 2)
+ self.assertEqual(get_state_as_dict(xformatted)["Text"], "#,##0.00 [$USD];[RED]-#,##0.00 [$USD]")
+ #click negative
+ xnegnumred.executeAction("CLICK", tuple())
+ #format check; https://bugs.documentfoundation.org/show_bug.cgi?id=122509#c7
+ self.assertEqual(get_state_as_dict(xformatted)["Text"], "#,##0.00 [$USD];-#,##0.00 [$USD]")
+ # click negative
+ xnegnumred.executeAction("CLICK", tuple())
+ #OK
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+ #verify; no crashes
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 2)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests7/tdf124818.py b/sc/qa/uitest/calc_tests7/tdf124818.py
index 5101be90a91a..f73bb543d312 100644
--- a/sc/qa/uitest/calc_tests7/tdf124818.py
+++ b/sc/qa/uitest/calc_tests7/tdf124818.py
@@ -11,18 +11,17 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf124818(UITestCase):
def test_tdf124818_crash_select_all_and_switch_spreadsheet(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf124818.xls"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf124818.xls")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #Select all ( Ctrl + A );Go to sheet Graph2;Select all;Crash
- self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:JumpToPrevTable")
- self.xUITest.executeCommand(".uno:SelectAll")
+ #Select all ( Ctrl + A );Go to sheet Graph2;Select all;Crash
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:JumpToPrevTable")
+ self.xUITest.executeCommand(".uno:SelectAll")
- #verify; no crashes
- self.assertEqual(document.Sheets.getCount(), 3)
+ #verify; no crashes
+ self.assertEqual(document.Sheets.getCount(), 3)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests7/tdf124896.py b/sc/qa/uitest/calc_tests7/tdf124896.py
index 128f4d270223..5605253f6979 100644
--- a/sc/qa/uitest/calc_tests7/tdf124896.py
+++ b/sc/qa/uitest/calc_tests7/tdf124896.py
@@ -11,18 +11,17 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf124896(UITestCase):
def test_tdf124896_crash_delete_sheet(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf124896.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf124896.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- # Remove X Bar R Chart (2) sheet
- self.ui_test.execute_dialog_through_command(".uno:Remove") #delete sheet
- xDialog = self.xUITest.getTopFocusWindow()
- xOKButton = xDialog.getChild("yes")
- xOKButton.executeAction("CLICK", tuple())
- #verify; no crashes
- self.assertEqual(document.Sheets.getCount(), 2)
+ # Remove X Bar R Chart (2) sheet
+ self.ui_test.execute_dialog_through_command(".uno:Remove") #delete sheet
+ xDialog = self.xUITest.getTopFocusWindow()
+ xOKButton = xDialog.getChild("yes")
+ xOKButton.executeAction("CLICK", tuple())
+ #verify; no crashes
+ self.assertEqual(document.Sheets.getCount(), 2)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests7/tdf137397.py b/sc/qa/uitest/calc_tests7/tdf137397.py
index ae67f9837bfc..c9e1b2d3525c 100644
--- a/sc/qa/uitest/calc_tests7/tdf137397.py
+++ b/sc/qa/uitest/calc_tests7/tdf137397.py
@@ -13,29 +13,27 @@ class tdf137397(UITestCase):
def test_tdf137397(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf137397.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf137397.ods")) as calc_doc:
- change_measurement_unit(self, 'Centimeter')
+ change_measurement_unit(self, 'Centimeter')
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWin = xCalcDoc.getChild("grid_window")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWin = xCalcDoc.getChild("grid_window")
- xGridWin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Shape"}))
+ xGridWin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Shape"}))
- self.xUITest.executeCommand(".uno:Sidebar")
- xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "TextPropertyPanel"}))
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "TextPropertyPanel"}))
- xChild = self.ui_test.wait_until_child_is_available('selectwidth')
- self.assertEqual(get_state_as_dict(xChild)['Text'], '6.00 cm')
+ xChild = self.ui_test.wait_until_child_is_available('selectwidth')
+ self.assertEqual(get_state_as_dict(xChild)['Text'], '6.00 cm')
- # Without the fix in place, this test would have failed with
- # AssertionError: '-14,585,309.84 cm' != '2.00 cm'
- xChild = self.ui_test.wait_until_child_is_available('selectheight')
- self.assertEqual(get_state_as_dict(xChild)['Text'], '2.00 cm')
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '-14,585,309.84 cm' != '2.00 cm'
+ xChild = self.ui_test.wait_until_child_is_available('selectheight')
+ self.assertEqual(get_state_as_dict(xChild)['Text'], '2.00 cm')
- self.xUITest.executeCommand(".uno:Sidebar")
-
- self.ui_test.close_doc()
+ self.xUITest.executeCommand(".uno:Sidebar")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests7/tdf31805.py b/sc/qa/uitest/calc_tests7/tdf31805.py
index 8c7fc1227912..5c2f363c3d9e 100644
--- a/sc/qa/uitest/calc_tests7/tdf31805.py
+++ b/sc/qa/uitest/calc_tests7/tdf31805.py
@@ -13,29 +13,28 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf31805(UITestCase):
def test_tdf31805_delete_column_merged(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf31805.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #1. open "sample.ods"
- #2. click 'G1'
- #3. Menu 'edit -> Delete Cell - Delete entire Column'
- #expected: Column with cell containing "g" will be deleted,
- # a merged cell range will remain left row 1
+ with self.ui_test.load_file(get_url_for_data_file("tdf31805.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #1. open "sample.ods"
+ #2. click 'G1'
+ #3. Menu 'edit -> Delete Cell - Delete entire Column'
+ #expected: Column with cell containing "g" will be deleted,
+ # a merged cell range will remain left row 1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "G1"}))
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getIsMerged(), True)
- self.xUITest.executeCommand(".uno:DeleteColumns")
- #verify. C5:F11 should be merged
- #isMerged returns true if this cell is merged with another cell.
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getIsMerged(), True) #C5
- self.assertEqual(get_cell_by_position(document, 0, 6, 4).getIsMerged(), False) #G5
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A11"}))
- self.xUITest.executeCommand(".uno:DeleteRows")
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getIsMerged(), True) #C5
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
- self.xUITest.executeCommand(".uno:DeleteColumns")
- self.assertEqual(get_cell_by_position(document, 0, 2, 4).getIsMerged(), True) #C5
- self.ui_test.close_doc()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "G1"}))
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getIsMerged(), True)
+ self.xUITest.executeCommand(".uno:DeleteColumns")
+ #verify. C5:F11 should be merged
+ #isMerged returns true if this cell is merged with another cell.
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getIsMerged(), True) #C5
+ self.assertEqual(get_cell_by_position(document, 0, 6, 4).getIsMerged(), False) #G5
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A11"}))
+ self.xUITest.executeCommand(".uno:DeleteRows")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getIsMerged(), True) #C5
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ self.xUITest.executeCommand(".uno:DeleteColumns")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 4).getIsMerged(), True) #C5
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests7/tdf91425.py b/sc/qa/uitest/calc_tests7/tdf91425.py
index 36f8966adf48..19948fb70810 100644
--- a/sc/qa/uitest/calc_tests7/tdf91425.py
+++ b/sc/qa/uitest/calc_tests7/tdf91425.py
@@ -13,23 +13,22 @@ from libreoffice.calc.document import get_cell_by_position
class tdf91425(UITestCase):
def test_tdf91425_insert_columns_left(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf91425.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #1) Open test file provided in report
- #2) Move mouse pointer over Column A header, the right mouse button click
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #3) Insert columns left
- self.xUITest.executeCommand(".uno:InsertColumnsBefore")
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "C")
- #undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "C")
- #redo
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "C")
+ with self.ui_test.load_file(get_url_for_data_file("tdf91425.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #1) Open test file provided in report
+ #2) Move mouse pointer over Column A header, the right mouse button click
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #3) Insert columns left
+ self.xUITest.executeCommand(".uno:InsertColumnsBefore")
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "C")
+ #undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "C")
+ #redo
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "C")
- 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 46ce7d9673cf..d92226771eb5 100644
--- a/sc/qa/uitest/calc_tests8/navigator.py
+++ b/sc/qa/uitest/calc_tests8/navigator.py
@@ -10,109 +10,107 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class navigator(UITestCase):
def test_rename_sheet(self):
- self.ui_test.load_file(get_url_for_data_file("navigator.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWin = xCalcDoc.getChild("grid_window")
-
- self.xUITest.executeCommand(".uno:Sidebar")
- xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
-
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
- xContentBox = xNavigatorPanel.getChild('contentbox')
- xSheets = xContentBox.getChild("0")
- self.assertEqual(get_state_as_dict(xSheets)['Text'], 'Sheets')
- self.assertEqual(len(xSheets.getChildren()), 2)
- self.assertEqual(get_state_as_dict(xSheets.getChild('0'))['Text'], 'Sheet1')
- self.assertEqual(get_state_as_dict(xSheets.getChild('1'))['Text'], 'S2')
- xRangeNames = xContentBox.getChild("1")
- self.assertEqual(get_state_as_dict(xRangeNames)['Text'], 'Range names')
- self.assertEqual(len(xRangeNames.getChildren()), 2)
- self.assertEqual(get_state_as_dict(xRangeNames.getChild('0'))['Text'], 'first (Sheet1)')
- self.assertEqual(get_state_as_dict(xRangeNames.getChild('1'))['Text'], 'second (Sheet1)')
-
- #The document has one comment too
- xComments = xContentBox.getChild("6")
- self.assertEqual(get_state_as_dict(xComments)['Text'], 'Comments')
- self.assertEqual(len(xComments.getChildren()), 1)
- self.assertEqual(get_state_as_dict(xComments.getChild('0'))['Text'], 'Test Comment')
-
- 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": "S1"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
- xContentBox = xNavigatorPanel.getChild('contentbox')
- xSheets = xContentBox.getChild("0")
- self.assertEqual(get_state_as_dict(xSheets)['Text'], 'Sheets')
- self.assertEqual(len(xSheets.getChildren()), 2)
- self.assertEqual(get_state_as_dict(xSheets.getChild('0'))['Text'], 'S1')
- self.assertEqual(get_state_as_dict(xSheets.getChild('1'))['Text'], 'S2')
- xRangeNames = xContentBox.getChild("1")
- self.assertEqual(get_state_as_dict(xRangeNames)['Text'], 'Range names')
- self.assertEqual(len(xRangeNames.getChildren()), 2)
- self.assertEqual(get_state_as_dict(xRangeNames.getChild('0'))['Text'], 'first (S1)')
- self.assertEqual(get_state_as_dict(xRangeNames.getChild('1'))['Text'], 'second (S1)')
-
- self.xUITest.executeCommand(".uno:Undo")
-
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
- xContentBox = xNavigatorPanel.getChild('contentbox')
- xSheets = xContentBox.getChild("0")
- self.assertEqual(get_state_as_dict(xSheets)['Text'], 'Sheets')
- self.assertEqual(len(xSheets.getChildren()), 2)
- self.assertEqual(get_state_as_dict(xSheets.getChild('0'))['Text'], 'Sheet1')
- self.assertEqual(get_state_as_dict(xSheets.getChild('1'))['Text'], 'S2')
- xRangeNames = xContentBox.getChild("1")
- self.assertEqual(get_state_as_dict(xRangeNames)['Text'], 'Range names')
- self.assertEqual(len(xRangeNames.getChildren()), 2)
- #FIXME: tdf#133082
- #self.assertEqual(get_state_as_dict(xRangeNames.getChild('0'))['Text'], 'first (Sheet1)')
- #self.assertEqual(get_state_as_dict(xRangeNames.getChild('1'))['Text'], 'second (Sheet1)')
-
- self.xUITest.executeCommand(".uno:Sidebar")
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("navigator.ods")):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWin = xCalcDoc.getChild("grid_window")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
+ xContentBox = xNavigatorPanel.getChild('contentbox')
+ xSheets = xContentBox.getChild("0")
+ self.assertEqual(get_state_as_dict(xSheets)['Text'], 'Sheets')
+ self.assertEqual(len(xSheets.getChildren()), 2)
+ self.assertEqual(get_state_as_dict(xSheets.getChild('0'))['Text'], 'Sheet1')
+ self.assertEqual(get_state_as_dict(xSheets.getChild('1'))['Text'], 'S2')
+ xRangeNames = xContentBox.getChild("1")
+ self.assertEqual(get_state_as_dict(xRangeNames)['Text'], 'Range names')
+ self.assertEqual(len(xRangeNames.getChildren()), 2)
+ self.assertEqual(get_state_as_dict(xRangeNames.getChild('0'))['Text'], 'first (Sheet1)')
+ self.assertEqual(get_state_as_dict(xRangeNames.getChild('1'))['Text'], 'second (Sheet1)')
+
+ #The document has one comment too
+ xComments = xContentBox.getChild("6")
+ self.assertEqual(get_state_as_dict(xComments)['Text'], 'Comments')
+ self.assertEqual(len(xComments.getChildren()), 1)
+ self.assertEqual(get_state_as_dict(xComments.getChild('0'))['Text'], 'Test Comment')
+
+ 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": "S1"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
+ xContentBox = xNavigatorPanel.getChild('contentbox')
+ xSheets = xContentBox.getChild("0")
+ self.assertEqual(get_state_as_dict(xSheets)['Text'], 'Sheets')
+ self.assertEqual(len(xSheets.getChildren()), 2)
+ self.assertEqual(get_state_as_dict(xSheets.getChild('0'))['Text'], 'S1')
+ self.assertEqual(get_state_as_dict(xSheets.getChild('1'))['Text'], 'S2')
+ xRangeNames = xContentBox.getChild("1")
+ self.assertEqual(get_state_as_dict(xRangeNames)['Text'], 'Range names')
+ self.assertEqual(len(xRangeNames.getChildren()), 2)
+ self.assertEqual(get_state_as_dict(xRangeNames.getChild('0'))['Text'], 'first (S1)')
+ self.assertEqual(get_state_as_dict(xRangeNames.getChild('1'))['Text'], 'second (S1)')
+
+ self.xUITest.executeCommand(".uno:Undo")
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
+ xContentBox = xNavigatorPanel.getChild('contentbox')
+ xSheets = xContentBox.getChild("0")
+ self.assertEqual(get_state_as_dict(xSheets)['Text'], 'Sheets')
+ self.assertEqual(len(xSheets.getChildren()), 2)
+ self.assertEqual(get_state_as_dict(xSheets.getChild('0'))['Text'], 'Sheet1')
+ self.assertEqual(get_state_as_dict(xSheets.getChild('1'))['Text'], 'S2')
+ xRangeNames = xContentBox.getChild("1")
+ self.assertEqual(get_state_as_dict(xRangeNames)['Text'], 'Range names')
+ self.assertEqual(len(xRangeNames.getChildren()), 2)
+ #FIXME: tdf#133082
+ #self.assertEqual(get_state_as_dict(xRangeNames.getChild('0'))['Text'], 'first (Sheet1)')
+ #self.assertEqual(get_state_as_dict(xRangeNames.getChild('1'))['Text'], 'second (Sheet1)')
+
+ self.xUITest.executeCommand(".uno:Sidebar")
def test_tdf98493(self):
- self.ui_test.load_file(get_url_for_data_file("tdf98493.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf98493.ods")):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWin = xCalcDoc.getChild("grid_window")
- self.assertEqual(get_state_as_dict(xGridWin)["SelectedTable"], "2")
+ self.assertEqual(get_state_as_dict(xGridWin)["SelectedTable"], "2")
- self.xUITest.executeCommand(".uno:Sidebar")
- xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
+ self.xUITest.executeCommand(".uno:Sidebar")
+ xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
- xToolBar = xNavigatorPanel.getChild("toolbox2")
- xToolBar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 'toggle' button
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
+ xToolBar = xNavigatorPanel.getChild("toolbox2")
+ xToolBar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 'toggle' button
- xContentBox = xNavigatorPanel.getChild('contentbox')
+ xContentBox = xNavigatorPanel.getChild('contentbox')
- # tdf#133079, without the fix in place, it would be 8
- self.assertEqual(len(xContentBox.getChildren()), 1)
+ # tdf#133079, without the fix in place, it would be 8
+ self.assertEqual(len(xContentBox.getChildren()), 1)
- xSheets = xContentBox.getChild('0')
- self.assertEqual(len(xSheets.getChildren()), 12)
+ xSheets = xContentBox.getChild('0')
+ self.assertEqual(len(xSheets.getChildren()), 12)
- #key=item position, value=sheet ( there are hidden sheets )
- results = { '1': '0', '5': '4', '6': '4', '11': '10'}
+ #key=item position, value=sheet ( there are hidden sheets )
+ results = { '1': '0', '5': '4', '6': '4', '11': '10'}
- for k, v in results.items():
- xChild = xSheets.getChild(k)
- xChild.executeAction("DOUBLECLICK", tuple())
+ for k, v in results.items():
+ xChild = xSheets.getChild(k)
+ xChild.executeAction("DOUBLECLICK", tuple())
- self.assertEqual(get_state_as_dict(xGridWin)["SelectedTable"], v)
+ self.assertEqual(get_state_as_dict(xGridWin)["SelectedTable"], v)
- self.xUITest.executeCommand(".uno:Sidebar")
- self.ui_test.close_doc()
+ self.xUITest.executeCommand(".uno:Sidebar")
def test_tdf134390(self):
@@ -152,23 +150,22 @@ class navigator(UITestCase):
self.ui_test.close_doc()
def test_tdf141973(self):
- self.ui_test.load_file(get_url_for_data_file("tdf141973.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf141973.ods")):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWin = xCalcDoc.getChild("grid_window")
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.xUITest.executeCommand(".uno:Sidebar")
- # Without the fix in place, this test would have crashed here
- xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
+ # Without the fix in place, this test would have crashed here
+ xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
- xContentBox = xNavigatorPanel.getChild('contentbox')
- xDrawings = xContentBox.getChild("7")
- self.assertEqual('Drawing objects', get_state_as_dict(xDrawings)['Text'])
- self.assertEqual(len(xDrawings.getChildren()), 1)
- self.assertEqual('withname', get_state_as_dict(xDrawings.getChild('0'))['Text'])
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
+ xContentBox = xNavigatorPanel.getChild('contentbox')
+ xDrawings = xContentBox.getChild("7")
+ self.assertEqual('Drawing objects', get_state_as_dict(xDrawings)['Text'])
+ self.assertEqual(len(xDrawings.getChildren()), 1)
+ self.assertEqual('withname', get_state_as_dict(xDrawings.getChild('0'))['Text'])
- self.xUITest.executeCommand(".uno:Sidebar")
+ self.xUITest.executeCommand(".uno:Sidebar")
- self.ui_test.close_doc()
diff --git a/sc/qa/uitest/calc_tests8/tdf114710.py b/sc/qa/uitest/calc_tests8/tdf114710.py
index 94f3849f58ac..a4989a72de58 100644
--- a/sc/qa/uitest/calc_tests8/tdf114710.py
+++ b/sc/qa/uitest/calc_tests8/tdf114710.py
@@ -11,42 +11,40 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf114710(UITestCase):
def test_tdf114710(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf114710.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf114710.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:O7"}))
- self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:O7"}))
+ self.xUITest.executeCommand(".uno:Copy")
- self.xUITest.executeCommand(".uno:CloseDoc")
+ self.xUITest.executeCommand(".uno:CloseDoc")
- self.ui_test.create_doc_in_start_center("writer")
+ self.ui_test.create_doc_in_start_center("writer")
- self.xUITest.getTopFocusWindow()
+ self.xUITest.getTopFocusWindow()
- 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()
- xList = xDialog.getChild('list')
+ xList = xDialog.getChild('list')
- for childName in xList.getChildren():
- xChild = xList.getChild(childName)
- if get_state_as_dict(xChild)['Text'] == "Graphics Device Interface metafile (GDI)":
- break
+ for childName in xList.getChildren():
+ xChild = xList.getChild(childName)
+ if get_state_as_dict(xChild)['Text'] == "Graphics Device Interface metafile (GDI)":
+ break
- xChild.executeAction("SELECT", tuple())
- self.assertEqual(
- get_state_as_dict(xList)['SelectEntryText'], "Graphics Device Interface metafile (GDI)")
+ xChild.executeAction("SELECT", tuple())
+ self.assertEqual(
+ get_state_as_dict(xList)['SelectEntryText'], "Graphics Device Interface metafile (GDI)")
- xOkBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- # Without the fix in place, this test would have crashed here
- document = self.ui_test.get_component()
- self.assertEqual(1, document.GraphicObjects.getCount())
-
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have crashed here
+ document = self.ui_test.get_component()
+ self.assertEqual(1, document.GraphicObjects.getCount())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests8/tdf119343.py b/sc/qa/uitest/calc_tests8/tdf119343.py
index a5128c488429..1393c50ad1c9 100644
--- a/sc/qa/uitest/calc_tests8/tdf119343.py
+++ b/sc/qa/uitest/calc_tests8/tdf119343.py
@@ -18,19 +18,18 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf119343(UITestCase):
def test_tdf119343_copy_paste_formula(self):
#numberingformatpage.ui
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf119343.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf119343.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "M295"}))
- self.xUITest.executeCommand(".uno:Copy")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
- self.xUITest.executeCommand(".uno:Paste")
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 12, 295).getString(), "Q11005355")
- self.assertEqual(get_cell_by_position(document, 0, 12, 294).getString(), "Q1099565")
- self.assertEqual(get_cell_by_position(document, 0, 12, 293).getString(), "Q108420")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "M295"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
+ self.xUITest.executeCommand(".uno:Paste")
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 12, 295).getString(), "Q11005355")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 294).getString(), "Q1099565")
+ self.assertEqual(get_cell_by_position(document, 0, 12, 293).getString(), "Q108420")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests8/tdf124829.py b/sc/qa/uitest/calc_tests8/tdf124829.py
index e41ee01eb093..45cf00b459a6 100644
--- a/sc/qa/uitest/calc_tests8/tdf124829.py
+++ b/sc/qa/uitest/calc_tests8/tdf124829.py
@@ -18,18 +18,17 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf124829(UITestCase):
def test_tdf124829_Crash_cutting_undo_sheet_external_links(self):
#numberingformatpage.ui
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf124829.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf124829.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:Cut")
- for i in range(40):
- self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:Cut")
+ for i in range(40):
+ self.xUITest.executeCommand(".uno:Undo")
- #verify; no crashes
- self.assertEqual(document.Sheets.getCount(), 6)
+ #verify; no crashes
+ self.assertEqual(document.Sheets.getCount(), 6)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests9/forms.py b/sc/qa/uitest/calc_tests9/forms.py
index b682cf69c9ea..aceb5a8b589d 100644
--- a/sc/qa/uitest/calc_tests9/forms.py
+++ b/sc/qa/uitest/calc_tests9/forms.py
@@ -12,19 +12,17 @@ class Forms(UITestCase):
def test_tdf131000(self):
- self.ui_test.load_file(get_url_for_data_file("tdf131000.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf131000.ods")):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "form"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "form"}))
- # Without the fix in place, this test would have hung here
- self.ui_test.execute_modeless_dialog_through_command(".uno:ControlProperties")
+ # Without the fix in place, this test would have hung here
+ self.ui_test.execute_modeless_dialog_through_command(".uno:ControlProperties")
- xCellRange = self.ui_test.wait_until_child_is_available('textfield-Source cell range')
+ xCellRange = self.ui_test.wait_until_child_is_available('textfield-Source cell range')
- self.assertEqual("A1:A7000", get_state_as_dict(xCellRange)['Text'])
-
- self.ui_test.close_doc()
+ self.assertEqual("A1:A7000", get_state_as_dict(xCellRange)['Text'])
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests9/pivotTable.py b/sc/qa/uitest/calc_tests9/pivotTable.py
index 6fd0ff0517cc..c5879f8ce143 100644
--- a/sc/qa/uitest/calc_tests9/pivotTable.py
+++ b/sc/qa/uitest/calc_tests9/pivotTable.py
@@ -15,54 +15,52 @@ class pivotTable(UITestCase):
# This is basically a test for cf93998eb5abc193d95ae5433bf4dfd11a9d62d8
# Without the fix in place, this test would have crashed
- self.ui_test.load_file(get_url_for_data_file("basicPivotTable.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("basicPivotTable.ods")):
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "1"}))
- self.xUITest.executeCommand(".uno:GoUp")
+ self.xUITest.executeCommand(".uno:GoUp")
- self.ui_test.execute_dialog_through_command(".uno:DataDataPilotRun")
+ self.ui_test.execute_dialog_through_command(".uno:DataDataPilotRun")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- xFields = xDialog.getChild("listbox-fields")
- self.assertEqual(2, len(xFields.getChildren()))
- self.assertEqual("qtX", get_state_as_dict(xFields.getChild('0'))['Text'])
- self.assertEqual("qtY", get_state_as_dict(xFields.getChild('1'))['Text'])
+ xFields = xDialog.getChild("listbox-fields")
+ self.assertEqual(2, len(xFields.getChildren()))
+ self.assertEqual("qtX", get_state_as_dict(xFields.getChild('0'))['Text'])
+ self.assertEqual("qtY", get_state_as_dict(xFields.getChild('1'))['Text'])
- xColumns = xDialog.getChild("listbox-column")
- self.assertEqual(1, len(xColumns.getChildren()))
- self.assertEqual("Data", get_state_as_dict(xColumns.getChild('0'))['Text'])
+ xColumns = xDialog.getChild("listbox-column")
+ self.assertEqual(1, len(xColumns.getChildren()))
+ self.assertEqual("Data", get_state_as_dict(xColumns.getChild('0'))['Text'])
- xPage = xDialog.getChild("listbox-page")
- self.assertEqual(1, len(xPage.getChildren()))
- xPageChild = xPage.getChild('0')
- self.assertEqual("qtX", get_state_as_dict(xPageChild)['Text'])
+ xPage = xDialog.getChild("listbox-page")
+ self.assertEqual(1, len(xPage.getChildren()))
+ xPageChild = xPage.getChild('0')
+ self.assertEqual("qtX", get_state_as_dict(xPageChild)['Text'])
- with self.ui_test.execute_blocking_action(xPageChild.executeAction, args=('DOUBLECLICK', ())) as dialog:
- optionBtn = dialog.getChild("options")
+ with self.ui_test.execute_blocking_action(xPageChild.executeAction, args=('DOUBLECLICK', ())) as dialog:
+ optionBtn = dialog.getChild("options")
- with self.ui_test.execute_blocking_action(optionBtn.executeAction, args=('CLICK', ())) as dialog2:
- xEmptyLine = dialog2.getChild("emptyline")
+ with self.ui_test.execute_blocking_action(optionBtn.executeAction, args=('CLICK', ())) as dialog2:
+ xEmptyLine = dialog2.getChild("emptyline")
- xEmptyLine.executeAction("CLICK", tuple())
- self.assertEqual('true', get_state_as_dict(xEmptyLine)['Selected'])
+ xEmptyLine.executeAction("CLICK", tuple())
+ self.assertEqual('true', get_state_as_dict(xEmptyLine)['Selected'])
- with self.ui_test.execute_blocking_action(optionBtn.executeAction, args=('CLICK', ()), close_button="cancel") as dialog2:
- xEmptyLine = dialog2.getChild("emptyline")
+ with self.ui_test.execute_blocking_action(optionBtn.executeAction, args=('CLICK', ()), close_button="cancel") as dialog2:
+ xEmptyLine = dialog2.getChild("emptyline")
- xEmptyLine.executeAction("CLICK", tuple())
- self.assertEqual('false', get_state_as_dict(xEmptyLine)['Selected'])
+ xEmptyLine.executeAction("CLICK", tuple())
+ self.assertEqual('false', get_state_as_dict(xEmptyLine)['Selected'])
- with self.ui_test.execute_blocking_action(optionBtn.executeAction, args=('CLICK', ())) as dialog2:
- xEmptyLine = dialog2.getChild("emptyline")
+ with self.ui_test.execute_blocking_action(optionBtn.executeAction, args=('CLICK', ())) as dialog2:
+ xEmptyLine = dialog2.getChild("emptyline")
- self.assertEqual('true', get_state_as_dict(xEmptyLine)['Selected'])
-
- self.ui_test.close_doc()
+ self.assertEqual('true', get_state_as_dict(xEmptyLine)['Selected'])
# 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 89e0b2afd3a4..48657e37e60d 100644
--- a/sc/qa/uitest/calc_tests9/tdf113571.py
+++ b/sc/qa/uitest/calc_tests9/tdf113571.py
@@ -11,28 +11,27 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class Tdf113571(UITestCase):
def test_tdf113571(self):
- self.ui_test.load_file(get_url_for_data_file("tdf113571.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf113571.ods")):
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:Copy")
- # Close the document
- self.xUITest.executeCommand(".uno:CloseDoc")
+ # Close the document
+ self.xUITest.executeCommand(".uno:CloseDoc")
- self.ui_test.create_doc_in_start_center("writer")
+ self.ui_test.create_doc_in_start_center("writer")
- self.xUITest.executeCommand(".uno:PasteUnformatted")
+ self.xUITest.executeCommand(".uno:PasteUnformatted")
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- # Without the fix in place, this test would have failed with
- # AssertionError: '<?xml version="1.0" encoding="UTF-8"?>\n<[34 chars]est>' !=
- # '"<?xml version=""1.0"" encoding=""UTF-8""[40 chars]st>"'
- self.assertEqual('<?xml version="1.0" encoding="UTF-8"?>\n<test>\n <hello>world</hello>\n</test>',
- document.Text.String)
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '<?xml version="1.0" encoding="UTF-8"?>\n<[34 chars]est>' !=
+ # '"<?xml version=""1.0"" encoding=""UTF-8""[40 chars]st>"'
+ self.assertEqual('<?xml version="1.0" encoding="UTF-8"?>\n<test>\n <hello>world</hello>\n</test>',
+ document.Text.String)
- self.ui_test.close_doc()
diff --git a/sc/qa/uitest/calc_tests9/tdf124318.py b/sc/qa/uitest/calc_tests9/tdf124318.py
index 69a8a8a181ef..8aad127c608e 100644
--- a/sc/qa/uitest/calc_tests9/tdf124318.py
+++ b/sc/qa/uitest/calc_tests9/tdf124318.py
@@ -12,24 +12,22 @@ class tdf124318(UITestCase):
def test_tdf124318(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf124318.xls"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf124318.xls")) as calc_doc:
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B4"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B4"}))
- self.ui_test.execute_dialog_through_action(gridwin, "TYPE", mkPropertyValues({"KEYCODE": "CTRL+k"}))
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_action(gridwin, "TYPE", mkPropertyValues({"KEYCODE": "CTRL+k"}))
+ xDialog = self.xUITest.getTopFocusWindow()
- # Without the fix in place, this test would have failed with
- # AssertionError: 'mobile/identification/authentification' !=
- # 'mobile/identification/authentification%00塹\uf481ᴻ䡿ⲯ嶂藄挧%00%00ꮥ%00'
- self.assertEqual("mobile/identification/authentification",
- get_state_as_dict(xDialog.getChild("target"))['Text'].split(".fr/")[1])
- self.assertEqual("mobile/identification/authentification",
- get_state_as_dict(xDialog.getChild("indication"))['Text'].split(".fr/")[1])
-
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'mobile/identification/authentification' !=
+ # 'mobile/identification/authentification%00塹\uf481ᴻ䡿ⲯ嶂藄挧%00%00ꮥ%00'
+ self.assertEqual("mobile/identification/authentification",
+ get_state_as_dict(xDialog.getChild("target"))['Text'].split(".fr/")[1])
+ self.assertEqual("mobile/identification/authentification",
+ get_state_as_dict(xDialog.getChild("indication"))['Text'].split(".fr/")[1])
# 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 12e113a1c17c..82accfb11942 100644
--- a/sc/qa/uitest/calc_tests9/tdf125440.py
+++ b/sc/qa/uitest/calc_tests9/tdf125440.py
@@ -14,29 +14,28 @@ class Tdf1254400(UITestCase):
def test_tdf125440(self):
# In order to simulate copy&paste from external source,
# import the text in Writer, copy it and paste it in Calc
- writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf125440.odt"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf125440.odt")) as writer_doc:
- self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:Copy")
- # Close the document
- self.xUITest.executeCommand(".uno:CloseDoc")
+ # Close the document
+ self.xUITest.executeCommand(".uno:CloseDoc")
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
+ 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()
+ 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.xUITest.executeCommand(".uno:PasteUnformatted")
+ self.xUITest.executeCommand(".uno:PasteUnformatted")
- # Without the fix in place, this test would have failed with
- # AssertionError: 'Row' != '"Row"'
- self.assertEqual("Row", get_cell_by_position(document, 0, 0, 0).getString())
- self.assertEqual("", get_cell_by_position(document, 0, 1, 0).getString())
- self.assertEqual("", get_cell_by_position(document, 0, 2, 0).getString())
- self.assertEqual("50", get_cell_by_position(document, 0, 3, 0).getString())
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'Row' != '"Row"'
+ self.assertEqual("Row", get_cell_by_position(document, 0, 0, 0).getString())
+ self.assertEqual("", get_cell_by_position(document, 0, 1, 0).getString())
+ self.assertEqual("", get_cell_by_position(document, 0, 2, 0).getString())
+ self.assertEqual("50", get_cell_by_position(document, 0, 3, 0).getString())
- self.ui_test.close_doc()
diff --git a/sc/qa/uitest/calc_tests9/tdf126673.py b/sc/qa/uitest/calc_tests9/tdf126673.py
index f01844bddd3a..30c81696f836 100644
--- a/sc/qa/uitest/calc_tests9/tdf126673.py
+++ b/sc/qa/uitest/calc_tests9/tdf126673.py
@@ -16,34 +16,32 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf126673(UITestCase):
def test_tdf126673_auto_fit_row_height(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf126673.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf126673.ods")) as calc_doc:
+ 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 A2
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
- #optimal row height
- self.ui_test.execute_dialog_through_command(".uno:SetOptimalRowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- # Click Ok
- xOK = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOK)
- #select A2
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
- #row height
- self.ui_test.execute_dialog_through_command(".uno:RowHeight")
- xDialog = self.xUITest.getTopFocusWindow()
- xvalue = xDialog.getChild("value")
- heightStrOrig = get_state_as_dict(xvalue)["Text"]
- heightVal = heightStrOrig[:4] #default 0.45 cm,
- self.assertEqual(heightVal > '0.45', True) #new value is bigger then default
- # Click Ok
- xcancel = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xcancel)
-
- self.ui_test.close_doc()
+ #select A2
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+ #optimal row height
+ self.ui_test.execute_dialog_through_command(".uno:SetOptimalRowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # Click Ok
+ xOK = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOK)
+ #select A2
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+ #row height
+ self.ui_test.execute_dialog_through_command(".uno:RowHeight")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xvalue = xDialog.getChild("value")
+ heightStrOrig = get_state_as_dict(xvalue)["Text"]
+ heightVal = heightStrOrig[:4] #default 0.45 cm,
+ self.assertEqual(heightVal > '0.45', True) #new value is bigger then default
+ # Click Ok
+ 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_tests9/tdf130371.py b/sc/qa/uitest/calc_tests9/tdf130371.py
index e2930e855b9a..9533e0719393 100644
--- a/sc/qa/uitest/calc_tests9/tdf130371.py
+++ b/sc/qa/uitest/calc_tests9/tdf130371.py
@@ -12,56 +12,54 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class namedRanges(UITestCase):
def test_tdf130371(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf130371.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- text1 = "value\t$Sheet2.$B$2\tSheet2"
- text2 = "value\t$Sheet3.$B$2\tSheet3"
- text3 = "value\t$Sheet4.$B$2\tSheet4"
-
- self.ui_test.execute_dialog_through_command(".uno:DefineName")
- xDialog = self.xUITest.getTopFocusWindow()
- namesList = xDialog.getChild('names')
- self.assertEqual(2, len(namesList.getChildren()))
- self.assertEqual(get_state_as_dict(namesList.getChild('0'))["Text"], text1)
- self.assertEqual(get_state_as_dict(namesList.getChild('1'))["Text"], text2)
-
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
- self.xUITest.executeCommand(".uno:Copy")
-
- self.xUITest.executeCommand(".uno:JumpToNextTable")
- self.xUITest.executeCommand(".uno:JumpToNextTable")
-
- self.xUITest.executeCommand(".uno:Paste")
-
- self.ui_test.execute_dialog_through_command(".uno:DefineName")
- xDialog = self.xUITest.getTopFocusWindow()
- namesList = xDialog.getChild('names')
- self.assertEqual(3, len(namesList.getChildren()))
- self.assertEqual(get_state_as_dict(namesList.getChild('0'))["Text"], text1)
- self.assertEqual(get_state_as_dict(namesList.getChild('1'))["Text"], text2)
- self.assertEqual(get_state_as_dict(namesList.getChild('2'))["Text"], text3)
-
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.xUITest.executeCommand(".uno:Undo")
-
- self.ui_test.execute_dialog_through_command(".uno:DefineName")
- xDialog = self.xUITest.getTopFocusWindow()
- namesList = xDialog.getChild('names')
- self.assertEqual(2, len(namesList.getChildren()))
- self.assertEqual(get_state_as_dict(namesList.getChild('0'))["Text"], text1)
- self.assertEqual(get_state_as_dict(namesList.getChild('1'))["Text"], text2)
-
- xCancelBtn = xDialog.getChild("cancel")
- xCancelBtn.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf130371.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ text1 = "value\t$Sheet2.$B$2\tSheet2"
+ text2 = "value\t$Sheet3.$B$2\tSheet3"
+ text3 = "value\t$Sheet4.$B$2\tSheet4"
+
+ self.ui_test.execute_dialog_through_command(".uno:DefineName")
+ xDialog = self.xUITest.getTopFocusWindow()
+ namesList = xDialog.getChild('names')
+ self.assertEqual(2, len(namesList.getChildren()))
+ self.assertEqual(get_state_as_dict(namesList.getChild('0'))["Text"], text1)
+ self.assertEqual(get_state_as_dict(namesList.getChild('1'))["Text"], text2)
+
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
+ self.xUITest.executeCommand(".uno:Copy")
+
+ self.xUITest.executeCommand(".uno:JumpToNextTable")
+ self.xUITest.executeCommand(".uno:JumpToNextTable")
+
+ self.xUITest.executeCommand(".uno:Paste")
+
+ self.ui_test.execute_dialog_through_command(".uno:DefineName")
+ xDialog = self.xUITest.getTopFocusWindow()
+ namesList = xDialog.getChild('names')
+ self.assertEqual(3, len(namesList.getChildren()))
+ self.assertEqual(get_state_as_dict(namesList.getChild('0'))["Text"], text1)
+ self.assertEqual(get_state_as_dict(namesList.getChild('1'))["Text"], text2)
+ self.assertEqual(get_state_as_dict(namesList.getChild('2'))["Text"], text3)
+
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
+
+ self.xUITest.executeCommand(".uno:Undo")
+
+ self.ui_test.execute_dialog_through_command(".uno:DefineName")
+ xDialog = self.xUITest.getTopFocusWindow()
+ namesList = xDialog.getChild('names')
+ self.assertEqual(2, len(namesList.getChildren()))
+ self.assertEqual(get_state_as_dict(namesList.getChild('0'))["Text"], text1)
+ self.assertEqual(get_state_as_dict(namesList.getChild('1'))["Text"], text2)
+
+ xCancelBtn = xDialog.getChild("cancel")
+ xCancelBtn.executeAction("CLICK", tuple())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests9/tdf137446.py b/sc/qa/uitest/calc_tests9/tdf137446.py
index 06a716121c28..efdfb0213fb2 100644
--- a/sc/qa/uitest/calc_tests9/tdf137446.py
+++ b/sc/qa/uitest/calc_tests9/tdf137446.py
@@ -13,45 +13,43 @@ class tdf137446(UITestCase):
def test_tdf137446(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf137446.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf137446.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- change_measurement_unit(self, "Centimeter")
+ change_measurement_unit(self, "Centimeter")
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "lineObject"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "lineObject"}))
- self.ui_test.execute_dialog_through_command(".uno:TransformDialog")
+ self.ui_test.execute_dialog_through_command(".uno:TransformDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- self.assertEqual('10', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value'])
- self.assertEqual('0', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value'])
- self.assertEqual('5.51', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value'])
- self.assertEqual('2.55', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value'])
- self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value'])
+ self.assertEqual('10', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value'])
+ self.assertEqual('0', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value'])
+ self.assertEqual('5.51', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value'])
+ self.assertEqual('2.55', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value'])
+ self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value'])
- xDialog.getChild('MTR_FLD_WIDTH').executeAction("UP", tuple())
+ xDialog.getChild('MTR_FLD_WIDTH').executeAction("UP", tuple())
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.ui_test.execute_dialog_through_command(".uno:TransformDialog")
+ self.ui_test.execute_dialog_through_command(".uno:TransformDialog")
- xDialog = self.xUITest.getTopFocusWindow()
+ xDialog = self.xUITest.getTopFocusWindow()
- self.assertEqual('10.1', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value'])
- self.assertEqual('0', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value'])
- self.assertEqual('5.51', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value'])
- self.assertEqual('2.55', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value'])
+ self.assertEqual('10.1', get_state_as_dict(xDialog.getChild('MTR_FLD_WIDTH'))['Value'])
+ self.assertEqual('0', get_state_as_dict(xDialog.getChild('MTR_FLD_HEIGHT'))['Value'])
+ self.assertEqual('5.51', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_X'))['Value'])
+ self.assertEqual('2.55', get_state_as_dict(xDialog.getChild('MTR_FLD_POS_Y'))['Value'])
- # Without the fix in place, this test would have failed with AssertionError: '0' != '180'
- self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value'])
+ # Without the fix in place, this test would have failed with AssertionError: '0' != '180'
+ self.assertEqual('0', get_state_as_dict(xDialog.getChild('NF_ANGLE'))['Value'])
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/calc_tests9/tdf91217.py b/sc/qa/uitest/calc_tests9/tdf91217.py
index 765271c8a8e2..397d43ec06fc 100644
--- a/sc/qa/uitest/calc_tests9/tdf91217.py
+++ b/sc/qa/uitest/calc_tests9/tdf91217.py
@@ -17,24 +17,22 @@ class tdf91217(UITestCase):
def test_tdf91217_crash_deleting_rows(self):
# FIXME disable this will it's clear what existing problem did this test uncover.
return
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf91217.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Select rows 76-1125 in sheet 3 (Daily), right click, Delete Rows. Instant crash.
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A76:A1125"}))
- self.xUITest.executeCommand(".uno:SelectRow")
- #delete rows
- self.xUITest.executeCommand(".uno:DeleteRows")
- #A1 should be "Dist"
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Dist")
- #- Undo-redo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Dist")
+ with self.ui_test.load_file(get_url_for_data_file("tdf91217.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Select rows 76-1125 in sheet 3 (Daily), right click, Delete Rows. Instant crash.
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A76:A1125"}))
+ self.xUITest.executeCommand(".uno:SelectRow")
+ #delete rows
+ self.xUITest.executeCommand(".uno:DeleteRows")
+ #A1 should be "Dist"
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Dist")
+ #- Undo-redo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Dist")
- self.xUITest.executeCommand(".uno:Redo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Dist")
-
- self.ui_test.close_doc()
+ self.xUITest.executeCommand(".uno:Redo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Dist")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/chartArea.py b/sc/qa/uitest/chart/chartArea.py
index 2e5b99b92ea5..d7a744749188 100644
--- a/sc/qa/uitest/chart/chartArea.py
+++ b/sc/qa/uitest/chart/chartArea.py
@@ -16,154 +16,153 @@ from uitest.uihelper.common import get_state_as_dict, type_text, get_url_for_dat
class chartArea(UITestCase):
def test_chart_area_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("chartArea.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- change_measurement_unit(self, "Centimeter")
-
- xArea = document.Sheets[0].Charts[0].getEmbeddedObject().Area
- self.assertEqual(xArea.LineWidth, 0)
- self.assertEqual(xArea.LineTransparence, 0)
- self.assertEqual(hex(xArea.FillColor), '0xffffff')
- self.assertEqual(xArea.FillTransparence, 0)
-
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Borders".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- xWidth.executeAction("UP", tuple())
- transparency.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertEqual(xArea.LineWidth, 100)
- self.assertEqual(xArea.LineTransparence, 5)
- self.assertEqual(hex(xArea.FillColor), '0xffffff')
- self.assertEqual(xArea.FillTransparence, 0)
-
- #reopen and verify tab "Borders".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
-
- #Click on tab "Area"
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
-
- btncolor = xDialog.getChild("btncolor")
- btncolor.executeAction("CLICK", tuple())
-
- rCustom = xDialog.getChild("R_custom")
- gCustom = xDialog.getChild("G_custom")
- bCustom = xDialog.getChild("B_custom")
-
- rCustom.executeAction("CLEAR", tuple())
- rCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"35"}))
- rCustom.executeAction("UP", tuple())
- rCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
- self.assertEqual(get_state_as_dict(rCustom)["Text"], "35")
- gCustom.executeAction("CLEAR", tuple())
- gCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"169"}))
- gCustom.executeAction("UP", tuple())
- gCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
- bCustom.executeAction("CLEAR", tuple())
- bCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"211"}))
- bCustom.executeAction("UP", tuple())
- bCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertEqual(xArea.LineWidth, 100)
- self.assertEqual(xArea.LineTransparence, 5)
- self.assertEqual(hex(xArea.FillColor), '0x23a9d3')
- self.assertEqual(xArea.FillTransparence, 0)
-
- #reopen and verify tab "Area".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
-
- rCustom = xDialog.getChild("R_custom")
- gCustom = xDialog.getChild("G_custom")
- bCustom = xDialog.getChild("B_custom")
-
- self.assertEqual(get_state_as_dict(rCustom)["Text"], "35")
- self.assertEqual(get_state_as_dict(gCustom)["Text"], "169")
- self.assertEqual(get_state_as_dict(bCustom)["Text"], "211")
-
- #change tab "Transparency"
- select_pos(tabcontrol, "2")
- transparency = xDialog.getChild("RBT_TRANS_LINEAR")
- transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51%
-
- transparency.executeAction("CLICK", tuple())
- transparencyPercent.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertEqual(xArea.LineWidth, 100)
- self.assertEqual(xArea.LineTransparence, 5)
- self.assertEqual(hex(xArea.FillColor), '0x23a9d3')
- self.assertEqual(xArea.FillTransparence, 51)
-
- #reopen and verify tab "Transparency"
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "2")
-
- transparency = xDialog.getChild("RBT_TRANS_LINEAR")
- transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51%
-
- self.assertEqual(get_state_as_dict(transparency)["Checked"], "true")
- self.assertEqual(get_state_as_dict(transparencyPercent)["Text"], "51%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertEqual(xArea.LineWidth, 100)
- self.assertEqual(xArea.LineTransparence, 5)
- self.assertEqual(hex(xArea.FillColor), '0x23a9d3')
- self.assertEqual(xArea.FillTransparence, 51)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("chartArea.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ xArea = document.Sheets[0].Charts[0].getEmbeddedObject().Area
+ self.assertEqual(xArea.LineWidth, 0)
+ self.assertEqual(xArea.LineTransparence, 0)
+ self.assertEqual(hex(xArea.FillColor), '0xffffff')
+ self.assertEqual(xArea.FillTransparence, 0)
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Borders".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ xWidth.executeAction("UP", tuple())
+ transparency.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(xArea.LineWidth, 100)
+ self.assertEqual(xArea.LineTransparence, 5)
+ self.assertEqual(hex(xArea.FillColor), '0xffffff')
+ self.assertEqual(xArea.FillTransparence, 0)
+
+ #reopen and verify tab "Borders".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
+
+ #Click on tab "Area"
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ btncolor = xDialog.getChild("btncolor")
+ btncolor.executeAction("CLICK", tuple())
+
+ rCustom = xDialog.getChild("R_custom")
+ gCustom = xDialog.getChild("G_custom")
+ bCustom = xDialog.getChild("B_custom")
+
+ rCustom.executeAction("CLEAR", tuple())
+ rCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"35"}))
+ rCustom.executeAction("UP", tuple())
+ rCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
+ self.assertEqual(get_state_as_dict(rCustom)["Text"], "35")
+ gCustom.executeAction("CLEAR", tuple())
+ gCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"169"}))
+ gCustom.executeAction("UP", tuple())
+ gCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
+ bCustom.executeAction("CLEAR", tuple())
+ bCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"211"}))
+ bCustom.executeAction("UP", tuple())
+ bCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(xArea.LineWidth, 100)
+ self.assertEqual(xArea.LineTransparence, 5)
+ self.assertEqual(hex(xArea.FillColor), '0x23a9d3')
+ self.assertEqual(xArea.FillTransparence, 0)
+
+ #reopen and verify tab "Area".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ rCustom = xDialog.getChild("R_custom")
+ gCustom = xDialog.getChild("G_custom")
+ bCustom = xDialog.getChild("B_custom")
+
+ self.assertEqual(get_state_as_dict(rCustom)["Text"], "35")
+ self.assertEqual(get_state_as_dict(gCustom)["Text"], "169")
+ self.assertEqual(get_state_as_dict(bCustom)["Text"], "211")
+
+ #change tab "Transparency"
+ select_pos(tabcontrol, "2")
+ transparency = xDialog.getChild("RBT_TRANS_LINEAR")
+ transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51%
+
+ transparency.executeAction("CLICK", tuple())
+ transparencyPercent.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(xArea.LineWidth, 100)
+ self.assertEqual(xArea.LineTransparence, 5)
+ self.assertEqual(hex(xArea.FillColor), '0x23a9d3')
+ self.assertEqual(xArea.FillTransparence, 51)
+
+ #reopen and verify tab "Transparency"
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramArea"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "2")
+
+ transparency = xDialog.getChild("RBT_TRANS_LINEAR")
+ transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51%
+
+ self.assertEqual(get_state_as_dict(transparency)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(transparencyPercent)["Text"], "51%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(xArea.LineWidth, 100)
+ self.assertEqual(xArea.LineTransparence, 5)
+ self.assertEqual(hex(xArea.FillColor), '0x23a9d3')
+ self.assertEqual(xArea.FillTransparence, 51)
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/chartAxes.py b/sc/qa/uitest/chart/chartAxes.py
index b0ceb6df5fc6..9b8db33aa4e7 100644
--- a/sc/qa/uitest/chart/chartAxes.py
+++ b/sc/qa/uitest/chart/chartAxes.py
@@ -15,53 +15,52 @@ from uitest.uihelper.common import get_state_as_dict, type_text, get_url_for_dat
class chartAxes(UITestCase):
def test_chart_enable_grids_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf98390.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf98390.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuAxes"}))
- xDialog = self.xUITest.getTopFocusWindow()
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuAxes"}))
+ xDialog = self.xUITest.getTopFocusWindow()
- primaryX = xDialog.getChild("primaryX")
- primaryY = xDialog.getChild("primaryY")
- secondaryX = xDialog.getChild("secondaryX")
- secondaryY = xDialog.getChild("secondaryY")
+ primaryX = xDialog.getChild("primaryX")
+ primaryY = xDialog.getChild("primaryY")
+ secondaryX = xDialog.getChild("secondaryX")
+ secondaryY = xDialog.getChild("secondaryY")
- primaryX.executeAction("CLICK", tuple())
- primaryY.executeAction("CLICK", tuple())
- secondaryX.executeAction("CLICK", tuple())
- secondaryY.executeAction("CLICK", tuple())
+ primaryX.executeAction("CLICK", tuple())
+ primaryY.executeAction("CLICK", tuple())
+ secondaryX.executeAction("CLICK", tuple())
+ secondaryY.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)
- #reopen and verify Grids dialog
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuAxes"}))
- xDialog = self.xUITest.getTopFocusWindow()
+ #reopen and verify Grids dialog
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuAxes"}))
+ xDialog = self.xUITest.getTopFocusWindow()
- primaryX = xDialog.getChild("primaryX")
- primaryY = xDialog.getChild("primaryY")
- secondaryX = xDialog.getChild("secondaryX")
- secondaryY = xDialog.getChild("secondaryY")
+ primaryX = xDialog.getChild("primaryX")
+ primaryY = xDialog.getChild("primaryY")
+ secondaryX = xDialog.getChild("secondaryX")
+ secondaryY = xDialog.getChild("secondaryY")
- self.assertEqual(get_state_as_dict(primaryX)["Selected"], "false")
- self.assertEqual(get_state_as_dict(primaryY)["Selected"], "false")
- self.assertEqual(get_state_as_dict(secondaryX)["Selected"], "true")
- self.assertEqual(get_state_as_dict(secondaryY)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(primaryX)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(primaryY)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(secondaryX)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(secondaryY)["Selected"], "true")
- 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.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/chartDataLabels.py b/sc/qa/uitest/chart/chartDataLabels.py
index d634aab839fb..0d5bae2f0333 100644
--- a/sc/qa/uitest/chart/chartDataLabels.py
+++ b/sc/qa/uitest/chart/chartDataLabels.py
@@ -19,323 +19,316 @@ from com.sun.star.lang import Locale
class chartDataLabels(UITestCase):
def test_chart_data_labels_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf98390.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
-
- xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
- self.assertFalse(xDataSeries[0].Label.ShowNumber)
- self.assertFalse(xDataSeries[0].Label.ShowCategoryName)
- self.assertFalse(xDataSeries[0].Label.ShowLegendSymbol)
- self.assertEqual(xDataSeries[0].LabelSeparator, " ")
-
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuDataLabels"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
-
- self.assertTrue(xDataSeries[0].Label.ShowNumber)
- self.assertFalse(xDataSeries[0].Label.ShowCategoryName)
- self.assertFalse(xDataSeries[0].Label.ShowLegendSymbol)
- self.assertEqual(xDataSeries[0].LabelSeparator, " ")
-
- valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER")
- category = xDialog.getChild("CB_CATEGORY")
- legend = xDialog.getChild("CB_SYMBOL")
- wrapText = xDialog.getChild("CB_WRAP_TEXT")
- separator = xDialog.getChild("LB_TEXT_SEPARATOR")
- placement = xDialog.getChild("LB_LABEL_PLACEMENT")
- degrees = xDialog.getChild("NF_LABEL_DEGREES")
- textDirection = xDialog.getChild("LB_LABEL_TEXTDIR")
-
- #valueAsNumber.executeAction("CLICK", tuple())
- category.executeAction("CLICK", tuple())
- legend.executeAction("CLICK", tuple())
- wrapText.executeAction("CLICK", tuple())
- select_by_text(separator, "Comma")
-
- select_by_text(placement, "Below")
- degrees.executeAction("UP", tuple())
- select_by_text(textDirection, "Right-to-left")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertTrue(xDataSeries[0].Label.ShowNumber)
- self.assertTrue(xDataSeries[0].Label.ShowCategoryName)
- self.assertTrue(xDataSeries[0].Label.ShowLegendSymbol)
- self.assertEqual(xDataSeries[0].LabelSeparator, ", ")
-
- #reopen and verify InsertMenuDataLabels dialog
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuDataLabels"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
-
- self.assertTrue(xDataSeries[0].Label.ShowNumber)
- self.assertTrue(xDataSeries[0].Label.ShowCategoryName)
- self.assertTrue(xDataSeries[0].Label.ShowLegendSymbol)
- self.assertEqual(xDataSeries[0].LabelSeparator, ", ")
-
- valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER")
- category = xDialog.getChild("CB_CATEGORY")
- legend = xDialog.getChild("CB_SYMBOL")
- wrapText = xDialog.getChild("CB_WRAP_TEXT")
- separator = xDialog.getChild("LB_TEXT_SEPARATOR")
- placement = xDialog.getChild("LB_LABEL_PLACEMENT")
- degrees = xDialog.getChild("NF_LABEL_DEGREES")
- textDirection = xDialog.getChild("LB_LABEL_TEXTDIR")
-
- self.assertEqual(get_state_as_dict(valueAsNumber)["Selected"], "true")
- self.assertEqual(get_state_as_dict(category)["Selected"], "true")
- self.assertEqual(get_state_as_dict(legend)["Selected"], "true")
- self.assertEqual(get_state_as_dict(wrapText)["Selected"], "true")
- self.assertEqual(get_state_as_dict(separator)["SelectEntryText"], "Comma")
- self.assertEqual(get_state_as_dict(placement)["SelectEntryText"], "Below")
- self.assertEqual(get_state_as_dict(degrees)["Text"], "1°")
- self.assertEqual(get_state_as_dict(textDirection)["SelectEntryText"], "Right-to-left")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertTrue(xDataSeries[0].Label.ShowNumber)
- self.assertTrue(xDataSeries[0].Label.ShowCategoryName)
- self.assertTrue(xDataSeries[0].Label.ShowLegendSymbol)
- self.assertEqual(xDataSeries[0].LabelSeparator, ", ")
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf98390.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+
+ xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+ self.assertFalse(xDataSeries[0].Label.ShowNumber)
+ self.assertFalse(xDataSeries[0].Label.ShowCategoryName)
+ self.assertFalse(xDataSeries[0].Label.ShowLegendSymbol)
+ self.assertEqual(xDataSeries[0].LabelSeparator, " ")
+
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuDataLabels"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ self.assertTrue(xDataSeries[0].Label.ShowNumber)
+ self.assertFalse(xDataSeries[0].Label.ShowCategoryName)
+ self.assertFalse(xDataSeries[0].Label.ShowLegendSymbol)
+ self.assertEqual(xDataSeries[0].LabelSeparator, " ")
+
+ valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER")
+ category = xDialog.getChild("CB_CATEGORY")
+ legend = xDialog.getChild("CB_SYMBOL")
+ wrapText = xDialog.getChild("CB_WRAP_TEXT")
+ separator = xDialog.getChild("LB_TEXT_SEPARATOR")
+ placement = xDialog.getChild("LB_LABEL_PLACEMENT")
+ degrees = xDialog.getChild("NF_LABEL_DEGREES")
+ textDirection = xDialog.getChild("LB_LABEL_TEXTDIR")
+
+ #valueAsNumber.executeAction("CLICK", tuple())
+ category.executeAction("CLICK", tuple())
+ legend.executeAction("CLICK", tuple())
+ wrapText.executeAction("CLICK", tuple())
+ select_by_text(separator, "Comma")
+
+ select_by_text(placement, "Below")
+ degrees.executeAction("UP", tuple())
+ select_by_text(textDirection, "Right-to-left")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertTrue(xDataSeries[0].Label.ShowNumber)
+ self.assertTrue(xDataSeries[0].Label.ShowCategoryName)
+ self.assertTrue(xDataSeries[0].Label.ShowLegendSymbol)
+ self.assertEqual(xDataSeries[0].LabelSeparator, ", ")
+
+ #reopen and verify InsertMenuDataLabels dialog
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuDataLabels"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ self.assertTrue(xDataSeries[0].Label.ShowNumber)
+ self.assertTrue(xDataSeries[0].Label.ShowCategoryName)
+ self.assertTrue(xDataSeries[0].Label.ShowLegendSymbol)
+ self.assertEqual(xDataSeries[0].LabelSeparator, ", ")
+
+ valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER")
+ category = xDialog.getChild("CB_CATEGORY")
+ legend = xDialog.getChild("CB_SYMBOL")
+ wrapText = xDialog.getChild("CB_WRAP_TEXT")
+ separator = xDialog.getChild("LB_TEXT_SEPARATOR")
+ placement = xDialog.getChild("LB_LABEL_PLACEMENT")
+ degrees = xDialog.getChild("NF_LABEL_DEGREES")
+ textDirection = xDialog.getChild("LB_LABEL_TEXTDIR")
+
+ self.assertEqual(get_state_as_dict(valueAsNumber)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(category)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(legend)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(wrapText)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(separator)["SelectEntryText"], "Comma")
+ self.assertEqual(get_state_as_dict(placement)["SelectEntryText"], "Below")
+ self.assertEqual(get_state_as_dict(degrees)["Text"], "1°")
+ self.assertEqual(get_state_as_dict(textDirection)["SelectEntryText"], "Right-to-left")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertTrue(xDataSeries[0].Label.ShowNumber)
+ self.assertTrue(xDataSeries[0].Label.ShowCategoryName)
+ self.assertTrue(xDataSeries[0].Label.ShowLegendSymbol)
+ self.assertEqual(xDataSeries[0].LabelSeparator, ", ")
def test_chart_data_labels_percentage_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("dataLabels.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
-
- xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
- self.assertTrue(xDataSeries[0].Label.ShowNumber)
- self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
- self.assertIsNone(xDataSeries[0].PercentageNumberFormat)
-
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataLabels"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
-
- self.assertTrue(xDataSeries[0].Label.ShowNumber)
- self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
- self.assertIsNone(xDataSeries[0].PercentageNumberFormat)
-
- valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER")
- valueAsPercentage = xDialog.getChild("CB_VALUE_AS_PERCENTAGE")
- category = xDialog.getChild("CB_CATEGORY")
- legend = xDialog.getChild("CB_SYMBOL")
- wrapText = xDialog.getChild("CB_WRAP_TEXT")
- separator = xDialog.getChild("LB_TEXT_SEPARATOR")
- placement = xDialog.getChild("LB_LABEL_PLACEMENT")
- degrees = xDialog.getChild("NF_LABEL_DEGREES")
- textDirection = xDialog.getChild("LB_LABEL_TEXTDIR")
- buttonPercentage = xDialog.getChild("PB_PERCENT_NUMBERFORMAT")
-
- valueAsNumber.executeAction("CLICK", tuple())
- valueAsPercentage.executeAction("CLICK", tuple())
- #button Percentage format
-
- with self.ui_test.execute_blocking_action(buttonPercentage.executeAction, args=('CLICK', ())) as dialog:
- sourceformat = dialog.getChild("sourceformat")
- decimalsed = dialog.getChild("decimalsed")
- leadzerosed = dialog.getChild("leadzerosed")
- negnumred = dialog.getChild("negnumred")
- thousands = dialog.getChild("thousands")
- formatted = dialog.getChild("formatted")
-
- sourceformat.executeAction("CLICK", tuple())
- decimalsed.executeAction("UP", tuple())
- leadzerosed.executeAction("UP", tuple())
- negnumred.executeAction("CLICK", tuple())
- thousands.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(formatted)["Text"], "#,#00.0%;[RED]-#,#00.0%")
-
- self.assertEqual(get_state_as_dict(valueAsNumber)["Selected"], "false")
- self.assertEqual(get_state_as_dict(valueAsPercentage)["Selected"], "true")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- xNumberFormats = document.Sheets[0].Charts[0].getEmbeddedObject().getNumberFormats()
- xLocale = Locale('en', 'US', '')
- xFormat = xNumberFormats.queryKey("#,#00.0%;[RED]-#,#00.0%", xLocale, True)
-
- self.assertFalse(xDataSeries[0].Label.ShowNumber)
- self.assertTrue(xDataSeries[0].Label.ShowNumberInPercent)
- self.assertEqual(xDataSeries[0].PercentageNumberFormat, xFormat)
-
- #reopen and verify Percentage dialog
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataLabels"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
-
- self.assertFalse(xDataSeries[0].Label.ShowNumber)
- self.assertTrue(xDataSeries[0].Label.ShowNumberInPercent)
- self.assertEqual(xDataSeries[0].PercentageNumberFormat, xFormat)
-
- valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER")
- valueAsPercentage = xDialog.getChild("CB_VALUE_AS_PERCENTAGE")
- category = xDialog.getChild("CB_CATEGORY")
- legend = xDialog.getChild("CB_SYMBOL")
- wrapText = xDialog.getChild("CB_WRAP_TEXT")
- separator = xDialog.getChild("LB_TEXT_SEPARATOR")
- placement = xDialog.getChild("LB_LABEL_PLACEMENT")
- degrees = xDialog.getChild("NF_LABEL_DEGREES")
- textDirection = xDialog.getChild("LB_LABEL_TEXTDIR")
- buttonPercentage = xDialog.getChild("PB_PERCENT_NUMBERFORMAT")
-
- self.assertEqual(get_state_as_dict(valueAsNumber)["Selected"], "false")
- self.assertEqual(get_state_as_dict(valueAsPercentage)["Selected"], "true")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertFalse(xDataSeries[0].Label.ShowNumber)
- self.assertTrue(xDataSeries[0].Label.ShowNumberInPercent)
- self.assertEqual(xDataSeries[0].PercentageNumberFormat, xFormat)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("dataLabels.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+
+ xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+ self.assertTrue(xDataSeries[0].Label.ShowNumber)
+ self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
+ self.assertIsNone(xDataSeries[0].PercentageNumberFormat)
+
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataLabels"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ self.assertTrue(xDataSeries[0].Label.ShowNumber)
+ self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
+ self.assertIsNone(xDataSeries[0].PercentageNumberFormat)
+
+ valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER")
+ valueAsPercentage = xDialog.getChild("CB_VALUE_AS_PERCENTAGE")
+ category = xDialog.getChild("CB_CATEGORY")
+ legend = xDialog.getChild("CB_SYMBOL")
+ wrapText = xDialog.getChild("CB_WRAP_TEXT")
+ separator = xDialog.getChild("LB_TEXT_SEPARATOR")
+ placement = xDialog.getChild("LB_LABEL_PLACEMENT")
+ degrees = xDialog.getChild("NF_LABEL_DEGREES")
+ textDirection = xDialog.getChild("LB_LABEL_TEXTDIR")
+ buttonPercentage = xDialog.getChild("PB_PERCENT_NUMBERFORMAT")
+
+ valueAsNumber.executeAction("CLICK", tuple())
+ valueAsPercentage.executeAction("CLICK", tuple())
+ #button Percentage format
+
+ with self.ui_test.execute_blocking_action(buttonPercentage.executeAction, args=('CLICK', ())) as dialog:
+ sourceformat = dialog.getChild("sourceformat")
+ decimalsed = dialog.getChild("decimalsed")
+ leadzerosed = dialog.getChild("leadzerosed")
+ negnumred = dialog.getChild("negnumred")
+ thousands = dialog.getChild("thousands")
+ formatted = dialog.getChild("formatted")
+
+ sourceformat.executeAction("CLICK", tuple())
+ decimalsed.executeAction("UP", tuple())
+ leadzerosed.executeAction("UP", tuple())
+ negnumred.executeAction("CLICK", tuple())
+ thousands.executeAction("CLICK", tuple())
+ self.assertEqual(get_state_as_dict(formatted)["Text"], "#,#00.0%;[RED]-#,#00.0%")
+
+ self.assertEqual(get_state_as_dict(valueAsNumber)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(valueAsPercentage)["Selected"], "true")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ xNumberFormats = document.Sheets[0].Charts[0].getEmbeddedObject().getNumberFormats()
+ xLocale = Locale('en', 'US', '')
+ xFormat = xNumberFormats.queryKey("#,#00.0%;[RED]-#,#00.0%", xLocale, True)
+
+ self.assertFalse(xDataSeries[0].Label.ShowNumber)
+ self.assertTrue(xDataSeries[0].Label.ShowNumberInPercent)
+ self.assertEqual(xDataSeries[0].PercentageNumberFormat, xFormat)
+
+ #reopen and verify Percentage dialog
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataLabels"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+
+ self.assertFalse(xDataSeries[0].Label.ShowNumber)
+ self.assertTrue(xDataSeries[0].Label.ShowNumberInPercent)
+ self.assertEqual(xDataSeries[0].PercentageNumberFormat, xFormat)
+
+ valueAsNumber = xDialog.getChild("CB_VALUE_AS_NUMBER")
+ valueAsPercentage = xDialog.getChild("CB_VALUE_AS_PERCENTAGE")
+ category = xDialog.getChild("CB_CATEGORY")
+ legend = xDialog.getChild("CB_SYMBOL")
+ wrapText = xDialog.getChild("CB_WRAP_TEXT")
+ separator = xDialog.getChild("LB_TEXT_SEPARATOR")
+ placement = xDialog.getChild("LB_LABEL_PLACEMENT")
+ degrees = xDialog.getChild("NF_LABEL_DEGREES")
+ textDirection = xDialog.getChild("LB_LABEL_TEXTDIR")
+ buttonPercentage = xDialog.getChild("PB_PERCENT_NUMBERFORMAT")
+
+ self.assertEqual(get_state_as_dict(valueAsNumber)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(valueAsPercentage)["Selected"], "true")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertFalse(xDataSeries[0].Label.ShowNumber)
+ self.assertTrue(xDataSeries[0].Label.ShowNumberInPercent)
+ self.assertEqual(xDataSeries[0].PercentageNumberFormat, xFormat)
def test_tdf131291(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf131291.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf131291.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
- self.assertTrue(xDataSeries[0].Label.ShowNumber)
- self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
+ xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+ self.assertTrue(xDataSeries[0].Label.ShowNumber)
+ self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataLabels"}))
- xDialog = self.xUITest.getTopFocusWindow()
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataLabels"}))
+ xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
- self.assertTrue(xDataSeries[0].Label.ShowNumber)
- self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
+ self.assertTrue(xDataSeries[0].Label.ShowNumber)
+ self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
- xNumberFormatBtn = xDialog.getChild("PB_NUMBERFORMAT")
+ xNumberFormatBtn = xDialog.getChild("PB_NUMBERFORMAT")
- with self.ui_test.execute_blocking_action(xNumberFormatBtn.executeAction, args=('CLICK', ())) as dialog:
- categoryformat = dialog.getChild("categorylb")
- formatted = dialog.getChild("formatted")
- sourceformat = dialog.getChild("sourceformat")
+ with self.ui_test.execute_blocking_action(xNumberFormatBtn.executeAction, args=('CLICK', ())) as dialog:
+ categoryformat = dialog.getChild("categorylb")
+ formatted = dialog.getChild("formatted")
+ sourceformat = dialog.getChild("sourceformat")
- # Select currency
- sourceformat.executeAction("CLICK", tuple());
- categoryformat.getChild("4").executeAction("SELECT", tuple());
+ # Select currency
+ sourceformat.executeAction("CLICK", tuple());
+ categoryformat.getChild("4").executeAction("SELECT", tuple());
- self.assertEqual(get_state_as_dict(categoryformat)["SelectEntryText"], "Currency")
+ self.assertEqual(get_state_as_dict(categoryformat)["SelectEntryText"], "Currency")
- self.assertEqual(get_state_as_dict(formatted)["Text"], "[$$-409]#,##0.00;[RED]-[$$-409]#,##0.00")
+ self.assertEqual(get_state_as_dict(formatted)["Text"], "[$$-409]#,##0.00;[RED]-[$$-409]#,##0.00")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- xNumberFormats = document.Sheets[0].Charts[0].getEmbeddedObject().getNumberFormats()
- xLocale = Locale()
- xFormat = xNumberFormats.queryKey("[$$-409]#,##0.00;[RED]-[$$-409]#,##0.00", xLocale, True)
+ xNumberFormats = document.Sheets[0].Charts[0].getEmbeddedObject().getNumberFormats()
+ xLocale = Locale()
+ xFormat = xNumberFormats.queryKey("[$$-409]#,##0.00;[RED]-[$$-409]#,##0.00", xLocale, True)
- self.assertTrue(xDataSeries[0].Label.ShowNumber)
- self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
- self.assertEqual(xDataSeries[0].NumberFormat, xFormat)
+ self.assertTrue(xDataSeries[0].Label.ShowNumber)
+ self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
+ self.assertEqual(xDataSeries[0].NumberFormat, xFormat)
- #reopen and verify the previous changes
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataLabels"}))
- xDialog = self.xUITest.getTopFocusWindow()
+ #reopen and verify the previous changes
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataLabels"}))
+ xDialog = self.xUITest.getTopFocusWindow()
- self.assertTrue(xDataSeries[0].Label.ShowNumber)
- self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
- # tdf#131291: it would fail here: AssertionError: 0 != 104
- self.assertEqual(xDataSeries[0].NumberFormat, xFormat)
+ self.assertTrue(xDataSeries[0].Label.ShowNumber)
+ self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
+ # tdf#131291: it would fail here: AssertionError: 0 != 104
+ self.assertEqual(xDataSeries[0].NumberFormat, xFormat)
- 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.assertTrue(xDataSeries[0].Label.ShowNumber)
- self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
- self.assertEqual(xDataSeries[0].NumberFormat, xFormat)
- self.ui_test.close_doc()
+ self.assertTrue(xDataSeries[0].Label.ShowNumber)
+ self.assertFalse(xDataSeries[0].Label.ShowNumberInPercent)
+ self.assertEqual(xDataSeries[0].NumberFormat, xFormat)
def test_tdf136573(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("dataLabels.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("dataLabels.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- change_measurement_unit(self, "Centimeter")
+ change_measurement_unit(self, "Centimeter")
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
- # Select the first label
- xDataLabel = xChartMain.getChild("CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0")
- xDataLabel.executeAction("SELECT", tuple())
+ # Select the first label
+ xDataLabel = xChartMain.getChild("CID/MultiClick/CID/D=0:CS=0:CT=0:Series=0:DataLabels=:DataLabel=0")
+ xDataLabel.executeAction("SELECT", tuple())
- self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
+ self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
- xDialog = self.xUITest.getTopFocusWindow()
- self.assertEqual("0.5", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
- self.assertEqual("2.89", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value'])
+ xDialog = self.xUITest.getTopFocusWindow()
+ self.assertEqual("0.5", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
+ self.assertEqual("2.89", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value'])
- # Use OK button in order to test tdf#137165
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ # Use OK button in order to test tdf#137165
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"}))
+ xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"}))
- self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
+ self.ui_test.execute_dialog_through_action(xDataLabel, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
- # Check the position has changed after moving the label using the arrows keys
- xDialog = self.xUITest.getTopFocusWindow()
- self.assertEqual("0.4", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
- self.assertEqual("2.79", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value'])
+ # Check the position has changed after moving the label using the arrows keys
+ xDialog = self.xUITest.getTopFocusWindow()
+ self.assertEqual("0.4", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
+ self.assertEqual("2.79", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value'])
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
-
- self.ui_test.close_doc()
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/chartGrid.py b/sc/qa/uitest/chart/chartGrid.py
index cb6a681a73fc..7b9814194e51 100644
--- a/sc/qa/uitest/chart/chartGrid.py
+++ b/sc/qa/uitest/chart/chartGrid.py
@@ -17,217 +17,216 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class chartGrid(UITestCase):
def test_tdf98390_chart_grid_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf98390.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- change_measurement_unit(self, "Centimeter")
-
- #X Axis Major Grid
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #tab "Line".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- xWidth.executeAction("UP", tuple())
- transparency.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify X Axis Major Grid
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Y Axis Major Grid
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- xWidth.executeAction("UP", tuple())
- transparency.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify Y Axis Major Grid
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Y Axis Minor Grid
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- xWidth.executeAction("UP", tuple())
- transparency.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify Y Axis Minor Grid
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #X Axis Minor Grid
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- xWidth.executeAction("UP", tuple())
- transparency.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify X Axis Minor Grid
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #All Grids
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridAll"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- xWidth.executeAction("UP", tuple())
- transparency.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify X Axis Minor Grid (changed in All Grids)
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.20 cm")
- self.assertEqual(get_state_as_dict(transparency)["Text"], "10%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf98390.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ #X Axis Major Grid
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #tab "Line".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ xWidth.executeAction("UP", tuple())
+ transparency.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify X Axis Major Grid
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYMain"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Y Axis Major Grid
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ xWidth.executeAction("UP", tuple())
+ transparency.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify Y Axis Major Grid
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXMain"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Y Axis Minor Grid
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ xWidth.executeAction("UP", tuple())
+ transparency.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify Y Axis Minor Grid
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridXHelp"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #X Axis Minor Grid
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ xWidth.executeAction("UP", tuple())
+ transparency.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify X Axis Minor Grid
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #All Grids
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridAll"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ xWidth.executeAction("UP", tuple())
+ transparency.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify X Axis Minor Grid (changed in All Grids)
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramGridYHelp"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.20 cm")
+ self.assertEqual(get_state_as_dict(transparency)["Text"], "10%")
+
+ 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/chart/chartGrids.py b/sc/qa/uitest/chart/chartGrids.py
index 0fed3e9e9571..b1ffd01b0c49 100644
--- a/sc/qa/uitest/chart/chartGrids.py
+++ b/sc/qa/uitest/chart/chartGrids.py
@@ -15,80 +15,79 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class chartGrids(UITestCase):
def test_chart_enable_grids_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf98390.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuGrids"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- primaryX = xDialog.getChild("primaryX")
- primaryY = xDialog.getChild("primaryY")
- secondaryX = xDialog.getChild("secondaryX")
- secondaryY = xDialog.getChild("secondaryY")
-
- primaryX.executeAction("CLICK", tuple())
- primaryY.executeAction("CLICK", tuple())
- secondaryX.executeAction("CLICK", tuple())
- secondaryY.executeAction("CLICK", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify Grids dialog
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuGrids"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- primaryX = xDialog.getChild("primaryX")
- primaryY = xDialog.getChild("primaryY")
- secondaryX = xDialog.getChild("secondaryX")
- secondaryY = xDialog.getChild("secondaryY")
-
- self.assertEqual(get_state_as_dict(primaryX)["Selected"], "false")
- self.assertEqual(get_state_as_dict(primaryY)["Selected"], "false")
- self.assertEqual(get_state_as_dict(secondaryX)["Selected"], "false")
- self.assertEqual(get_state_as_dict(secondaryY)["Selected"], "false")
-
- primaryX.executeAction("CLICK", tuple())
- primaryY.executeAction("CLICK", tuple())
- secondaryX.executeAction("CLICK", tuple())
- secondaryY.executeAction("CLICK", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify Grids dialog
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuGrids"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- primaryX = xDialog.getChild("primaryX")
- primaryY = xDialog.getChild("primaryY")
- secondaryX = xDialog.getChild("secondaryX")
- secondaryY = xDialog.getChild("secondaryY")
-
- self.assertEqual(get_state_as_dict(primaryX)["Selected"], "true")
- self.assertEqual(get_state_as_dict(primaryY)["Selected"], "true")
- self.assertEqual(get_state_as_dict(secondaryX)["Selected"], "true")
- self.assertEqual(get_state_as_dict(secondaryY)["Selected"], "true")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf98390.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuGrids"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ primaryX = xDialog.getChild("primaryX")
+ primaryY = xDialog.getChild("primaryY")
+ secondaryX = xDialog.getChild("secondaryX")
+ secondaryY = xDialog.getChild("secondaryY")
+
+ primaryX.executeAction("CLICK", tuple())
+ primaryY.executeAction("CLICK", tuple())
+ secondaryX.executeAction("CLICK", tuple())
+ secondaryY.executeAction("CLICK", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify Grids dialog
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuGrids"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ primaryX = xDialog.getChild("primaryX")
+ primaryY = xDialog.getChild("primaryY")
+ secondaryX = xDialog.getChild("secondaryX")
+ secondaryY = xDialog.getChild("secondaryY")
+
+ self.assertEqual(get_state_as_dict(primaryX)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(primaryY)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(secondaryX)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(secondaryY)["Selected"], "false")
+
+ primaryX.executeAction("CLICK", tuple())
+ primaryY.executeAction("CLICK", tuple())
+ secondaryX.executeAction("CLICK", tuple())
+ secondaryY.executeAction("CLICK", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify Grids dialog
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuGrids"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ primaryX = xDialog.getChild("primaryX")
+ primaryY = xDialog.getChild("primaryY")
+ secondaryX = xDialog.getChild("secondaryX")
+ secondaryY = xDialog.getChild("secondaryY")
+
+ self.assertEqual(get_state_as_dict(primaryX)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(primaryY)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(secondaryX)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(secondaryY)["Selected"], "true")
+
+ 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/chart/chartLegend.py b/sc/qa/uitest/chart/chartLegend.py
index 0e7727b6b854..54929c5c6c30 100644
--- a/sc/qa/uitest/chart/chartLegend.py
+++ b/sc/qa/uitest/chart/chartLegend.py
@@ -17,7 +17,7 @@ from uitest.uihelper import guarded
class chartLegend(UITestCase):
def test_chart_display_legend_dialog(self):
- with guarded.load_file(self, get_url_for_data_file("tdf98390.ods")) as calc_doc:
+ with self.ui_test.load_file(get_url_for_data_file("tdf98390.ods")) as calc_doc:
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
document = self.ui_test.get_component()
@@ -77,7 +77,7 @@ class chartLegend(UITestCase):
def test_legends_move_with_arrows_keys(self):
- with guarded.load_file(self, get_url_for_data_file("dataLabels.ods")) as calc_doc:
+ with self.ui_test.load_file(get_url_for_data_file("dataLabels.ods")) as calc_doc:
xCalcDoc = self.xUITest.getTopFocusWindow()
gridwin = xCalcDoc.getChild("grid_window")
diff --git a/sc/qa/uitest/chart/chartTitles.py b/sc/qa/uitest/chart/chartTitles.py
index 35765ba6b05a..84f0878a22e8 100644
--- a/sc/qa/uitest/chart/chartTitles.py
+++ b/sc/qa/uitest/chart/chartTitles.py
@@ -16,118 +16,115 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class chartTitles(UITestCase):
def test_chart_display_titles_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf98390.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- xCS = document.Sheets[0].Charts[0].getEmbeddedObject().FirstDiagram.CoordinateSystems[0]
-
- self.assertFalse(document.Sheets[0].Charts[0].getEmbeddedObject().HasMainTitle)
- self.assertFalse(document.Sheets[0].Charts[0].getEmbeddedObject().HasSubTitle)
- self.assertIsNone(xCS.getAxisByDimension(0, 0).TitleObject)
- self.assertIsNone(xCS.getAxisByDimension(1, 0).TitleObject)
-
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuTitles"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- maintitle = xDialog.getChild("maintitle")
- subtitle = xDialog.getChild("subtitle")
- primaryXaxis = xDialog.getChild("primaryXaxis")
- primaryYaxis = xDialog.getChild("primaryYaxis")
- secondaryXaxis = xDialog.getChild("secondaryXaxis")
- secondaryYaxis = xDialog.getChild("secondaryYaxis")
-
- maintitle.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
- subtitle.executeAction("TYPE", mkPropertyValues({"TEXT":"B"}))
- primaryXaxis.executeAction("TYPE", mkPropertyValues({"TEXT":"C"}))
- primaryYaxis.executeAction("TYPE", mkPropertyValues({"TEXT":"D"}))
- secondaryXaxis.executeAction("TYPE", mkPropertyValues({"TEXT":"E"}))
- secondaryYaxis.executeAction("TYPE", mkPropertyValues({"TEXT":"F"}))
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertTrue(document.Sheets[0].Charts[0].getEmbeddedObject().HasMainTitle)
- self.assertTrue(document.Sheets[0].Charts[0].getEmbeddedObject().HasSubTitle)
- self.assertEqual("A", document.Sheets[0].Charts[0].getEmbeddedObject().Title.String)
- self.assertEqual("B", document.Sheets[0].Charts[0].getEmbeddedObject().SubTitle.String)
- self.assertEqual("C", xCS.getAxisByDimension(0, 0).TitleObject.Text[0].String)
- self.assertEqual("D", xCS.getAxisByDimension(1, 0).TitleObject.Text[0].String)
- self.assertEqual("E", xCS.getAxisByDimension(0, 1).TitleObject.Text[0].String)
- self.assertEqual("F", xCS.getAxisByDimension(1, 1).TitleObject.Text[0].String)
-
- #reopen and verify InsertMenuTitles dialog
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuTitles"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- maintitle = xDialog.getChild("maintitle")
- subtitle = xDialog.getChild("subtitle")
- primaryXaxis = xDialog.getChild("primaryXaxis")
- primaryYaxis = xDialog.getChild("primaryYaxis")
- secondaryXaxis = xDialog.getChild("secondaryXaxis")
- secondaryYaxis = xDialog.getChild("secondaryYaxis")
-
- self.assertEqual(get_state_as_dict(maintitle)["Text"], "A")
- self.assertEqual(get_state_as_dict(subtitle)["Text"], "B")
- self.assertEqual(get_state_as_dict(primaryXaxis)["Text"], "C")
- self.assertEqual(get_state_as_dict(primaryYaxis)["Text"], "D")
- self.assertEqual(get_state_as_dict(secondaryXaxis)["Text"], "E")
- self.assertEqual(get_state_as_dict(secondaryYaxis)["Text"], "F")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf98390.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ xCS = document.Sheets[0].Charts[0].getEmbeddedObject().FirstDiagram.CoordinateSystems[0]
+
+ self.assertFalse(document.Sheets[0].Charts[0].getEmbeddedObject().HasMainTitle)
+ self.assertFalse(document.Sheets[0].Charts[0].getEmbeddedObject().HasSubTitle)
+ self.assertIsNone(xCS.getAxisByDimension(0, 0).TitleObject)
+ self.assertIsNone(xCS.getAxisByDimension(1, 0).TitleObject)
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuTitles"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ maintitle = xDialog.getChild("maintitle")
+ subtitle = xDialog.getChild("subtitle")
+ primaryXaxis = xDialog.getChild("primaryXaxis")
+ primaryYaxis = xDialog.getChild("primaryYaxis")
+ secondaryXaxis = xDialog.getChild("secondaryXaxis")
+ secondaryYaxis = xDialog.getChild("secondaryYaxis")
+
+ maintitle.executeAction("TYPE", mkPropertyValues({"TEXT":"A"}))
+ subtitle.executeAction("TYPE", mkPropertyValues({"TEXT":"B"}))
+ primaryXaxis.executeAction("TYPE", mkPropertyValues({"TEXT":"C"}))
+ primaryYaxis.executeAction("TYPE", mkPropertyValues({"TEXT":"D"}))
+ secondaryXaxis.executeAction("TYPE", mkPropertyValues({"TEXT":"E"}))
+ secondaryYaxis.executeAction("TYPE", mkPropertyValues({"TEXT":"F"}))
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertTrue(document.Sheets[0].Charts[0].getEmbeddedObject().HasMainTitle)
+ self.assertTrue(document.Sheets[0].Charts[0].getEmbeddedObject().HasSubTitle)
+ self.assertEqual("A", document.Sheets[0].Charts[0].getEmbeddedObject().Title.String)
+ self.assertEqual("B", document.Sheets[0].Charts[0].getEmbeddedObject().SubTitle.String)
+ self.assertEqual("C", xCS.getAxisByDimension(0, 0).TitleObject.Text[0].String)
+ self.assertEqual("D", xCS.getAxisByDimension(1, 0).TitleObject.Text[0].String)
+ self.assertEqual("E", xCS.getAxisByDimension(0, 1).TitleObject.Text[0].String)
+ self.assertEqual("F", xCS.getAxisByDimension(1, 1).TitleObject.Text[0].String)
+
+ #reopen and verify InsertMenuTitles dialog
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "InsertMenuTitles"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ maintitle = xDialog.getChild("maintitle")
+ subtitle = xDialog.getChild("subtitle")
+ primaryXaxis = xDialog.getChild("primaryXaxis")
+ primaryYaxis = xDialog.getChild("primaryYaxis")
+ secondaryXaxis = xDialog.getChild("secondaryXaxis")
+ secondaryYaxis = xDialog.getChild("secondaryYaxis")
+
+ self.assertEqual(get_state_as_dict(maintitle)["Text"], "A")
+ self.assertEqual(get_state_as_dict(subtitle)["Text"], "B")
+ self.assertEqual(get_state_as_dict(primaryXaxis)["Text"], "C")
+ self.assertEqual(get_state_as_dict(primaryYaxis)["Text"], "D")
+ self.assertEqual(get_state_as_dict(secondaryXaxis)["Text"], "E")
+ self.assertEqual(get_state_as_dict(secondaryYaxis)["Text"], "F")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
def test_title_move_with_arrows_keys(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("chartArea.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("chartArea.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- change_measurement_unit(self, "Centimeter")
+ change_measurement_unit(self, "Centimeter")
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
- # Select the title
- xTitle = xChartMain.getChild("CID/Title=")
- xTitle.executeAction("SELECT", tuple())
+ # Select the title
+ xTitle = xChartMain.getChild("CID/Title=")
+ xTitle.executeAction("SELECT", tuple())
- self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
+ self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
- xDialog = self.xUITest.getTopFocusWindow()
- self.assertEqual("3.52", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
- self.assertEqual("0.3", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value'])
+ xDialog = self.xUITest.getTopFocusWindow()
+ self.assertEqual("3.52", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
+ self.assertEqual("0.3", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value'])
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
- xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"}))
+ xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "UP"}))
+ xChartMain.executeAction("TYPE", mkPropertyValues({"KEYCODE": "LEFT"}))
- self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
+ self.ui_test.execute_dialog_through_action(xTitle, "COMMAND", mkPropertyValues({"COMMAND": "TransformDialog"}))
- # Check the position has changed after moving the title using the arrows keys
- xDialog = self.xUITest.getTopFocusWindow()
- self.assertEqual("3.42", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
- self.assertEqual("0.2", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value'])
+ # Check the position has changed after moving the title using the arrows keys
+ xDialog = self.xUITest.getTopFocusWindow()
+ self.assertEqual("3.42", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_X"))['Value'])
+ self.assertEqual("0.2", get_state_as_dict(xDialog.getChild("MTR_FLD_POS_Y"))['Value'])
- xOkBtn = xDialog.getChild("ok")
- xOkBtn.executeAction("CLICK", tuple())
+ xOkBtn = xDialog.getChild("ok")
+ xOkBtn.executeAction("CLICK", tuple())
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/chartWall.py b/sc/qa/uitest/chart/chartWall.py
index 3c48db27d16e..485ce8d2090f 100644
--- a/sc/qa/uitest/chart/chartWall.py
+++ b/sc/qa/uitest/chart/chartWall.py
@@ -16,169 +16,168 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class chartWall(UITestCase):
def test_chart_wall_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf122398.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- change_measurement_unit(self, "Centimeter")
-
- xWall = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().Wall
- self.assertEqual(xWall.LineWidth, 0)
- self.assertEqual(xWall.LineTransparence, 0)
- self.assertEqual(hex(xWall.FillColor), '0xe6e6e6')
- self.assertEqual(xWall.FillTransparence, 0)
-
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Borders".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- xWidth.executeAction("UP", tuple())
- transparency.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertEqual(xWall.LineWidth, 100)
- self.assertEqual(xWall.LineTransparence, 5)
- self.assertEqual(hex(xWall.FillColor), '0xe6e6e6')
- self.assertEqual(xWall.FillTransparence, 0)
-
- #reopen and verify tab "Borders".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
-
- self.assertEqual(xWall.LineWidth, 100)
- self.assertEqual(xWall.LineTransparence, 5)
- self.assertEqual(hex(xWall.FillColor), '0xe6e6e6')
- self.assertEqual(xWall.FillTransparence, 0)
-
- #Click on tab "Area"
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
-
- btncolor = xDialog.getChild("btncolor")
- btncolor.executeAction("CLICK", tuple())
-
- rCustom = xDialog.getChild("R_custom")
- gCustom = xDialog.getChild("G_custom")
- bCustom = xDialog.getChild("B_custom")
-
- rCustom.executeAction("CLEAR", tuple())
- rCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"35"}))
- rCustom.executeAction("UP", tuple())
- rCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
- self.assertEqual(get_state_as_dict(rCustom)["Text"], "35")
- gCustom.executeAction("CLEAR", tuple())
- gCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"169"}))
- gCustom.executeAction("UP", tuple())
- gCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
- bCustom.executeAction("CLEAR", tuple())
- bCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"211"}))
- bCustom.executeAction("UP", tuple())
- bCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertEqual(xWall.LineWidth, 100)
- self.assertEqual(xWall.LineTransparence, 5)
- self.assertEqual(hex(xWall.FillColor), '0x23a9d3')
- self.assertEqual(xWall.FillTransparence, 0)
-
- #reopen and verify tab "Area".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
-
- rCustom = xDialog.getChild("R_custom")
- gCustom = xDialog.getChild("G_custom")
- bCustom = xDialog.getChild("B_custom")
-
- self.assertEqual(get_state_as_dict(rCustom)["Text"], "35")
- self.assertEqual(get_state_as_dict(gCustom)["Text"], "169")
- self.assertEqual(get_state_as_dict(bCustom)["Text"], "211")
-
- self.assertEqual(xWall.LineWidth, 100)
- self.assertEqual(xWall.LineTransparence, 5)
- self.assertEqual(hex(xWall.FillColor), '0x23a9d3')
- self.assertEqual(xWall.FillTransparence, 0)
-
- #change tab "Transparency"
- select_pos(tabcontrol, "2")
- transparency = xDialog.getChild("RBT_TRANS_LINEAR")
- transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51%
-
- transparency.executeAction("CLICK", tuple())
- transparencyPercent.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertEqual(xWall.LineWidth, 100)
- self.assertEqual(xWall.LineTransparence, 5)
- self.assertEqual(hex(xWall.FillColor), '0x23a9d3')
- self.assertEqual(xWall.FillTransparence, 51)
-
- #reopen and verify tab "Transparency"
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "2")
-
- transparency = xDialog.getChild("RBT_TRANS_LINEAR")
- transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51%
-
- self.assertEqual(get_state_as_dict(transparency)["Checked"], "true")
- self.assertEqual(get_state_as_dict(transparencyPercent)["Text"], "51%")
-
- self.assertEqual(xWall.LineWidth, 100)
- self.assertEqual(xWall.LineTransparence, 5)
- self.assertEqual(hex(xWall.FillColor), '0x23a9d3')
- self.assertEqual(xWall.FillTransparence, 51)
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertEqual(xWall.LineWidth, 100)
- self.assertEqual(xWall.LineTransparence, 5)
- self.assertEqual(hex(xWall.FillColor), '0x23a9d3')
- self.assertEqual(xWall.FillTransparence, 51)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf122398.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ xWall = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().Wall
+ self.assertEqual(xWall.LineWidth, 0)
+ self.assertEqual(xWall.LineTransparence, 0)
+ self.assertEqual(hex(xWall.FillColor), '0xe6e6e6')
+ self.assertEqual(xWall.FillTransparence, 0)
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Borders".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ xWidth.executeAction("UP", tuple())
+ transparency.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(xWall.LineWidth, 100)
+ self.assertEqual(xWall.LineTransparence, 5)
+ self.assertEqual(hex(xWall.FillColor), '0xe6e6e6')
+ self.assertEqual(xWall.FillTransparence, 0)
+
+ #reopen and verify tab "Borders".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
+
+ self.assertEqual(xWall.LineWidth, 100)
+ self.assertEqual(xWall.LineTransparence, 5)
+ self.assertEqual(hex(xWall.FillColor), '0xe6e6e6')
+ self.assertEqual(xWall.FillTransparence, 0)
+
+ #Click on tab "Area"
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ btncolor = xDialog.getChild("btncolor")
+ btncolor.executeAction("CLICK", tuple())
+
+ rCustom = xDialog.getChild("R_custom")
+ gCustom = xDialog.getChild("G_custom")
+ bCustom = xDialog.getChild("B_custom")
+
+ rCustom.executeAction("CLEAR", tuple())
+ rCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"35"}))
+ rCustom.executeAction("UP", tuple())
+ rCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
+ self.assertEqual(get_state_as_dict(rCustom)["Text"], "35")
+ gCustom.executeAction("CLEAR", tuple())
+ gCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"169"}))
+ gCustom.executeAction("UP", tuple())
+ gCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
+ bCustom.executeAction("CLEAR", tuple())
+ bCustom.executeAction("TYPE", mkPropertyValues({"TEXT":"211"}))
+ bCustom.executeAction("UP", tuple())
+ bCustom.executeAction("DOWN", tuple()) #without this save data doesn't works
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(xWall.LineWidth, 100)
+ self.assertEqual(xWall.LineTransparence, 5)
+ self.assertEqual(hex(xWall.FillColor), '0x23a9d3')
+ self.assertEqual(xWall.FillTransparence, 0)
+
+ #reopen and verify tab "Area".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ rCustom = xDialog.getChild("R_custom")
+ gCustom = xDialog.getChild("G_custom")
+ bCustom = xDialog.getChild("B_custom")
+
+ self.assertEqual(get_state_as_dict(rCustom)["Text"], "35")
+ self.assertEqual(get_state_as_dict(gCustom)["Text"], "169")
+ self.assertEqual(get_state_as_dict(bCustom)["Text"], "211")
+
+ self.assertEqual(xWall.LineWidth, 100)
+ self.assertEqual(xWall.LineTransparence, 5)
+ self.assertEqual(hex(xWall.FillColor), '0x23a9d3')
+ self.assertEqual(xWall.FillTransparence, 0)
+
+ #change tab "Transparency"
+ select_pos(tabcontrol, "2")
+ transparency = xDialog.getChild("RBT_TRANS_LINEAR")
+ transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51%
+
+ transparency.executeAction("CLICK", tuple())
+ transparencyPercent.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(xWall.LineWidth, 100)
+ self.assertEqual(xWall.LineTransparence, 5)
+ self.assertEqual(hex(xWall.FillColor), '0x23a9d3')
+ self.assertEqual(xWall.FillTransparence, 51)
+
+ #reopen and verify tab "Transparency"
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramWall"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "2")
+
+ transparency = xDialog.getChild("RBT_TRANS_LINEAR")
+ transparencyPercent = xDialog.getChild("MTR_TRANSPARENT") #51%
+
+ self.assertEqual(get_state_as_dict(transparency)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(transparencyPercent)["Text"], "51%")
+
+ self.assertEqual(xWall.LineWidth, 100)
+ self.assertEqual(xWall.LineTransparence, 5)
+ self.assertEqual(hex(xWall.FillColor), '0x23a9d3')
+ self.assertEqual(xWall.FillTransparence, 51)
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(xWall.LineWidth, 100)
+ self.assertEqual(xWall.LineTransparence, 5)
+ self.assertEqual(hex(xWall.FillColor), '0x23a9d3')
+ self.assertEqual(xWall.FillTransparence, 51)
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/chartXAxis.py b/sc/qa/uitest/chart/chartXAxis.py
index d169fa5d683e..15adb54b64b0 100644
--- a/sc/qa/uitest/chart/chartXAxis.py
+++ b/sc/qa/uitest/chart/chartXAxis.py
@@ -17,246 +17,245 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class chartXAxis(UITestCase):
def test_chart_x_axis_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf122398.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- change_measurement_unit(self, "Centimeter")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) # X Axis...
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Scale".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- reverseDirection = xDialog.getChild("CBX_REVERSE")
- logarithmicScale = xDialog.getChild("CBX_LOGARITHM")
- autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
- autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
- majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
- minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
- minimum = xDialog.getChild("EDT_MIN")
- maximum = xDialog.getChild("EDT_MAX")
- major = xDialog.getChild("EDT_STEP_MAIN")
- minor = xDialog.getChild("MT_STEPHELP")
-
- reverseDirection.executeAction("CLICK", tuple())
- logarithmicScale.executeAction("CLICK", tuple())
- autoMinimum.executeAction("CLICK", tuple())
- autoMaximum.executeAction("CLICK", tuple())
- majorInterval.executeAction("CLICK", tuple())
- minorInterval.executeAction("CLICK", tuple())
-
- minimum.executeAction("DOWN", tuple()) #10.12.2017
- maximum.executeAction("DOWN", tuple()) #29.04.2018
- major.executeAction("DOWN", tuple()) #19
- minor.executeAction("UP", tuple()) #3
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Scale".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- reverseDirection = xDialog.getChild("CBX_REVERSE")
- logarithmicScale = xDialog.getChild("CBX_LOGARITHM")
- autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
- autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
- majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
- minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
- minimum = xDialog.getChild("EDT_MIN")
- maximum = xDialog.getChild("EDT_MAX")
- major = xDialog.getChild("EDT_STEP_MAIN")
- minor = xDialog.getChild("MT_STEPHELP")
-
- self.assertEqual(get_state_as_dict(reverseDirection)["Selected"], "true")
- self.assertEqual(get_state_as_dict(logarithmicScale)["Selected"], "true")
- self.assertEqual(get_state_as_dict(autoMinimum)["Selected"], "false")
- self.assertEqual(get_state_as_dict(autoMaximum)["Selected"], "false")
- self.assertEqual(get_state_as_dict(majorInterval)["Selected"], "false")
- self.assertEqual(get_state_as_dict(minorInterval)["Selected"], "false")
- self.assertEqual(get_state_as_dict(minimum)["Text"], "10.12.2017")
- self.assertEqual(get_state_as_dict(maximum)["Text"], "29.04.2018")
- self.assertEqual(get_state_as_dict(major)["Text"], "19")
- self.assertEqual(get_state_as_dict(minor)["Text"], "3")
-
- #Click on tab "positioning".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
-
- crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
- crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
- placeLabels = xDialog.getChild("LB_PLACE_LABELS")
- innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
- outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
- innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
- outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
- placeMarks = xDialog.getChild("LB_PLACE_TICKS")
-
- select_by_text(crossAxis, "Start")
- select_by_text(placeLabels, "Outside end")
- innerMajorTick.executeAction("CLICK", tuple())
- outerMajorTick.executeAction("CLICK", tuple())
- innerMinorTick.executeAction("CLICK", tuple())
- outerMinorTick.executeAction("CLICK", tuple())
- select_by_text(placeMarks, "At axis")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify tab "positioning".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
-
- crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
- crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
- placeLabels = xDialog.getChild("LB_PLACE_LABELS")
- innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
- outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
- innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
- outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
- placeMarks = xDialog.getChild("LB_PLACE_TICKS")
-
- self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Start")
- self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end")
- self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false")
- self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis")
- #change tab "positioning".
- select_by_text(crossAxis, "Value")
- crossAxisValue.executeAction("UP", tuple()) #1
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify tab "positioning".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
-
- crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
- crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
- placeLabels = xDialog.getChild("LB_PLACE_LABELS")
- innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
- outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
- innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
- outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
- placeMarks = xDialog.getChild("LB_PLACE_TICKS")
-
- self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value")
- self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "1")
- self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end")
- self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false")
- self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis")
- #change tab "Line".
- select_pos(tabcontrol, "2")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- xWidth.executeAction("UP", tuple())
- transparency.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify tab "Line".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "2")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
-
- #change tab "Label"
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "3")
-
- tile = xDialog.getChild("tile")
- overlapCB = xDialog.getChild("overlapCB")
- breakCB = xDialog.getChild("breakCB")
- stackedCB = xDialog.getChild("stackedCB")
- textdirLB = xDialog.getChild("textdirLB")
-
- tile.executeAction("CLICK", tuple())
- overlapCB.executeAction("CLICK", tuple())
- breakCB.executeAction("CLICK", tuple())
- stackedCB.executeAction("CLICK", tuple())
- select_by_text(textdirLB, "Right-to-left")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify tab "Label".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "3")
-
- tile = xDialog.getChild("tile")
- overlapCB = xDialog.getChild("overlapCB")
- breakCB = xDialog.getChild("breakCB")
- stackedCB = xDialog.getChild("stackedCB")
- textdirLB = xDialog.getChild("textdirLB")
-
- self.assertEqual(get_state_as_dict(tile)["Checked"], "true")
- self.assertEqual(get_state_as_dict(overlapCB)["Selected"], "true")
- self.assertEqual(get_state_as_dict(breakCB)["Selected"], "true")
- self.assertEqual(get_state_as_dict(stackedCB)["Selected"], "true")
- self.assertEqual(get_state_as_dict(textdirLB)["SelectEntryText"], "Right-to-left")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf122398.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) # X Axis...
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Scale".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ reverseDirection = xDialog.getChild("CBX_REVERSE")
+ logarithmicScale = xDialog.getChild("CBX_LOGARITHM")
+ autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
+ autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
+ majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
+ minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
+ minimum = xDialog.getChild("EDT_MIN")
+ maximum = xDialog.getChild("EDT_MAX")
+ major = xDialog.getChild("EDT_STEP_MAIN")
+ minor = xDialog.getChild("MT_STEPHELP")
+
+ reverseDirection.executeAction("CLICK", tuple())
+ logarithmicScale.executeAction("CLICK", tuple())
+ autoMinimum.executeAction("CLICK", tuple())
+ autoMaximum.executeAction("CLICK", tuple())
+ majorInterval.executeAction("CLICK", tuple())
+ minorInterval.executeAction("CLICK", tuple())
+
+ minimum.executeAction("DOWN", tuple()) #10.12.2017
+ maximum.executeAction("DOWN", tuple()) #29.04.2018
+ major.executeAction("DOWN", tuple()) #19
+ minor.executeAction("UP", tuple()) #3
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Scale".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ reverseDirection = xDialog.getChild("CBX_REVERSE")
+ logarithmicScale = xDialog.getChild("CBX_LOGARITHM")
+ autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
+ autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
+ majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
+ minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
+ minimum = xDialog.getChild("EDT_MIN")
+ maximum = xDialog.getChild("EDT_MAX")
+ major = xDialog.getChild("EDT_STEP_MAIN")
+ minor = xDialog.getChild("MT_STEPHELP")
+
+ self.assertEqual(get_state_as_dict(reverseDirection)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(logarithmicScale)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(autoMinimum)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(autoMaximum)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(majorInterval)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(minorInterval)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(minimum)["Text"], "10.12.2017")
+ self.assertEqual(get_state_as_dict(maximum)["Text"], "29.04.2018")
+ self.assertEqual(get_state_as_dict(major)["Text"], "19")
+ self.assertEqual(get_state_as_dict(minor)["Text"], "3")
+
+ #Click on tab "positioning".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
+ crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
+ placeLabels = xDialog.getChild("LB_PLACE_LABELS")
+ innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
+ outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
+ innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
+ outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
+ placeMarks = xDialog.getChild("LB_PLACE_TICKS")
+
+ select_by_text(crossAxis, "Start")
+ select_by_text(placeLabels, "Outside end")
+ innerMajorTick.executeAction("CLICK", tuple())
+ outerMajorTick.executeAction("CLICK", tuple())
+ innerMinorTick.executeAction("CLICK", tuple())
+ outerMinorTick.executeAction("CLICK", tuple())
+ select_by_text(placeMarks, "At axis")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify tab "positioning".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
+ crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
+ placeLabels = xDialog.getChild("LB_PLACE_LABELS")
+ innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
+ outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
+ innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
+ outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
+ placeMarks = xDialog.getChild("LB_PLACE_TICKS")
+
+ self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Start")
+ self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end")
+ self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis")
+ #change tab "positioning".
+ select_by_text(crossAxis, "Value")
+ crossAxisValue.executeAction("UP", tuple()) #1
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify tab "positioning".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
+ crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
+ placeLabels = xDialog.getChild("LB_PLACE_LABELS")
+ innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
+ outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
+ innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
+ outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
+ placeMarks = xDialog.getChild("LB_PLACE_TICKS")
+
+ self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value")
+ self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "1")
+ self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end")
+ self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis")
+ #change tab "Line".
+ select_pos(tabcontrol, "2")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ xWidth.executeAction("UP", tuple())
+ transparency.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify tab "Line".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "2")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
+
+ #change tab "Label"
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "3")
+
+ tile = xDialog.getChild("tile")
+ overlapCB = xDialog.getChild("overlapCB")
+ breakCB = xDialog.getChild("breakCB")
+ stackedCB = xDialog.getChild("stackedCB")
+ textdirLB = xDialog.getChild("textdirLB")
+
+ tile.executeAction("CLICK", tuple())
+ overlapCB.executeAction("CLICK", tuple())
+ breakCB.executeAction("CLICK", tuple())
+ stackedCB.executeAction("CLICK", tuple())
+ select_by_text(textdirLB, "Right-to-left")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify tab "Label".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "3")
+
+ tile = xDialog.getChild("tile")
+ overlapCB = xDialog.getChild("overlapCB")
+ breakCB = xDialog.getChild("breakCB")
+ stackedCB = xDialog.getChild("stackedCB")
+ textdirLB = xDialog.getChild("textdirLB")
+
+ self.assertEqual(get_state_as_dict(tile)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(overlapCB)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(breakCB)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(stackedCB)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(textdirLB)["SelectEntryText"], "Right-to-left")
+
+ 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/chart/chartYAxis.py b/sc/qa/uitest/chart/chartYAxis.py
index 22c3b79329d5..22e7fe67b8fb 100644
--- a/sc/qa/uitest/chart/chartYAxis.py
+++ b/sc/qa/uitest/chart/chartYAxis.py
@@ -17,248 +17,247 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class chartYAxis(UITestCase):
def test_chart_y_axis_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf122398.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- change_measurement_unit(self, "Centimeter")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) # X Axis...
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Scale".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
-
- reverseDirection = xDialog.getChild("CBX_REVERSE")
- logarithmicScale = xDialog.getChild("CBX_LOGARITHM")
- autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
- autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
- majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
- minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
- minimum = xDialog.getChild("EDT_MIN")
- maximum = xDialog.getChild("EDT_MAX")
- major = xDialog.getChild("EDT_STEP_MAIN")
- minor = xDialog.getChild("MT_STEPHELP")
-
- reverseDirection.executeAction("CLICK", tuple())
- logarithmicScale.executeAction("CLICK", tuple())
- autoMinimum.executeAction("CLICK", tuple())
- autoMaximum.executeAction("CLICK", tuple())
- majorInterval.executeAction("CLICK", tuple())
- minorInterval.executeAction("CLICK", tuple())
-
- minimum.executeAction("UP", tuple()) #1
- maximum.executeAction("DOWN", tuple()) #17
- major.executeAction("DOWN", tuple()) #1
- minor.executeAction("UP", tuple()) #3
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Scale".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- reverseDirection = xDialog.getChild("CBX_REVERSE")
- logarithmicScale = xDialog.getChild("CBX_LOGARITHM")
- autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
- autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
- majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
- minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
- minimum = xDialog.getChild("EDT_MIN")
- maximum = xDialog.getChild("EDT_MAX")
- major = xDialog.getChild("EDT_STEP_MAIN")
- minor = xDialog.getChild("MT_STEPHELP")
-
- self.assertEqual(get_state_as_dict(reverseDirection)["Selected"], "true")
- self.assertEqual(get_state_as_dict(logarithmicScale)["Selected"], "true")
- self.assertEqual(get_state_as_dict(autoMinimum)["Selected"], "false")
- self.assertEqual(get_state_as_dict(autoMaximum)["Selected"], "false")
- self.assertEqual(get_state_as_dict(majorInterval)["Selected"], "false")
- self.assertEqual(get_state_as_dict(minorInterval)["Selected"], "false")
- self.assertEqual(get_state_as_dict(minimum)["Text"], "1")
- self.assertEqual(get_state_as_dict(maximum)["Text"], "17")
- self.assertEqual(get_state_as_dict(major)["Text"], "1")
- self.assertEqual(get_state_as_dict(minor)["Text"], "3")
-
- #Click on tab "positioning".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
-
- crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
- crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
- placeLabels = xDialog.getChild("LB_PLACE_LABELS")
- innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
- outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
- innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
- outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
- placeMarks = xDialog.getChild("LB_PLACE_TICKS")
-
- select_by_text(crossAxis, "Start")
- select_by_text(placeLabels, "Outside end")
- innerMajorTick.executeAction("CLICK", tuple())
- outerMajorTick.executeAction("CLICK", tuple())
- innerMinorTick.executeAction("CLICK", tuple())
- outerMinorTick.executeAction("CLICK", tuple())
- select_by_text(placeMarks, "At axis")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify tab "positioning".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
-
- crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
- crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
- placeLabels = xDialog.getChild("LB_PLACE_LABELS")
- innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
- outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
- innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
- outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
- placeMarks = xDialog.getChild("LB_PLACE_TICKS")
-
- self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Start")
- self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end")
- self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false")
- self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis")
- #change tab "positioning".
- select_by_text(crossAxis, "Value")
- crossAxisValue.executeAction("CLEAR", tuple())
- crossAxisValue.executeAction("TYPE", mkPropertyValues({"TEXT":"19.01.2018"})) #19.01.2018
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify tab "positioning".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
-
- crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
- crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
- placeLabels = xDialog.getChild("LB_PLACE_LABELS")
- innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
- outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
- innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
- outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
- placeMarks = xDialog.getChild("LB_PLACE_TICKS")
-
- self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value")
- #self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "19.01.2018") #bug 123520
- self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end")
- self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false")
- self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true")
- self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis")
- #change tab "Line".
- select_pos(tabcontrol, "2")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- xWidth.executeAction("UP", tuple())
- transparency.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify tab "Line".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "2")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
-
- #change tab "Label"
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "3")
-
- tile = xDialog.getChild("tile")
- overlapCB = xDialog.getChild("overlapCB")
- breakCB = xDialog.getChild("breakCB")
- stackedCB = xDialog.getChild("stackedCB")
- textdirLB = xDialog.getChild("textdirLB")
-
- tile.executeAction("CLICK", tuple())
- overlapCB.executeAction("CLICK", tuple())
- breakCB.executeAction("CLICK", tuple())
- stackedCB.executeAction("CLICK", tuple())
- select_by_text(textdirLB, "Right-to-left")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify tab "Label".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
- xDialog = self.xUITest.getTopFocusWindow()
-
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "3")
-
- tile = xDialog.getChild("tile")
- overlapCB = xDialog.getChild("overlapCB")
- breakCB = xDialog.getChild("breakCB")
- stackedCB = xDialog.getChild("stackedCB")
- textdirLB = xDialog.getChild("textdirLB")
-
- self.assertEqual(get_state_as_dict(tile)["Checked"], "true")
- self.assertEqual(get_state_as_dict(overlapCB)["Selected"], "true")
- self.assertEqual(get_state_as_dict(breakCB)["Selected"], "true")
- self.assertEqual(get_state_as_dict(stackedCB)["Selected"], "true")
- self.assertEqual(get_state_as_dict(textdirLB)["SelectEntryText"], "Right-to-left")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf122398.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) # X Axis...
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Scale".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+
+ reverseDirection = xDialog.getChild("CBX_REVERSE")
+ logarithmicScale = xDialog.getChild("CBX_LOGARITHM")
+ autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
+ autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
+ majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
+ minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
+ minimum = xDialog.getChild("EDT_MIN")
+ maximum = xDialog.getChild("EDT_MAX")
+ major = xDialog.getChild("EDT_STEP_MAIN")
+ minor = xDialog.getChild("MT_STEPHELP")
+
+ reverseDirection.executeAction("CLICK", tuple())
+ logarithmicScale.executeAction("CLICK", tuple())
+ autoMinimum.executeAction("CLICK", tuple())
+ autoMaximum.executeAction("CLICK", tuple())
+ majorInterval.executeAction("CLICK", tuple())
+ minorInterval.executeAction("CLICK", tuple())
+
+ minimum.executeAction("UP", tuple()) #1
+ maximum.executeAction("DOWN", tuple()) #17
+ major.executeAction("DOWN", tuple()) #1
+ minor.executeAction("UP", tuple()) #3
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Scale".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ reverseDirection = xDialog.getChild("CBX_REVERSE")
+ logarithmicScale = xDialog.getChild("CBX_LOGARITHM")
+ autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
+ autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
+ majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
+ minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
+ minimum = xDialog.getChild("EDT_MIN")
+ maximum = xDialog.getChild("EDT_MAX")
+ major = xDialog.getChild("EDT_STEP_MAIN")
+ minor = xDialog.getChild("MT_STEPHELP")
+
+ self.assertEqual(get_state_as_dict(reverseDirection)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(logarithmicScale)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(autoMinimum)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(autoMaximum)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(majorInterval)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(minorInterval)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(minimum)["Text"], "1")
+ self.assertEqual(get_state_as_dict(maximum)["Text"], "17")
+ self.assertEqual(get_state_as_dict(major)["Text"], "1")
+ self.assertEqual(get_state_as_dict(minor)["Text"], "3")
+
+ #Click on tab "positioning".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
+ crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
+ placeLabels = xDialog.getChild("LB_PLACE_LABELS")
+ innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
+ outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
+ innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
+ outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
+ placeMarks = xDialog.getChild("LB_PLACE_TICKS")
+
+ select_by_text(crossAxis, "Start")
+ select_by_text(placeLabels, "Outside end")
+ innerMajorTick.executeAction("CLICK", tuple())
+ outerMajorTick.executeAction("CLICK", tuple())
+ innerMinorTick.executeAction("CLICK", tuple())
+ outerMinorTick.executeAction("CLICK", tuple())
+ select_by_text(placeMarks, "At axis")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify tab "positioning".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
+ crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
+ placeLabels = xDialog.getChild("LB_PLACE_LABELS")
+ innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
+ outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
+ innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
+ outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
+ placeMarks = xDialog.getChild("LB_PLACE_TICKS")
+
+ self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Start")
+ self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end")
+ self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis")
+ #change tab "positioning".
+ select_by_text(crossAxis, "Value")
+ crossAxisValue.executeAction("CLEAR", tuple())
+ crossAxisValue.executeAction("TYPE", mkPropertyValues({"TEXT":"19.01.2018"})) #19.01.2018
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify tab "positioning".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+
+ crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
+ crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
+ placeLabels = xDialog.getChild("LB_PLACE_LABELS")
+ innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
+ outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
+ innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
+ outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
+ placeMarks = xDialog.getChild("LB_PLACE_TICKS")
+
+ self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value")
+ #self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "19.01.2018") #bug 123520
+ self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside end")
+ self.assertEqual(get_state_as_dict(innerMajorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(outerMajorTick)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(innerMinorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(outerMinorTick)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(placeMarks)["SelectEntryText"], "At axis")
+ #change tab "Line".
+ select_pos(tabcontrol, "2")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ xWidth.executeAction("UP", tuple())
+ transparency.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify tab "Line".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "2")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ transparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(transparency)["Text"], "5%")
+
+ #change tab "Label"
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "3")
+
+ tile = xDialog.getChild("tile")
+ overlapCB = xDialog.getChild("overlapCB")
+ breakCB = xDialog.getChild("breakCB")
+ stackedCB = xDialog.getChild("stackedCB")
+ textdirLB = xDialog.getChild("textdirLB")
+
+ tile.executeAction("CLICK", tuple())
+ overlapCB.executeAction("CLICK", tuple())
+ breakCB.executeAction("CLICK", tuple())
+ stackedCB.executeAction("CLICK", tuple())
+ select_by_text(textdirLB, "Right-to-left")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify tab "Label".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "3")
+
+ tile = xDialog.getChild("tile")
+ overlapCB = xDialog.getChild("overlapCB")
+ breakCB = xDialog.getChild("breakCB")
+ stackedCB = xDialog.getChild("stackedCB")
+ textdirLB = xDialog.getChild("textdirLB")
+
+ self.assertEqual(get_state_as_dict(tile)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(overlapCB)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(breakCB)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(stackedCB)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(textdirLB)["SelectEntryText"], "Right-to-left")
+
+ 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/chart/copyPaste.py b/sc/qa/uitest/chart/copyPaste.py
index 078dc1938973..5294022bfdac 100644
--- a/sc/qa/uitest/chart/copyPaste.py
+++ b/sc/qa/uitest/chart/copyPaste.py
@@ -16,64 +16,62 @@ class CopyPaste(UITestCase):
@unittest.skipIf(platform.system() == "Windows", "Fails on Windows: tdf#142635")
def test_copy_paste_chart_with_dot_in_sheet_name(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("chartWithDotInSheetName.ods"))
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("chartWithDotInSheetName.ods")) as calc_doc:
+ document = self.ui_test.get_component()
- xChart = document.Sheets[0].Charts[0]
- xDataSeries = xChart.getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+ xChart = document.Sheets[0].Charts[0]
+ xDataSeries = xChart.getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
- self.assertEqual(4, len(xDataSeries))
+ self.assertEqual(4, len(xDataSeries))
- xOldSheetRanges = []
- for i in range(4):
- xRow = []
- xDS = xDataSeries[i].DataSequences
+ xOldSheetRanges = []
+ for i in range(4):
+ xRow = []
+ xDS = xDataSeries[i].DataSequences
- self.assertEqual(1, len(xDS))
- xRow.append(xDS[0].Values.SourceRangeRepresentation)
- xOldSheetRanges.append(xRow)
+ self.assertEqual(1, len(xDS))
+ xRow.append(xDS[0].Values.SourceRangeRepresentation)
+ xOldSheetRanges.append(xRow)
- self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:Copy")
- self.xUITest.executeCommand(".uno:CloseDoc")
+ self.xUITest.executeCommand(".uno:CloseDoc")
- self.ui_test.create_doc_in_start_center("calc")
- document = self.ui_test.get_component()
+ 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
- self.ui_test.execute_dialog_through_command(".uno:RenameTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xname_entry = xDialog.getChild("name_entry")
+ # Rename the sheet to match the same name as the first document
+ self.ui_test.execute_dialog_through_command(".uno:RenameTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xname_entry = xDialog.getChild("name_entry")
- xname_entry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xname_entry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xname_entry.executeAction("TYPE", mkPropertyValues({"TEXT":"Sheet.1"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xname_entry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xname_entry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xname_entry.executeAction("TYPE", mkPropertyValues({"TEXT":"Sheet.1"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.xUITest.executeCommand(".uno:Paste")
+ self.xUITest.executeCommand(".uno:Paste")
- xChart = document.Sheets[0].Charts[0]
- xDataSeries = xChart.getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+ xChart = document.Sheets[0].Charts[0]
+ xDataSeries = xChart.getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
- self.assertEqual(4, len(xDataSeries))
+ self.assertEqual(4, len(xDataSeries))
- xNewSheetRanges = []
- for i in range(4):
- xRow = []
- xDS = xDataSeries[i].DataSequences
+ xNewSheetRanges = []
+ for i in range(4):
+ xRow = []
+ xDS = xDataSeries[i].DataSequences
- self.assertEqual(1, len(xDS))
- xRow.append(xDS[0].Values.SourceRangeRepresentation)
- xNewSheetRanges.append(xRow)
+ self.assertEqual(1, len(xDS))
+ xRow.append(xDS[0].Values.SourceRangeRepresentation)
+ xNewSheetRanges.append(xRow)
- # Without the fix in place, this test would have failed with
- # ["$'Sheet.1'.$B$12:$B$18"]
- # ["'file:///home/<user>/Documents/Sheet.1'#$Sheet1.$B$12:$B$18"]
- self.assertEqual(xOldSheetRanges, xNewSheetRanges)
-
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have failed with
+ # ["$'Sheet.1'.$B$12:$B$18"]
+ # ["'file:///home/<user>/Documents/Sheet.1'#$Sheet1.$B$12:$B$18"]
+ self.assertEqual(xOldSheetRanges, xNewSheetRanges)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/formatDataSeries.py b/sc/qa/uitest/chart/formatDataSeries.py
index 4aeaebe66ce8..660a29de0507 100644
--- a/sc/qa/uitest/chart/formatDataSeries.py
+++ b/sc/qa/uitest/chart/formatDataSeries.py
@@ -16,95 +16,94 @@ from uitest.uihelper.common import get_state_as_dict, type_text, get_url_for_dat
class chartFormatDataSeries(UITestCase):
def test_chart_format_data_series_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf93506.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- change_measurement_unit(self, "Centimeter")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Options".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- primaryYAxis = xDialog.getChild("RBT_OPT_AXIS_1")
- secondaryYAxis = xDialog.getChild("RBT_OPT_AXIS_2")
- leaveGap = xDialog.getChild("RB_DONT_PAINT")
- assumeZero = xDialog.getChild("RB_ASSUME_ZERO")
- continueLine = xDialog.getChild("RB_CONTINUE_LINE")
- includeHiddenCells = xDialog.getChild("CB_INCLUDE_HIDDEN_CELLS")
- hideLegend = xDialog.getChild("CB_LEGEND_ENTRY_HIDDEN")
-
- secondaryYAxis.executeAction("CLICK", tuple())
- leaveGap.executeAction("CLICK", tuple())
- includeHiddenCells.executeAction("CLICK", tuple())
- hideLegend.executeAction("CLICK", tuple())
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
-
- xWidth = xDialog.getChild("MF_SYMBOL_WIDTH")
- xHeight = xDialog.getChild("MF_SYMBOL_HEIGHT")
- xKeep = xDialog.getChild("CB_SYMBOL_RATIO")
-
- xKeep.executeAction("CLICK", tuple())
- xWidth.executeAction("UP", tuple())
- xWidth.executeAction("UP", tuple())
- xHeight.executeAction("UP", tuple())
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Options".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- primaryYAxis = xDialog.getChild("RBT_OPT_AXIS_1")
- secondaryYAxis = xDialog.getChild("RBT_OPT_AXIS_2")
- leaveGap = xDialog.getChild("RB_DONT_PAINT")
- assumeZero = xDialog.getChild("RB_ASSUME_ZERO")
- continueLine = xDialog.getChild("RB_CONTINUE_LINE")
- includeHiddenCells = xDialog.getChild("CB_INCLUDE_HIDDEN_CELLS")
- hideLegend = xDialog.getChild("CB_LEGEND_ENTRY_HIDDEN")
-
- self.assertEqual(get_state_as_dict(secondaryYAxis)["Checked"], "true")
- self.assertEqual(get_state_as_dict(leaveGap)["Checked"], "true")
- self.assertEqual(get_state_as_dict(includeHiddenCells)["Selected"], "true")
- self.assertEqual(get_state_as_dict(hideLegend)["Selected"], "true")
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
-
- xWidth = xDialog.getChild("MF_SYMBOL_WIDTH")
- xHeight = xDialog.getChild("MF_SYMBOL_HEIGHT")
- xKeep = xDialog.getChild("CB_SYMBOL_RATIO")
-
- self.assertEqual(get_state_as_dict(xKeep)["Selected"], "true") #checked as default even after reopen
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.35 cm")
- self.assertEqual(get_state_as_dict(xHeight)["Text"], "0.30 cm")
- #click up, should up both values, because Keep ratio is checked
- xWidth.executeAction("UP", tuple())
- xHeight.executeAction("UP", tuple())
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.41 cm")
- self.assertEqual(get_state_as_dict(xHeight)["Text"], "0.35 cm")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf93506.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Options".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ primaryYAxis = xDialog.getChild("RBT_OPT_AXIS_1")
+ secondaryYAxis = xDialog.getChild("RBT_OPT_AXIS_2")
+ leaveGap = xDialog.getChild("RB_DONT_PAINT")
+ assumeZero = xDialog.getChild("RB_ASSUME_ZERO")
+ continueLine = xDialog.getChild("RB_CONTINUE_LINE")
+ includeHiddenCells = xDialog.getChild("CB_INCLUDE_HIDDEN_CELLS")
+ hideLegend = xDialog.getChild("CB_LEGEND_ENTRY_HIDDEN")
+
+ secondaryYAxis.executeAction("CLICK", tuple())
+ leaveGap.executeAction("CLICK", tuple())
+ includeHiddenCells.executeAction("CLICK", tuple())
+ hideLegend.executeAction("CLICK", tuple())
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+
+ xWidth = xDialog.getChild("MF_SYMBOL_WIDTH")
+ xHeight = xDialog.getChild("MF_SYMBOL_HEIGHT")
+ xKeep = xDialog.getChild("CB_SYMBOL_RATIO")
+
+ xKeep.executeAction("CLICK", tuple())
+ xWidth.executeAction("UP", tuple())
+ xWidth.executeAction("UP", tuple())
+ xHeight.executeAction("UP", tuple())
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Options".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ primaryYAxis = xDialog.getChild("RBT_OPT_AXIS_1")
+ secondaryYAxis = xDialog.getChild("RBT_OPT_AXIS_2")
+ leaveGap = xDialog.getChild("RB_DONT_PAINT")
+ assumeZero = xDialog.getChild("RB_ASSUME_ZERO")
+ continueLine = xDialog.getChild("RB_CONTINUE_LINE")
+ includeHiddenCells = xDialog.getChild("CB_INCLUDE_HIDDEN_CELLS")
+ hideLegend = xDialog.getChild("CB_LEGEND_ENTRY_HIDDEN")
+
+ self.assertEqual(get_state_as_dict(secondaryYAxis)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(leaveGap)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(includeHiddenCells)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(hideLegend)["Selected"], "true")
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+
+ xWidth = xDialog.getChild("MF_SYMBOL_WIDTH")
+ xHeight = xDialog.getChild("MF_SYMBOL_HEIGHT")
+ xKeep = xDialog.getChild("CB_SYMBOL_RATIO")
+
+ self.assertEqual(get_state_as_dict(xKeep)["Selected"], "true") #checked as default even after reopen
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.35 cm")
+ self.assertEqual(get_state_as_dict(xHeight)["Text"], "0.30 cm")
+ #click up, should up both values, because Keep ratio is checked
+ xWidth.executeAction("UP", tuple())
+ xHeight.executeAction("UP", tuple())
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.41 cm")
+ self.assertEqual(get_state_as_dict(xHeight)["Text"], "0.35 cm")
+
+ 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/chart/tdf101894.py b/sc/qa/uitest/chart/tdf101894.py
index 11399f0fe83d..db5f9cb93ea9 100644
--- a/sc/qa/uitest/chart/tdf101894.py
+++ b/sc/qa/uitest/chart/tdf101894.py
@@ -13,66 +13,64 @@ from uitest.uihelper.common import get_state_as_dict
class tdf101894(UITestCase):
def test_tdf101894(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf101894.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
-
- document = self.ui_test.get_component()
-
- xChart = document.Sheets[0].Charts[0]
- xDataSeries = xChart.getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
-
- self.assertEqual(4, len(xDataSeries))
-
- xOldSheetRanges = []
- for i in range(4):
- xRow = []
- xDS = xDataSeries[i].DataSequences
-
- self.assertEqual(2, len(xDS))
- xRow.append(xDS[0].Values.SourceRangeRepresentation)
- xRow.append(xDS[1].Values.SourceRangeRepresentation)
- xOldSheetRanges.append(xRow)
-
- # Rename the sheet first
- self.ui_test.execute_dialog_through_command(".uno:RenameTable")
- xDialog = self.xUITest.getTopFocusWindow()
- xname_entry = xDialog.getChild("name_entry")
-
- oldName = get_state_as_dict(xname_entry)['Text']
- xname_entry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- xname_entry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- xname_entry.executeAction("TYPE", mkPropertyValues({"TEXT":"NewName"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- # Copy sheet and use the old name
- self.ui_test.execute_dialog_through_command(".uno:Move")
- xDialog = self.xUITest.getTopFocusWindow()
- newName = xDialog.getChild("newName")
- newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
- newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
- newName.executeAction("TYPE", mkPropertyValues({"TEXT": oldName}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- xChart = document.Sheets[0].Charts[0]
- xDataSeries = xChart.getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
-
- self.assertEqual(4, len(xDataSeries))
-
- xNewSheetRanges = []
- for i in range(4):
- xRow = []
- xDS = xDataSeries[i].DataSequences
-
- self.assertEqual(2, len(xDS))
- xRow.append(xDS[0].Values.SourceRangeRepresentation)
- xRow.append(xDS[1].Values.SourceRangeRepresentation)
- xNewSheetRanges.append(xRow)
-
- self.assertEqual(xOldSheetRanges, xNewSheetRanges)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf101894.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ document = self.ui_test.get_component()
+
+ xChart = document.Sheets[0].Charts[0]
+ xDataSeries = xChart.getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+
+ self.assertEqual(4, len(xDataSeries))
+
+ xOldSheetRanges = []
+ for i in range(4):
+ xRow = []
+ xDS = xDataSeries[i].DataSequences
+
+ self.assertEqual(2, len(xDS))
+ xRow.append(xDS[0].Values.SourceRangeRepresentation)
+ xRow.append(xDS[1].Values.SourceRangeRepresentation)
+ xOldSheetRanges.append(xRow)
+
+ # Rename the sheet first
+ self.ui_test.execute_dialog_through_command(".uno:RenameTable")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xname_entry = xDialog.getChild("name_entry")
+
+ oldName = get_state_as_dict(xname_entry)['Text']
+ xname_entry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ xname_entry.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ xname_entry.executeAction("TYPE", mkPropertyValues({"TEXT":"NewName"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ # Copy sheet and use the old name
+ self.ui_test.execute_dialog_through_command(".uno:Move")
+ xDialog = self.xUITest.getTopFocusWindow()
+ newName = xDialog.getChild("newName")
+ newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
+ newName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"}))
+ newName.executeAction("TYPE", mkPropertyValues({"TEXT": oldName}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ xChart = document.Sheets[0].Charts[0]
+ xDataSeries = xChart.getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+
+ self.assertEqual(4, len(xDataSeries))
+
+ xNewSheetRanges = []
+ for i in range(4):
+ xRow = []
+ xDS = xDataSeries[i].DataSequences
+
+ self.assertEqual(2, len(xDS))
+ xRow.append(xDS[0].Values.SourceRangeRepresentation)
+ xRow.append(xDS[1].Values.SourceRangeRepresentation)
+ xNewSheetRanges.append(xRow)
+
+ self.assertEqual(xOldSheetRanges, xNewSheetRanges)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf107097.py b/sc/qa/uitest/chart/tdf107097.py
index 50ecccaff309..09db67f197cc 100644
--- a/sc/qa/uitest/chart/tdf107097.py
+++ b/sc/qa/uitest/chart/tdf107097.py
@@ -14,52 +14,50 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf107097(UITestCase):
def test_tdf107097(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf107097.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf107097.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- xFirstMatrix = []
- for row in range(6, 18):
- xRow = []
- for column in range(3, 7):
- xRow.append(get_cell_by_position(document, 1, column, row).getValue())
- xFirstMatrix.append(xRow)
+ xFirstMatrix = []
+ for row in range(6, 18):
+ xRow = []
+ for column in range(3, 7):
+ xRow.append(get_cell_by_position(document, 1, column, row).getValue())
+ xFirstMatrix.append(xRow)
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:Copy")
- self.xUITest.executeCommand(".uno:CloseDoc")
+ self.xUITest.executeCommand(".uno:CloseDoc")
- 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.create_doc_in_start_center("calc")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- self.xUITest.executeCommand(".uno:Paste")
+ self.xUITest.executeCommand(".uno:Paste")
- xData = document.Sheets[0].Charts[0].getEmbeddedObject().Data
+ xData = document.Sheets[0].Charts[0].getEmbeddedObject().Data
- xSecondMatrix = []
- for row in xData.Data:
- xRow = []
- for value in row:
- xRow.append(value)
- xSecondMatrix.append(xRow)
+ xSecondMatrix = []
+ for row in xData.Data:
+ xRow = []
+ for value in row:
+ xRow.append(value)
+ xSecondMatrix.append(xRow)
- self.assertEqual(xFirstMatrix, xSecondMatrix)
+ self.assertEqual(xFirstMatrix, xSecondMatrix)
- aExpectedColumnDescriptions = ('Sum - Sales T1', 'Sum - Sales T2',
- 'Sum - Sales T3', 'Sum - Sales T4')
- aExpectedRowDescriptions = ('DE Berlin A', 'DE Berlin B', 'DE Munich A',
- 'DE Munich B', 'EN Glasgow A', 'EN Liverpool B', 'EN London A',
- 'EN London B', 'FR Nantes A', 'FR Nantes B', 'FR Paris A', 'FR Paris B')
+ aExpectedColumnDescriptions = ('Sum - Sales T1', 'Sum - Sales T2',
+ 'Sum - Sales T3', 'Sum - Sales T4')
+ aExpectedRowDescriptions = ('DE Berlin A', 'DE Berlin B', 'DE Munich A',
+ 'DE Munich B', 'EN Glasgow A', 'EN Liverpool B', 'EN London A',
+ 'EN London B', 'FR Nantes A', 'FR Nantes B', 'FR Paris A', 'FR Paris B')
- self.assertEqual(aExpectedColumnDescriptions, xData.ColumnDescriptions)
- self.assertEqual(aExpectedRowDescriptions, xData.RowDescriptions)
-
- self.ui_test.close_doc()
+ self.assertEqual(aExpectedColumnDescriptions, xData.ColumnDescriptions)
+ self.assertEqual(aExpectedRowDescriptions, xData.RowDescriptions)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf120348.py b/sc/qa/uitest/chart/tdf120348.py
index b8ccb6c9b2c0..0685ab7c0f63 100644
--- a/sc/qa/uitest/chart/tdf120348.py
+++ b/sc/qa/uitest/chart/tdf120348.py
@@ -14,49 +14,48 @@ class tdf120348(UITestCase):
def test_tdf120348(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf120348.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf120348.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- xFirstMatrix = []
- for row in range(1, 159):
- xRow = []
- for column in range(5, 9):
- xRow.append(round(get_cell_by_position(document, 0, column, row).getValue(), 5))
- xFirstMatrix.append(xRow)
+ xFirstMatrix = []
+ for row in range(1, 159):
+ xRow = []
+ for column in range(5, 9):
+ xRow.append(round(get_cell_by_position(document, 0, column, row).getValue(), 5))
+ xFirstMatrix.append(xRow)
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 2"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 2"}))
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:Copy")
- self.xUITest.executeCommand(".uno:CloseDoc")
+ self.xUITest.executeCommand(".uno:CloseDoc")
- 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.create_doc_in_start_center("calc")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- self.xUITest.executeCommand(".uno:Paste")
+ self.xUITest.executeCommand(".uno:Paste")
- xData = document.Sheets[0].Charts[0].getEmbeddedObject().Data
+ xData = document.Sheets[0].Charts[0].getEmbeddedObject().Data
- columnNames = ('Finland', 'Sweden', 'Poland', '')
- self.assertEqual(columnNames, xData.ColumnDescriptions)
+ columnNames = ('Finland', 'Sweden', 'Poland', '')
+ self.assertEqual(columnNames, xData.ColumnDescriptions)
- xSecondMatrix = []
- for row in xData.Data:
- xRow = []
- for value in row:
- xRow.append(round(value, 5))
- xSecondMatrix.append(xRow)
+ xSecondMatrix = []
+ for row in xData.Data:
+ xRow = []
+ for value in row:
+ xRow.append(round(value, 5))
+ xSecondMatrix.append(xRow)
- # Without the fix in place, this test would have failed with
- # First differing element 51:
- # [3.31618, 3.65089, 3.33626, 0.0]
- # [3.31618, 3.65089, 0.0, 0.0]
+ # Without the fix in place, this test would have failed with
+ # First differing element 51:
+ # [3.31618, 3.65089, 3.33626, 0.0]
+ # [3.31618, 3.65089, 0.0, 0.0]
- self.assertEqual(xFirstMatrix, xSecondMatrix)
+ self.assertEqual(xFirstMatrix, xSecondMatrix)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf122398.py b/sc/qa/uitest/chart/tdf122398.py
index 279d46ccce4c..c6093f61677c 100644
--- a/sc/qa/uitest/chart/tdf122398.py
+++ b/sc/qa/uitest/chart/tdf122398.py
@@ -15,80 +15,79 @@ from uitest.uihelper.common import get_state_as_dict, type_text, get_url_for_dat
class tdf122398(UITestCase):
def test_tdf122398_chart_min_max_x_axis(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf122398.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf122398.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #Open attached file. Set chart into edit mode. Select x-axis and then Format Selection.
- #Disable the Automatic for min and max. You cannot change the values at all, neither with direct
- #input nor with up-down arrow buttons.
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) # X Axis...
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Scale".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
+ #Open attached file. Set chart into edit mode. Select x-axis and then Format Selection.
+ #Disable the Automatic for min and max. You cannot change the values at all, neither with direct
+ #input nor with up-down arrow buttons.
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) # X Axis...
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Scale".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
- autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
- autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
- majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
- minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
- minimum = xDialog.getChild("EDT_MIN")
- maximum = xDialog.getChild("EDT_MAX")
- major = xDialog.getChild("EDT_STEP_MAIN")
- minor = xDialog.getChild("MT_STEPHELP")
+ autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
+ autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
+ majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
+ minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
+ minimum = xDialog.getChild("EDT_MIN")
+ maximum = xDialog.getChild("EDT_MAX")
+ major = xDialog.getChild("EDT_STEP_MAIN")
+ minor = xDialog.getChild("MT_STEPHELP")
- autoMinimum.executeAction("CLICK", tuple())
- autoMaximum.executeAction("CLICK", tuple())
- majorInterval.executeAction("CLICK", tuple())
- minorInterval.executeAction("CLICK", tuple())
- #In a chart that contains an axis with a date datatype, the UI does not allow specifying
- #a minimum or maximum value greater than 09/04/1900 (i.e., April 9, 1900)
- minimum.executeAction("CLEAR", tuple())
- minimum.executeAction("TYPE", mkPropertyValues({"TEXT":"01.01.2018"}))
- maximum.executeAction("DOWN", tuple()) #29.04.2018
- major.executeAction("UP", tuple()) #21
- minor.executeAction("DOWN", tuple()) #1
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ autoMinimum.executeAction("CLICK", tuple())
+ autoMaximum.executeAction("CLICK", tuple())
+ majorInterval.executeAction("CLICK", tuple())
+ minorInterval.executeAction("CLICK", tuple())
+ #In a chart that contains an axis with a date datatype, the UI does not allow specifying
+ #a minimum or maximum value greater than 09/04/1900 (i.e., April 9, 1900)
+ minimum.executeAction("CLEAR", tuple())
+ minimum.executeAction("TYPE", mkPropertyValues({"TEXT":"01.01.2018"}))
+ maximum.executeAction("DOWN", tuple()) #29.04.2018
+ major.executeAction("UP", tuple()) #21
+ minor.executeAction("DOWN", tuple()) #1
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #reopen and verify
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Scale".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
+ #reopen and verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Scale".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
- autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
- autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
- majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
- minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
- minimum = xDialog.getChild("EDT_MIN")
- maximum = xDialog.getChild("EDT_MAX")
- major = xDialog.getChild("EDT_STEP_MAIN")
- minor = xDialog.getChild("MT_STEPHELP")
+ autoMinimum = xDialog.getChild("CBX_AUTO_MIN")
+ autoMaximum = xDialog.getChild("CBX_AUTO_MAX")
+ majorInterval = xDialog.getChild("CBX_AUTO_STEP_MAIN")
+ minorInterval = xDialog.getChild("CBX_AUTO_STEP_HELP")
+ minimum = xDialog.getChild("EDT_MIN")
+ maximum = xDialog.getChild("EDT_MAX")
+ major = xDialog.getChild("EDT_STEP_MAIN")
+ minor = xDialog.getChild("MT_STEPHELP")
- self.assertEqual(get_state_as_dict(autoMinimum)["Selected"], "false")
- self.assertEqual(get_state_as_dict(autoMaximum)["Selected"], "false")
- self.assertEqual(get_state_as_dict(majorInterval)["Selected"], "false")
- self.assertEqual(get_state_as_dict(minorInterval)["Selected"], "false")
- self.assertEqual(get_state_as_dict(minimum)["Text"], "01.01.2018")
- self.assertEqual(get_state_as_dict(maximum)["Text"], "29.04.2018")
- self.assertEqual(get_state_as_dict(major)["Text"], "21")
- self.assertEqual(get_state_as_dict(minor)["Text"], "1")
+ self.assertEqual(get_state_as_dict(autoMinimum)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(autoMaximum)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(majorInterval)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(minorInterval)["Selected"], "false")
+ self.assertEqual(get_state_as_dict(minimum)["Text"], "01.01.2018")
+ self.assertEqual(get_state_as_dict(maximum)["Text"], "29.04.2018")
+ self.assertEqual(get_state_as_dict(major)["Text"], "21")
+ self.assertEqual(get_state_as_dict(minor)["Text"], "1")
- 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.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf123013.py b/sc/qa/uitest/chart/tdf123013.py
index 72fca5bce520..23a667f86317 100644
--- a/sc/qa/uitest/chart/tdf123013.py
+++ b/sc/qa/uitest/chart/tdf123013.py
@@ -15,45 +15,44 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class tdf123013(UITestCase):
def test_tdf96432_chart_trendline_name(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf123013.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- #add name
- xentryname = xDialog.getChild("entry_name")
- xentryname.executeAction("TYPE", mkPropertyValues({"TEXT":"Tline"}))
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ with self.ui_test.load_file(get_url_for_data_file("tdf123013.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ #add name
+ xentryname = xDialog.getChild("entry_name")
+ xentryname.executeAction("TYPE", mkPropertyValues({"TEXT":"Tline"}))
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #reopen and try again
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
+ #reopen and try again
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
- #Right-click on the chart; from the pop-up menu select "Format Y bars
- # The program presents dialog "Format Y bars", tab "Line".
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- #add name
- xentryname = xDialog.getChild("entry_name")
- self.assertEqual(get_state_as_dict(xentryname)["Text"], "Tline")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ #Right-click on the chart; from the pop-up menu select "Format Y bars
+ # The program presents dialog "Format Y bars", tab "Line".
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ #add name
+ xentryname = xDialog.getChild("entry_name")
+ self.assertEqual(get_state_as_dict(xentryname)["Text"], "Tline")
+ 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/chart/tdf123231.py b/sc/qa/uitest/chart/tdf123231.py
index db596266579c..a9d3546fb0eb 100644
--- a/sc/qa/uitest/chart/tdf123231.py
+++ b/sc/qa/uitest/chart/tdf123231.py
@@ -15,69 +15,68 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class tdf123231(UITestCase):
def test_tdf123231_chart_trendline_dialog_power(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf93506.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf93506.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #Change regression Type to Power
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- exponential = xDialog.getChild("exponential") #type regression exponential
- power = xDialog.getChild("exponential") #type regression power
+ #Change regression Type to Power
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ exponential = xDialog.getChild("exponential") #type regression exponential
+ power = xDialog.getChild("exponential") #type regression power
- power.executeAction("CLICK", tuple()) #set power
+ power.executeAction("CLICK", tuple()) #set power
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #reopen dialog and close dialog
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- exponential = xDialog.getChild("exponential") #type regression exponential
- power = xDialog.getChild("exponential") #type regression power
- self.assertEqual(get_state_as_dict(power)["Checked"], "true")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ #reopen dialog and close dialog
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ exponential = xDialog.getChild("exponential") #type regression exponential
+ power = xDialog.getChild("exponential") #type regression power
+ self.assertEqual(get_state_as_dict(power)["Checked"], "true")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #reopen and verify Power
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
+ #reopen and verify Power
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- exponential = xDialog.getChild("exponential") #type regression exponential
- power = xDialog.getChild("exponential") #type regression power
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ exponential = xDialog.getChild("exponential") #type regression exponential
+ power = xDialog.getChild("exponential") #type regression power
- self.assertEqual(get_state_as_dict(power)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(power)["Checked"], "true")
- 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.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf123520.py b/sc/qa/uitest/chart/tdf123520.py
index 150467bb5990..2fa43e9e110a 100644
--- a/sc/qa/uitest/chart/tdf123520.py
+++ b/sc/qa/uitest/chart/tdf123520.py
@@ -16,66 +16,65 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class tdf123520(UITestCase):
def test_tdf123520_chart_y_cross_other_axis(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf123520.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf123520.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) # Y Axis
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "positioning".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"})) # Y Axis
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "positioning".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
- crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
- crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
- placeLabels = xDialog.getChild("LB_PLACE_LABELS")
- innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
- outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
- innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
- outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
- placeMarks = xDialog.getChild("LB_PLACE_TICKS")
- crossAxisValue.executeAction("CLEAR", tuple())
- crossAxisValue.executeAction("TYPE", mkPropertyValues({"TEXT":"01.01.2018"}))
- #crossAxisValue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"TAB"}))
- #TAB doesn't works- add "a" at the end of textbox
- #workaround - edit another ui item, it should trigger leave of textbox
- select_by_text(placeLabels, "Outside start")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
+ crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
+ placeLabels = xDialog.getChild("LB_PLACE_LABELS")
+ innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
+ outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
+ innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
+ outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
+ placeMarks = xDialog.getChild("LB_PLACE_TICKS")
+ crossAxisValue.executeAction("CLEAR", tuple())
+ crossAxisValue.executeAction("TYPE", mkPropertyValues({"TEXT":"01.01.2018"}))
+ #crossAxisValue.executeAction("TYPE", mkPropertyValues({"KEYCODE":"TAB"}))
+ #TAB doesn't works- add "a" at the end of textbox
+ #workaround - edit another ui item, it should trigger leave of textbox
+ select_by_text(placeLabels, "Outside start")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #reopen and verify tab "positioning".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
- xDialog = self.xUITest.getTopFocusWindow()
+ #reopen and verify tab "positioning".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisY"}))
+ xDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
- crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
- crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
- placeLabels = xDialog.getChild("LB_PLACE_LABELS")
- innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
- outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
- innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
- outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
- placeMarks = xDialog.getChild("LB_PLACE_TICKS")
+ crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
+ crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
+ placeLabels = xDialog.getChild("LB_PLACE_LABELS")
+ innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
+ outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
+ innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
+ outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
+ placeMarks = xDialog.getChild("LB_PLACE_TICKS")
- self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value")
- self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "01.01.2018")
- self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside start")
+ self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value")
+ self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "01.01.2018")
+ self.assertEqual(get_state_as_dict(placeLabels)["SelectEntryText"], "Outside start")
- 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.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf124111.py b/sc/qa/uitest/chart/tdf124111.py
index b7b5f954ecf2..056deff2f103 100644
--- a/sc/qa/uitest/chart/tdf124111.py
+++ b/sc/qa/uitest/chart/tdf124111.py
@@ -15,60 +15,59 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class tdf124111(UITestCase):
def test_tdf124111_chart_x_negative_cross(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf124111.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf124111.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) # X Axis...
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "positioning".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"})) # X Axis...
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "positioning".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
- crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
- crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
- placeLabels = xDialog.getChild("LB_PLACE_LABELS")
- innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
- outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
- innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
- outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
- placeMarks = xDialog.getChild("LB_PLACE_TICKS")
- crossAxisValue.executeAction("DOWN", tuple()) #-1
+ crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
+ crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
+ placeLabels = xDialog.getChild("LB_PLACE_LABELS")
+ innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
+ outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
+ innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
+ outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
+ placeMarks = xDialog.getChild("LB_PLACE_TICKS")
+ crossAxisValue.executeAction("DOWN", tuple()) #-1
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #reopen and verify tab "positioning".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
- xDialog = self.xUITest.getTopFocusWindow()
+ #reopen and verify tab "positioning".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
+ xDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
- crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
- crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
- placeLabels = xDialog.getChild("LB_PLACE_LABELS")
- innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
- outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
- innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
- outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
- placeMarks = xDialog.getChild("LB_PLACE_TICKS")
+ crossAxis = xDialog.getChild("LB_CROSSES_OTHER_AXIS_AT")
+ crossAxisValue = xDialog.getChild("EDT_CROSSES_OTHER_AXIS_AT") #only available when crossAxis = Value
+ placeLabels = xDialog.getChild("LB_PLACE_LABELS")
+ innerMajorTick = xDialog.getChild("CB_TICKS_INNER")
+ outerMajorTick = xDialog.getChild("CB_TICKS_OUTER")
+ innerMinorTick = xDialog.getChild("CB_MINOR_INNER")
+ outerMinorTick = xDialog.getChild("CB_MINOR_OUTER")
+ placeMarks = xDialog.getChild("LB_PLACE_TICKS")
- self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value")
- self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "-1")
+ self.assertEqual(get_state_as_dict(crossAxis)["SelectEntryText"], "Value")
+ self.assertEqual(get_state_as_dict(crossAxisValue)["Text"], "-1")
- 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/chart/tdf129587.py b/sc/qa/uitest/chart/tdf129587.py
index 24b319806763..020b866274b7 100644
--- a/sc/qa/uitest/chart/tdf129587.py
+++ b/sc/qa/uitest/chart/tdf129587.py
@@ -12,48 +12,47 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf129587(UITestCase):
def test_tdf129587(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf129587.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf129587.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
- self.assertEqual("$Tabelle1.$F$2:$G$11", xDataSeries[0].ErrorBarY.ErrorBarRangeNegative)
+ document = self.ui_test.get_component()
+ xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+ self.assertEqual("$Tabelle1.$F$2:$G$11", xDataSeries[0].ErrorBarY.ErrorBarRangeNegative)
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/MultiClick/D=0:CS=0:CT=0:Series=0:ErrorsY=")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatYErrorBars"}))
- xDialog = self.xUITest.getTopFocusWindow()
+ xSeriesObj = xChartMain.getChild("CID/MultiClick/D=0:CS=0:CT=0:Series=0:ErrorsY=")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatYErrorBars"}))
+ xDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
- xPerBtn = xDialog.getChild("RB_PERCENT")
- xPerBtn.executeAction("CLICK", tuple())
+ xPerBtn = xDialog.getChild("RB_PERCENT")
+ xPerBtn.executeAction("CLICK", tuple())
- xPosField = xDialog.getChild("MF_POSITIVE")
- xNegField = xDialog.getChild("MF_NEGATIVE")
+ xPosField = xDialog.getChild("MF_POSITIVE")
+ xNegField = xDialog.getChild("MF_NEGATIVE")
- self.assertEqual("0%", get_state_as_dict(xPosField)['Text'])
- self.assertEqual("0%", get_state_as_dict(xNegField)['Text'])
+ self.assertEqual("0%", get_state_as_dict(xPosField)['Text'])
+ self.assertEqual("0%", get_state_as_dict(xNegField)['Text'])
- #Increase value by one
- xPosField.executeAction("UP", tuple())
+ #Increase value by one
+ xPosField.executeAction("UP", tuple())
- #Both fields are updated because 'Same value for both' is enabled
- self.assertEqual("1%", get_state_as_dict(xPosField)['Text'])
- self.assertEqual("1%", get_state_as_dict(xNegField)['Text'])
+ #Both fields are updated because 'Same value for both' is enabled
+ self.assertEqual("1%", get_state_as_dict(xPosField)['Text'])
+ self.assertEqual("1%", get_state_as_dict(xNegField)['Text'])
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #Without the fix in place, it would have crashed here
- xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
- self.assertEqual(1.0, xDataSeries[0].ErrorBarY.PercentageError)
+ #Without the fix in place, it would have crashed here
+ xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+ self.assertEqual(1.0, xDataSeries[0].ErrorBarY.PercentageError)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf133630.py b/sc/qa/uitest/chart/tdf133630.py
index 1f3ced1cd9ad..2b0ee28e3913 100644
--- a/sc/qa/uitest/chart/tdf133630.py
+++ b/sc/qa/uitest/chart/tdf133630.py
@@ -13,55 +13,54 @@ class tdf133630(UITestCase):
def test_tdf133630(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("chartArea.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("chartArea.ods")) as calc_doc:
+ 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")
- xCS = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0]
- self.assertEqual(0, xCS.getAxisByDimension(0, 0).LineWidth)
- self.assertEqual(80, xCS.ChartTypes[0].DataSeries[0].LineWidth)
+ xCS = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0]
+ self.assertEqual(0, xCS.getAxisByDimension(0, 0).LineWidth)
+ self.assertEqual(80, xCS.ChartTypes[0].DataSeries[0].LineWidth)
- # First change the line width of one element
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:Axis=0,0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
+ # First change the line width of one element
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:Axis=0,0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DiagramAxisX"}))
- xDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "2")
+ xDialog = self.xUITest.getTopFocusWindow()
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "2")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xWidth.executeAction("UP", tuple())
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xWidth.executeAction("UP", 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)
- self.assertEqual(100, xCS.getAxisByDimension(0, 0).LineWidth)
- self.assertEqual(80, xCS.ChartTypes[0].DataSeries[0].LineWidth)
+ self.assertEqual(100, xCS.getAxisByDimension(0, 0).LineWidth)
+ self.assertEqual(80, xCS.ChartTypes[0].DataSeries[0].LineWidth)
- # Now change the line width of another element
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"}))
+ # Now change the line width of another element
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatDataSeries"}))
- xDialog = self.xUITest.getTopFocusWindow()
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
+ xDialog = self.xUITest.getTopFocusWindow()
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xWidth.executeAction("UP", tuple())
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xWidth.executeAction("UP", tuple())
- # Without the fix in place, this test would have crashed here
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ # Without the fix in place, this test would have crashed here
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- self.assertEqual(100, xCS.getAxisByDimension(0, 0).LineWidth)
- self.assertEqual(100, xCS.ChartTypes[0].DataSeries[0].LineWidth)
+ self.assertEqual(100, xCS.getAxisByDimension(0, 0).LineWidth)
+ self.assertEqual(100, xCS.ChartTypes[0].DataSeries[0].LineWidth)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf134059.py b/sc/qa/uitest/chart/tdf134059.py
index 1869256e0c7b..76f364a7c58d 100644
--- a/sc/qa/uitest/chart/tdf134059.py
+++ b/sc/qa/uitest/chart/tdf134059.py
@@ -39,30 +39,28 @@ class Tdf134059(UITestCase):
gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": "Object 1"}))
def test_tdf134059(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf134059.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf134059.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- self.assertSeriesNames(gridwin)
+ self.assertSeriesNames(gridwin)
- # Hide row 10
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A10"}))
- self.ui_test._xUITest.executeCommand(".uno:HideRow")
+ # Hide row 10
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A10"}))
+ self.ui_test._xUITest.executeCommand(".uno:HideRow")
- row = get_row(calc_doc, 9)
- self.assertFalse(row.getPropertyValue("IsVisible"))
+ row = get_row(calc_doc, 9)
+ self.assertFalse(row.getPropertyValue("IsVisible"))
- # Without the fix in place, this test would have failed with
- # AssertionError: 'Col. 1' != 'Column C'
- self.assertSeriesNames(gridwin)
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'Col. 1' != 'Column C'
+ self.assertSeriesNames(gridwin)
- self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
- self.assertTrue(row.getPropertyValue("IsVisible"))
+ self.assertTrue(row.getPropertyValue("IsVisible"))
- self.assertSeriesNames(gridwin)
-
- self.ui_test.close_doc()
+ self.assertSeriesNames(gridwin)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf136011.py b/sc/qa/uitest/chart/tdf136011.py
index e4bcbd5f975e..a523b8ecaa0e 100644
--- a/sc/qa/uitest/chart/tdf136011.py
+++ b/sc/qa/uitest/chart/tdf136011.py
@@ -22,36 +22,35 @@ class tdf136011(UITestCase):
# Test both charts
for i, name in enumerate(xObjectNames):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf136011.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf136011.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- xExpectedResults = []
- for category in xCategories:
- for subCategory in xSubCategories[i]:
- xExpectedResults.append(category + ' ' + subCategory)
+ xExpectedResults = []
+ for category in xCategories:
+ for subCategory in xSubCategories[i]:
+ xExpectedResults.append(category + ' ' + subCategory)
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": name}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": name}))
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:Copy")
- self.xUITest.executeCommand(".uno:CloseDoc")
+ self.xUITest.executeCommand(".uno:CloseDoc")
- 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.create_doc_in_start_center("calc")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- self.xUITest.executeCommand(".uno:Paste")
+ self.xUITest.executeCommand(".uno:Paste")
- xData = document.Sheets[0].Charts[0].getEmbeddedObject().Data
+ xData = document.Sheets[0].Charts[0].getEmbeddedObject().Data
- self.assertEqual(xColumnNames, list(xData.ColumnDescriptions))
+ self.assertEqual(xColumnNames, list(xData.ColumnDescriptions))
- # Without the fix in place, the numbers in the categories in chart
- # 'Object 2' wouldn't have been pasted to the new document
- self.assertEqual(xExpectedResults, list(xData.RowDescriptions))
+ # Without the fix in place, the numbers in the categories in chart
+ # 'Object 2' wouldn't have been pasted to the new document
+ self.assertEqual(xExpectedResults, list(xData.RowDescriptions))
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf43175.py b/sc/qa/uitest/chart/tdf43175.py
index fe837197e6a5..1bfb26aa43d3 100644
--- a/sc/qa/uitest/chart/tdf43175.py
+++ b/sc/qa/uitest/chart/tdf43175.py
@@ -11,38 +11,36 @@ from uitest.uihelper.common import get_url_for_data_file
class Tdf43175(UITestCase):
def test_tdf43175(self):
- self.ui_test.load_file(get_url_for_data_file("tdf43175.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf43175.ods")):
- self.xUITest.executeCommand(".uno:TableSelectAll")
+ self.xUITest.executeCommand(".uno:TableSelectAll")
- self.ui_test.execute_dialog_through_command(".uno:Move")
- xDialog = self.xUITest.getTopFocusWindow()
- insertBefore = xDialog.getChild("insertBefore")
+ self.ui_test.execute_dialog_through_command(".uno:Move")
+ xDialog = self.xUITest.getTopFocusWindow()
+ insertBefore = xDialog.getChild("insertBefore")
- # Select - move to end position -
- xTreeEntry = insertBefore.getChild('2')
- xTreeEntry.executeAction("SELECT", tuple())
+ # Select - move to end position -
+ xTreeEntry = insertBefore.getChild('2')
+ xTreeEntry.executeAction("SELECT", 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)
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- aSheetNames = ['Blad1', 'Blad2', 'Blad1_2', 'Blad2_2']
+ aSheetNames = ['Blad1', 'Blad2', 'Blad1_2', 'Blad2_2']
- self.assertEqual(4, document.Sheets.getCount())
- for i in range(4):
- self.assertEqual(aSheetNames[i], document.Sheets[i].Name)
+ self.assertEqual(4, document.Sheets.getCount())
+ for i in range(4):
+ self.assertEqual(aSheetNames[i], document.Sheets[i].Name)
- xChart = document.Sheets[i].Charts[0]
- xDataSeries = xChart.getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
- self.assertEqual(1, len(xDataSeries))
+ xChart = document.Sheets[i].Charts[0]
+ xDataSeries = xChart.getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+ self.assertEqual(1, len(xDataSeries))
- # Without the fix in place, this test would have failed with
- # AssertionError: '$Blad1_2.$A$1:$A$5' != '$Blad1.$A$1:$A$5'
- aExpectedRangeName = '$' + aSheetNames[i] + '.$A$1:$A$5'
- self.assertEqual(aExpectedRangeName, xDataSeries[0].DataSequences[0].Values.SourceRangeRepresentation)
-
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '$Blad1_2.$A$1:$A$5' != '$Blad1.$A$1:$A$5'
+ aExpectedRangeName = '$' + aSheetNames[i] + '.$A$1:$A$5'
+ self.assertEqual(aExpectedRangeName, xDataSeries[0].DataSequences[0].Values.SourceRangeRepresentation)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf62057.py b/sc/qa/uitest/chart/tdf62057.py
index dc67dd8db5a5..6cb1ef8cdd21 100644
--- a/sc/qa/uitest/chart/tdf62057.py
+++ b/sc/qa/uitest/chart/tdf62057.py
@@ -12,48 +12,46 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf62057(UITestCase):
def test_tdf62057(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf62057.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf62057.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ document = self.ui_test.get_component()
- xDataMatrix = []
- for column in range(1, 3):
- xColumn = []
- for row in range(0, 6):
- xColumn.append(round(get_cell_by_position(document, 0, column, row).getValue(), 5))
- xDataMatrix.append(xColumn)
-
- xRowDescriptions = []
- for row in range(0, 6):
- xRowDescriptions.append(get_cell_by_position(document, 0, 0, row).getString())
+ xDataMatrix = []
+ for column in range(1, 3):
+ xColumn = []
+ for row in range(0, 6):
+ xColumn.append(round(get_cell_by_position(document, 0, column, row).getValue(), 5))
+ xDataMatrix.append(xColumn)
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ xRowDescriptions = []
+ for row in range(0, 6):
+ xRowDescriptions.append(get_cell_by_position(document, 0, 0, row).getString())
- self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- self.xUITest.executeCommand(".uno:CloseDoc")
+ self.xUITest.executeCommand(".uno:Copy")
- 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.xUITest.executeCommand(".uno:CloseDoc")
- self.xUITest.executeCommand(".uno:Paste")
+ self.ui_test.create_doc_in_start_center("calc")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- xData = document.Sheets[0].Charts[0].getEmbeddedObject().Data
+ self.xUITest.executeCommand(".uno:Paste")
- xNewDataMatrix = []
- xNewDataMatrix.append([round(item[0], 5) for item in xData.Data])
- xNewDataMatrix.append([round(item[1], 5) for item in xData.Data])
+ xData = document.Sheets[0].Charts[0].getEmbeddedObject().Data
- # Without the fix in place, this test would have failed with
- # AssertionError: Lists differ: ['10m', '11v', '12m', '13m', '14m', '15v'] != ['55.3796', '35.0989']
- self.assertEqual(xRowDescriptions, list(xData.RowDescriptions))
+ xNewDataMatrix = []
+ xNewDataMatrix.append([round(item[0], 5) for item in xData.Data])
+ xNewDataMatrix.append([round(item[1], 5) for item in xData.Data])
- self.assertEqual(xDataMatrix, xNewDataMatrix)
+ # Without the fix in place, this test would have failed with
+ # AssertionError: Lists differ: ['10m', '11v', '12m', '13m', '14m', '15v'] != ['55.3796', '35.0989']
+ self.assertEqual(xRowDescriptions, list(xData.RowDescriptions))
- self.ui_test.close_doc()
+ self.assertEqual(xDataMatrix, xNewDataMatrix)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf62349.py b/sc/qa/uitest/chart/tdf62349.py
index 6c3e97760a8e..2c9d0d44fef1 100644
--- a/sc/qa/uitest/chart/tdf62349.py
+++ b/sc/qa/uitest/chart/tdf62349.py
@@ -15,29 +15,27 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf62349(UITestCase):
def test_tdf62349_crash_copy_chart_clipboard(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf62349.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #3: select all data cells C5:H9
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C5:H9"}))
- # 4: create a chart with insert/chart menu
- self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
- xChartDlg = self.xUITest.getTopFocusWindow()
+ with self.ui_test.load_file(get_url_for_data_file("tdf62349.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #3: select all data cells C5:H9
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C5:H9"}))
+ # 4: create a chart with insert/chart menu
+ self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
+ xChartDlg = self.xUITest.getTopFocusWindow()
- xOkBtn = xChartDlg.getChild("finish")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xChartDlg.getChild("finish")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- # 5: (single) click to an empty cell to finalize the chart
- gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
- # 6: (single) click back inside the chart to select it
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- # 7: press CTRL-C
- self.xUITest.executeCommand(".uno:Copy")
- self.xUITest.executeCommand(".uno:Paste")
- #check we didn't crash
- self.assertEqual(get_cell_by_position(document, 0, 2, 5).getString(), "group1")
-
- self.ui_test.close_doc()
+ # 5: (single) click to an empty cell to finalize the chart
+ gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ # 6: (single) click back inside the chart to select it
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ # 7: press CTRL-C
+ self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:Paste")
+ #check we didn't crash
+ self.assertEqual(get_cell_by_position(document, 0, 2, 5).getString(), "group1")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf93506_trendline.py b/sc/qa/uitest/chart/tdf93506_trendline.py
index 8efd880ccbb5..f528238bdd90 100644
--- a/sc/qa/uitest/chart/tdf93506_trendline.py
+++ b/sc/qa/uitest/chart/tdf93506_trendline.py
@@ -18,449 +18,448 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class tdf93506(UITestCase):
def test_tdf93506_chart_trendline_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf93506.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- change_measurement_unit(self, "Centimeter")
-
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- xentryname = xDialog.getChild("entry_name") #add name
- extrapolateForward = xDialog.getChild("extrapolateForward")
- extrapolateBackward = xDialog.getChild("extrapolateBackward")
- setIntercept = xDialog.getChild("setIntercept")
- interceptValue = xDialog.getChild("interceptValue")
- showEquation = xDialog.getChild("showEquation")
- showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
- xVarname = xDialog.getChild("entry_Xname")
- yVarName = xDialog.getChild("entry_Yname")
-
- logarithmic.executeAction("CLICK", tuple())
- xentryname.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"}))
- extrapolateForward.executeAction("UP", tuple())
- extrapolateBackward.executeAction("UP", tuple())
- showEquation.executeAction("CLICK", tuple())
- showCorrelationCoefficient.executeAction("CLICK", tuple())
- xVarname.executeAction("CLEAR", tuple())
- xVarname.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
- yVarName.executeAction("CLEAR", tuple())
- yVarName.executeAction("TYPE", mkPropertyValues({"TEXT":"f(a)"}))
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
-
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- xWidth.executeAction("UP", tuple())
- xTransparent.executeAction("UP", tuple())
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- xentryname = xDialog.getChild("entry_name") #add name
- extrapolateForward = xDialog.getChild("extrapolateForward")
- extrapolateBackward = xDialog.getChild("extrapolateBackward")
- setIntercept = xDialog.getChild("setIntercept")
- interceptValue = xDialog.getChild("interceptValue")
- showEquation = xDialog.getChild("showEquation")
- showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
- xVarname = xDialog.getChild("entry_Xname")
- yVarName = xDialog.getChild("entry_Yname")
-
- self.assertEqual(get_state_as_dict(logarithmic)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name")
- self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1")
- self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1")
- self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true")
- self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xVarname)["Text"], "a")
- self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)")
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Now change regression Type to Exponential
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- exponential = xDialog.getChild("exponential") #type regression exponential
- xentryname = xDialog.getChild("entry_name") #add name
- extrapolateForward = xDialog.getChild("extrapolateForward")
- extrapolateBackward = xDialog.getChild("extrapolateBackward")
- setIntercept = xDialog.getChild("setIntercept")
- interceptValue = xDialog.getChild("interceptValue")
- showEquation = xDialog.getChild("showEquation")
- showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
- xVarname = xDialog.getChild("entry_Xname")
- yVarName = xDialog.getChild("entry_Yname")
-
- exponential.executeAction("CLICK", tuple()) #set exponential
- #set Force intercept
- setIntercept.executeAction("CLICK", tuple())
- interceptValue.executeAction("UP", tuple())
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify Exponential
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- exponential = xDialog.getChild("exponential") #type regression exponential
- xentryname = xDialog.getChild("entry_name") #add name
- extrapolateForward = xDialog.getChild("extrapolateForward")
- extrapolateBackward = xDialog.getChild("extrapolateBackward")
- setIntercept = xDialog.getChild("setIntercept")
- interceptValue = xDialog.getChild("interceptValue")
- showEquation = xDialog.getChild("showEquation")
- showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
- xVarname = xDialog.getChild("entry_Xname")
- yVarName = xDialog.getChild("entry_Yname")
-
- self.assertEqual(get_state_as_dict(exponential)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name")
- self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1")
- self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1")
- self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true")
- self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true")
- self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1")
- self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xVarname)["Text"], "a")
- self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)")
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Now change regression Type to Power
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- exponential = xDialog.getChild("exponential") #type regression exponential
- power = xDialog.getChild("exponential") #type regression power
- xentryname = xDialog.getChild("entry_name") #add name
- extrapolateForward = xDialog.getChild("extrapolateForward")
- extrapolateBackward = xDialog.getChild("extrapolateBackward")
- setIntercept = xDialog.getChild("setIntercept")
- interceptValue = xDialog.getChild("interceptValue")
- showEquation = xDialog.getChild("showEquation")
- showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
- xVarname = xDialog.getChild("entry_Xname")
- yVarName = xDialog.getChild("entry_Yname")
-
- power.executeAction("CLICK", tuple()) #set power
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify Power
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- exponential = xDialog.getChild("exponential") #type regression exponential
- power = xDialog.getChild("exponential") #type regression power
- xentryname = xDialog.getChild("entry_name") #add name
- extrapolateForward = xDialog.getChild("extrapolateForward")
- extrapolateBackward = xDialog.getChild("extrapolateBackward")
- setIntercept = xDialog.getChild("setIntercept")
- interceptValue = xDialog.getChild("interceptValue")
- showEquation = xDialog.getChild("showEquation")
- showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
- xVarname = xDialog.getChild("entry_Xname")
- yVarName = xDialog.getChild("entry_Yname")
-
- self.assertEqual(get_state_as_dict(power)["Checked"], "true")
- self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name")
- self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1")
- self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1")
- self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true")
- # self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true")
- # self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1")
- self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xVarname)["Text"], "a")
- self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)")
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Now change regression Type to Polynomial
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- exponential = xDialog.getChild("exponential") #type regression exponential
- power = xDialog.getChild("exponential") #type regression power
- polynomial = xDialog.getChild("polynomial") #type regression polynomial
- degree = xDialog.getChild("degree")
- xentryname = xDialog.getChild("entry_name") #add name
- extrapolateForward = xDialog.getChild("extrapolateForward")
- extrapolateBackward = xDialog.getChild("extrapolateBackward")
- setIntercept = xDialog.getChild("setIntercept")
- interceptValue = xDialog.getChild("interceptValue")
- showEquation = xDialog.getChild("showEquation")
- showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
- xVarname = xDialog.getChild("entry_Xname")
- yVarName = xDialog.getChild("entry_Yname")
-
- polynomial.executeAction("CLICK", tuple()) #set polynomial
- degree.executeAction("UP", tuple())
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify Polynomial
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- exponential = xDialog.getChild("exponential") #type regression exponential
- power = xDialog.getChild("exponential") #type regression power
- polynomial = xDialog.getChild("polynomial") #type regression polynomial
- degree = xDialog.getChild("degree")
- xentryname = xDialog.getChild("entry_name") #add name
- extrapolateForward = xDialog.getChild("extrapolateForward")
- extrapolateBackward = xDialog.getChild("extrapolateBackward")
- setIntercept = xDialog.getChild("setIntercept")
- interceptValue = xDialog.getChild("interceptValue")
- showEquation = xDialog.getChild("showEquation")
- showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
- xVarname = xDialog.getChild("entry_Xname")
- yVarName = xDialog.getChild("entry_Yname")
-
- self.assertEqual(get_state_as_dict(polynomial)["Checked"], "true")
- self.assertEqual(get_state_as_dict(degree)["Text"], "3")
- self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name")
- self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1")
- self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1")
- self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true")
- self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true")
- self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1")
- self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true")
- self.assertEqual(get_state_as_dict(xVarname)["Text"], "a")
- self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)")
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #Now change regression Type to Moving average
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- exponential = xDialog.getChild("exponential") #type regression exponential
- power = xDialog.getChild("exponential") #type regression power
- movingAverage = xDialog.getChild("movingAverage") #type regression Moving average
- movingAverageType = xDialog.getChild("combo_moving_type") #type regression Moving average type
- period = xDialog.getChild("period")
- xentryname = xDialog.getChild("entry_name") #add name
- extrapolateForward = xDialog.getChild("extrapolateForward")
- extrapolateBackward = xDialog.getChild("extrapolateBackward")
- setIntercept = xDialog.getChild("setIntercept")
- interceptValue = xDialog.getChild("interceptValue")
- showEquation = xDialog.getChild("showEquation")
- showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
- xVarname = xDialog.getChild("entry_Xname")
- yVarName = xDialog.getChild("entry_Yname")
-
- movingAverage.executeAction("CLICK", tuple()) #set polynomial
- select_by_text(movingAverageType, "Averaged Abscissa")
- period.executeAction("UP", tuple())
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #reopen and verify Moving average
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Type".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "0")
-
- logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
- exponential = xDialog.getChild("exponential") #type regression exponential
- power = xDialog.getChild("exponential") #type regression power
- polynomial = xDialog.getChild("polynomial") #type regression polynomial
- movingAverage = xDialog.getChild("movingAverage") #type regression Moving average
- movingAverageType = xDialog.getChild("combo_moving_type") #type regression Moving average type
- degree = xDialog.getChild("degree")
- period = xDialog.getChild("period")
- xentryname = xDialog.getChild("entry_name") #add name
- extrapolateForward = xDialog.getChild("extrapolateForward")
- extrapolateBackward = xDialog.getChild("extrapolateBackward")
- setIntercept = xDialog.getChild("setIntercept")
- interceptValue = xDialog.getChild("interceptValue")
- showEquation = xDialog.getChild("showEquation")
- showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
- xVarname = xDialog.getChild("entry_Xname")
- yVarName = xDialog.getChild("entry_Yname")
-
- self.assertEqual(get_state_as_dict(movingAverage)["Checked"], "true")
- self.assertEqual(get_state_as_dict(movingAverageType)["SelectEntryText"], "Averaged Abscissa")
- self.assertEqual(get_state_as_dict(period)["Text"], "3")
- self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name")
-
- #Click on tab "Line".
- select_pos(tabcontrol, "1")
- xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
- xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
-
- self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
- self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
-
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf93506.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ change_measurement_unit(self, "Centimeter")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ xentryname = xDialog.getChild("entry_name") #add name
+ extrapolateForward = xDialog.getChild("extrapolateForward")
+ extrapolateBackward = xDialog.getChild("extrapolateBackward")
+ setIntercept = xDialog.getChild("setIntercept")
+ interceptValue = xDialog.getChild("interceptValue")
+ showEquation = xDialog.getChild("showEquation")
+ showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
+ xVarname = xDialog.getChild("entry_Xname")
+ yVarName = xDialog.getChild("entry_Yname")
+
+ logarithmic.executeAction("CLICK", tuple())
+ xentryname.executeAction("TYPE", mkPropertyValues({"TEXT":"Name"}))
+ extrapolateForward.executeAction("UP", tuple())
+ extrapolateBackward.executeAction("UP", tuple())
+ showEquation.executeAction("CLICK", tuple())
+ showCorrelationCoefficient.executeAction("CLICK", tuple())
+ xVarname.executeAction("CLEAR", tuple())
+ xVarname.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
+ yVarName.executeAction("CLEAR", tuple())
+ yVarName.executeAction("TYPE", mkPropertyValues({"TEXT":"f(a)"}))
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ xWidth.executeAction("UP", tuple())
+ xTransparent.executeAction("UP", tuple())
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ xentryname = xDialog.getChild("entry_name") #add name
+ extrapolateForward = xDialog.getChild("extrapolateForward")
+ extrapolateBackward = xDialog.getChild("extrapolateBackward")
+ setIntercept = xDialog.getChild("setIntercept")
+ interceptValue = xDialog.getChild("interceptValue")
+ showEquation = xDialog.getChild("showEquation")
+ showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
+ xVarname = xDialog.getChild("entry_Xname")
+ yVarName = xDialog.getChild("entry_Yname")
+
+ self.assertEqual(get_state_as_dict(logarithmic)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name")
+ self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1")
+ self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1")
+ self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xVarname)["Text"], "a")
+ self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)")
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Now change regression Type to Exponential
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ exponential = xDialog.getChild("exponential") #type regression exponential
+ xentryname = xDialog.getChild("entry_name") #add name
+ extrapolateForward = xDialog.getChild("extrapolateForward")
+ extrapolateBackward = xDialog.getChild("extrapolateBackward")
+ setIntercept = xDialog.getChild("setIntercept")
+ interceptValue = xDialog.getChild("interceptValue")
+ showEquation = xDialog.getChild("showEquation")
+ showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
+ xVarname = xDialog.getChild("entry_Xname")
+ yVarName = xDialog.getChild("entry_Yname")
+
+ exponential.executeAction("CLICK", tuple()) #set exponential
+ #set Force intercept
+ setIntercept.executeAction("CLICK", tuple())
+ interceptValue.executeAction("UP", tuple())
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify Exponential
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ exponential = xDialog.getChild("exponential") #type regression exponential
+ xentryname = xDialog.getChild("entry_name") #add name
+ extrapolateForward = xDialog.getChild("extrapolateForward")
+ extrapolateBackward = xDialog.getChild("extrapolateBackward")
+ setIntercept = xDialog.getChild("setIntercept")
+ interceptValue = xDialog.getChild("interceptValue")
+ showEquation = xDialog.getChild("showEquation")
+ showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
+ xVarname = xDialog.getChild("entry_Xname")
+ yVarName = xDialog.getChild("entry_Yname")
+
+ self.assertEqual(get_state_as_dict(exponential)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name")
+ self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1")
+ self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1")
+ self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1")
+ self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xVarname)["Text"], "a")
+ self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)")
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Now change regression Type to Power
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ exponential = xDialog.getChild("exponential") #type regression exponential
+ power = xDialog.getChild("exponential") #type regression power
+ xentryname = xDialog.getChild("entry_name") #add name
+ extrapolateForward = xDialog.getChild("extrapolateForward")
+ extrapolateBackward = xDialog.getChild("extrapolateBackward")
+ setIntercept = xDialog.getChild("setIntercept")
+ interceptValue = xDialog.getChild("interceptValue")
+ showEquation = xDialog.getChild("showEquation")
+ showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
+ xVarname = xDialog.getChild("entry_Xname")
+ yVarName = xDialog.getChild("entry_Yname")
+
+ power.executeAction("CLICK", tuple()) #set power
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify Power
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ exponential = xDialog.getChild("exponential") #type regression exponential
+ power = xDialog.getChild("exponential") #type regression power
+ xentryname = xDialog.getChild("entry_name") #add name
+ extrapolateForward = xDialog.getChild("extrapolateForward")
+ extrapolateBackward = xDialog.getChild("extrapolateBackward")
+ setIntercept = xDialog.getChild("setIntercept")
+ interceptValue = xDialog.getChild("interceptValue")
+ showEquation = xDialog.getChild("showEquation")
+ showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
+ xVarname = xDialog.getChild("entry_Xname")
+ yVarName = xDialog.getChild("entry_Yname")
+
+ self.assertEqual(get_state_as_dict(power)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name")
+ self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1")
+ self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1")
+ self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true")
+ # self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true")
+ # self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1")
+ self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xVarname)["Text"], "a")
+ self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)")
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Now change regression Type to Polynomial
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ exponential = xDialog.getChild("exponential") #type regression exponential
+ power = xDialog.getChild("exponential") #type regression power
+ polynomial = xDialog.getChild("polynomial") #type regression polynomial
+ degree = xDialog.getChild("degree")
+ xentryname = xDialog.getChild("entry_name") #add name
+ extrapolateForward = xDialog.getChild("extrapolateForward")
+ extrapolateBackward = xDialog.getChild("extrapolateBackward")
+ setIntercept = xDialog.getChild("setIntercept")
+ interceptValue = xDialog.getChild("interceptValue")
+ showEquation = xDialog.getChild("showEquation")
+ showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
+ xVarname = xDialog.getChild("entry_Xname")
+ yVarName = xDialog.getChild("entry_Yname")
+
+ polynomial.executeAction("CLICK", tuple()) #set polynomial
+ degree.executeAction("UP", tuple())
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify Polynomial
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ exponential = xDialog.getChild("exponential") #type regression exponential
+ power = xDialog.getChild("exponential") #type regression power
+ polynomial = xDialog.getChild("polynomial") #type regression polynomial
+ degree = xDialog.getChild("degree")
+ xentryname = xDialog.getChild("entry_name") #add name
+ extrapolateForward = xDialog.getChild("extrapolateForward")
+ extrapolateBackward = xDialog.getChild("extrapolateBackward")
+ setIntercept = xDialog.getChild("setIntercept")
+ interceptValue = xDialog.getChild("interceptValue")
+ showEquation = xDialog.getChild("showEquation")
+ showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
+ xVarname = xDialog.getChild("entry_Xname")
+ yVarName = xDialog.getChild("entry_Yname")
+
+ self.assertEqual(get_state_as_dict(polynomial)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(degree)["Text"], "3")
+ self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name")
+ self.assertEqual(get_state_as_dict(extrapolateForward)["Text"], "1")
+ self.assertEqual(get_state_as_dict(extrapolateBackward)["Text"], "1")
+ self.assertEqual(get_state_as_dict(showEquation)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(setIntercept)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(interceptValue)["Text"], "1")
+ self.assertEqual(get_state_as_dict(showCorrelationCoefficient)["Selected"], "true")
+ self.assertEqual(get_state_as_dict(xVarname)["Text"], "a")
+ self.assertEqual(get_state_as_dict(yVarName)["Text"], "f(a)")
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #Now change regression Type to Moving average
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ exponential = xDialog.getChild("exponential") #type regression exponential
+ power = xDialog.getChild("exponential") #type regression power
+ movingAverage = xDialog.getChild("movingAverage") #type regression Moving average
+ movingAverageType = xDialog.getChild("combo_moving_type") #type regression Moving average type
+ period = xDialog.getChild("period")
+ xentryname = xDialog.getChild("entry_name") #add name
+ extrapolateForward = xDialog.getChild("extrapolateForward")
+ extrapolateBackward = xDialog.getChild("extrapolateBackward")
+ setIntercept = xDialog.getChild("setIntercept")
+ interceptValue = xDialog.getChild("interceptValue")
+ showEquation = xDialog.getChild("showEquation")
+ showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
+ xVarname = xDialog.getChild("entry_Xname")
+ yVarName = xDialog.getChild("entry_Yname")
+
+ movingAverage.executeAction("CLICK", tuple()) #set polynomial
+ select_by_text(movingAverageType, "Averaged Abscissa")
+ period.executeAction("UP", tuple())
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #reopen and verify Moving average
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatTrendline"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Type".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "0")
+
+ logarithmic = xDialog.getChild("logarithmic") #type regression logarithmic
+ exponential = xDialog.getChild("exponential") #type regression exponential
+ power = xDialog.getChild("exponential") #type regression power
+ polynomial = xDialog.getChild("polynomial") #type regression polynomial
+ movingAverage = xDialog.getChild("movingAverage") #type regression Moving average
+ movingAverageType = xDialog.getChild("combo_moving_type") #type regression Moving average type
+ degree = xDialog.getChild("degree")
+ period = xDialog.getChild("period")
+ xentryname = xDialog.getChild("entry_name") #add name
+ extrapolateForward = xDialog.getChild("extrapolateForward")
+ extrapolateBackward = xDialog.getChild("extrapolateBackward")
+ setIntercept = xDialog.getChild("setIntercept")
+ interceptValue = xDialog.getChild("interceptValue")
+ showEquation = xDialog.getChild("showEquation")
+ showCorrelationCoefficient = xDialog.getChild("showCorrelationCoefficient")
+ xVarname = xDialog.getChild("entry_Xname")
+ yVarName = xDialog.getChild("entry_Yname")
+
+ self.assertEqual(get_state_as_dict(movingAverage)["Checked"], "true")
+ self.assertEqual(get_state_as_dict(movingAverageType)["SelectEntryText"], "Averaged Abscissa")
+ self.assertEqual(get_state_as_dict(period)["Text"], "3")
+ self.assertEqual(get_state_as_dict(xentryname)["Text"], "Name")
+
+ #Click on tab "Line".
+ select_pos(tabcontrol, "1")
+ xWidth = xDialog.getChild("MTR_FLD_LINE_WIDTH")
+ xTransparent = xDialog.getChild("MTR_LINE_TRANSPARENT")
+
+ self.assertEqual(get_state_as_dict(xWidth)["Text"], "0.10 cm")
+ self.assertEqual(get_state_as_dict(xTransparent)["Text"], "5%")
+
+ 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/chart/tdf96432.py b/sc/qa/uitest/chart/tdf96432.py
index 28b3015f37ab..6d8a5e4c2f91 100644
--- a/sc/qa/uitest/chart/tdf96432.py
+++ b/sc/qa/uitest/chart/tdf96432.py
@@ -13,65 +13,64 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf96432(UITestCase):
def test_tdf96432_chart_crash_transparency_error_bar_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf96432.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf96432.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
- self.assertEqual(0, xDataSeries[0].ErrorBarY.LineTransparence)
+ document = self.ui_test.get_component()
+ xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+ self.assertEqual(0, xDataSeries[0].ErrorBarY.LineTransparence)
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
- #Right-click on the chart; from the pop-up menu select "Format Y bars
- # The program presents dialog "Format Y bars", tab "Line".
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatYErrorBars"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Line".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
- #Type a non-zero integer into the "Transparency:" Edit Field, or use the up arrow to select one
- xTransparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
- xTransparency.executeAction("UP", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ #Right-click on the chart; from the pop-up menu select "Format Y bars
+ # The program presents dialog "Format Y bars", tab "Line".
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatYErrorBars"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Line".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+ #Type a non-zero integer into the "Transparency:" Edit Field, or use the up arrow to select one
+ xTransparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+ xTransparency.executeAction("UP", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #verify - we didn't crash
- gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ #verify - we didn't crash
+ gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
- xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
- self.assertEqual(5, xDataSeries[0].ErrorBarY.LineTransparence)
+ xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+ self.assertEqual(5, xDataSeries[0].ErrorBarY.LineTransparence)
- #reopen and try again
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
+ #reopen and try again
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
- #Right-click on the chart; from the pop-up menu select "Format Y bars
- # The program presents dialog "Format Y bars", tab "Line".
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatYErrorBars"}))
- xDialog = self.xUITest.getTopFocusWindow()
- #Click on tab "Line".
- tabcontrol = xDialog.getChild("tabcontrol")
- select_pos(tabcontrol, "1")
- #Type a non-zero integer into the "Transparency:" Edit Field, or use the up arrow to select one
- xTransparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
- self.assertEqual(get_state_as_dict(xTransparency)["Text"][0], "5")
- xTransparency.executeAction("UP", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
+ #Right-click on the chart; from the pop-up menu select "Format Y bars
+ # The program presents dialog "Format Y bars", tab "Line".
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "FormatYErrorBars"}))
+ xDialog = self.xUITest.getTopFocusWindow()
+ #Click on tab "Line".
+ tabcontrol = xDialog.getChild("tabcontrol")
+ select_pos(tabcontrol, "1")
+ #Type a non-zero integer into the "Transparency:" Edit Field, or use the up arrow to select one
+ xTransparency = xDialog.getChild("MTR_LINE_TRANSPARENT")
+ self.assertEqual(get_state_as_dict(xTransparency)["Text"][0], "5")
+ xTransparency.executeAction("UP", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
- #verify - we didn't crash
- gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ #verify - we didn't crash
+ gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
- xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
- self.assertEqual(10, xDataSeries[0].ErrorBarY.LineTransparence)
+ xDataSeries = document.Sheets[0].Charts[0].getEmbeddedObject().getFirstDiagram().CoordinateSystems[0].ChartTypes[0].DataSeries
+ self.assertEqual(10, xDataSeries[0].ErrorBarY.LineTransparence)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf98690.py b/sc/qa/uitest/chart/tdf98690.py
index 4ea448c1d0d9..f99009206bb4 100644
--- a/sc/qa/uitest/chart/tdf98690.py
+++ b/sc/qa/uitest/chart/tdf98690.py
@@ -11,35 +11,33 @@ from uitest.uihelper.common import get_url_for_data_file
class tdf98690(UITestCase):
def test_tdf98690(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf98690.xlsx"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ with self.ui_test.load_file(get_url_for_data_file("tdf98690.xlsx")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Chart 2"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Chart 2"}))
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:Copy")
- self.xUITest.executeCommand(".uno:CloseDoc")
+ self.xUITest.executeCommand(".uno:CloseDoc")
- 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.create_doc_in_start_center("calc")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- self.xUITest.executeCommand(".uno:Paste")
+ self.xUITest.executeCommand(".uno:Paste")
- xData = document.Sheets[0].Charts[0].getEmbeddedObject().Data
+ xData = document.Sheets[0].Charts[0].getEmbeddedObject().Data
- aExpectedRowDescriptions = tuple(str(i) for i in range(1, 14))
- aExpectedColumnDescriptions = ('Column D Column D', 'cc_girder2', 'Column S Column S',
- 'Column S Column S', 'Column D Column D', 'clexrfdon', 'Column S Column S',
- 'Column S Column S', 'Column D', 'clexrfdoff', 'Column S Column S', 'Column S Column S')
+ aExpectedRowDescriptions = tuple(str(i) for i in range(1, 14))
+ aExpectedColumnDescriptions = ('Column D Column D', 'cc_girder2', 'Column S Column S',
+ 'Column S Column S', 'Column D Column D', 'clexrfdon', 'Column S Column S',
+ 'Column S Column S', 'Column D', 'clexrfdoff', 'Column S Column S', 'Column S Column S')
- # Without the fix in place, this test would have failed here,
- # since the pasted chart wouldn't have had any data
- self.assertEqual(aExpectedRowDescriptions, xData.RowDescriptions)
- self.assertEqual(aExpectedColumnDescriptions, xData.ColumnDescriptions)
-
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have failed here,
+ # since the pasted chart wouldn't have had any data
+ self.assertEqual(aExpectedRowDescriptions, xData.RowDescriptions)
+ self.assertEqual(aExpectedColumnDescriptions, xData.ColumnDescriptions)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/chart/tdf99069.py b/sc/qa/uitest/chart/tdf99069.py
index bca0d532ffa6..e8d805d82355 100644
--- a/sc/qa/uitest/chart/tdf99069.py
+++ b/sc/qa/uitest/chart/tdf99069.py
@@ -15,56 +15,55 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class tdf99069(UITestCase):
def test_tdf99069_chart_cancel_data_ranges_dialog(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf99069.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #(1) Download and open example.ods attached to tdf#97266 with cell B1 active.
- #(2) In tool bar, click the chart icon. Program presents Chart Wizard.
- self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
- xDialog = self.xUITest.getTopFocusWindow()
- #(3) In Chart Wizard, click <Finish>. The program closes the wizard;
- # the chart shows a border with handles on each side and at each corner.
- xFinishBtn = xDialog.getChild("finish")
- self.ui_test.close_dialog_through_button(xFinishBtn)
- for _ in range(0,5):
- #(4) Click outside the chart, for example in cell C23. The borders
- #disappear from the chart and the program restores the menubar to
- #the window. (Yes, this step is necessary to the crash.)
- gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C23"}))
- #(5) Double-click on the chart. The program shows a border around the
- # chart. (It may be necessary to do this a second time before the
- # pop-up menu will offer "Data Ranges...".
- gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
- gridwin.executeAction("ACTIVATE", tuple())
- xChartMainTop = self.xUITest.getTopFocusWindow()
- xChartMain = xChartMainTop.getChild("chart_window")
-
- #(6) Right-click on the chart; from the pop-up menu select "Data
- # Ranges...". The program presents dialog "Data Ranges", tab "Data Range".
- xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
- self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DataRanges"}))
+ with self.ui_test.load_file(get_url_for_data_file("tdf99069.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #(1) Download and open example.ods attached to tdf#97266 with cell B1 active.
+ #(2) In tool bar, click the chart icon. Program presents Chart Wizard.
+ self.ui_test.execute_dialog_through_command(".uno:InsertObjectChart")
xDialog = self.xUITest.getTopFocusWindow()
+ #(3) In Chart Wizard, click <Finish>. The program closes the wizard;
+ # the chart shows a border with handles on each side and at each corner.
+ xFinishBtn = xDialog.getChild("finish")
+ self.ui_test.close_dialog_through_button(xFinishBtn)
+ for _ in range(0,5):
+ #(4) Click outside the chart, for example in cell C23. The borders
+ #disappear from the chart and the program restores the menubar to
+ #the window. (Yes, this step is necessary to the crash.)
+ gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C23"}))
+ #(5) Double-click on the chart. The program shows a border around the
+ # chart. (It may be necessary to do this a second time before the
+ # pop-up menu will offer "Data Ranges...".
+ gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 1"}))
+ gridwin.executeAction("ACTIVATE", tuple())
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild("chart_window")
- #(7) Click on tab "Data Series". (Actually, tab "Data Range" crashes,
- # too. This step is just a remnant of what I was doing when I
- # stumbled over the bug.)
- notebook = xDialog.getChild("tabcontrol")
- select_pos(notebook, "0")
- select_pos(notebook, "1")
+ #(6) Right-click on the chart; from the pop-up menu select "Data
+ # Ranges...". The program presents dialog "Data Ranges", tab "Data Range".
+ xSeriesObj = xChartMain.getChild("CID/D=0:CS=0:CT=0:Series=0")
+ self.ui_test.execute_dialog_through_action(xSeriesObj, "COMMAND", mkPropertyValues({"COMMAND": "DataRanges"}))
+ xDialog = self.xUITest.getTopFocusWindow()
- #(8) Click <Cancel>. In the versions that I deemed bad while
- # bibisecting, the program crashed here five times out of seven.
- # The other two attempts, both on daily bibisect version 2016-02-18,
- # crashed after I closed the Data Ranges dialog an additional three
- # times, one of those times using by typing <Esc>.
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ #(7) Click on tab "Data Series". (Actually, tab "Data Range" crashes,
+ # too. This step is just a remnant of what I was doing when I
+ # stumbled over the bug.)
+ notebook = xDialog.getChild("tabcontrol")
+ select_pos(notebook, "0")
+ select_pos(notebook, "1")
- #verify - we didn't crash
- gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 0.529084)
+ #(8) Click <Cancel>. In the versions that I deemed bad while
+ # bibisecting, the program crashed here five times out of seven.
+ # The other two attempts, both on daily bibisect version 2016-02-18,
+ # crashed after I closed the Data Ranges dialog an additional three
+ # times, one of those times using by typing <Esc>.
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+
+ #verify - we didn't crash
+ gridwin.executeAction("DESELECT", mkPropertyValues({"OBJECT": ""}))
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getValue(), 0.529084)
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/conditional_format/tdf100793.py b/sc/qa/uitest/conditional_format/tdf100793.py
index 36b243008deb..516090076ec8 100644
--- a/sc/qa/uitest/conditional_format/tdf100793.py
+++ b/sc/qa/uitest/conditional_format/tdf100793.py
@@ -15,83 +15,81 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf100793(UITestCase):
def test_tdf100793(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf100793.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- sheet = get_sheet_from_doc(calc_doc, 2)
- conditional_format_list = get_conditional_format_from_sheet(sheet)
- self.assertEqual(conditional_format_list.getLength(), 1)
- #2) Go to sheet "plan"
- gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "2"}))
- #3) Open the conditional formatting management dialog-> The indicated range should be G18:K29,F18,F20:F29
- self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
-
- xCondFormatMgr = self.xUITest.getTopFocusWindow()
-
- # check that we have exactly one conditional formats in the beginning
- xList = xCondFormatMgr.getChild("CONTAINER")
- list_state = get_state_as_dict(xList)
- self.assertEqual(list_state['Children'], '1')
-
- #3) Click Edit & try to change to intended one, F18:K33
- xEditBtn = xCondFormatMgr.getChild("edit")
- self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name = "ModelessDialogVisible")
- xCondFormatDlg = self.xUITest.getTopFocusWindow()
-
- #modify textbox
- xedassign = xCondFormatDlg.getChild("edassign")
- #go at the beginning
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "END"}))
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "HOME"}))
- # 11x right
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
- #now I'm at F18 - write :K33
- xedassign.executeAction("TYPE", mkPropertyValues({"TEXT":":K33"}))
-
- xCondFormatOkBtn = xCondFormatDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xCondFormatOkBtn)
-
- # we need to get a pointer again as the old window has been deleted
- xCondFormatMgr = self.xUITest.getTopFocusWindow()
-
- # check again that we still have 1 entry in the list
- # and still only 1 conditional format in the document
- xList = xCondFormatMgr.getChild("CONTAINER")
- list_state = get_state_as_dict(xList)
- self.assertEqual(list_state['Children'], '1')
-
- self.assertEqual(conditional_format_list.getLength(), 1)
-
- # close the conditional format manager
- xOKBtn = xCondFormatMgr.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- #verify - reopen, check range
- self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
- xCondFormatMgr = self.xUITest.getTopFocusWindow()
- xEditBtn = xCondFormatMgr.getChild("edit")
- self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name = "ModelessDialogVisible")
- xCondFormatDlg = self.xUITest.getTopFocusWindow()
- xedassign = xCondFormatDlg.getChild("edassign")
- self.assertEqual(get_state_as_dict(xedassign)["Text"], "G18:K29,F18:K33,F20:F29")
- xCondFormatOkBtn = xCondFormatDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xCondFormatOkBtn)
- xCondFormatMgr = self.xUITest.getTopFocusWindow()
- xCancelBtn = xCondFormatMgr.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf100793.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ sheet = get_sheet_from_doc(calc_doc, 2)
+ conditional_format_list = get_conditional_format_from_sheet(sheet)
+ self.assertEqual(conditional_format_list.getLength(), 1)
+ #2) Go to sheet "plan"
+ gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "2"}))
+ #3) Open the conditional formatting management dialog-> The indicated range should be G18:K29,F18,F20:F29
+ self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
+
+ xCondFormatMgr = self.xUITest.getTopFocusWindow()
+
+ # check that we have exactly one conditional formats in the beginning
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '1')
+
+ #3) Click Edit & try to change to intended one, F18:K33
+ xEditBtn = xCondFormatMgr.getChild("edit")
+ self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name = "ModelessDialogVisible")
+ xCondFormatDlg = self.xUITest.getTopFocusWindow()
+
+ #modify textbox
+ xedassign = xCondFormatDlg.getChild("edassign")
+ #go at the beginning
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "END"}))
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "HOME"}))
+ # 11x right
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ xedassign.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RIGHT"}))
+ #now I'm at F18 - write :K33
+ xedassign.executeAction("TYPE", mkPropertyValues({"TEXT":":K33"}))
+
+ xCondFormatOkBtn = xCondFormatDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xCondFormatOkBtn)
+
+ # we need to get a pointer again as the old window has been deleted
+ xCondFormatMgr = self.xUITest.getTopFocusWindow()
+
+ # check again that we still have 1 entry in the list
+ # and still only 1 conditional format in the document
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '1')
+
+ self.assertEqual(conditional_format_list.getLength(), 1)
+
+ # close the conditional format manager
+ xOKBtn = xCondFormatMgr.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ #verify - reopen, check range
+ self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
+ xCondFormatMgr = self.xUITest.getTopFocusWindow()
+ xEditBtn = xCondFormatMgr.getChild("edit")
+ self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name = "ModelessDialogVisible")
+ xCondFormatDlg = self.xUITest.getTopFocusWindow()
+ xedassign = xCondFormatDlg.getChild("edassign")
+ self.assertEqual(get_state_as_dict(xedassign)["Text"], "G18:K29,F18:K33,F20:F29")
+ xCondFormatOkBtn = xCondFormatDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xCondFormatOkBtn)
+ xCondFormatMgr = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xCondFormatMgr.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/conditional_format/tdf104026.py b/sc/qa/uitest/conditional_format/tdf104026.py
index 5aa6a1ff8b6f..45c2b9dea665 100644
--- a/sc/qa/uitest/conditional_format/tdf104026.py
+++ b/sc/qa/uitest/conditional_format/tdf104026.py
@@ -29,20 +29,18 @@ class Tdf104026(UITestCase):
self.ui_test.close_dialog_through_button(xOKBtn)
def test_tdf104026(self):
- self.ui_test.load_file(get_url_for_data_file("tdf104026.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf104026.ods")):
- self.execute_conditional_format_manager_dialog(6)
+ self.execute_conditional_format_manager_dialog(6)
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
- self.xUITest.executeCommand(".uno:DeleteRows")
+ self.xUITest.executeCommand(".uno:DeleteRows")
- # Without the fix in place, this test would have failed with
- # AssertionError: 'A2\tCell value != $Sheet1.$B2' != 'A2\tCell value != $Sheet1.$B#REF!'
- self.execute_conditional_format_manager_dialog(5)
-
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'A2\tCell value != $Sheet1.$B2' != 'A2\tCell value != $Sheet1.$B#REF!'
+ self.execute_conditional_format_manager_dialog(5)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/conditional_format/tdf105544.py b/sc/qa/uitest/conditional_format/tdf105544.py
index b15f094004a4..0099ed682ac7 100644
--- a/sc/qa/uitest/conditional_format/tdf105544.py
+++ b/sc/qa/uitest/conditional_format/tdf105544.py
@@ -15,41 +15,39 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf105544(UITestCase):
def test_tdf105544_Manage_Conditional_Formatting_edit_condition(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf105544.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #2. select B3. Format> conditional formatting> manage
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
- self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
- xCondFormatMgr = self.xUITest.getTopFocusWindow()
-
- # check that we have exactly four conditional formats in the beginning
- xList = xCondFormatMgr.getChild("CONTAINER")
- list_state = get_state_as_dict(xList)
- self.assertEqual(list_state['Children'], '4')
-
- #select B3:B37 range and click edit, then click yes
- xList.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"})) #2nd position in the list
- xEditBtn = xCondFormatMgr.getChild("edit")
- self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name = "ModelessDialogVisible")
- xCondFormatDlg = self.xUITest.getTopFocusWindow()
-
- xCondFormatOkBtn = xCondFormatDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xCondFormatOkBtn)
-
- # we need to get a pointer again as the old window has been deleted
- xCondFormatMgr = self.xUITest.getTopFocusWindow()
-
- # check again that we still have 4 entry in the list
- xList = xCondFormatMgr.getChild("CONTAINER")
- list_state = get_state_as_dict(xList)
- self.assertEqual(list_state['Children'], '4')
-
- # close the conditional format manager
- xOKBtn = xCondFormatMgr.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf105544.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #2. select B3. Format> conditional formatting> manage
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B3"}))
+ self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
+ xCondFormatMgr = self.xUITest.getTopFocusWindow()
+
+ # check that we have exactly four conditional formats in the beginning
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '4')
+
+ #select B3:B37 range and click edit, then click yes
+ xList.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"})) #2nd position in the list
+ xEditBtn = xCondFormatMgr.getChild("edit")
+ self.ui_test.execute_dialog_through_action(xEditBtn, "CLICK", event_name = "ModelessDialogVisible")
+ xCondFormatDlg = self.xUITest.getTopFocusWindow()
+
+ xCondFormatOkBtn = xCondFormatDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xCondFormatOkBtn)
+
+ # we need to get a pointer again as the old window has been deleted
+ xCondFormatMgr = self.xUITest.getTopFocusWindow()
+
+ # check again that we still have 4 entry in the list
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '4')
+
+ # close the conditional format manager
+ xOKBtn = xCondFormatMgr.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/conditional_format/tdf117899.py b/sc/qa/uitest/conditional_format/tdf117899.py
index 67146bcdf20a..bec007993e6c 100644
--- a/sc/qa/uitest/conditional_format/tdf117899.py
+++ b/sc/qa/uitest/conditional_format/tdf117899.py
@@ -28,50 +28,47 @@ class Tdf117899(UITestCase):
self.ui_test.close_dialog_through_button(xOKBtn)
def test_tdf117899(self):
- self.ui_test.load_file(get_url_for_data_file("tdf117899.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf117899.ods")):
- self.execute_conditional_format_manager_dialog()
+ self.execute_conditional_format_manager_dialog()
- self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:Copy")
- # Close the Calc document
- self.xUITest.executeCommand(".uno:CloseDoc")
+ # Close the Calc document
+ self.xUITest.executeCommand(".uno:CloseDoc")
- with TemporaryDirectory() as tempdir:
- xFilePath = os.path.join(tempdir, "tdf117899-temp.ods")
+ with TemporaryDirectory() as tempdir:
+ xFilePath = os.path.join(tempdir, "tdf117899-temp.ods")
- self.ui_test.create_doc_in_start_center("writer")
+ 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)
+ xOpenBtn = xDialog.getChild("open")
+ self.ui_test.close_dialog_through_button(xOpenBtn)
- # Close the Writer document
- self.ui_test.close_doc()
+ # Close the Writer document
+ self.ui_test.close_doc()
- self.ui_test.load_file(systemPathToFileUrl(xFilePath))
+ with self.ui_test.load_file(systemPathToFileUrl(xFilePath)):
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
- # Without the fix in place, this test would have failed here
- self.execute_conditional_format_manager_dialog()
-
- # Close the Calc document
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have failed here
+ self.execute_conditional_format_manager_dialog()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/conditional_format/tdf118206.py b/sc/qa/uitest/conditional_format/tdf118206.py
index 70e51a6c880c..679e76dcb879 100644
--- a/sc/qa/uitest/conditional_format/tdf118206.py
+++ b/sc/qa/uitest/conditional_format/tdf118206.py
@@ -14,30 +14,29 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
#Bug 118206 - [GTK3] Calc hangs copying/cutting a conditional format column
class tdf118206(UITestCase):
def test_tdf118206(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf118206.xlsx"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:SelectColumn")
- self.xUITest.executeCommand(".uno:Copy")
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- self.xUITest.executeCommand(".uno:SelectColumn")
- self.xUITest.executeCommand(".uno:Paste")
+ with self.ui_test.load_file(get_url_for_data_file("tdf118206.xlsx")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ self.xUITest.executeCommand(".uno:Paste")
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "On Back Order")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 1, 7).getValue(), 1)
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "On Back Order")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 7).getValue(), 1)
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "On Back Order")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "")
- self.assertEqual(get_cell_by_position(document, 0, 1, 7).getString(), "")
- self.ui_test.close_doc()
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "On Back Order")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 7).getString(), "")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/conditional_format/tdf81696.py b/sc/qa/uitest/conditional_format/tdf81696.py
index 92717c57db60..a57d91a70479 100644
--- a/sc/qa/uitest/conditional_format/tdf81696.py
+++ b/sc/qa/uitest/conditional_format/tdf81696.py
@@ -18,28 +18,27 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf81696(UITestCase):
def test_tdf81696_sort_cell_conditional_formatting(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf81696.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf81696.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B3"}))
- #Open sort dialog by DATA - SORT,Just sort it by Column A, ascending. (it's default)
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- xleftright = xDialog.getChild("leftright")
- select_pos(xTabs, "0")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B3"}))
+ #Open sort dialog by DATA - SORT,Just sort it by Column A, ascending. (it's default)
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ xleftright = xDialog.getChild("leftright")
+ select_pos(xTabs, "0")
- 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")
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 1)
+ 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")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 1)
- self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/conditional_format/tdf96453.py b/sc/qa/uitest/conditional_format/tdf96453.py
index 44ef9243a792..c20cf15c2393 100644
--- a/sc/qa/uitest/conditional_format/tdf96453.py
+++ b/sc/qa/uitest/conditional_format/tdf96453.py
@@ -14,55 +14,53 @@ class ConditionalFormatDlgTest(UITestCase):
def test_tdf96453(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf96453.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf96453.ods")) as calc_doc:
- sheet = get_sheet_from_doc(calc_doc, 0)
- conditional_format_list = get_conditional_format_from_sheet(sheet)
- self.assertEqual(conditional_format_list.getLength(), 2)
+ sheet = get_sheet_from_doc(calc_doc, 0)
+ conditional_format_list = get_conditional_format_from_sheet(sheet)
+ self.assertEqual(conditional_format_list.getLength(), 2)
- self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
+ self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog")
- xCondFormatMgr = self.xUITest.getTopFocusWindow()
+ xCondFormatMgr = self.xUITest.getTopFocusWindow()
- # check that we have exactly two conditional formats in the beginning
- xList = xCondFormatMgr.getChild("CONTAINER")
- list_state = get_state_as_dict(xList)
- self.assertEqual(list_state['Children'], '2')
+ # check that we have exactly two conditional formats in the beginning
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '2')
- # remove one conditional format
- xRemoveBtn = xCondFormatMgr.getChild("remove")
- xRemoveBtn.executeAction("CLICK", tuple())
+ # remove one conditional format
+ xRemoveBtn = xCondFormatMgr.getChild("remove")
+ xRemoveBtn.executeAction("CLICK", tuple())
- # check that the table only shows one
- # but the document still contains two
- list_state = get_state_as_dict(xList)
- self.assertEqual(list_state['Children'], '1')
+ # check that the table only shows one
+ # but the document still contains two
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '1')
- self.assertEqual(conditional_format_list.getLength(), 2)
+ self.assertEqual(conditional_format_list.getLength(), 2)
- # add a new conditional format through the add button
- xAddBtn = xCondFormatMgr.getChild("add")
- self.ui_test.execute_dialog_through_action(xAddBtn, "CLICK", event_name = "ModelessDialogVisible")
+ # add a new conditional format through the add button
+ xAddBtn = xCondFormatMgr.getChild("add")
+ self.ui_test.execute_dialog_through_action(xAddBtn, "CLICK", event_name = "ModelessDialogVisible")
- xCondFormatDlg = self.xUITest.getTopFocusWindow()
- xCondFormatOkBtn = xCondFormatDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xCondFormatOkBtn)
+ xCondFormatDlg = self.xUITest.getTopFocusWindow()
+ xCondFormatOkBtn = xCondFormatDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xCondFormatOkBtn)
- # we need to get a pointer again as the old window has been deleted
- xCondFormatMgr = self.xUITest.getTopFocusWindow()
+ # we need to get a pointer again as the old window has been deleted
+ xCondFormatMgr = self.xUITest.getTopFocusWindow()
- # check again that we now have 2 and not 3 entries in the list
- # and still only 2 conditional formats in the document
- xList = xCondFormatMgr.getChild("CONTAINER")
- list_state = get_state_as_dict(xList)
- self.assertEqual(list_state['Children'], '2')
+ # check again that we now have 2 and not 3 entries in the list
+ # and still only 2 conditional formats in the document
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '2')
- self.assertEqual(conditional_format_list.getLength(), 2)
+ self.assertEqual(conditional_format_list.getLength(), 2)
- # close the conditional format manager
- xCancelBtn = xCondFormatMgr.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.ui_test.close_doc()
+ # close the conditional format manager
+ xCancelBtn = xCondFormatMgr.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/tdf123479.py b/sc/qa/uitest/function_wizard/tdf123479.py
index 0ef068a90a2b..478db9cc1fdd 100644
--- a/sc/qa/uitest/function_wizard/tdf123479.py
+++ b/sc/qa/uitest/function_wizard/tdf123479.py
@@ -19,28 +19,27 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf123479(UITestCase):
def test_tdf123479_Crash_ScFormulaResult_GetMatrixFormulaCellToken(self):
#numberingformatpage.ui
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf123479.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Select D14:D16
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D14:D16"}))
- #Open Formula Wizard (Ctrl+F2)
- self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- edArg1 = xDialog.getChild("ED_ARG1")
- edArg2 = xDialog.getChild("ED_ARG2")
- formulaRes = xDialog.getChild("formula_result")
+ with self.ui_test.load_file(get_url_for_data_file("tdf123479.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Select D14:D16
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D14:D16"}))
+ #Open Formula Wizard (Ctrl+F2)
+ self.ui_test.execute_modeless_dialog_through_command(".uno:FunctionDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ edArg1 = xDialog.getChild("ED_ARG1")
+ edArg2 = xDialog.getChild("ED_ARG2")
+ formulaRes = xDialog.getChild("formula_result")
- #check formula wizard data
- self.assertEqual(get_state_as_dict(edArg1)["Text"], "CHAR(10)")
- self.assertEqual(get_state_as_dict(edArg2)["Text"], "OFFSET($Data.$A$2:$Data.$A$4,0,COLUMN()-3)")
- self.assertEqual(get_state_as_dict(formulaRes)["Text"], "{4;4;4}")
+ #check formula wizard data
+ self.assertEqual(get_state_as_dict(edArg1)["Text"], "CHAR(10)")
+ self.assertEqual(get_state_as_dict(edArg2)["Text"], "OFFSET($Data.$A$2:$Data.$A$4,0,COLUMN()-3)")
+ self.assertEqual(get_state_as_dict(formulaRes)["Text"], "{4;4;4}")
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
- #verify; no crashes
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Pass/Fail")
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+ #verify; no crashes
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "Pass/Fail")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/goalSeek/goalSeek.py b/sc/qa/uitest/goalSeek/goalSeek.py
index f17377c5b505..7bbb35a78b0e 100644
--- a/sc/qa/uitest/goalSeek/goalSeek.py
+++ b/sc/qa/uitest/goalSeek/goalSeek.py
@@ -13,26 +13,25 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class goalSeek(UITestCase):
def test_goalSeek(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("goalSeek.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B4"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:GoalSeekDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xformulaedit = xDialog.getChild("formulaedit")
- xtarget = xDialog.getChild("target")
- xvaredit = xDialog.getChild("varedit")
- xtarget.executeAction("TYPE", mkPropertyValues({"TEXT":"15000"}))
- xvaredit.executeAction("TYPE", mkPropertyValues({"TEXT":"B1"}))
- xOKBtn = xDialog.getChild("ok")
+ with self.ui_test.load_file(get_url_for_data_file("goalSeek.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B4"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:GoalSeekDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xformulaedit = xDialog.getChild("formulaedit")
+ xtarget = xDialog.getChild("target")
+ xvaredit = xDialog.getChild("varedit")
+ xtarget.executeAction("TYPE", mkPropertyValues({"TEXT":"15000"}))
+ xvaredit.executeAction("TYPE", mkPropertyValues({"TEXT":"B1"}))
+ xOKBtn = xDialog.getChild("ok")
- with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
+ with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 200000)
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 15000)
- self.ui_test.close_doc()
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 200000)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 15000)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/goalSeek/tdf37341.py b/sc/qa/uitest/goalSeek/tdf37341.py
index 117949fb44b1..7248e6b39218 100644
--- a/sc/qa/uitest/goalSeek/tdf37341.py
+++ b/sc/qa/uitest/goalSeek/tdf37341.py
@@ -15,25 +15,24 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf37341(UITestCase):
def test_tdf37341_goalSeek(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf37341.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "F111"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:GoalSeekDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xformulaedit = xDialog.getChild("formulaedit")
- xtarget = xDialog.getChild("target")
- xvaredit = xDialog.getChild("varedit")
- xtarget.executeAction("TYPE", mkPropertyValues({"TEXT":"0"}))
- xvaredit.executeAction("TYPE", mkPropertyValues({"TEXT":"E7"}))
- xOKBtn = xDialog.getChild("ok")
+ with self.ui_test.load_file(get_url_for_data_file("tdf37341.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "F111"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:GoalSeekDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xformulaedit = xDialog.getChild("formulaedit")
+ xtarget = xDialog.getChild("target")
+ xvaredit = xDialog.getChild("varedit")
+ xtarget.executeAction("TYPE", mkPropertyValues({"TEXT":"0"}))
+ xvaredit.executeAction("TYPE", mkPropertyValues({"TEXT":"E7"}))
+ xOKBtn = xDialog.getChild("ok")
- with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
+ with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 4, 6).getValue() > 0, True)
- self.ui_test.close_doc()
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 4, 6).getValue() > 0, True)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/goalSeek/tdf43693.py b/sc/qa/uitest/goalSeek/tdf43693.py
index 07e4ece7ab1a..43bce6da86bd 100644
--- a/sc/qa/uitest/goalSeek/tdf43693.py
+++ b/sc/qa/uitest/goalSeek/tdf43693.py
@@ -15,25 +15,24 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf43693(UITestCase):
def test_tdf43693_goalSeek(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf43693.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "K248"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:GoalSeekDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xformulaedit = xDialog.getChild("formulaedit")
- xtarget = xDialog.getChild("target")
- xvaredit = xDialog.getChild("varedit")
- xtarget.executeAction("TYPE", mkPropertyValues({"TEXT":"0"}))
- xvaredit.executeAction("TYPE", mkPropertyValues({"TEXT":"H5"}))
- xOKBtn = xDialog.getChild("ok")
+ with self.ui_test.load_file(get_url_for_data_file("tdf43693.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "K248"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:GoalSeekDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xformulaedit = xDialog.getChild("formulaedit")
+ xtarget = xDialog.getChild("target")
+ xvaredit = xDialog.getChild("varedit")
+ xtarget.executeAction("TYPE", mkPropertyValues({"TEXT":"0"}))
+ xvaredit.executeAction("TYPE", mkPropertyValues({"TEXT":"H5"}))
+ xOKBtn = xDialog.getChild("ok")
- with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="yes"):
- pass
+ with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 7, 4).getValue(), 0.04)
- self.ui_test.close_doc()
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 7, 4).getValue(), 0.04)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/key_f4/tdf102525.py b/sc/qa/uitest/key_f4/tdf102525.py
index 7976827a44ae..9681d2be87ab 100644
--- a/sc/qa/uitest/key_f4/tdf102525.py
+++ b/sc/qa/uitest/key_f4/tdf102525.py
@@ -13,27 +13,25 @@ from libreoffice.calc.document import get_cell_by_position
class tdf102525(UITestCase):
def test_tdf102525_F4_key_array_formula(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf102525.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf102525.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #select B1:B4
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B4"}))
- #F4
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getFormula(), "{=IF($A$1:$A$4>2;1;2)}")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1)
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getFormula(), "{=IF(A1:A4>2;1;2)}")
-
- self.ui_test.close_doc()
+ #select B1:B4
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:B4"}))
+ #F4
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "F4"}))
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getFormula(), "{=IF($A$1:$A$4>2;1;2)}")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1)
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getFormula(), "{=IF(A1:A4>2;1;2)}")
# 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 88cc750ca834..247f7028e2ae 100644
--- a/sc/qa/uitest/manual_tests/calc.py
+++ b/sc/qa/uitest/manual_tests/calc.py
@@ -168,22 +168,20 @@ class ManualCalcTests(UITestCase):
# http://manual-test.libreoffice.org/manage/case/151/
def test_cell_recalc(self):
- doc = self.ui_test.load_file(get_url_for_data_file("cell_recalc.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("cell_recalc.ods")) as doc:
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "D2:D9"}))
- self.xUITest.executeCommand(".uno:Cut")
-
- self.assertEqual(get_cell_by_position(doc, 0, 3, 15).getValue(), 0)
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "D2:D9"}))
+ self.xUITest.executeCommand(".uno:Cut")
- self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(doc, 0, 3, 15).getValue(), 0)
- for i in range(1, 9):
- self.assertTrue(get_cell_by_position(doc, 0, 3, i).getValue() != 0)
+ self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(doc, 0, 3, 15).getValue(), 195)
+ for i in range(1, 9):
+ self.assertTrue(get_cell_by_position(doc, 0, 3, i).getValue() != 0)
- self.ui_test.close_doc()
+ self.assertEqual(get_cell_by_position(doc, 0, 3, 15).getValue(), 195)
# http://manual-test.libreoffice.org/manage/case/143/
def test_random_numbers(self):
diff --git a/sc/qa/uitest/pageFormat/tdf123508.py b/sc/qa/uitest/pageFormat/tdf123508.py
index 61d53fd4187b..df3fae824162 100644
--- a/sc/qa/uitest/pageFormat/tdf123508.py
+++ b/sc/qa/uitest/pageFormat/tdf123508.py
@@ -16,42 +16,41 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class tdf123508(UITestCase):
def test_tdf123508_format_page_scale(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf123508.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #open "Format > Page - Sheet > Scale
- self.ui_test.execute_dialog_through_command(".uno:PageFormatDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "6") #tab Scale
- scalingMode = xDialog.getChild("comboLB_SCALEMODE")
- spinEDSCALEPAGEWIDTH = xDialog.getChild("spinED_SCALEPAGEWIDTH")
- spinEDSCALEPAGEHEIGHT = xDialog.getChild("spinED_SCALEPAGEHEIGHT")
- #select "Fit print range(s) to width/height" from the scale mode drop-down list
- select_by_text(scalingMode, "Fit print range(s) to width/height")
- #define a value for the page, e.g.: width 2; height 2
- spinEDSCALEPAGEWIDTH.executeAction("UP", tuple())
- spinEDSCALEPAGEHEIGHT.executeAction("UP", tuple())
+ with self.ui_test.load_file(get_url_for_data_file("tdf123508.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #open "Format > Page - Sheet > Scale
+ self.ui_test.execute_dialog_through_command(".uno:PageFormatDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "6") #tab Scale
+ scalingMode = xDialog.getChild("comboLB_SCALEMODE")
+ spinEDSCALEPAGEWIDTH = xDialog.getChild("spinED_SCALEPAGEWIDTH")
+ spinEDSCALEPAGEHEIGHT = xDialog.getChild("spinED_SCALEPAGEHEIGHT")
+ #select "Fit print range(s) to width/height" from the scale mode drop-down list
+ select_by_text(scalingMode, "Fit print range(s) to width/height")
+ #define a value for the page, e.g.: width 2; height 2
+ spinEDSCALEPAGEWIDTH.executeAction("UP", tuple())
+ spinEDSCALEPAGEHEIGHT.executeAction("UP", 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:PageFormatDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "6") #tab Scale
- scalingMode = xDialog.getChild("comboLB_SCALEMODE")
- spinEDSCALEPAGEWIDTH = xDialog.getChild("spinED_SCALEPAGEWIDTH")
- spinEDSCALEPAGEHEIGHT = xDialog.getChild("spinED_SCALEPAGEHEIGHT")
+ #verify
+ self.ui_test.execute_dialog_through_command(".uno:PageFormatDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "6") #tab Scale
+ scalingMode = xDialog.getChild("comboLB_SCALEMODE")
+ spinEDSCALEPAGEWIDTH = xDialog.getChild("spinED_SCALEPAGEWIDTH")
+ spinEDSCALEPAGEHEIGHT = xDialog.getChild("spinED_SCALEPAGEHEIGHT")
- self.assertEqual(get_state_as_dict(scalingMode)["SelectEntryText"], "Fit print range(s) to width/height")
- self.assertEqual(get_state_as_dict(spinEDSCALEPAGEWIDTH)["Text"], "2")
- self.assertEqual(get_state_as_dict(spinEDSCALEPAGEHEIGHT)["Text"], "2")
+ self.assertEqual(get_state_as_dict(scalingMode)["SelectEntryText"], "Fit print range(s) to width/height")
+ self.assertEqual(get_state_as_dict(spinEDSCALEPAGEWIDTH)["Text"], "2")
+ self.assertEqual(get_state_as_dict(spinEDSCALEPAGEHEIGHT)["Text"], "2")
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ 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/range_name/tdf119954.py b/sc/qa/uitest/range_name/tdf119954.py
index 0adc2a3cb6bc..99495123fe14 100644
--- a/sc/qa/uitest/range_name/tdf119954.py
+++ b/sc/qa/uitest/range_name/tdf119954.py
@@ -16,66 +16,65 @@ from uitest.uihelper.keyboard import select_all
class tdf119954(UITestCase):
def test_tdf119954_second_db_range(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf119954.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #* new document
- #* in A1 enter 1
- #* in C3 enter 2
- #* on A1 define a database range 'aaa' with $Sheet1.$A$1
- #* on C3 define a database range 'bbb' with $Sheet2.$C$3
- #* in any cell enter formula =bbb
- # => result is 1 instead of 2
- #* place cell cursor on that formula cell again
- # => see that the formula is =aaa instead of =bbb
+ with self.ui_test.load_file(get_url_for_data_file("tdf119954.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #* new document
+ #* in A1 enter 1
+ #* in C3 enter 2
+ #* on A1 define a database range 'aaa' with $Sheet1.$A$1
+ #* on C3 define a database range 'bbb' with $Sheet2.$C$3
+ #* in any cell enter formula =bbb
+ # => result is 1 instead of 2
+ #* place cell cursor on that formula cell again
+ # => see that the formula is =aaa instead of =bbb
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DefineDBName")
- xDefineNameDlg = self.xUITest.getTopFocusWindow()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DefineDBName")
+ xDefineNameDlg = self.xUITest.getTopFocusWindow()
- xEntryBox = xDefineNameDlg.getChild("entry")
- type_text(xEntryBox, "aaa")
- add = xDefineNameDlg.getChild("add")
- assign = xDefineNameDlg.getChild("assign")
- add.executeAction("CLICK", tuple())
- xOkBtn = xDefineNameDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xEntryBox = xDefineNameDlg.getChild("entry")
+ type_text(xEntryBox, "aaa")
+ add = xDefineNameDlg.getChild("add")
+ assign = xDefineNameDlg.getChild("assign")
+ add.executeAction("CLICK", tuple())
+ xOkBtn = xDefineNameDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:DefineDBName")
- xDefineNameDlg = self.xUITest.getTopFocusWindow()
- xEntryBox = xDefineNameDlg.getChild("entry")
- assign = xDefineNameDlg.getChild("assign")
- select_all(xEntryBox)
- type_text(xEntryBox, "bbb")
- select_all(assign)
- type_text(assign, "$Sheet2.$C$3")
- add.executeAction("CLICK", tuple())
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DefineDBName")
+ xDefineNameDlg = self.xUITest.getTopFocusWindow()
+ xEntryBox = xDefineNameDlg.getChild("entry")
+ assign = xDefineNameDlg.getChild("assign")
+ select_all(xEntryBox)
+ type_text(xEntryBox, "bbb")
+ select_all(assign)
+ type_text(assign, "$Sheet2.$C$3")
+ add.executeAction("CLICK", tuple())
- xOkBtn = xDefineNameDlg.getChild("ok")
- self.ui_test.close_dialog_through_button(xOkBtn)
+ xOkBtn = xDefineNameDlg.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOkBtn)
- enter_text_to_cell(gridwin, "B2", "=bbb")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
+ enter_text_to_cell(gridwin, "B2", "=bbb")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
- enter_text_to_cell(gridwin, "C2", "=aaa")
- gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 1)
+ enter_text_to_cell(gridwin, "C2", "=aaa")
+ gridwin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 1)
- self.xUITest.executeCommand(".uno:Undo")
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 0)
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getFormula(), "")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getFormula(), "")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 0)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getFormula(), "")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getFormula(), "")
- # check cancel button
- self.ui_test.execute_modeless_dialog_through_command(".uno:DefineDBName")
- xDefineNameDlg = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDefineNameDlg.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
+ # check cancel button
+ self.ui_test.execute_modeless_dialog_through_command(".uno:DefineDBName")
+ xDefineNameDlg = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDefineNameDlg.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/search_replace/replace.py b/sc/qa/uitest/search_replace/replace.py
index 867482fbeaea..2a6d2a3cd424 100644
--- a/sc/qa/uitest/search_replace/replace.py
+++ b/sc/qa/uitest/search_replace/replace.py
@@ -12,48 +12,47 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class ReplaceTest(UITestCase):
def test_tdf106194(self):
- doc = self.ui_test.load_file(get_url_for_data_file("tdf106194.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf106194.ods")) as doc:
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xSearchDlg = self.xUITest.getTopFocusWindow()
+ xSearchDlg = self.xUITest.getTopFocusWindow()
- xSearchTerm = xSearchDlg.getChild("searchterm")
- xSearchTerm.executeAction("TYPE", mkPropertyValues({"TEXT": "1"}))
- xReplaceTerm = xSearchDlg.getChild("replaceterm")
- xReplaceTerm.executeAction("TYPE", mkPropertyValues({"TEXT": "2"}))
+ xSearchTerm = xSearchDlg.getChild("searchterm")
+ xSearchTerm.executeAction("TYPE", mkPropertyValues({"TEXT": "1"}))
+ xReplaceTerm = xSearchDlg.getChild("replaceterm")
+ xReplaceTerm.executeAction("TYPE", mkPropertyValues({"TEXT": "2"}))
- xSearchBtn = xSearchDlg.getChild("search")
- xSearchBtn.executeAction("CLICK", tuple())
+ xSearchBtn = xSearchDlg.getChild("search")
+ xSearchBtn.executeAction("CLICK", tuple())
- self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "1")
- lastTopVisibleRow = int(get_state_as_dict(xGridWin)["TopVisibleRow"])
+ self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "1")
+ lastTopVisibleRow = int(get_state_as_dict(xGridWin)["TopVisibleRow"])
- # start replacing
- xReplaceBtn = xSearchDlg.getChild("replace")
- xReplaceBtn.executeAction("CLICK", tuple())
+ # start replacing
+ xReplaceBtn = xSearchDlg.getChild("replace")
+ xReplaceBtn.executeAction("CLICK", tuple())
- # check position and visible range
- self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "199")
- currentTopVisibleRow = int(get_state_as_dict(xGridWin)["TopVisibleRow"])
- self.assertGreater(currentTopVisibleRow, lastTopVisibleRow)
+ # check position and visible range
+ self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "199")
+ currentTopVisibleRow = int(get_state_as_dict(xGridWin)["TopVisibleRow"])
+ self.assertGreater(currentTopVisibleRow, lastTopVisibleRow)
- lastTopVisibleRow = currentTopVisibleRow
+ lastTopVisibleRow = currentTopVisibleRow
- # replace again
- xReplaceBtn.executeAction("CLICK", tuple())
+ # replace again
+ xReplaceBtn.executeAction("CLICK", tuple())
- # check position and visible range
- self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "499")
- currentTopVisibleRow = int(get_state_as_dict(xGridWin)["TopVisibleRow"])
- self.assertGreater(currentTopVisibleRow, lastTopVisibleRow)
+ # check position and visible range
+ self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "499")
+ currentTopVisibleRow = int(get_state_as_dict(xGridWin)["TopVisibleRow"])
+ self.assertGreater(currentTopVisibleRow, lastTopVisibleRow)
- xReplaceBtn.executeAction("CLICK", tuple())
+ xReplaceBtn.executeAction("CLICK", tuple())
- xCloseBtn = xSearchDlg.getChild("close")
+ xCloseBtn = xSearchDlg.getChild("close")
- self.ui_test.close_dialog_through_button(xCloseBtn)
+ self.ui_test.close_dialog_through_button(xCloseBtn)
- self.ui_test.close_doc()
diff --git a/sc/qa/uitest/search_replace/tdf132783.py b/sc/qa/uitest/search_replace/tdf132783.py
index 372b3ddb0f5f..5795a5afcf2c 100644
--- a/sc/qa/uitest/search_replace/tdf132783.py
+++ b/sc/qa/uitest/search_replace/tdf132783.py
@@ -11,25 +11,23 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf132783(UITestCase):
def test_tdf132783(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf132783.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf132783.ods")) as calc_doc:
- for i in range(5):
- self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xSearchTerm = xDialog.getChild("searchterm")
+ for i in range(5):
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xSearchTerm = xDialog.getChild("searchterm")
- xSearchTerm.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
+ xSearchTerm.executeAction("TYPE", mkPropertyValues({"TEXT":"1"}))
- xSearch = xDialog.getChild("search")
- xSearch.executeAction("CLICK", tuple())
+ xSearch = xDialog.getChild("search")
+ xSearch.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)
- xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
- self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "1")
- self.assertEqual(get_state_as_dict(xGridWin)["CurrentColumn"], str( 96 + i))
-
- self.ui_test.close_doc()
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ self.assertEqual(get_state_as_dict(xGridWin)["CurrentRow"], "1")
+ self.assertEqual(get_state_as_dict(xGridWin)["CurrentColumn"], str( 96 + i))
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/search_replace/tdf35020.py b/sc/qa/uitest/search_replace/tdf35020.py
index 994bcd21a89d..335d985eadcb 100644
--- a/sc/qa/uitest/search_replace/tdf35020.py
+++ b/sc/qa/uitest/search_replace/tdf35020.py
@@ -16,34 +16,33 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class tdf35020(UITestCase):
def test_tdf39959_find_replace_all_sheets(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf35020.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf35020.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- 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":"X6"}))
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"A6"})) #replace textbox
- allsheets = xDialog.getChild("allsheets")
- allsheets.executeAction("CLICK", tuple())
- calcsearchin = xDialog.getChild("calcsearchin")
- select_by_text(calcsearchin, "Formulas")
- replaceall = xDialog.getChild("replaceall")
- replaceall.executeAction("CLICK", tuple())
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
+ 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":"X6"}))
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"A6"})) #replace textbox
+ allsheets = xDialog.getChild("allsheets")
+ allsheets.executeAction("CLICK", tuple())
+ calcsearchin = xDialog.getChild("calcsearchin")
+ select_by_text(calcsearchin, "Formulas")
+ replaceall = xDialog.getChild("replaceall")
+ replaceall.executeAction("CLICK", tuple())
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
- #verify Sheet1.A13 A14 = 2
- self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 2)
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 1)
- self.ui_test.close_doc()
+ #verify Sheet1.A13 A14 = 2
+ self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 2)
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 12).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 13).getValue(), 1)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/search_replace/tdf39959.py b/sc/qa/uitest/search_replace/tdf39959.py
index b743c4a90f0f..3c05533bc540 100644
--- a/sc/qa/uitest/search_replace/tdf39959.py
+++ b/sc/qa/uitest/search_replace/tdf39959.py
@@ -15,38 +15,37 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class tdf39959(UITestCase):
def test_tdf39959_find_replace_all_sheets(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf39959.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf39959.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- # 1. Open a new document
- # 2. Enter "asdf" in A1
- # 3. Activate Sheet2
- # 4. Try Find-and-replace (Ctrl+Alt+F) to search for "asdf"
- # Whether the checkbox "in allen Tabellen suchen" is activated or not: LibO Calc never seems to find the text
+ # 1. Open a new document
+ # 2. Enter "asdf" in A1
+ # 3. Activate Sheet2
+ # 4. Try Find-and-replace (Ctrl+Alt+F) to search for "asdf"
+ # Whether the checkbox "in allen Tabellen suchen" is activated or not: LibO Calc never seems to find the 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":"asdf"}))
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"bbb"})) #replace textbox
- allsheets = xDialog.getChild("allsheets")
- allsheets.executeAction("CLICK", tuple())
- replaceall = xDialog.getChild("replaceall")
- replaceall.executeAction("CLICK", tuple())
- # print(xDialog.getChildren())
- xcloseBtn = xDialog.getChild("close")
- self.ui_test.close_dialog_through_button(xcloseBtn)
+ 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":"asdf"}))
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"bbb"})) #replace textbox
+ allsheets = xDialog.getChild("allsheets")
+ allsheets.executeAction("CLICK", tuple())
+ replaceall = xDialog.getChild("replaceall")
+ replaceall.executeAction("CLICK", tuple())
+ # print(xDialog.getChildren())
+ xcloseBtn = xDialog.getChild("close")
+ self.ui_test.close_dialog_through_button(xcloseBtn)
- #verify Sheet2.A1 = "bbb"
- self.assertEqual(get_cell_by_position(document, 1, 0, 0).getString(), "bbb ")
- self.assertEqual(get_cell_by_position(document, 1, 0, 2).getString(), "abc")
- #Undo
- self.xUITest.executeCommand(".uno:Undo")
- self.assertEqual(get_cell_by_position(document, 1, 0, 0).getString(), "asdf ")
- self.ui_test.close_doc()
+ #verify Sheet2.A1 = "bbb"
+ self.assertEqual(get_cell_by_position(document, 1, 0, 0).getString(), "bbb ")
+ self.assertEqual(get_cell_by_position(document, 1, 0, 2).getString(), "abc")
+ #Undo
+ self.xUITest.executeCommand(".uno:Undo")
+ self.assertEqual(get_cell_by_position(document, 1, 0, 0).getString(), "asdf ")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/search_replace/tdf44861.py b/sc/qa/uitest/search_replace/tdf44861.py
index 1df8e8e6b012..37947ff9d3de 100644
--- a/sc/qa/uitest/search_replace/tdf44861.py
+++ b/sc/qa/uitest/search_replace/tdf44861.py
@@ -15,39 +15,37 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, typ
class tdf44861(UITestCase):
def test_tdf44861_find_replaceAll_regexp(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf44861.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- # 2. ctrl-h, in dialog
- # Search: ([0-9]{2})([0-9]{2})
- # Replace: $1.$2
- # check option "Enable regular expressions"
- # Press "Replace all"
+ with self.ui_test.load_file(get_url_for_data_file("tdf44861.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ # 2. ctrl-h, in dialog
+ # Search: ([0-9]{2})([0-9]{2})
+ # Replace: $1.$2
+ # check option "Enable regular expressions"
+ # 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":"([0-9]{2})([0-9]{2})"}))
- replaceterm = xDialog.getChild("replaceterm")
- replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"$1.$2"})) #replace textbox
- regexp = xDialog.getChild("regexp")
- if (get_state_as_dict(regexp)["Selected"]) == "false":
- 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.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]{2})([0-9]{2})"}))
+ replaceterm = xDialog.getChild("replaceterm")
+ replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"$1.$2"})) #replace textbox
+ regexp = xDialog.getChild("regexp")
+ if (get_state_as_dict(regexp)["Selected"]) == "false":
+ 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)
- #Expected: instead of 1345-1430 appears 13.45-14.30
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "13.45-14.30")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "13.45-14.30")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "14.50-15.30")
- self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "12.55-13.35")
- self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "12.30-13.40")
-
- self.ui_test.close_doc()
+ #Expected: instead of 1345-1430 appears 13.45-14.30
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "13.45-14.30")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "13.45-14.30")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "14.50-15.30")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "12.55-13.35")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 4).getString(), "12.30-13.40")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/solver/solver.py b/sc/qa/uitest/solver/solver.py
index e8d62ae789fb..762773e8635f 100644
--- a/sc/qa/uitest/solver/solver.py
+++ b/sc/qa/uitest/solver/solver.py
@@ -14,39 +14,38 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class solver(UITestCase):
def test_solver(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("solver.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B4"}))
- self.ui_test.execute_modeless_dialog_through_command(".uno:SolverDialog")
- xDialog = self.xUITest.getTopFocusWindow()
- xtargetedit = xDialog.getChild("targetedit")
- xvalue = xDialog.getChild("value")
- xvalueedit = xDialog.getChild("valueedit")
- xchangeedit = xDialog.getChild("changeedit")
- xref1edit = xDialog.getChild("ref1edit")
- xval1edit = xDialog.getChild("val1edit")
- xref2edit = xDialog.getChild("ref2edit")
- xval2edit = xDialog.getChild("val2edit")
- xop2list = xDialog.getChild("op2list")
+ with self.ui_test.load_file(get_url_for_data_file("solver.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B4"}))
+ self.ui_test.execute_modeless_dialog_through_command(".uno:SolverDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xtargetedit = xDialog.getChild("targetedit")
+ xvalue = xDialog.getChild("value")
+ xvalueedit = xDialog.getChild("valueedit")
+ xchangeedit = xDialog.getChild("changeedit")
+ xref1edit = xDialog.getChild("ref1edit")
+ xval1edit = xDialog.getChild("val1edit")
+ xref2edit = xDialog.getChild("ref2edit")
+ xval2edit = xDialog.getChild("val2edit")
+ xop2list = xDialog.getChild("op2list")
- xvalue.executeAction("CLICK", tuple())
- xvalueedit.executeAction("TYPE", mkPropertyValues({"TEXT":"1000"}))
- xchangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"C2"}))
- xref1edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C2"}))
- xval1edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C4"}))
- xref2edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C4"}))
- select_by_text(xop2list, "=>")
+ xvalue.executeAction("CLICK", tuple())
+ xvalueedit.executeAction("TYPE", mkPropertyValues({"TEXT":"1000"}))
+ xchangeedit.executeAction("TYPE", mkPropertyValues({"TEXT":"C2"}))
+ xref1edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C2"}))
+ xval1edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C4"}))
+ xref2edit.executeAction("TYPE", mkPropertyValues({"TEXT":"C4"}))
+ select_by_text(xop2list, "=>")
- xval2edit.executeAction("TYPE", mkPropertyValues({"TEXT":"0"}))
- xOKBtn = xDialog.getChild("ok")
+ xval2edit.executeAction("TYPE", mkPropertyValues({"TEXT":"0"}))
+ xOKBtn = xDialog.getChild("ok")
- with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ())):
- pass
+ with self.ui_test.execute_blocking_action(xOKBtn.executeAction, args=('CLICK', ())):
+ pass
- #verify
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 400)
- self.ui_test.close_doc()
+ #verify
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 400)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/sorting.py b/sc/qa/uitest/sort/sorting.py
index 4b56ceea7c5b..59c00c7b258a 100644
--- a/sc/qa/uitest/sort/sorting.py
+++ b/sc/qa/uitest/sort/sorting.py
@@ -300,4 +300,4 @@ class CalcSorting(UITestCase):
self.ui_test.close_dialog_through_button(xCanc)
self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/stableSorting.py b/sc/qa/uitest/sort/stableSorting.py
index 269bd5252f2b..8b68af659538 100644
--- a/sc/qa/uitest/sort/stableSorting.py
+++ b/sc/qa/uitest/sort/stableSorting.py
@@ -19,49 +19,47 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class CalcStableSorting(UITestCase):
def test_Must_keep_sort_order_previous_sorting_toolbar_button_Ascending(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("stableSorting.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Select cell E1 ("Sales") and press toolbar button for ascending sorting.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"}))
- self.xUITest.executeCommand(".uno:SortAscending")
- #Select cell D1 ("Product") and press toolbar button for ascending sorting.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
- self.xUITest.executeCommand(".uno:SortAscending")
- #Select cell C1 ("Salesman") and press toolbar button for ascending sorting.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- self.xUITest.executeCommand(".uno:SortAscending")
- # Select cell B1 ("Region") and press toolbar button for ascending sorting.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- self.xUITest.executeCommand(".uno:SortAscending")
- #Verify that the numbers in column "CheckOrder" are ascending
- for i in range(1, 501):
- self.assertEqual(get_cell_by_position(document, 0, 5, i).getValue(), i)
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("stableSorting.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Select cell E1 ("Sales") and press toolbar button for ascending sorting.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"}))
+ self.xUITest.executeCommand(".uno:SortAscending")
+ #Select cell D1 ("Product") and press toolbar button for ascending sorting.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ self.xUITest.executeCommand(".uno:SortAscending")
+ #Select cell C1 ("Salesman") and press toolbar button for ascending sorting.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ self.xUITest.executeCommand(".uno:SortAscending")
+ # Select cell B1 ("Region") and press toolbar button for ascending sorting.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ self.xUITest.executeCommand(".uno:SortAscending")
+ #Verify that the numbers in column "CheckOrder" are ascending
+ for i in range(1, 501):
+ self.assertEqual(get_cell_by_position(document, 0, 5, i).getValue(), i)
def test_Must_keep_sort_order_previous_sorting_toolbar_button_Descending(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("stableSorting.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #Select cell E1 ("Sales") and press toolbar button for descending sorting.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"}))
- self.xUITest.executeCommand(".uno:SortDescending")
- #Select cell D1 ("Product") and press toolbar button for descending sorting.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
- self.xUITest.executeCommand(".uno:SortDescending")
- #Select cell C1 ("Salesman") and press toolbar button for descending sorting.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
- self.xUITest.executeCommand(".uno:SortDescending")
- # Select cell B1 ("Region") and press toolbar button for descending sorting.
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
- self.xUITest.executeCommand(".uno:SortDescending")
- #Verify that the numbers in column "CheckOrder" are ascending
- for i in range(1, 501):
- j = 501 - i
- self.assertEqual(get_cell_by_position(document, 0, 5, i).getValue(), j)
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("stableSorting.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #Select cell E1 ("Sales") and press toolbar button for descending sorting.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "E1"}))
+ self.xUITest.executeCommand(".uno:SortDescending")
+ #Select cell D1 ("Product") and press toolbar button for descending sorting.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ self.xUITest.executeCommand(".uno:SortDescending")
+ #Select cell C1 ("Salesman") and press toolbar button for descending sorting.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ self.xUITest.executeCommand(".uno:SortDescending")
+ # Select cell B1 ("Region") and press toolbar button for descending sorting.
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ self.xUITest.executeCommand(".uno:SortDescending")
+ #Verify that the numbers in column "CheckOrder" are ascending
+ for i in range(1, 501):
+ j = 501 - i
+ self.assertEqual(get_cell_by_position(document, 0, 5, i).getValue(), j)
# def test_Must_keep_sort_order_previous_sorting_using_sort_dialog(self):
# cannot test for now - criteria names are identical - Markus https://gerrit.libreoffice.org/#/c/52534/
diff --git a/sc/qa/uitest/sort/subtotals.py b/sc/qa/uitest/sort/subtotals.py
index b17dbb73cbf4..1445a1d87dc2 100644
--- a/sc/qa/uitest/sort/subtotals.py
+++ b/sc/qa/uitest/sort/subtotals.py
@@ -49,128 +49,124 @@ class Subtotals(UITestCase):
self.ui_test.close_doc()
def test_tdf88792(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf88792.ods"))
- XcalcDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- gridwin = XcalcDoc.getChild("grid_window")
-
- # go to cell A1
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- # Select from the menu bar Data
- # Select option subtotal
- # Subtotal dialog displays
- self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
- xDialog = self.xUITest.getTopFocusWindow()
- # Select group by: Category
- xGroupBy = xDialog.getChild("group_by")
- select_by_text(xGroupBy, "Category")
- # Select calculate subtotals for the months - selected by default
- # Select tab options
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "3")
- # select option include formats
- xformats = xDialog.getChild("formats")
- xformats.executeAction("CLICK", tuple())
- # apply with OK
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertEqual(get_cell_by_position(document, 0, 3, 5).getValue(), 28000)
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf88792.ods")) as calc_doc:
+ XcalcDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ gridwin = XcalcDoc.getChild("grid_window")
+
+ # go to cell A1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ # Select from the menu bar Data
+ # Select option subtotal
+ # Subtotal dialog displays
+ self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # Select group by: Category
+ xGroupBy = xDialog.getChild("group_by")
+ select_by_text(xGroupBy, "Category")
+ # Select calculate subtotals for the months - selected by default
+ # Select tab options
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "3")
+ # select option include formats
+ xformats = xDialog.getChild("formats")
+ xformats.executeAction("CLICK", tuple())
+ # apply with OK
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(get_cell_by_position(document, 0, 3, 5).getValue(), 28000)
def test_tdf88735(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf88735.ods"))
- XcalcDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- gridwin = XcalcDoc.getChild("grid_window")
- # 1 select all cells
- self.xUITest.executeCommand(".uno:SelectAll")#use uno command Menu Edit->Select All
- # 2 invoke sub-total menu and select none
- self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
- xDialog = self.xUITest.getTopFocusWindow()
- xGroupBy = xDialog.getChild("group_by")
- select_by_text(xGroupBy, "- none -")
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- # 2 invoke sort menu and... crash
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xCancelBtn = xDialog.getChild("cancel")
- self.ui_test.close_dialog_through_button(xCancelBtn)
-
- self.assertEqual(get_cell_by_position(document, 0, 0, 8).getString(), "z")
- self.assertEqual(get_cell_by_position(document, 0, 1, 8).getValue(), 8)
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf88735.ods")) as calc_doc:
+ XcalcDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ gridwin = XcalcDoc.getChild("grid_window")
+ # 1 select all cells
+ self.xUITest.executeCommand(".uno:SelectAll")#use uno command Menu Edit->Select All
+ # 2 invoke sub-total menu and select none
+ self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xGroupBy = xDialog.getChild("group_by")
+ select_by_text(xGroupBy, "- none -")
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ # 2 invoke sort menu and... crash
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xCancelBtn = xDialog.getChild("cancel")
+ self.ui_test.close_dialog_through_button(xCancelBtn)
+
+ self.assertEqual(get_cell_by_position(document, 0, 0, 8).getString(), "z")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 8).getValue(), 8)
def test_tdf56958(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf56958.ods"))
- XcalcDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- gridwin = XcalcDoc.getChild("grid_window")
- # 1. Open the test file
- # 2. Data->Subtotals
- self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
- xDialog = self.xUITest.getTopFocusWindow()
- # 3. Group by->Trans date
- xGroupBy = xDialog.getChild("group_by")
- select_by_text(xGroupBy, "Trans Date")
- # 4. Tick 'Calculate subtotals for' -> Amount (grid1)
- xCheckListMenu = xDialog.getChild("grid1")
- xTreeList = xCheckListMenu.getChild("columns")
- xFirstEntry = xTreeList.getChild("2")
- xFirstEntry.executeAction("CLICK", tuple())
- # 5. Click OK
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- # 6. Data->Subtotals
- self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
- xDialog = self.xUITest.getTopFocusWindow()
- # 7. Group by->-none-
- xGroupBy = xDialog.getChild("group_by")
- select_by_text(xGroupBy, "- none -")
- # 8. Untick 'Calculate subtotals for' -> Amount
- xCheckListMenu = xDialog.getChild("grid1")
- xTreeList = xCheckListMenu.getChild("columns")
- xFirstEntry = xTreeList.getChild("2")
- xFirstEntry.executeAction("CLICK", tuple())
- # 9. Click OK
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- # 10. Data->Sort
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- # 11. Sort key 1->Post Date.
- sortkey1 = xDialog.getChild("sortlb")
- select_by_text(sortkey1, "Post Date")
- # 12. Sort key 2->-undefined-
- sortkey2 = xDialog.getChild("sortuserlb")
- select_by_text(sortkey2, "- undefined -")
- # 13. Click OK
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), -0.25)
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf56958.ods")) as calc_doc:
+ XcalcDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ gridwin = XcalcDoc.getChild("grid_window")
+ # 1. Open the test file
+ # 2. Data->Subtotals
+ self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # 3. Group by->Trans date
+ xGroupBy = xDialog.getChild("group_by")
+ select_by_text(xGroupBy, "Trans Date")
+ # 4. Tick 'Calculate subtotals for' -> Amount (grid1)
+ xCheckListMenu = xDialog.getChild("grid1")
+ xTreeList = xCheckListMenu.getChild("columns")
+ xFirstEntry = xTreeList.getChild("2")
+ xFirstEntry.executeAction("CLICK", tuple())
+ # 5. Click OK
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ # 6. Data->Subtotals
+ self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # 7. Group by->-none-
+ xGroupBy = xDialog.getChild("group_by")
+ select_by_text(xGroupBy, "- none -")
+ # 8. Untick 'Calculate subtotals for' -> Amount
+ xCheckListMenu = xDialog.getChild("grid1")
+ xTreeList = xCheckListMenu.getChild("columns")
+ xFirstEntry = xTreeList.getChild("2")
+ xFirstEntry.executeAction("CLICK", tuple())
+ # 9. Click OK
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ # 10. Data->Sort
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # 11. Sort key 1->Post Date.
+ sortkey1 = xDialog.getChild("sortlb")
+ select_by_text(sortkey1, "Post Date")
+ # 12. Sort key 2->-undefined-
+ sortkey2 = xDialog.getChild("sortuserlb")
+ select_by_text(sortkey2, "- undefined -")
+ # 13. Click OK
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), -0.25)
def test_tdf55734(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf55734.ods"))
- XcalcDoc = self.xUITest.getTopFocusWindow()
- document = self.ui_test.get_component()
- gridwin = XcalcDoc.getChild("grid_window")
- # 1. Open attached document
- # 2. Place cursor in cell outside of subtotals range (e.g. B7)
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B7"}))
- # 3. Data → Subtotals
- self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
- xDialog = self.xUITest.getTopFocusWindow()
- # 4. Group by: "- none -"
- xGroupBy = xDialog.getChild("group_by")
- select_by_text(xGroupBy, "- none -")
- # 5. Press "OK" and watch LibreOffice crash.
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
-
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 1)
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf55734.ods")) as calc_doc:
+ XcalcDoc = self.xUITest.getTopFocusWindow()
+ document = self.ui_test.get_component()
+ gridwin = XcalcDoc.getChild("grid_window")
+ # 1. Open attached document
+ # 2. Place cursor in cell outside of subtotals range (e.g. B7)
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B7"}))
+ # 3. Data → Subtotals
+ self.ui_test.execute_dialog_through_command(".uno:DataSubTotals")
+ xDialog = self.xUITest.getTopFocusWindow()
+ # 4. Group by: "- none -"
+ xGroupBy = xDialog.getChild("group_by")
+ select_by_text(xGroupBy, "- none -")
+ # 5. Press "OK" and watch LibreOffice crash.
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 2)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/tdf105301.py b/sc/qa/uitest/sort/tdf105301.py
index 48cb62ec9252..2a93df6b57b9 100644
--- a/sc/qa/uitest/sort/tdf105301.py
+++ b/sc/qa/uitest/sort/tdf105301.py
@@ -12,33 +12,31 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf105301(UITestCase):
def test_tdf105301(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf105301.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
-
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:R9"}))
-
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- self.assertEqual("Column B", get_state_as_dict(xDialog.getChild("sortlb"))['DisplayText'])
- self.assertEqual("Column C", get_state_as_dict(xDialog.getChild("sortlb2"))['DisplayText'])
- self.assertEqual("Column D", get_state_as_dict(xDialog.getChild("sortlb3"))['DisplayText'])
-
- # Without the fix in place, this test would have failed with
- # AssertionError: 'Column E' != '- undefined -'
- self.assertEqual("Column E", get_state_as_dict(xDialog.getChild("sortlb4"))['DisplayText'])
- self.assertEqual("Column F", get_state_as_dict(xDialog.getChild("sortlb5"))['DisplayText'])
- self.assertEqual("Column G", get_state_as_dict(xDialog.getChild("sortlb6"))['DisplayText'])
-
- # tdf#51828: Without the fix in place, this test would have failed here
- self.assertEqual("- undefined -", get_state_as_dict(xDialog.getChild("sortlb7"))['DisplayText'])
-
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf105301.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:R9"}))
+
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ self.assertEqual("Column B", get_state_as_dict(xDialog.getChild("sortlb"))['DisplayText'])
+ self.assertEqual("Column C", get_state_as_dict(xDialog.getChild("sortlb2"))['DisplayText'])
+ self.assertEqual("Column D", get_state_as_dict(xDialog.getChild("sortlb3"))['DisplayText'])
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'Column E' != '- undefined -'
+ self.assertEqual("Column E", get_state_as_dict(xDialog.getChild("sortlb4"))['DisplayText'])
+ self.assertEqual("Column F", get_state_as_dict(xDialog.getChild("sortlb5"))['DisplayText'])
+ self.assertEqual("Column G", get_state_as_dict(xDialog.getChild("sortlb6"))['DisplayText'])
+
+ # tdf#51828: Without the fix in place, this test would have failed here
+ self.assertEqual("- undefined -", get_state_as_dict(xDialog.getChild("sortlb7"))['DisplayText'])
+
+ 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/sort/tdf49531.py b/sc/qa/uitest/sort/tdf49531.py
index 1d66f6a36c5a..fc1a5a05afd4 100644
--- a/sc/qa/uitest/sort/tdf49531.py
+++ b/sc/qa/uitest/sort/tdf49531.py
@@ -17,46 +17,45 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf49531(UITestCase):
def test_td49531_sort_undo_crash(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf49531.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #select A3:C147
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A3:C147"}))
+ with self.ui_test.load_file(get_url_for_data_file("tdf49531.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #select A3:C147
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A3:C147"}))
- #Menu 'Data -> Sort -> Top to bottom - all otheroptions unchecked
- #Column B - Ascending' <ok>
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- xNatural = xDialog.getChild("naturalsort")
- xtopdown = xDialog.getChild("topdown")
- xHeader = xDialog.getChild("header")
- if (get_state_as_dict(xNatural)["Selected"]) == "true":
- xNatural.executeAction("CLICK", tuple())
- if (get_state_as_dict(xHeader)["Selected"]) == "true":
- xHeader.executeAction("CLICK", tuple())
- xtopdown.executeAction("CLICK", tuple())
- select_pos(xTabs, "0")
- xSortKey1 = xDialog.getChild("sortlb")
- xAsc = xDialog.getChild("up")
- select_by_text(xSortKey1, "Column B")
- xAsc.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(), "x")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "0")
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 111)
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 48)
- # UNDO Bug 49520 - EDITING: CRASH when undo sort with chart
- self.xUITest.executeCommand(".uno:Undo")
- # Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "x")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "0")
- self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 2)
- self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
- self.ui_test.close_doc()
+ #Menu 'Data -> Sort -> Top to bottom - all otheroptions unchecked
+ #Column B - Ascending' <ok>
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ xNatural = xDialog.getChild("naturalsort")
+ xtopdown = xDialog.getChild("topdown")
+ xHeader = xDialog.getChild("header")
+ if (get_state_as_dict(xNatural)["Selected"]) == "true":
+ xNatural.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xHeader)["Selected"]) == "true":
+ xHeader.executeAction("CLICK", tuple())
+ xtopdown.executeAction("CLICK", tuple())
+ select_pos(xTabs, "0")
+ xSortKey1 = xDialog.getChild("sortlb")
+ xAsc = xDialog.getChild("up")
+ select_by_text(xSortKey1, "Column B")
+ xAsc.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(), "x")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "0")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 111)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 48)
+ # UNDO Bug 49520 - EDITING: CRASH when undo sort with chart
+ self.xUITest.executeCommand(".uno:Undo")
+ # Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "x")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "0")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 3)
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/tdf53482.py b/sc/qa/uitest/sort/tdf53482.py
index 1e6fa01b404a..2058f1888f93 100644
--- a/sc/qa/uitest/sort/tdf53482.py
+++ b/sc/qa/uitest/sort/tdf53482.py
@@ -17,37 +17,35 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf53482(UITestCase):
def test_tdf53482_Range_contains_column_headings_file(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf53482.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #1. Highlight cells to be sorted A8:J124
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A8:J124"}))
- #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.load_file(get_url_for_data_file("tdf53482.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #1. Highlight cells to be sorted A8:J124
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A8:J124"}))
+ #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())
- xSortKey1 = xDialog.getChild("sortlb")
- select_by_text(xSortKey1, "Occupation")
- #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, 6, 7).getString(), "Occupation")
- self.assertEqual(get_cell_by_position(document, 0, 6, 8).getString(), "Travel Industry")
- self.assertEqual(get_cell_by_position(document, 0, 6, 123).getString(), "13")
-
- 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())
+ xSortKey1 = xDialog.getChild("sortlb")
+ select_by_text(xSortKey1, "Occupation")
+ #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, 6, 7).getString(), "Occupation")
+ self.assertEqual(get_cell_by_position(document, 0, 6, 8).getString(), "Travel Industry")
+ 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")
diff --git a/sc/qa/uitest/sort/tdf54018.py b/sc/qa/uitest/sort/tdf54018.py
index db5085e9266c..ece3a7fa2cc0 100644
--- a/sc/qa/uitest/sort/tdf54018.py
+++ b/sc/qa/uitest/sort/tdf54018.py
@@ -16,34 +16,32 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf54018(UITestCase):
def test_td54018_sort_with_comments(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf54018.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf54018.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- #click top left columns / rows heading field to select all cells
- self.xUITest.executeCommand(".uno:SelectAll")
- #Menu 'Data -> Sort -> Column D -> Descending' <ok>
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "0")
- xSortKey1 = xDialog.getChild("sortlb")
- xdown = xDialog.getChild("down")
- select_by_text(xSortKey1, "Column B")
- xdown.executeAction("CLICK", tuple())
- xOKBtn = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOKBtn)
- #Bug: When progress bar reaches 40% LibO Stops responding
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "7")
- self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "6")
- self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "5")
- self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "4")
- self.assertEqual(get_cell_by_position(document, 0, 1, 4).getString(), "3")
- self.assertEqual(get_cell_by_position(document, 0, 1, 5).getString(), "2")
- self.assertEqual(get_cell_by_position(document, 0, 1, 6).getString(), "1")
-
- self.ui_test.close_doc()
+ #click top left columns / rows heading field to select all cells
+ self.xUITest.executeCommand(".uno:SelectAll")
+ #Menu 'Data -> Sort -> Column D -> Descending' <ok>
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "0")
+ xSortKey1 = xDialog.getChild("sortlb")
+ xdown = xDialog.getChild("down")
+ select_by_text(xSortKey1, "Column B")
+ xdown.executeAction("CLICK", tuple())
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+ #Bug: When progress bar reaches 40% LibO Stops responding
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "7")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "6")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "5")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getString(), "4")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 4).getString(), "3")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 5).getString(), "2")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 6).getString(), "1")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/tdf57465.py b/sc/qa/uitest/sort/tdf57465.py
index 9f03d09fa798..26cdd6bdbf52 100644
--- a/sc/qa/uitest/sort/tdf57465.py
+++ b/sc/qa/uitest/sort/tdf57465.py
@@ -13,42 +13,40 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf57465(UITestCase):
def test_tdf57465(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf57465.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf57465.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:G4"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B1:G4"}))
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
- xHeader = xDialog.getChild("header")
- if (get_state_as_dict(xHeader)["Selected"]) == 'true':
- xHeader.executeAction("CLICK", tuple())
+ xHeader = xDialog.getChild("header")
+ if (get_state_as_dict(xHeader)["Selected"]) == 'true':
+ xHeader.executeAction("CLICK", tuple())
- xLeftRight = xDialog.getChild("leftright")
- xLeftRight.executeAction("CLICK", tuple())
+ xLeftRight = xDialog.getChild("leftright")
+ xLeftRight.executeAction("CLICK", tuple())
- select_pos(xTabs, "0")
+ select_pos(xTabs, "0")
- self.assertEqual("Row 1", get_state_as_dict(xDialog.getChild("sortlb"))['DisplayText'])
+ self.assertEqual("Row 1", get_state_as_dict(xDialog.getChild("sortlb"))['DisplayText'])
- 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.assertEqual("a", get_cell_by_position(document, 0, 1, 1).getString())
+ self.assertEqual("a", get_cell_by_position(document, 0, 1, 1).getString())
- # Without the fix in place, this test would have failed with
- # AssertionError: 'b' != ''
- self.assertEqual("b", get_cell_by_position(document, 0, 2, 2).getString())
- self.assertEqual("c", get_cell_by_position(document, 0, 3, 3).getString())
- self.assertEqual("d", get_cell_by_position(document, 0, 4, 1).getString())
- self.assertEqual("e", get_cell_by_position(document, 0, 5, 2).getString())
- self.assertEqual("f", get_cell_by_position(document, 0, 6, 3).getString())
-
- self.ui_test.close_doc()
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'b' != ''
+ self.assertEqual("b", get_cell_by_position(document, 0, 2, 2).getString())
+ self.assertEqual("c", get_cell_by_position(document, 0, 3, 3).getString())
+ self.assertEqual("d", get_cell_by_position(document, 0, 4, 1).getString())
+ self.assertEqual("e", get_cell_by_position(document, 0, 5, 2).getString())
+ self.assertEqual("f", get_cell_by_position(document, 0, 6, 3).getString())
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/tdf91305.py b/sc/qa/uitest/sort/tdf91305.py
index eae7e8c4555e..340efdb3a531 100644
--- a/sc/qa/uitest/sort/tdf91305.py
+++ b/sc/qa/uitest/sort/tdf91305.py
@@ -137,4 +137,4 @@ class tdf91305(UITestCase):
self.assertEqual(get_cell_by_position(document, 0, 0, 3).getString(), "ff")
self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/tdf95192.py b/sc/qa/uitest/sort/tdf95192.py
index be310f6a4eb1..b3d7b1d069e6 100644
--- a/sc/qa/uitest/sort/tdf95192.py
+++ b/sc/qa/uitest/sort/tdf95192.py
@@ -14,34 +14,32 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf95192(UITestCase):
def test_td99627_natural_sort(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf95192.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf95192.ods")) as calc_doc:
+ 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"}))
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- xNatural = xDialog.getChild("naturalsort")
- xNatural.executeAction("CLICK", tuple())
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Sal. Capra 1/17")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Sal. Capra 1/20")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "Sal. Oregina 1/2")
- self.assertEqual(get_cell_by_position(document, 0, 0, 41).getString(), "Vico Chiuso Cinque Santi 18/10")
- #UNDO
- self.xUITest.executeCommand(".uno:Undo")
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Sal. Oregina 1/2")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Via A. Centurione 11/7")
- self.assertEqual(get_cell_by_position(document, 0, 0, 41).getString(), "Vico Chiuso Cinque Santi 18/10")
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ xNatural = xDialog.getChild("naturalsort")
+ xNatural.executeAction("CLICK", tuple())
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Sal. Capra 1/17")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Sal. Capra 1/20")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "Sal. Oregina 1/2")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 41).getString(), "Vico Chiuso Cinque Santi 18/10")
+ #UNDO
+ self.xUITest.executeCommand(".uno:Undo")
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "Sal. Oregina 1/2")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "Via A. Centurione 11/7")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 41).getString(), "Vico Chiuso Cinque Santi 18/10")
- self.ui_test.close_doc()
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/tdf99208.py b/sc/qa/uitest/sort/tdf99208.py
index 1b9680a19cb7..dd037792dda1 100644
--- a/sc/qa/uitest/sort/tdf99208.py
+++ b/sc/qa/uitest/sort/tdf99208.py
@@ -16,49 +16,47 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf99208(UITestCase):
def test_td99627_natural_sort(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf99208.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #select A3:C245
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C245"}))
+ with self.ui_test.load_file(get_url_for_data_file("tdf99208.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #select A3:C245
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C245"}))
- #Menu 'Data -> Sort
- #Column A - Ascending' <ok>
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- xNatural = xDialog.getChild("naturalsort")
- xtopdown = xDialog.getChild("topdown")
- xHeader = xDialog.getChild("header")
- xFormats = xDialog.getChild("formats")
- if (get_state_as_dict(xNatural)["Selected"]) == "false":
- xNatural.executeAction("CLICK", tuple())
- if (get_state_as_dict(xHeader)["Selected"]) == "false":
- xHeader.executeAction("CLICK", tuple())
- if (get_state_as_dict(xFormats)["Selected"]) == "false":
- xFormats.executeAction("CLICK", tuple())
- xtopdown.executeAction("CLICK", tuple())
- select_pos(xTabs, "0")
- xSortKey1 = xDialog.getChild("sortlb")
- xAsc = xDialog.getChild("up")
- select_by_text(xSortKey1, "FODMAP")
- xAsc.executeAction("CLICK", tuple())
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
- #Verify Expected: Values column B sorted ascending, column "control" unsorted
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "FODMAP")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "agave")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "almond milk")
- self.assertEqual(get_cell_by_position(document, 0, 0, 244).getString(), "zucchini")
- # UNDO
- self.xUITest.executeCommand(".uno:Undo")
- # Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "FODMAP")
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "beef (grass fed, no breadcrumbs)")
- self.assertEqual(get_cell_by_position(document, 0, 0, 244).getString(), "salsa")
-
- self.ui_test.close_doc()
+ #Menu 'Data -> Sort
+ #Column A - Ascending' <ok>
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ xNatural = xDialog.getChild("naturalsort")
+ xtopdown = xDialog.getChild("topdown")
+ xHeader = xDialog.getChild("header")
+ xFormats = xDialog.getChild("formats")
+ if (get_state_as_dict(xNatural)["Selected"]) == "false":
+ xNatural.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xHeader)["Selected"]) == "false":
+ xHeader.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xFormats)["Selected"]) == "false":
+ xFormats.executeAction("CLICK", tuple())
+ xtopdown.executeAction("CLICK", tuple())
+ select_pos(xTabs, "0")
+ xSortKey1 = xDialog.getChild("sortlb")
+ xAsc = xDialog.getChild("up")
+ select_by_text(xSortKey1, "FODMAP")
+ xAsc.executeAction("CLICK", tuple())
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+ #Verify Expected: Values column B sorted ascending, column "control" unsorted
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "FODMAP")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "agave")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "almond milk")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 244).getString(), "zucchini")
+ # UNDO
+ self.xUITest.executeCommand(".uno:Undo")
+ # Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "FODMAP")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "beef (grass fed, no breadcrumbs)")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 244).getString(), "salsa")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/sort/tdf99627.py b/sc/qa/uitest/sort/tdf99627.py
index d5071adeae79..0be80c388586 100644
--- a/sc/qa/uitest/sort/tdf99627.py
+++ b/sc/qa/uitest/sort/tdf99627.py
@@ -15,34 +15,32 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class tdf99627(UITestCase):
def test_td99627_natural_sort(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf99627.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("tdf99627.ods")) as calc_doc:
+ 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"}))
- #Open sort dialog by DATA - SORT
- self.ui_test.execute_dialog_through_command(".uno:DataSort")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- xNatural = xDialog.getChild("naturalsort")
- xdown = xDialog.getChild("down")
- xNatural.executeAction("CLICK", tuple())
- select_pos(xTabs, "0")
- xdown.executeAction("CLICK", tuple())
- xOk = xDialog.getChild("ok")
- self.ui_test.close_dialog_through_button(xOk)
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "2998")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2998).getString(), "1")
- #UNDO
- self.xUITest.executeCommand(".uno:Undo")
- #Verify
- self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "1")
- self.assertEqual(get_cell_by_position(document, 0, 0, 2998).getString(), "2998")
+ #Open sort dialog by DATA - SORT
+ self.ui_test.execute_dialog_through_command(".uno:DataSort")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ xNatural = xDialog.getChild("naturalsort")
+ xdown = xDialog.getChild("down")
+ xNatural.executeAction("CLICK", tuple())
+ select_pos(xTabs, "0")
+ xdown.executeAction("CLICK", tuple())
+ xOk = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOk)
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "2998")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2998).getString(), "1")
+ #UNDO
+ self.xUITest.executeCommand(".uno:Undo")
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2998).getString(), "2998")
- self.ui_test.close_doc()
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/statistics/regression.py b/sc/qa/uitest/statistics/regression.py
index 588b1bea77fc..0102df1f8f92 100644
--- a/sc/qa/uitest/statistics/regression.py
+++ b/sc/qa/uitest/statistics/regression.py
@@ -20,22 +20,21 @@ class regression(UITestCase):
self._regression_check(data_groupedby_column = True)
def _regression_check(self, data_groupedby_column = True):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("regression.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ with self.ui_test.load_file(get_url_for_data_file("regression.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- # Initially the final check status is "FALSE" (failed).
- self.assertEqual(get_cell_by_position(document, 14, 1, 6).getString(), "FALSE",
- "Check status must be FALSE before the test")
- self._do_regression(regression_type = "LINEAR", data_groupedby_column = data_groupedby_column, calc_intercept = True)
- self._do_regression(regression_type = "LINEAR", data_groupedby_column = data_groupedby_column, calc_intercept = False)
- self._do_regression(regression_type = "LOG", data_groupedby_column = data_groupedby_column)
- self._do_regression(regression_type = "POWER", data_groupedby_column = data_groupedby_column)
- self.assertEqual(get_cell_by_position(document, 14, 1, 6).getString(), "TRUE",
- "One of more of the checks failed for data_groupedby_column = {}, manually try with the document".
- format(data_groupedby_column))
- self.ui_test.close_doc()
+ # Initially the final check status is "FALSE" (failed).
+ self.assertEqual(get_cell_by_position(document, 14, 1, 6).getString(), "FALSE",
+ "Check status must be FALSE before the test")
+ self._do_regression(regression_type = "LINEAR", data_groupedby_column = data_groupedby_column, calc_intercept = True)
+ self._do_regression(regression_type = "LINEAR", data_groupedby_column = data_groupedby_column, calc_intercept = False)
+ self._do_regression(regression_type = "LOG", data_groupedby_column = data_groupedby_column)
+ self._do_regression(regression_type = "POWER", data_groupedby_column = data_groupedby_column)
+ self.assertEqual(get_cell_by_position(document, 14, 1, 6).getString(), "TRUE",
+ "One of more of the checks failed for data_groupedby_column = {}, manually try with the document".
+ format(data_groupedby_column))
def _do_regression(self, regression_type, data_groupedby_column = True, calc_intercept = True):
assert(regression_type == "LINEAR" or regression_type == "LOG" or regression_type == "POWER")
diff --git a/sc/qa/uitest/statistics/tdf76731.py b/sc/qa/uitest/statistics/tdf76731.py
index 48db1ff350d2..12cecdab1832 100644
--- a/sc/qa/uitest/statistics/tdf76731.py
+++ b/sc/qa/uitest/statistics/tdf76731.py
@@ -17,52 +17,51 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
class anova(UITestCase):
def test_tdf76731_anova(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf76731.ods"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #1. Open the attached sample document in Calc.
- #2. Select the data range, i.e. A1:C5.
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C5"}))
- #3. Choose Data - Analysis of Variance (ANOVA).
- #4. Choose an arbitrary output cell and click OK.
- 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")
+ with self.ui_test.load_file(get_url_for_data_file("tdf76731.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #1. Open the attached sample document in Calc.
+ #2. Select the data range, i.e. A1:C5.
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:C5"}))
+ #3. Choose Data - Analysis of Variance (ANOVA).
+ #4. Choose an arbitrary output cell and click OK.
+ 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")
- 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, Table of results is shown, "F critical" cell has "#NAME?" error value.
- 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")
+ 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, Table of results is shown, "F critical" cell has "#NAME?" error value.
+ 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, 11, 8).getString(), "F critical")
- self.assertEqual(round(get_cell_by_position(document, 0, 11, 9).getValue(),9), 3.885293835)
+ 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(),9), 3.885293835)
- #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(), "")
- self.ui_test.close_doc()
-# vim: set shiftwidth=4 softtabstop=4 expandtab: \ No newline at end of file
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/textCase/textCase.py b/sc/qa/uitest/textCase/textCase.py
index 711bfa548301..d3823f1dacc6 100644
--- a/sc/qa/uitest/textCase/textCase.py
+++ b/sc/qa/uitest/textCase/textCase.py
@@ -127,35 +127,32 @@ class textCase(UITestCase):
def test_tdf119155_Capitalize_Every_Word(self):
#Bug 119155 - Freeze after command format->text->Capitalize Every Word
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf119155.xlsx"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #1. Open attached file
- #2. Select cells from C2 to C14
- gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C2:C14"}))
- #3. Go to menu: Format->Text->Capitalize Every Word
- self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
- #Actual Results:Freezes LibreOffice
- self.assertEqual(get_cell_by_position(document, 0, 2, 1).getString(), "Collagene Expert Targeted Wrinkle Corrector Unboxed 10 Ml")
- self.assertEqual(get_cell_by_position(document, 0, 2, 13).getString(), "Vitamina Suractivee Hand Cream 400 Ml")
-
- self.ui_test.close_doc()
+ with self.ui_test.load_file(get_url_for_data_file("tdf119155.xlsx")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #1. Open attached file
+ #2. Select cells from C2 to C14
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C2:C14"}))
+ #3. Go to menu: Format->Text->Capitalize Every Word
+ self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
+ #Actual Results:Freezes LibreOffice
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getString(), "Collagene Expert Targeted Wrinkle Corrector Unboxed 10 Ml")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 13).getString(), "Vitamina Suractivee Hand Cream 400 Ml")
def test_tdf119162_Cycle_Case(self):
#Bug 119162 - Format > Text > Cycle Case on attached example file hangs Calc reproducibly
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf119162.xls"))
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
- #1.Open the attached .xls file
- #2. Select column A
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- #3. Select [Format] > [Text] > [Cycle Case]
- self.xUITest.executeCommand(".uno:ChangeCaseRotateCase")
- self.xUITest.executeCommand(".uno:ChangeCaseToLower")
- #Actual Results:Freezes LibreOffice
- self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "test\n")
+ with self.ui_test.load_file(get_url_for_data_file("tdf119162.xls")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
+ #1.Open the attached .xls file
+ #2. Select column A
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ #3. Select [Format] > [Text] > [Cycle Case]
+ self.xUITest.executeCommand(".uno:ChangeCaseRotateCase")
+ self.xUITest.executeCommand(".uno:ChangeCaseToLower")
+ #Actual Results:Freezes LibreOffice
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "test\n")
- self.ui_test.close_doc()
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/validity/tdf137945.py b/sc/qa/uitest/validity/tdf137945.py
index 65f433de5931..4885ab3d5f42 100644
--- a/sc/qa/uitest/validity/tdf137945.py
+++ b/sc/qa/uitest/validity/tdf137945.py
@@ -11,23 +11,21 @@ from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
class Tdf137945(UITestCase):
def test_tdf137945(self):
- calc_doc = self.ui_test.load_file(get_url_for_data_file("tdf137945.ods"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf137945.ods")) as calc_doc:
- self.ui_test.execute_dialog_through_command(".uno:Validation")
- xDialog = self.xUITest.getTopFocusWindow()
- xTabs = xDialog.getChild("tabcontrol")
- select_pos(xTabs, "1")
- xInput = xDialog.getChild("inputhelp")
- xTitle = xDialog.getChild("title")
+ self.ui_test.execute_dialog_through_command(".uno:Validation")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "1")
+ xInput = xDialog.getChild("inputhelp")
+ xTitle = xDialog.getChild("title")
- self.assertEqual("test", get_state_as_dict(xTitle)['Text'])
- # Without the fix in place, this test would have failed with
- # '1 2 3 4 5 10 end' != '1 2 3 4 5 10 end'
- self.assertEqual("1 2 3 4 5 10 end", get_state_as_dict(xInput)['Text'])
+ self.assertEqual("test", get_state_as_dict(xTitle)['Text'])
+ # Without the fix in place, this test would have failed with
+ # '1 2 3 4 5 10 end' != '1 2 3 4 5 10 end'
+ self.assertEqual("1 2 3 4 5 10 end", get_state_as_dict(xInput)['Text'])
- 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: