[Libreoffice-commits] dev-tools.git: uitest/mass-testing

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Apr 16 15:20:42 UTC 2019


 uitest/mass-testing/calc.py                   |   51 ++++++
 uitest/mass-testing/impress.py                |  107 ++++++++++++
 uitest/mass-testing/registrymodifications.xcu |   18 ++
 uitest/mass-testing/run.py                    |  169 +++++++++++++++++++
 uitest/mass-testing/writer.py                 |  221 ++++++++++++++++++++++++++
 5 files changed, 566 insertions(+)

New commits:
commit 1308c9141e389d6182075cde07615468221aad95
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Tue Apr 16 17:15:56 2019 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Apr 16 17:19:45 2019 +0200

    mass-uitesting: initial commit

diff --git a/uitest/mass-testing/calc.py b/uitest/mass-testing/calc.py
new file mode 100755
index 0000000..39cbcda
--- /dev/null
+++ b/uitest/mass-testing/calc.py
@@ -0,0 +1,51 @@
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+import os
+import signal
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+import time
+
+
+def handle_skip():
+    #Kill the process so we don't have to open the same file for each test
+    print("skipped")
+    os.killpg(os.getpid(), signal.SIGINT)
+
+class massTesting(UITestCase):
+
+    def load_file(self):
+        #TODO: Ignore password protected files
+
+        fileName = os.environ["TESTFILENAME"]
+
+        self.ui_test.create_doc_in_start_center("calc")
+
+        self.ui_test.load_file(fileName)
+        document = self.ui_test.get_component()
+
+        # Ignore read-only files
+        if not hasattr(document, 'isReadonly') or document.isReadonly():
+            handle_skip()
+
+        try:
+            xDoc = self.xUITest.getTopFocusWindow()
+            xEdit = xDoc.getChild("edit")
+        except:
+            #In case the mimetype is wrong and the file is open with another component
+            handle_skip()
+
+        return xEdit
+
+    def test_calc(self):
+        xEdit = self.load_file()
+        if xEdit:
+            continue
+
+        self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/uitest/mass-testing/impress.py b/uitest/mass-testing/impress.py
new file mode 100755
index 0000000..f2797b2
--- /dev/null
+++ b/uitest/mass-testing/impress.py
@@ -0,0 +1,107 @@
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+import os
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+import time
+
+def handle_skip():
+    #Kill the process so we don't have to open the same file for each test
+    print("skipped")
+    os.killpg(os.getpid(), signal.SIGINT)
+
+class massTesting(UITestCase):
+
+    def load_file(self):
+        #TODO: Ignore password protected files
+
+        fileName = os.environ["TESTFILENAME"]
+
+        self.ui_test.create_doc_in_start_center("impress")
+
+        self.ui_test.load_file(fileName)
+        document = self.ui_test.get_component()
+
+        # Ignore read-only files
+        if not hasattr(document, 'isReadonly') or document.isReadonly():
+            handle_skip()
+
+        # Go to the normal view
+        self.xUITest.executeCommand(".uno:NormalMultiPaneGUI")
+
+        try:
+            xDoc = self.xUITest.getTopFocusWindow()
+            xEdit = xDoc.getChild("impress_win")
+        except:
+            #In case the mimetype is wrong and the file is open with another component
+            handle_skip()
+
+        return xEdit
+
+    def test_copy_all_paste_undo(self):
+        xEdit = self.load_file()
+        if xEdit:
+            self.xUITest.executeCommand(".uno:SelectAll")
+
+            self.xUITest.executeCommand(".uno:Copy")
+
+            for i in range(5):
+                self.xUITest.executeCommand(".uno:Paste")
+
+            for i in range(5):
+                self.xUITest.executeCommand(".uno:Undo")
+        self.ui_test.close_doc()
+
+    def test_traverse_all_slides_and_delete_and_undo(self):
+        xEdit = self.load_file()
+        if xEdit:
+            document = self.ui_test.get_component()
+            slideCount = document.DrawPages.getCount()
+
+            for i in range(slideCount):
+                xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"PAGEDOWN"}))
+
+                self.xUITest.executeCommand(".uno:SelectAll")
+
+                xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DELETE"}))
+
+                self.xUITest.executeCommand(".uno:Undo")
+        self.ui_test.close_doc()
+
+    def test_duplicate_all_slides_and_undo(self):
+        xEdit = self.load_file()
+        if xEdit:
+            # Go to the slide sorter view
+            self.xUITest.executeCommand(".uno:DiaMode")
+
+            xDoc = self.xUITest.getTopFocusWindow()
+            xEdit = xDoc.getChild("slidesorter")
+
+            self.xUITest.executeCommand(".uno:SelectAll")
+
+            self.xUITest.executeCommand(".uno:DuplicatePage")
+
+            self.xUITest.executeCommand(".uno:Undo")
+        self.ui_test.close_doc()
+
+    def test_remove_all_slides_and_undo(self):
+        xEdit = self.load_file()
+        if xEdit:
+            # Go to the slide sorter view
+            self.xUITest.executeCommand(".uno:DiaMode")
+
+            xDoc = self.xUITest.getTopFocusWindow()
+            xEdit = xDoc.getChild("slidesorter")
+
+            self.xUITest.executeCommand(".uno:SelectAll")
+
+            xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DELETE"}))
+
+            self.xUITest.executeCommand(".uno:Undo")
+        self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/uitest/mass-testing/registrymodifications.xcu b/uitest/mass-testing/registrymodifications.xcu
new file mode 100644
index 0000000..f992e48
--- /dev/null
+++ b/uitest/mass-testing/registrymodifications.xcu
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<oor:items xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="FirstRun" oor:op="fuse"><value>false</value></prop></item>
+<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="Persona" oor:op="fuse"><value>no</value></prop></item>
+<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="PersonaSettings" oor:op="fuse"><value></value></prop></item>
+<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="UseOpenCL" oor:op="fuse"><value>false</value></prop></item>
+<item oor:path="/org.openoffice.Office.Logging/Settings"><node oor:name="unopkg" oor:op="replace"><prop oor:name="LogLevel" oor:op="fuse"><value>2147483647</value></prop><prop oor:name="DefaultHandler" oor:op="fuse"><value>com.sun.star.logging.FileHandler</value></prop><node oor:name="HandlerSettings"><prop oor:name="FileURL" oor:op="fuse"><value>$(userurl)/$(loggername).log</value></prop></node><prop oor:name="DefaultFormatter" oor:op="fuse"><value>com.sun.star.logging.PlainTextFormatter</value></prop><node oor:name="FormatterSettings"></node></node></item>
+<item oor:path="/org.openoffice.Office.Recovery/RecoveryInfo"><prop oor:name="SessionData" oor:op="fuse"><value>false</value></prop></item>
+<item oor:path="/org.openoffice.Setup/L10N"><prop oor:name="ooLocale" oor:op="fuse"><value>en-US</value></prop></item>
+<item oor:path="/org.openoffice.Setup/Office/Factories/org.openoffice.Setup:Factory['com.sun.star.frame.StartModule']"><prop oor:name="ooSetupFactoryWindowAttributes" oor:op="fuse"><value>57,30,1805,980;1;0,0,0,0;</value></prop></item>
+<item oor:path="/org.openoffice.Setup/Office"><prop oor:name="LastCompatibilityCheckID" oor:op="fuse"><value>ea3a1b075154a665d30aaac6513812ceb839f64b</value></prop></item>
+<item oor:path="/org.openoffice.Setup/Office"><prop oor:name="OfficeRestartInProgress" oor:op="fuse"><value>false</value></prop></item>
+<item oor:path="/org.openoffice.Setup/Office"><prop oor:name="ooSetupInstCompleted" oor:op="fuse"><value>true</value></prop></item>
+<item oor:path="/org.openoffice.Office.Common/Security/Scripting"><prop oor:name="DisableMacrosExecution" oor:op="fuse"><value>true</value></prop></item>
+<item oor:path="/org.openoffice.Office.Writer/Cursor/Option"><prop oor:name="IgnoreProtectedArea" oor:op="fuse"><value>true</value></prop></item>
+<item oor:path="/org.openoffice.Office.Impress/Misc/NewDoc"><prop oor:name="AutoPilot" oor:op="fuse"><value>false</value></prop></item>
+<item oor:path="/org.openoffice.Office.Common/Misc"><prop oor:name="ShowTipOfTheDay" oor:op="fuse"><value>false</value></prop></item>
+</oor:items>
diff --git a/uitest/mass-testing/run.py b/uitest/mass-testing/run.py
new file mode 100755
index 0000000..5a0ba75
--- /dev/null
+++ b/uitest/mass-testing/run.py
@@ -0,0 +1,169 @@
+#!/usr/bin/env python3
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+import os
+import argparse
+from subprocess import Popen, PIPE, TimeoutExpired
+import sys
+import signal
+import logging
+from shutil import copyfile
+
+extensions = {
+    'writer' : [ "odt", "doc", "docx", "rtf" ],
+    'calc' : [ "ods", "xls", "xlsx" ],
+    'impress' : [ "odp", "ppt", "pptx" ]
+    }
+
+class DefaultHelpParser(argparse.ArgumentParser):
+    def error(self, message):
+        sys.stderr.write('error: %s\n' % message)
+        self.print_help()
+        sys.exit(2)
+
+def start_logger():
+    rootLogger = logging.getLogger()
+    rootLogger.setLevel(os.environ.get("LOGLEVEL", "INFO"))
+
+    logFormatter = logging.Formatter("%(asctime)s %(message)s")
+    fileHandler = logging.FileHandler("massTesting.log")
+    fileHandler.setFormatter(logFormatter)
+    rootLogger.addHandler(fileHandler)
+
+    streamHandler = logging.StreamHandler(sys.stdout)
+    rootLogger.addHandler(streamHandler)
+
+    return rootLogger
+
+def get_file_names(component, filesPath):
+    auxNames = []
+    for fileName in os.listdir(filesPath):
+        for ext in extensions[component]:
+            if fileName.endswith(ext):
+                auxNames.append("file:///" + filesPath + fileName)
+
+                #Remove previous lock files
+                lockFilePath = filesPath + '.~lock.' + fileName + '#'
+                if os.path.isfile(lockFilePath):
+                    os.remove(lockFilePath)
+
+    return auxNames
+
+def run_tests_and_get_results(liboPath, listFiles, isDebug):
+
+    #Create directory for the user profile
+    profilePath = '/tmp/libreoffice/4/'
+    userPath = profilePath + 'user/'
+    if not os.path.exists(userPath):
+        os.makedirs(userPath)
+
+    totalPass = 0
+    totalFail = 0
+    totalTimeout = 0
+    totalSkip = 0
+
+    for fileName in listFiles:
+        # Replace the profile file with
+        # 1. DisableMacrosExecution = True
+        # 2. IgnoreProtectedArea = True
+        # 3. AutoPilot = False
+        copyfile(os.getcwd() + '/registrymodifications.xcu', userPath + 'registrymodifications.xcu')
+
+        #TODO: Find a better way to pass fileName parameter
+        os.environ["TESTFILENAME"] = fileName
+
+        with Popen(["python3.5",
+                    liboPath + "uitest/test_main.py",
+                    "--debug",
+                    "--soffice=path:" + liboPath + "instdir/program/soffice",
+                    "--userdir=file://" + profilePath,
+                    "--file=" + component + ".py"], stdin=PIPE, stdout=PIPE, stderr=PIPE,
+                    encoding="utf-8", preexec_fn=os.setsid) as process:
+            try:
+                outputLines = process.communicate(timeout=60)[0].splitlines()
+                importantInfo = ''
+                for line in outputLines:
+                    if isDebug:
+                        print(line)
+
+                    if 'skipped' == line.rstrip().lower():
+                        logger.info("SKIP: " + fileName + " : " + importantInfo)
+                        totalSkip += 1
+                        break
+
+                    if 'Execution time' in line:
+                        # No error found between one Execution time line and the other
+                        if importantInfo:
+                            logger.info("PASS: " + fileName + " : " + importantInfo)
+                            totalPass += 1
+
+                        importantInfo = line.rstrip().split('for ')[1]
+
+                    elif importantInfo and 'error' == line.rstrip().lower() or 'fail' == line.rstrip().lower():
+                        logger.info("FAIL: " + fileName + " : " + importantInfo)
+                        totalFail += 1
+                        importantInfo = ''
+
+                if importantInfo:
+                    # No error found between the last Execution time line and the end
+                    logger.info("PASS: " + fileName + " : " + importantInfo)
+                    totalPass += 1
+
+            except TimeoutExpired:
+                logger.info("TIMEOUT: " + fileName)
+                totalTimeout += 1
+
+                os.killpg(process.pid, signal.SIGINT) # send signal to the process group
+
+    totalTests = totalPass + totalTimeout + totalSkip + totalFail
+    logger.info("")
+    logger.info("Total Tests: " + str(totalTests))
+    logger.info("\tPASS: " + str(totalPass))
+    logger.info("\tSKIP: " + str(totalSkip))
+    logger.info("\tTIMEOUT: " + str(totalTimeout))
+    logger.info("\tFAIL: " + str(totalFail))
+    logger.info("")
+
+if __name__ == '__main__':
+    parser = DefaultHelpParser()
+
+    parser.add_argument(
+            '--dir', required=True, help="Path to the files directory")
+    parser.add_argument(
+            '--soffice', required=True, help="Path to the LibreOffice directory")
+    parser.add_argument(
+            '--debug', action='store_true', help="Flag to print output")
+    parser.add_argument(
+            '--component', required=True, help="The component to be used. Options: " + \
+                    " ".join("[" + x + "]" for x in extensions.keys()))
+
+    argument = parser.parse_args()
+
+    component = argument.component.lower()
+    if component not in extensions.keys():
+        parser.error(component + " is an invalid component.")
+
+    filesPath = os.path.join(argument.dir, '')
+    if not os.path.exists(filesPath):
+        parser.error(filesPath + " is an invalid directory path")
+
+    liboPath = os.path.join(argument.soffice, '')
+    if not os.path.exists(liboPath) or not os.path.exists(liboPath + "instdir/program/"):
+        parser.error(liboPath + " is an invalid LibreOffice path")
+
+    os.environ["PYTHONPATH"] = liboPath + "instdir/program/"
+    os.environ["URE_BOOTSTRAP"] = "file://" + liboPath + "instdir/program/fundamentalrc"
+    os.environ["SAL_USE_VCLPLUGIN"] = "gen"
+
+    logger = start_logger()
+
+
+    listFiles = get_file_names(component, filesPath)
+
+    run_tests_and_get_results(liboPath, listFiles, argument.debug)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/uitest/mass-testing/writer.py b/uitest/mass-testing/writer.py
new file mode 100755
index 0000000..cbf27b6
--- /dev/null
+++ b/uitest/mass-testing/writer.py
@@ -0,0 +1,221 @@
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+import os
+import signal
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+import time
+
+def handle_skip():
+    #Kill the process so we don't have to open the same file for each test
+    print("skipped")
+    os.killpg(os.getpid(), signal.SIGINT)
+
+class massTesting(UITestCase):
+
+    def load_file(self):
+        #TODO: Ignore password protected files
+
+        fileName = os.environ["TESTFILENAME"]
+
+        self.ui_test.create_doc_in_start_center("writer")
+
+        self.ui_test.load_file(fileName)
+        document = self.ui_test.get_component()
+
+        # Ignore read-only files
+        if not hasattr(document, 'isReadonly') or document.isReadonly():
+            handle_skip()
+
+        try:
+            xDoc = self.xUITest.getTopFocusWindow()
+            xEdit = xDoc.getChild("writer_edit")
+        except:
+            #In case the mimetype is wrong and the file is open with another component
+            handle_skip()
+
+        return xEdit
+
+    def test_remove_all_and_undo(self):
+        xEdit = self.load_file()
+        if xEdit:
+            self.xUITest.executeCommand(".uno:SelectAll")
+            xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DELETE"}))
+
+            self.xUITest.executeCommand(".uno:Undo")
+
+        self.ui_test.close_doc()
+
+    def test_insert_returns_and_undo(self):
+        xEdit = self.load_file()
+        if xEdit:
+            for i in range(60):
+                xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RETURN"}))
+
+            for i in range(60):
+                self.xUITest.executeCommand(".uno:Undo")
+
+        self.ui_test.close_doc()
+
+    def test_insert_pageBreaks_and_undo(self):
+        xEdit = self.load_file()
+        if xEdit:
+            for i in range(5):
+                self.xUITest.executeCommand(".uno:InsertPagebreak")
+
+            for i in range(5):
+                self.xUITest.executeCommand(".uno:Undo")
+
+        self.ui_test.close_doc()
+
+    def test_insert_remove_header(self):
+        xEdit = self.load_file()
+        if xEdit:
+            document = self.ui_test.get_component()
+
+            #Insert Default header if it doesn't exists
+            if not document.StyleFamilies.PageStyles.Standard.HeaderIsOn:
+                self.xUITest.executeCommand(
+                        ".uno:InsertPageHeader?PageStyle:string=Default%20Style&On:bool=true")
+
+            self.assertEqual(document.StyleFamilies.PageStyles.Standard.HeaderIsOn, True)
+
+            # Delete the header
+            self.ui_test.execute_dialog_through_command(
+                    ".uno:InsertPageHeader?PageStyle:string=Default%20Style&On:bool=false")
+
+            xDialog = self.xUITest.getTopFocusWindow()  #question dialog
+            xOption = xDialog.getChild("yes")
+            xOption.executeAction("CLICK", tuple())
+
+            self.assertEqual(document.StyleFamilies.PageStyles.Standard.HeaderIsOn, False)
+
+        self.ui_test.close_doc()
+
+    def test_copy_all_paste_undo(self):
+        xEdit = self.load_file()
+        if xEdit:
+            self.xUITest.executeCommand(".uno:SelectAll")
+
+            self.xUITest.executeCommand(".uno:Copy")
+
+            for i in range(5):
+                self.xUITest.executeCommand(".uno:Paste")
+
+            for i in range(5):
+                self.xUITest.executeCommand(".uno:Undo")
+
+        self.ui_test.close_doc()
+
+    def test_insert_remove_footer(self):
+        xEdit = self.load_file()
+        if xEdit:
+            document = self.ui_test.get_component()
+
+            #Insert Default footer if it doesn't exists
+            if not document.StyleFamilies.PageStyles.Standard.FooterIsOn:
+                self.xUITest.executeCommand(
+                        ".uno:InsertPageFooter?PageStyle:string=Default%20Style&On:bool=true")
+
+            self.assertEqual(document.StyleFamilies.PageStyles.Standard.FooterIsOn, True)
+
+            # Delete the header
+            self.ui_test.execute_dialog_through_command(
+                    ".uno:InsertPageFooter?PageStyle:string=Default%20Style&On:bool=false")
+
+            xDialog = self.xUITest.getTopFocusWindow()  #question dialog
+            xOption = xDialog.getChild("yes")
+            xOption.executeAction("CLICK", tuple())
+
+            self.assertEqual(document.StyleFamilies.PageStyles.Standard.FooterIsOn, False)
+
+        self.ui_test.close_doc()
+
+    def test_traverse_all_pages(self):
+        xEdit = self.load_file()
+        if xEdit:
+            document = self.ui_test.get_component()
+            pageCount = document.CurrentController.PageCount
+
+            for i in range(pageCount):
+                xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"PAGEDOWN"}))
+
+            for i in range(pageCount):
+                xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"PAGEUP"}))
+
+        self.ui_test.close_doc()
+
+    def test_change_text_formatting_and_undo(self):
+        xEdit = self.load_file()
+        if xEdit:
+            self.xUITest.executeCommand(".uno:SelectAll")
+            self.xUITest.executeCommand(".uno:Bold")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:Italic")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:Underline")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:UnderlineDouble")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:Strikeout")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:Overline")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:SuperScript")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:SubScript")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:Shadowed")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:OutlineFont")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:Grow")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:Shrink")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:ChangeCaseToUpper")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:ChangeCaseToLower")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:ChangeCaseRotateCase")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:ChangeCaseToSentenceCase")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:ChangeCaseToTitleCase")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:ChangeCaseToToggleCase")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:SmallCaps")
+            self.xUITest.executeCommand(".uno:Undo")
+
+        self.ui_test.close_doc()
+
+    def test_default_bullet_list_and_undo(self):
+        xEdit = self.load_file()
+        if xEdit:
+            self.xUITest.executeCommand(".uno:SelectAll")
+            self.xUITest.executeCommand(".uno:DefaultBullet")
+            self.xUITest.executeCommand(".uno:Undo")
+
+        self.ui_test.close_doc()
+
+    def test_change_alignment_and_undo(self):
+        xEdit = self.load_file()
+        if xEdit:
+            self.xUITest.executeCommand(".uno:SelectAll")
+            self.xUITest.executeCommand(".uno:CommonAlignLeft")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:CommonAlignHorizontalCenter")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:CommonAlignRight")
+            self.xUITest.executeCommand(".uno:Undo")
+            self.xUITest.executeCommand(".uno:CommonAlignJustified")
+            self.xUITest.executeCommand(".uno:Undo")
+
+        self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list