diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-02-06 13:52:58 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-02-07 09:33:40 +0000 |
commit | 7355c2ee8a9f0811d1cd3d37fc9dac2ad5f95774 (patch) | |
tree | a5fd1f08a00eac447ca2e6b8da00c75cfa947442 /sc/qa/uitest/calc_tests7 | |
parent | ca57cee2ae5718378193a9c7050248c63b5fa47e (diff) |
uitest: reset value when changing the measurement unit
Otherwise, changing it in one test might affect other tests
Use @contextmanager decorator to change it back to default 'Inch'
at the end of the test even if the test hits an assert
Change-Id: I1e7b35019cd19b490aa619c0a866bb9f93820950
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146583
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/uitest/calc_tests7')
-rw-r--r-- | sc/qa/uitest/calc_tests7/tdf137397.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sc/qa/uitest/calc_tests7/tdf137397.py b/sc/qa/uitest/calc_tests7/tdf137397.py index c98a706d20ed..f1d84bf37a63 100644 --- a/sc/qa/uitest/calc_tests7/tdf137397.py +++ b/sc/qa/uitest/calc_tests7/tdf137397.py @@ -17,25 +17,25 @@ class tdf137397(UITestCase): with self.ui_test.load_file(get_url_for_data_file("tdf137397.ods")): - change_measurement_unit(self, 'Centimeter') + with 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.xUITest.executeCommand(".uno:Sidebar") # vim: set shiftwidth=4 softtabstop=4 expandtab: |