Debian Codegraph @

sd/qa/uitest/impress_tests/slideShowSettings.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 uitest.uihelper.common import get_state_as_dict, select_pos
12
13 class slideShowSettings(UITestCase):
14 def test_slideShowSettings(self):
15 with self.ui_test.create_doc_in_start_center("impress"):
16 TemplateDialog = self.xUITest.getTopFocusWindow()
17 cancel = TemplateDialog.getChild("close")
18 self.ui_test.close_dialog_through_button(cancel)
19 self.xUITest.executeCommand(".uno:InsertPage")
20 with self.ui_test.execute_dialog_through_command(".uno:PresentationDialog") as PresentationDialog:
21
22 xfrom = PresentationDialog.getChild("from")
23 xfrom.executeAction("CLICK",tuple())
24 from_cb = PresentationDialog.getChild("from_cb")
25 select_pos(from_cb, "0")
26 window = PresentationDialog.getChild("window")
27 window.executeAction("CLICK",tuple())
28 manualslides = PresentationDialog.getChild("manualslides")
29 manualslides.executeAction("CLICK",tuple())
30 pointervisible = PresentationDialog.getChild("pointervisible")
31 pointervisible.executeAction("CLICK",tuple())
32 pointeraspen = PresentationDialog.getChild("pointeraspen")
33 pointeraspen.executeAction("CLICK",tuple())
34 animationsallowed = PresentationDialog.getChild("animationsallowed")
35 animationsallowed.executeAction("CLICK",tuple())
36 changeslidesbyclick = PresentationDialog.getChild("changeslidesbyclick")
37 changeslidesbyclick.executeAction("CLICK",tuple())
38
39 #verify
40 with self.ui_test.execute_dialog_through_command(".uno:PresentationDialog", close_button="cancel") as PresentationDialog:
41 xfrom = PresentationDialog.getChild("from")
42 self.assertEqual(get_state_as_dict(xfrom)["Checked"], "true")
43 from_cb = PresentationDialog.getChild("from_cb")
44 self.assertEqual(get_state_as_dict(from_cb)["SelectEntryText"], "Slide 1")
45 manualslides = PresentationDialog.getChild("manualslides")
46 self.assertEqual(get_state_as_dict(manualslides)["Selected"], "true")
47 pointervisible = PresentationDialog.getChild("pointervisible")
48 self.assertEqual(get_state_as_dict(pointervisible)["Selected"], "true")
49 pointeraspen = PresentationDialog.getChild("pointeraspen")
50 self.assertEqual(get_state_as_dict(pointeraspen)["Selected"], "true")
51 animationsallowed = PresentationDialog.getChild("animationsallowed")
52 self.assertEqual(get_state_as_dict(animationsallowed)["Selected"], "false")
53 changeslidesbyclick = PresentationDialog.getChild("changeslidesbyclick")
54 self.assertEqual(get_state_as_dict(changeslidesbyclick)["Selected"], "false")
55
56
57
58 # vim: set shiftwidth=4 softtabstop=4 expandtab: