Update git submodules
[LibreOffice.git] / sw / qa / uitest / writer_tests2 / horizontalLine.py
blobcecd517f0dc6da15c95954b2bd63de3dae511a21
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 uitest.uihelper.common import get_state_as_dict, type_text
13 class WriterInsertHorizontalLine(UITestCase):
15 def test_insert_horizontal_line(self):
16 with self.ui_test.create_doc_in_start_center("writer"):
17 xWriterDoc = self.xUITest.getTopFocusWindow()
18 xWriterEdit = xWriterDoc.getChild("writer_edit")
20 type_text(xWriterEdit, "Test horizontal line") #write the text
22 self.xUITest.executeCommand(".uno:StyleApply?Style:string=Horizontal%20Line&FamilyName:string=ParagraphStyles") #insert horizontal line
24 with self.ui_test.execute_dialog_through_command(".uno:EditStyle", close_button="cancel") as xDialog:
25 xStyleNametxt = xDialog.getChild("name")
26 self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name
28 self.xUITest.executeCommand(".uno:Undo")
29 self.xUITest.executeCommand(".uno:Redo")
31 with self.ui_test.execute_dialog_through_command(".uno:EditStyle", close_button="cancel") as xDialog:
32 xStyleNametxt = xDialog.getChild("name")
33 self.assertEqual(get_state_as_dict(xStyleNametxt)["Text"], "Horizontal Line") #check style name
35 # vim: set shiftwidth=4 softtabstop=4 expandtab: