summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdeněk Crhonek <zcrhonek@gmail.com>2017-12-06 20:25:23 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-12-19 16:43:44 +0100
commitaa9d919e50e38d40c46cbd172cf51a4cc13673c4 (patch)
tree23f4ec2c05066a445b915dbdab9e9a1f4d6fa99b
parentac5518b6d4a14b2ed8011c35f97435e797a7b8d6 (diff)
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@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rwxr-xr-xbin/list-uitest.py2
-rw-r--r--sw/Module_sw.mk4
-rw-r--r--sw/UITest_writer_tests.mk12
-rw-r--r--sw/qa/uitest/writer_tests/deleteAllComments.py54
4 files changed, 71 insertions, 1 deletions
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()