diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-06-29 11:35:20 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-06-29 13:26:30 +0200 |
commit | 8fe4a2cb1ad3b4819e069179cc11430c5127613c (patch) | |
tree | f8265029a84d6a97b9abbe90ab66599749892fa0 /uitest/impress_tests/backgrounds.py | |
parent | 8b961addb7887a8b8dc8dbc6758c3dc7c1068ac4 (diff) |
uitest: guard remaining execute_dialog_through_command
Mostly done with a script
for motivation, see 89aaa17a0a4413f07da2bc5084b0164f15dc01ac
< UITest: introduce guarded context managers >
Change-Id: Ib8e7c5f5e2c9b8a7756fe533ea4f30349dd68761
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118076
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'uitest/impress_tests/backgrounds.py')
-rw-r--r-- | uitest/impress_tests/backgrounds.py | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/uitest/impress_tests/backgrounds.py b/uitest/impress_tests/backgrounds.py index 123c7ef81021..1ab001fea91f 100644 --- a/uitest/impress_tests/backgrounds.py +++ b/uitest/impress_tests/backgrounds.py @@ -113,33 +113,27 @@ class ImpressBackgrounds(UITestCase): buttons = ['btnbitmap', 'btncolor', 'btngradient', 'btnhatch', 'btnpattern'] for index, button in enumerate(buttons): - self.ui_test.execute_dialog_through_command(".uno:PageSetup") + with self.ui_test.execute_dialog_through_command_guarded(".uno:PageSetup") as xPageSetupDlg: - xPageSetupDlg = self.xUITest.getTopFocusWindow() - tabcontrol = xPageSetupDlg.getChild("tabcontrol") - select_pos(tabcontrol, "1") + tabcontrol = xPageSetupDlg.getChild("tabcontrol") + select_pos(tabcontrol, "1") - xBtn = xPageSetupDlg.getChild(button) - xBtn.executeAction("CLICK", tuple()) + xBtn = xPageSetupDlg.getChild(button) + xBtn.executeAction("CLICK", tuple()) - # tdf#100024: Without the fix in place, this test would have crashed here - # changing the background to bitmap - xOkBtn = xPageSetupDlg.getChild("ok") - xOkBtn.executeAction("CLICK", tuple()) + # tdf#100024: Without the fix in place, this test would have crashed here + # changing the background to bitmap self.checkDefaultBackground(button) - self.ui_test.execute_dialog_through_command(".uno:PageSetup") + with self.ui_test.execute_dialog_through_command_guarded(".uno:PageSetup") as xPageSetupDlg: - xPageSetupDlg = self.xUITest.getTopFocusWindow() - tabcontrol = xPageSetupDlg.getChild("tabcontrol") - select_pos(tabcontrol, "1") + tabcontrol = xPageSetupDlg.getChild("tabcontrol") + select_pos(tabcontrol, "1") - xBtn = xPageSetupDlg.getChild('btnnone') - xBtn.executeAction("CLICK", tuple()) + xBtn = xPageSetupDlg.getChild('btnnone') + xBtn.executeAction("CLICK", tuple()) - xOkBtn = xPageSetupDlg.getChild("ok") - xOkBtn.executeAction("CLICK", tuple()) self.checkDefaultBackground('btnnone') |