diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-02-07 13:24:25 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-02-14 13:18:20 +0000 |
commit | 9ee1b714c13db308c199172ffa0199405ca3d9c3 (patch) | |
tree | cfae854aeaaa8e06dbd32610e1d97f768f091e86 /sc/qa/uitest | |
parent | 4d05f115518615d957bf8cfde15fc61facd28cec (diff) |
sc: use try/finally to reset the changes in OptionsTreeDialog
Otherwise it might affect other tests if it hits an assert
Change-Id: If1d0226860f4befe7f531fda7260c8b4147f2079
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146606
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/uitest')
-rw-r--r-- | sc/qa/uitest/calc_tests8/tdf126248.py | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/sc/qa/uitest/calc_tests8/tdf126248.py b/sc/qa/uitest/calc_tests8/tdf126248.py index dce58b03bbba..9e65f9c3d5b3 100644 --- a/sc/qa/uitest/calc_tests8/tdf126248.py +++ b/sc/qa/uitest/calc_tests8/tdf126248.py @@ -52,36 +52,38 @@ class tdf126248(UITestCase): with self.ui_test.create_doc_in_start_center("calc"): - self.changeLocalSetting("Chinese (traditional)") + try: + self.changeLocalSetting("Chinese (traditional)") - with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog: - xTabs = xDialog.getChild("tabcontrol") - select_pos(xTabs, "1") + with self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog: + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "1") - # Get current font names from the Format Cell dialog - westFontName = get_state_as_dict(xDialog.getChild("edWestFontName"))['Text'] - eastFontName = get_state_as_dict(xDialog.getChild("edCJKFontName"))['Text'] + # Get current font names from the Format Cell dialog + westFontName = get_state_as_dict(xDialog.getChild("edWestFontName"))['Text'] + eastFontName = get_state_as_dict(xDialog.getChild("edCJKFontName"))['Text'] - xCalcDoc = self.xUITest.getTopFocusWindow() - gridwin = xCalcDoc.getChild("grid_window") + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") - enter_text_to_cell(gridwin, "A1", "Test") + enter_text_to_cell(gridwin, "A1", "Test") - # Without the fix in place, this test would have failed here - self.assertFontName(gridwin, westFontName) + # Without the fix in place, this test would have failed here + self.assertFontName(gridwin, westFontName) - enter_text_to_cell(gridwin, "B1", "測試") + enter_text_to_cell(gridwin, "B1", "測試") - self.assertFontName(gridwin, eastFontName) + self.assertFontName(gridwin, eastFontName) - self.changeLocalSetting("English (USA)") + finally: + self.changeLocalSetting("English (USA)") - enter_text_to_cell(gridwin, "C1", "Test") + enter_text_to_cell(gridwin, "C1", "Test") - self.assertFontName(gridwin, westFontName) + self.assertFontName(gridwin, westFontName) - enter_text_to_cell(gridwin, "D1", "測試") + enter_text_to_cell(gridwin, "D1", "測試") - self.assertFontName(gridwin, eastFontName) + self.assertFontName(gridwin, eastFontName) # vim: set shiftwidth=4 softtabstop=4 expandtab: |