Get the style color and number just once
[LibreOffice.git] / sw / qa / uitest / writer_tests3 / insertEnvelope.py
blobeddce821b405941271b5efbae71ded91dd0e6400
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 from uitest.framework import UITestCase
11 from libreoffice.uno.propertyvalue import mkPropertyValues
12 from uitest.uihelper.common import get_state_as_dict
14 #envaddresspage.ui
16 class WriterInsertEnvelope(UITestCase):
18 def test_insert_envelope(self):
19 with self.ui_test.create_doc_in_start_center("writer"):
20 with self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope", close_button="user") as xDialog:
21 xAddrTxt= xDialog.getChild("addredit")
22 xSenderTxt = xDialog.getChild("senderedit")
24 xAddrTxt.executeAction("SELECT", mkPropertyValues({"FROM": "1", "TO": "200"}))
25 xAddrTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
26 xAddrTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"Address"}))
28 xSenderTxt.executeAction("SELECT", mkPropertyValues({"FROM": "1", "TO": "200"}))
29 xSenderTxt.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"}))
30 xSenderTxt.executeAction("TYPE", mkPropertyValues({"TEXT":"Sender"}))
32 with self.ui_test.execute_dialog_through_command(".uno:InsertEnvelope", close_button="cancel") as xDialog:
33 xAddrTxt= xDialog.getChild("addredit")
34 xSenderTxt = xDialog.getChild("senderedit")
35 self.assertEqual(get_state_as_dict(xAddrTxt)["Text"], "Address")
36 self.assertEqual(get_state_as_dict(xSenderTxt)["Text"], "Sender")
38 # vim: set shiftwidth=4 softtabstop=4 expandtab: