1# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
2#
3# This Source Code Form is subject to the terms of the Mozilla Public
4# License, v. 2.0. If a copy of the MPL was not distributed with this
5# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6#
7
8from libreoffice.uno.propertyvalue import mkPropertyValues
9
10from uitest.uihelper.calc import enter_text_to_cell
11
12from uitest.framework import UITestCase
13
14class GridWindowTest(UITestCase):
15
16    def test_input(self):
17
18        self.ui_test.create_doc_in_start_center("calc")
19        xTopWindow = self.xUITest.getTopFocusWindow()
20
21        xGridWindow = xTopWindow.getChild("grid_window")
22
23        enter_text_to_cell(xGridWindow, "C3", "=A1")
24        enter_text_to_cell(xGridWindow, "A1", "2")
25
26        self.ui_test.close_doc()
27
28    def test_special_keys(self):
29
30        self.ui_test.create_doc_in_start_center("calc")
31        xTopWindow = self.xUITest.getTopFocusWindow()
32
33        xGridWindow = xTopWindow.getChild("grid_window")
34
35        selectProps = mkPropertyValues({"CELL": "C3"})
36        xGridWindow.executeAction("SELECT", selectProps)
37
38        typeProps = mkPropertyValues({"KEYCODE": "CTRL+DOWN"})
39        xGridWindow.executeAction("TYPE", typeProps)
40
41        self.ui_test.close_doc()
42
43# vim: set shiftwidth=4 softtabstop=4 expandtab:
44