summaryrefslogtreecommitdiff
path: root/sc/qa/uitest/autofilter/tdf97340.py
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/uitest/autofilter/tdf97340.py')
-rw-r--r--sc/qa/uitest/autofilter/tdf97340.py39
1 files changed, 19 insertions, 20 deletions
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: