2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from uitest
.framework
import UITestCase
9 from uitest
.uihelper
.common
import get_state_as_dict
, type_text
11 class DeleteAllComments(UITestCase
):
13 def test_comments_delete(self
):
15 self
.ui_test
.create_doc_in_start_center("writer")
17 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
18 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
21 type_text(xWriterEdit
, "Test LibreOffice")
23 document
= self
.ui_test
.get_component()
25 selection
= self
.xUITest
.executeCommand(".uno:SelectAll")
26 self
.xUITest
.executeCommand(".uno:InsertAnnotation")
27 cursor
= document
.getCurrentController().getViewCursor()
28 xWriterDoc
.executeAction("LEFT", tuple())
29 type_text(xWriterEdit
, "EEEEE")
30 self
.xUITest
.executeCommand(".uno:InsertAnnotation")
31 self
.xUITest
.executeCommand(".uno:DeleteAllNotes")
32 self
.assertEqual(document
.Text
.String
[0:4], "Test")
34 self
.ui_test
.close_doc()
36 def test_comment_trackchanges(self
):
38 self
.ui_test
.create_doc_in_start_center("writer")
40 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
41 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
43 type_text(xWriterEdit
, "foo")
45 document
= self
.ui_test
.get_component()
47 selection
= self
.xUITest
.executeCommand(".uno:SelectAll")
48 self
.xUITest
.executeCommand(".uno:InsertAnnotation")
49 self
.xUITest
.executeCommand(".uno:TrackChanges")
50 self
.xUITest
.executeCommand(".uno:DeleteAllNotes")
54 self
.ui_test
.close_doc()