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 import org
.libreoffice
.unotest
12 def get_url_for_data_file(file_name
):
13 return pathlib
.Path(org
.libreoffice
.unotest
.makeCopyFromTDOC(file_name
)).as_uri()
15 class tdf104649(UITestCase
):
17 def test_delete_and_undo(self
):
19 writer_doc
= self
.ui_test
.load_file(get_url_for_data_file("tdf104649.docx"))
21 document
= self
.ui_test
.get_component()
23 self
.assertEqual(document
.Text
.String
[0:4], "Test")
25 selection
= self
.xUITest
.executeCommand(".uno:SelectAll")
27 self
.xUITest
.executeCommand(".uno:Delete")
29 self
.assertEqual(document
.Text
.String
, "")
31 self
.xUITest
.executeCommand(".uno:Undo")
33 self
.assertEqual(document
.Text
.String
[0:4], "Test")
35 self
.ui_test
.close_doc()
37 # vim: set shiftwidth=4 softtabstop=4 expandtab: