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
11 from uitest
.debug
import sleep
12 from uitest
.uihelper
.common
import select_pos
14 class asianPhoneticGuide(UITestCase
):
16 def test_asian_phonetic_guide(self
):
17 self
.ui_test
.create_doc_in_start_center("writer")
18 document
= self
.ui_test
.get_component()
19 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
21 self
.ui_test
.execute_modeless_dialog_through_command(".uno:RubyDialog")
22 xDialog
= self
.xUITest
.getTopFocusWindow()
24 xLeft1ED
= xDialog
.getChild("Left1ED")
25 xRight1ED
= xDialog
.getChild("Right1ED")
26 xadjustlb
= xDialog
.getChild("adjustlb")
27 xpositionlb
= xDialog
.getChild("positionlb")
28 xstylelb
= xDialog
.getChild("stylelb")
30 xLeft1ED
.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
31 xRight1ED
.executeAction("TYPE", mkPropertyValues({"TEXT":"w"}))
32 props
= {"TEXT": "Right"}
33 actionProps
= mkPropertyValues(props
)
34 xadjustlb
.executeAction("SELECT", actionProps
)
35 props2
= {"TEXT": "Right"}
36 actionProps2
= mkPropertyValues(props2
)
37 xpositionlb
.executeAction("SELECT", actionProps2
)
38 props3
= {"TEXT": "Quotation"}
39 actionProps3
= mkPropertyValues(props3
)
40 xstylelb
.executeAction("SELECT", actionProps3
)
42 xApplyBtn
= xDialog
.getChild("ok")
43 xApplyBtn
.executeAction("CLICK", tuple())
45 xCloseBtn
= xDialog
.getChild("cancel")
46 self
.ui_test
.close_dialog_through_button(xCloseBtn
)
48 self
.assertEqual(document
.Text
.String
[0:1], "a")
49 self
.ui_test
.close_doc()
50 # vim: set shiftwidth=4 softtabstop=4 expandtab: