Debian Codegraph @

sd/qa/uitest/impress_tests2/tdf106612.py

raw
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 libreoffice.uno.propertyvalue import mkPropertyValues
12 from uitest.uihelper.common import get_state_as_dict
13
14 class Tdf106612(UITestCase):
15
16 def test_tdf106612(self):
17 with self.ui_test.create_doc_in_start_center("impress"):
18 xTemplateDlg = self.xUITest.getTopFocusWindow()
19 xCancelBtn = xTemplateDlg.getChild("close")
20 self.ui_test.close_dialog_through_button(xCancelBtn)
21
22 xImpressDoc = self.xUITest.getTopFocusWindow()
23
24 xEditWin = xImpressDoc.getChild("impress_win")
25
26 self.xUITest.executeCommand(".uno:DuplicatePage")
27
28 self.assertEqual("2", get_state_as_dict(xEditWin)["CurrentSlide"])
29
30 xEditWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SdNavigatorPanel"}))
31
32 xTree = xImpressDoc.getChild("tree")
33 self.assertEqual(2, len(xTree.getChildren()))
34
35 self.assertEqual("Slide 1", get_state_as_dict(xTree.getChild('0'))['Text'])
36 self.assertEqual(2, len(xTree.getChild('0').getChildren()))
37
38 self.assertEqual("Slide 2", get_state_as_dict(xTree.getChild('1'))['Text'])
39 self.assertEqual(2, len(xTree.getChild('1').getChildren()))
40
41 xTree.getChild('0').executeAction("DOUBLECLICK", tuple())
42
43 # Without the fix in place, this test would have failed with
44 # AssertionError: '1' != '2'
45 self.assertEqual("1", get_state_as_dict(xEditWin)["CurrentSlide"])
46
47 # vim: set shiftwidth=4 softtabstop=4 expandtab: