summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-06-18 21:17:20 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-06-18 22:25:01 +0200
commit6ae1ce87ad494f435bd2b286b9b435a3ab00fd1a (patch)
tree3239315b0e47fe1b5aed0e76a2904ad1a0e7bbdd /sw
parentfd652938473aaaf0f716ea5c29ebb715ca7c290c (diff)
Revert "uitest: Add demo for Writer-comments"
This reverts commit ba33a51ff1eb34a5983870dcb50e975002e6d3a4. Reason for revert: These new tests do not only occasionally fail for <https://ci.libreoffice.org/job/lo_tb_master_linux_dbg/> (see comment at <https://gerrit.libreoffice.org/c/core/+/96295/11# message-50341d16b29be9704f1c25bf59e27ab6aa20a1ec> "uitest: Add demo for Writer-comments", they also appear to massively impact Jenkins builds of Gerrit master changes, see e.g. <https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/62008/>, <https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/62002/>, and <https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/61999/>. Change-Id: Ibad0e0523fa15491212c283cada4b1c51b22dea0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96636 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/uitest/writer_tests/comments.py156
1 files changed, 0 insertions, 156 deletions
diff --git a/sw/qa/uitest/writer_tests/comments.py b/sw/qa/uitest/writer_tests/comments.py
deleted file mode 100644
index e62e4f050738..000000000000
--- a/sw/qa/uitest/writer_tests/comments.py
+++ /dev/null
@@ -1,156 +0,0 @@
-# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
-#
-# 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/.
-#
-
-from uitest.framework import UITestCase
-import time
-from uitest.uihelper.common import get_state_as_dict, type_text
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.debug import sleep
-#test comments
-
-class Comments(UITestCase):
-
- def test_comments_features(self):
-
- xMainDoc = self.ui_test.create_doc_in_start_center("writer")
-
- xMainWindow = self.xUITest.getTopFocusWindow()
-
- xwriter_edit = xMainWindow.getChild("writer_edit")
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Before "}))
-
- # adding new Comment
- self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", mkPropertyValues({"KeyModifier" : 0 }) )
-
- xComment1 = xMainWindow.getChild("Comment1")
- xComment1.executeAction("TYPE", mkPropertyValues({"TEXT": "This is the First Comment"}))
- self.assertEqual(get_state_as_dict(xComment1)["Text"], "This is the First Comment" )
- self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "false" )
- self.assertEqual(get_state_as_dict(xComment1)["Author"], "Unknown Author" )
- self.assertEqual(get_state_as_dict(xComment1)["ReadOnly"], "false" )
-
- xComment1.executeAction("LEAVE", mkPropertyValues({}))
-
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "After"}))
- xwriter_edit.executeAction("SELECT", mkPropertyValues({"END_POS": "0", "START_POS": "13"}))
- self.assertEqual(get_state_as_dict(xwriter_edit)["SelectedText"], "Before After" )
-
- # test Resolve Comment
- xComment1.executeAction("RESOLVE", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "true" )
-
- # test Select text from Comment
- xComment1.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "4"}))
- self.assertEqual(get_state_as_dict(xComment1)["SelectedText"], "This" )
-
- # test Hide then Show Comment
- xComment1.executeAction("HIDE", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment1)["Visible"], "false" )
- xComment1.executeAction("SHOW", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment1)["Visible"], "true" )
-
- # test delete Comment
- number_of_items = len(xMainWindow.getChildren())
- xComment1.executeAction("DELETE", mkPropertyValues({}))
- self.assertTrue("Comment1" not in xMainWindow.getChildren())
-
- self.ui_test.close_doc()
-
- def test_multi_comments(self):
-
- xMainDoc = self.ui_test.create_doc_in_start_center("writer")
-
- xMainWindow = self.xUITest.getTopFocusWindow()
-
- xwriter_edit = xMainWindow.getChild("writer_edit")
-
- # adding 3 new Comment
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 1"}))
- self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", mkPropertyValues({"KeyModifier" : 0 }) )
- xMainWindow = self.xUITest.getTopFocusWindow()
- xComment1 = xMainWindow.getChild("Comment1")
- xComment1.executeAction("TYPE", mkPropertyValues({"TEXT": "First Comment"}))
- xComment1.executeAction("LEAVE", mkPropertyValues({}))
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
-
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 2"}))
- self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", mkPropertyValues({"KeyModifier" : 0 }) )
- xMainWindow = self.xUITest.getTopFocusWindow()
- xComment2 = xMainWindow.getChild("Comment2")
- xComment2.executeAction("TYPE", mkPropertyValues({"TEXT": "Second Comment"}))
- xComment2.executeAction("LEAVE", mkPropertyValues({}))
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
-
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"TEXT": "Line 3"}))
- self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", mkPropertyValues({"KeyModifier" : 0 }) )
- xMainWindow = self.xUITest.getTopFocusWindow()
- xComment3 = xMainWindow.getChild("Comment3")
- xComment3.executeAction("TYPE", mkPropertyValues({"TEXT": "Third Comment"}))
- xComment3.executeAction("LEAVE", mkPropertyValues({}))
- xwriter_edit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
-
- # Check text
- self.assertEqual(get_state_as_dict(xComment1)["Text"], "First Comment" )
- self.assertEqual(get_state_as_dict(xComment2)["Text"], "Second Comment" )
- self.assertEqual(get_state_as_dict(xComment3)["Text"], "Third Comment" )
-
- xComment2.executeAction("RESOLVE", mkPropertyValues({}))
- xComment3.executeAction("RESOLVE", mkPropertyValues({}))
-
- # Check Resolved
- self.assertEqual(get_state_as_dict(xComment1)["Resolved"], "false" )
- self.assertEqual(get_state_as_dict(xComment2)["Resolved"], "true" )
- self.assertEqual(get_state_as_dict(xComment3)["Resolved"], "true" )
-
- # Check ReadOnly
- self.assertEqual(get_state_as_dict(xComment1)["ReadOnly"], "false" )
- self.assertEqual(get_state_as_dict(xComment2)["ReadOnly"], "false" )
- self.assertEqual(get_state_as_dict(xComment3)["ReadOnly"], "false" )
-
- # Check Select
- xComment1.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "5"}))
- self.assertEqual(get_state_as_dict(xComment1)["SelectedText"], "First" )
-
- xComment2.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "6"}))
- self.assertEqual(get_state_as_dict(xComment2)["SelectedText"], "Second" )
-
- xComment3.executeAction("SELECT", mkPropertyValues({"FROM": "0", "TO": "5"}))
- self.assertEqual(get_state_as_dict(xComment3)["SelectedText"], "Third" )
-
- # Check that they all are Visible
- self.assertEqual(get_state_as_dict(xComment1)["Visible"], "true" )
- self.assertEqual(get_state_as_dict(xComment2)["Visible"], "true" )
- self.assertEqual(get_state_as_dict(xComment3)["Visible"], "true" )
-
- # Hide all
- xComment1.executeAction("HIDE", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment1)["Visible"], "false" )
- xComment2.executeAction("HIDE", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment2)["Visible"], "false" )
- xComment3.executeAction("HIDE", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment3)["Visible"], "false" )
-
- # Show comment 2 only
- xComment2.executeAction("SHOW", mkPropertyValues({}))
- self.assertEqual(get_state_as_dict(xComment2)["Visible"], "true" )
-
- # test delete all
- # First we calculate the number of objects that we have
- number_of_items=len(xMainWindow.getChildren())
- # Then remove the 3 objects
- xComment1.executeAction("DELETE", mkPropertyValues({}))
- xComment2.executeAction("DELETE", mkPropertyValues({}))
- xComment3.executeAction("DELETE", mkPropertyValues({}))
- self.assertTrue("Comment1" not in xMainWindow.getChildren())
- self.assertTrue("Comment2" not in xMainWindow.getChildren())
- self.assertTrue("Comment3" not in xMainWindow.getChildren())
-
- self.ui_test.close_doc()
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab: