[Libreoffice-commits] core.git: sc/qa

Ahmed ElShreif (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 8 14:48:22 UTC 2020


 sc/qa/uitest/calc_tests/Comments.py |   49 ++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

New commits:
commit a480b32fb7a381fc17d51c2ccd0e8c4455d38792
Author:     Ahmed ElShreif <aelshreif7 at gmail.com>
AuthorDate: Wed Jun 24 18:59:32 2020 +0200
Commit:     Ahmed ElShreif <aelshreif7 at gmail.com>
CommitDate: Wed Jul 8 16:47:39 2020 +0200

    uitest : Add demo for Calc-comments
    
    This patch test the support that added to this patch:
    https://gerrit.libreoffice.org/c/core/+/96837
    
    Change-Id: If7444813f65bd90d62d0eb3504dcfc588c3f4e32
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97074
    Tested-by: Jenkins
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/qa/uitest/calc_tests/Comments.py b/sc/qa/uitest/calc_tests/Comments.py
new file mode 100644
index 000000000000..52d1f2a1d666
--- /dev/null
+++ b/sc/qa/uitest/calc_tests/Comments.py
@@ -0,0 +1,49 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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
+from uitest.uihelper.common import get_state_as_dict
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.debug import sleep
+
+class Comments(UITestCase):
+    def test_comment(self):
+        calc_doc = self.ui_test.create_doc_in_start_center("calc")
+        xCalcDoc = self.xUITest.getTopFocusWindow()
+        gridwin = xCalcDoc.getChild("grid_window")
+        document = self.ui_test.get_component()
+
+        # Select Cell D8
+        gridwin.executeAction("SELECT", mkPropertyValues({"TABLE": "0"}))
+        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D8"}))
+
+        # Create comment and open it's window
+        gridwin.executeAction("COMMENT", mkPropertyValues({"OPEN": ""}))
+
+        # Write text in the Comment Window
+        gridwin.executeAction("TYPE", mkPropertyValues({"TEXT": "First Comment"}))
+
+        # Close Comment Window
+        gridwin.executeAction("COMMENT", mkPropertyValues({"CLOSE":""}))
+
+        # Check on the comment text
+        self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "First Comment")
+
+        # Check on comment in another cell
+        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+        gridwin.executeAction("COMMENT", mkPropertyValues({"OPEN": ""}))
+        gridwin.executeAction("TYPE", mkPropertyValues({"TEXT": "Second Comment"}))
+        gridwin.executeAction("COMMENT", mkPropertyValues({"CLOSE":""}))
+        self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "Second Comment")
+
+        # Write Comment without opening Comment window
+        gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B5"}))
+        gridwin.executeAction("COMMENT", mkPropertyValues({"SETTEXT": "Third Comment"}))
+        self.assertEqual(get_state_as_dict(gridwin)["CurrentCellCommentText"], "Third Comment")
+
+        self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
\ No newline at end of file


More information about the Libreoffice-commits mailing list