1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 from uitest
.framework
import UITestCase
11 from uitest
.uihelper
.common
import type_text
13 class DeleteAllComments(UITestCase
):
15 def test_comments_delete(self
):
17 with self
.ui_test
.create_doc_in_start_center("writer") as document
:
19 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
20 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
23 type_text(xWriterEdit
, "Test LibreOffice")
26 self
.xUITest
.executeCommand(".uno:SelectAll")
27 self
.xUITest
.executeCommand(".uno:InsertAnnotation")
28 type_text(xWriterEdit
, "EEEEE")
29 self
.xUITest
.executeCommand(".uno:InsertAnnotation")
30 self
.xUITest
.executeCommand(".uno:DeleteAllNotes")
31 self
.assertEqual(document
.Text
.String
[0:4], "Test")
34 def test_comment_trackchanges(self
):
36 with self
.ui_test
.create_doc_in_start_center("writer"):
38 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
39 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
41 type_text(xWriterEdit
, "foo")
44 self
.xUITest
.executeCommand(".uno:SelectAll")
45 self
.xUITest
.executeCommand(".uno:InsertAnnotation")
46 self
.xUITest
.executeCommand(".uno:TrackChanges")
47 self
.xUITest
.executeCommand(".uno:DeleteAllNotes")
49 # vim: set shiftwidth=4 softtabstop=4 expandtab: