tdf#138596: sw: Add UItest

Change-Id: I59b78fe12e1c95e23ac3f7145ca802375ba98cfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107081
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/qa/uitest/options/optionsDialog.py b/sw/qa/uitest/options/optionsDialog.py
index d991eae..cf1229e 100644
--- a/sw/qa/uitest/options/optionsDialog.py
+++ b/sw/qa/uitest/options/optionsDialog.py
@@ -40,4 +40,27 @@ class optionsDialog(UITestCase):

        self.ui_test.close_doc()

    def test_tdf138596(self):
        self.ui_test.create_doc_in_start_center("writer")

        self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog")
        xDialog = self.xUITest.getTopFocusWindow()
        xPages = xDialog.getChild("pages")
        xWriterEntry = xPages.getChild('3')
        xWriterEntry.executeAction("EXPAND", tuple())
        xFormattingAidsEntry = xWriterEntry.getChild('2')
        xFormattingAidsEntry.executeAction("SELECT", tuple())

        xApplyBtn = xDialog.getChild("apply")

        # Click apply button twice
        # Without the fix in place, this test would have crashed here
        xApplyBtn.executeAction("CLICK", tuple())
        xApplyBtn.executeAction("CLICK", tuple())

        xOKBtn = xDialog.getChild("ok")
        self.ui_test.close_dialog_through_button(xOKBtn)

        self.ui_test.close_doc()

# vim: set shiftwidth=4 softtabstop=4 expandtab: