| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
from uitest.framework import UITestCase |
| 11 |
from uitest.uihelper.common import type_text |
| 12 |
from libreoffice.uno.propertyvalue import mkPropertyValues |
| 13 |
|
| 14 |
|
| 15 |
class tdf44837(UITestCase): |
| 16 |
|
| 17 |
def test_tdf448373_Replace_All_clears_current_selection(self): |
| 18 |
with self.ui_test.create_doc_in_start_center("writer") as document: |
| 19 |
xWriterDoc = self.xUITest.getTopFocusWindow() |
| 20 |
xWriterEdit = xWriterDoc.getChild("writer_edit") |
| 21 |
|
| 22 |
type_text(xWriterEdit, "asd asd") |
| 23 |
self.xUITest.executeCommand(".uno:SelectAll") |
| 24 |
|
| 25 |
with self.ui_test.execute_modeless_dialog_through_command(".uno:SearchDialog", close_button="close") as xDialog: |
| 26 |
searchterm = xDialog.getChild("searchterm") |
| 27 |
searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) |
| 28 |
searchterm.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) |
| 29 |
searchterm.executeAction("TYPE", mkPropertyValues({"TEXT":"a"})) |
| 30 |
replaceterm = xDialog.getChild("replaceterm") |
| 31 |
replaceterm.executeAction("TYPE", mkPropertyValues({"TEXT":"b"})) |
| 32 |
|
| 33 |
selectionOnly = xDialog.getChild("selection") |
| 34 |
selectionOnly.executeAction("CLICK", tuple()) |
| 35 |
replaceall = xDialog.getChild("replaceall") |
| 36 |
replaceall.executeAction("CLICK", tuple()) |
| 37 |
|
| 38 |
self.assertEqual(document.Text.String[0:8], "bsd bsd") |
| 39 |
self.assertEqual(len(document.CurrentSelection[0].String) > 1, True) |
| 40 |
|
| 41 |
|
| 42 |
|