1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 from uitest
.framework
import UITestCase
8 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
9 from uitest
.uihelper
.common
import get_state_as_dict
, type_text
11 from uitest
.debug
import sleep
13 class tdf115088(UITestCase
):
15 def test_tdf115088(self
):
16 self
.ui_test
.create_doc_in_start_center("writer")
17 document
= self
.ui_test
.get_component()
18 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
19 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
21 type_text(xWriterEdit
, "1")
22 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
23 type_text(xWriterEdit
, "1")
25 selection
= self
.xUITest
.executeCommand(".uno:SelectAll") #select whole text
26 self
.xUITest
.executeCommand(".uno:Cut") #cut text
27 type_text(xWriterEdit
, "test")
28 self
.xUITest
.executeCommand(".uno:GoLeft")
29 self
.xUITest
.executeCommand(".uno:GoLeft")
30 self
.xUITest
.executeCommand(".uno:GoLeft")
31 self
.xUITest
.executeCommand(".uno:GoLeft")
32 self
.xUITest
.executeCommand(".uno:PasteUnformatted")
33 self
.assertEqual(document
.Text
.String
[0:2], "1\n")
35 self
.ui_test
.close_doc()
36 # vim: set shiftwidth=4 softtabstop=4 expandtab: