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 libreoffice
.uno
.propertyvalue
import mkPropertyValues
12 from uitest
.framework
import UITestCase
13 from uitest
.uihelper
.common
import get_state_as_dict
15 class SimpleWriterTest(UITestCase
):
17 def test_start_writer(self
):
19 with self
.ui_test
.create_doc_in_start_center("writer"):
21 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
23 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
25 xWriterEdit
.executeAction("SET", mkPropertyValues({"ZOOM": "200"}))
27 self
.assertEqual(get_state_as_dict(xWriterEdit
)["Zoom"], "200")
30 def test_goto_first_page(self
):
32 with self
.ui_test
.create_doc_in_start_center("writer"):
34 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
35 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
37 state
= get_state_as_dict(xWriterEdit
)
38 while state
["CurrentPage"] == "1":
39 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
40 state
= get_state_as_dict(xWriterEdit
)
42 self
.assertEqual(get_state_as_dict(xWriterEdit
)["CurrentPage"], "2")
44 xWriterEdit
.executeAction("GOTO", mkPropertyValues({"PAGE": "1"}))
46 self
.assertEqual(get_state_as_dict(xWriterEdit
)["CurrentPage"], "1")
49 # vim: set shiftwidth=4 softtabstop=4 expandtab: