[Libreoffice-commits] core.git: bin/list-uitest.py sw/Module_sw.mk sw/qa sw/UITest_writer_tests.mk

Zdeněk Crhonek zcrhonek at gmail.com
Tue Dec 19 15:47:51 UTC 2017


 bin/list-uitest.py                             |    2 
 sw/Module_sw.mk                                |    4 +
 sw/UITest_writer_tests.mk                      |   12 +++++
 sw/qa/uitest/writer_tests/deleteAllComments.py |   54 +++++++++++++++++++++++++
 4 files changed, 71 insertions(+), 1 deletion(-)

New commits:
commit aa9d919e50e38d40c46cbd172cf51a4cc13673c4
Author: Zdeněk Crhonek <zcrhonek at gmail.com>
Date:   Wed Dec 6 20:25:23 2017 +0100

    uitest  - writer "delete all comments"; move writer  tests to sw/qa/uitest
    
    Change-Id: Id7d6a2a413234b07df3f0f07184e7e33fec73633
    Reviewed-on: https://gerrit.libreoffice.org/45985
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/bin/list-uitest.py b/bin/list-uitest.py
index e95af23676ab..c5cabc3abdea 100755
--- a/bin/list-uitest.py
+++ b/bin/list-uitest.py
@@ -47,7 +47,7 @@ def linkFormat(name):
 def main():
     uitest_ext = '.py'
     uitest_dirs = {
-            'Writer' : ['../uitest/writer_tests/', '../writerperfect/qa/uitest/'],
+            'Writer' : ['../uitest/writer_tests/', '../writerperfect/qa/uitest/', '../sw/qa/uitest/writer_tests/'],
             'Calc' : ['../uitest/calc_tests', '../sc/qa/uitest/'],
             'Impress' : ['../uitest/impress_tests/'],
             'Math': ['../uitest/math_tests/'],
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 966c71d097fd..472eac81ad93 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -122,6 +122,10 @@ $(eval $(call gb_Module_add_screenshot_targets,sw,\
     CppunitTest_sw_dialogs_test \
     CppunitTest_sw_dialogs_test_2 \
 ))
+
+$(eval $(call gb_Module_add_uicheck_targets,sw,\
+	UITest_writer_tests \
+))
 endif
 
 # vim: set noet sw=4 ts=4:
diff --git a/sw/UITest_writer_tests.mk b/sw/UITest_writer_tests.mk
new file mode 100644
index 000000000000..3205991d0429
--- /dev/null
+++ b/sw/UITest_writer_tests.mk
@@ -0,0 +1,12 @@
+# This file is part of the LibreOffice project.
+#
+# 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/.
+# 
+
+$(eval $(call 	gb_UITest_UITest,writer_tests))
+
+$(eval $(call gb_UITest_add_modules,writer_tests,$(SRCDIR)/sw/qa/uitest,\
+	writer_tests/ \
+))
diff --git a/sw/qa/uitest/writer_tests/deleteAllComments.py b/sw/qa/uitest/writer_tests/deleteAllComments.py
new file mode 100644
index 000000000000..ad9e0c823e6f
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/deleteAllComments.py
@@ -0,0 +1,54 @@
+#
+# 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/.
+#
+
+from uitest.framework import UITestCase
+import time
+from uitest.uihelper.common import get_state_as_dict, type_text
+
+class DeleteAllComments(UITestCase):
+
+    def test_comments_delete(self):
+
+        self.ui_test.create_doc_in_start_center("writer")
+
+        xWriterDoc = self.xUITest.getTopFocusWindow()
+        xWriterEdit = xWriterDoc.getChild("writer_edit")
+        
+
+        type_text(xWriterEdit, "Test LibreOffice")
+
+        document = self.ui_test.get_component()
+
+        selection = self.xUITest.executeCommand(".uno:SelectAll")
+        self.xUITest.executeCommand(".uno:InsertAnnotation")
+        cursor = document.getCurrentController().getViewCursor()
+        xWriterDoc.executeAction("LEFT", tuple())
+        type_text(xWriterEdit, "EEEEE")
+        self.xUITest.executeCommand(".uno:InsertAnnotation")
+        self.xUITest.executeCommand(".uno:DeleteAllNotes")
+        self.assertEqual(document.Text.String[0:4], "Test")
+
+        self.ui_test.close_doc()
+
+    def test_comment_trackchanges(self):
+#tdf111524
+        self.ui_test.create_doc_in_start_center("writer")
+
+        xWriterDoc = self.xUITest.getTopFocusWindow()
+        xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+        type_text(xWriterEdit, "foo")
+
+        document = self.ui_test.get_component()
+
+        selection = self.xUITest.executeCommand(".uno:SelectAll")
+        self.xUITest.executeCommand(".uno:InsertAnnotation")
+        self.xUITest.executeCommand(".uno:TrackChanges")
+        self.xUITest.executeCommand(".uno:DeleteAllNotes")
+
+
+
+        self.ui_test.close_doc()


More information about the Libreoffice-commits mailing list