Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / uitest / writer_tests / tdf104649.py
bloba1593d38733936a49076614f370130f1cc56eb69
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
8 from uitest.path import get_srcdir_url
10 def get_url_for_data_file(file_name):
11 return get_srcdir_url() + "/uitest/writer_tests/data/" + file_name
13 class tdf104649(UITestCase):
15 def test_delete_and_undo(self):
17 writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf104649.docx"))
19 document = self.ui_test.get_component()
21 self.assertEqual(document.Text.String[0:4], "Test")
23 selection = self.xUITest.executeCommand(".uno:SelectAll")
25 self.xUITest.executeCommand(".uno:Delete")
27 self.assertEqual(document.Text.String, "")
29 self.xUITest.executeCommand(".uno:Undo")
31 self.assertEqual(document.Text.String[0:4], "Test")
33 self.ui_test.close_doc()
35 # vim: set shiftwidth=4 softtabstop=4 expandtab: