diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-11-17 13:42:15 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-11-17 15:30:35 +0100 |
commit | 192a16d6b0bad2d312b244a5576dfce3f4b05c36 (patch) | |
tree | e7799e3ad824c6985049bcbab93fa2696b5c30ca /sw | |
parent | c48a5f2653f7e76421c140cbd6018deffefccaf9 (diff) |
uitest: sw: Use execute_dialog_through_command and remove sleeps
Change-Id: I5b14248bedc595092729c2c36cefb936ca9d33f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125397
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/uitest/writer_tests7/tdf141158.py | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/sw/qa/uitest/writer_tests7/tdf141158.py b/sw/qa/uitest/writer_tests7/tdf141158.py index 6624530ee3cd..cefb8ed2da7b 100644 --- a/sw/qa/uitest/writer_tests7/tdf141158.py +++ b/sw/qa/uitest/writer_tests7/tdf141158.py @@ -5,26 +5,21 @@ from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict from uitest.uihelper.common import select_pos from uitest.uihelper.common import get_url_for_data_file -import time class TestTdf141158(UITestCase): def test_tdf141158(self): # load the desired bugdoc - with self.ui_test.load_file(get_url_for_data_file("TestHiddenHeadersFooters.docx")): + with self.ui_test.load_file(get_url_for_data_file("TestHiddenHeadersFooters.docx")) as document: xWriterDoc = self.xUITest.getTopFocusWindow() xWriterEdit = xWriterDoc.getChild("writer_edit") - document = self.ui_test.get_component() # open the page styles dialog and select the headers tab - self.xUITest.executeCommand(".uno:PageStyleName") - TemplateDialog8 = self.xUITest.getTopFocusWindow() - xTabs = TemplateDialog8.getChild("tabcontrol") - select_pos(xTabs, "4") - # make the same left right page header state to off and apply the setting - checkSameLR = TemplateDialog8.getChild("checkSameLR") - checkSameLR.executeAction("CLICK",tuple()) - ok = TemplateDialog8.getChild("ok") - self.ui_test.close_dialog_through_button(ok) - time.sleep(1) + with self.ui_test.execute_dialog_through_command(".uno:PageStyleName") as xDialog: + xTabs = xDialog.getChild("tabcontrol") + select_pos(xTabs, "4") + # make the same left right page header state to off and apply the setting + checkSameLR = xDialog.getChild("checkSameLR") + checkSameLR.executeAction("CLICK",tuple()) + # go to the left header xWriterEdit.executeAction("GOTO", mkPropertyValues({"PAGE": "2"})) self.xUITest.executeCommand(".uno:JumpToHeader") @@ -35,6 +30,5 @@ class TestTdf141158(UITestCase): # without the fix in place it was "Right Header" (lost hidden left header), # with the fix it should pass... self.assertEqual("Left Header", xHeaderLeftText) - time.sleep(1) # vim: set shiftwidth=4 softtabstop=4 expandtab: |