Debian Codegraph @

sw/qa/uitest/writer_tests5/tdf122722.py

raw symbols SCIP
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
2 #
3 # This file is part of the LibreOffice project.
4 #
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/.
8 #
9
10 from uitest.framework import UITestCase
11 from uitest.uihelper.common import get_state_as_dict, type_text
12 from uitest.uihelper.common import select_pos
13
14 #Bug 122722 - Hiding characters will crash. Crash in: SwAttrIter::CtorInitAttrIter(SwTextNode &,SwScriptInfo &,SwTextFrame const *)
15
16 class tdf122722(UITestCase):
17 def test_tdf122722_format_character_hidden(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 #1. Start LibreOffice
22 #2. Create New Writer Document
23 #3. Type "LibreOffice" in Writer
24 type_text(xWriterEdit, "LibreOffice")
25 #4. Select "LibreOffice" with mouse, and right click
26 self.xUITest.executeCommand(".uno:SelectAll")
27 self.assertEqual(document.Text.String[0:11], "LibreOffice")
28 #5. Appear Context Menu, Character -> Character
29 #6. Opened Character, Select "Font Effect" tab
30 #7. Check Hidden, and click [OK]
31 #8. Crash a LibreOffice
32 with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
33 xTabs = xDialog.getChild("tabcontrol")
34 select_pos(xTabs, "1")
35
36 xHidden = xDialog.getChild("hiddencb")
37
38 xHidden.executeAction("CLICK", tuple())
39
40 #un-hidden
41 with self.ui_test.execute_dialog_through_command(".uno:FontDialog") as xDialog:
42 xTabs = xDialog.getChild("tabcontrol")
43 select_pos(xTabs, "1")
44
45 xHidden = xDialog.getChild("hiddencb")
46
47 self.assertEqual(get_state_as_dict(xHidden)["Selected"], "true")
48 xHidden.executeAction("CLICK", tuple())
49
50
51 self.assertEqual(document.Text.String[0:11], "LibreOffice")
52
53 # vim: set shiftwidth=4 softtabstop=4 expandtab: