docthemes: Save themes def. to a file when added to ColorSets
[LibreOffice.git] / sd / qa / uitest / impress_tests2 / tdf106612.py
blob6ca8fbbaf55903ba959d9ee64f64b9be8d38c5e2
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 class Tdf106612(UITestCase):
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)
22 xImpressDoc = self.xUITest.getTopFocusWindow()
24 xEditWin = xImpressDoc.getChild("impress_win")
26 self.xUITest.executeCommand(".uno:DuplicatePage")
28 self.assertEqual("2", get_state_as_dict(xEditWin)["CurrentSlide"])
30 xEditWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SdNavigatorPanel"}))
32 xTree = xImpressDoc.getChild("tree")
33 self.assertEqual(2, len(xTree.getChildren()))
35 self.assertEqual("Slide 1", get_state_as_dict(xTree.getChild('0'))['Text'])
36 self.assertEqual(2, len(xTree.getChild('0').getChildren()))
38 self.assertEqual("Slide 2", get_state_as_dict(xTree.getChild('1'))['Text'])
39 self.assertEqual(2, len(xTree.getChild('1').getChildren()))
41 xTree.getChild('0').executeAction("DOUBLECLICK", tuple())
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"])
47 # vim: set shiftwidth=4 softtabstop=4 expandtab: