summaryrefslogtreecommitdiff
path: root/uitest/demo_ui/gridwin.py
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-06-22 11:17:29 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-06-22 21:47:11 +0200
commit374baf308979306aa35575118c40ccd7caae1e29 (patch)
tree2570881a42fe5b5555db1dbf2aecc0a3fdd33878 /uitest/demo_ui/gridwin.py
parentb2331179fc508fd6bc37355e5c3c5a5ee54557c4 (diff)
uitest: guard create_doc_in_start_center
Mostly done by a script for motivation, see 89aaa17a0a4413f07da2bc5084b0164f15dc01ac < UITest: introduce guarded context managers > Change-Id: I75ef7712af3676363a9a464acf83f6f68ffc4f85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117617 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'uitest/demo_ui/gridwin.py')
-rw-r--r--uitest/demo_ui/gridwin.py40
1 files changed, 17 insertions, 23 deletions
diff --git a/uitest/demo_ui/gridwin.py b/uitest/demo_ui/gridwin.py
index ddfb13273bb8..98d4c9c91fd0 100644
--- a/uitest/demo_ui/gridwin.py
+++ b/uitest/demo_ui/gridwin.py
@@ -13,39 +13,33 @@ class GridWinTest(UITestCase):
def test_select_cell(self):
- self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
- selectProps = mkPropertyValues({"CELL": "B10"})
- xGridWindow.executeAction("SELECT", selectProps)
-
- self.ui_test.close_doc()
+ selectProps = mkPropertyValues({"CELL": "B10"})
+ xGridWindow.executeAction("SELECT", selectProps)
def test_select_range(self):
- self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- xGridWindow = xCalcDoc.getChild("grid_window")
-
- selectProps = mkPropertyValues({"RANGE": "B10:C20"})
- xGridWindow.executeAction("SELECT", selectProps)
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ xGridWindow = xCalcDoc.getChild("grid_window")
- self.ui_test.close_doc()
+ selectProps = mkPropertyValues({"RANGE": "B10:C20"})
+ xGridWindow.executeAction("SELECT", selectProps)
def test_extend_range(self):
- self.ui_test.create_doc_in_start_center("calc")
- xTopWindow = self.xUITest.getTopFocusWindow()
-
- xGridWindow = xTopWindow.getChild("grid_window")
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xTopWindow = self.xUITest.getTopFocusWindow()
- selectProps = mkPropertyValues({"RANGE": "B10:C20"})
- xGridWindow.executeAction("SELECT", selectProps)
+ xGridWindow = xTopWindow.getChild("grid_window")
- select2Props = mkPropertyValues({"RANGE": "D3:F5", "EXTEND": "true"})
- xGridWindow.executeAction("SELECT", select2Props)
+ selectProps = mkPropertyValues({"RANGE": "B10:C20"})
+ xGridWindow.executeAction("SELECT", selectProps)
- self.ui_test.close_doc()
+ select2Props = mkPropertyValues({"RANGE": "D3:F5", "EXTEND": "true"})
+ xGridWindow.executeAction("SELECT", select2Props)
# vim: set shiftwidth=4 softtabstop=4 expandtab: