| 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 |
from uitest.framework import UITestCase |
| 10 |
from libreoffice.uno.propertyvalue import mkPropertyValues |
| 11 |
from uitest.uihelper.common import get_url_for_data_file |
| 12 |
from libreoffice.calc.document import get_cell_by_position |
| 13 |
|
| 14 |
class EmbeddedDocument(UITestCase): |
| 15 |
|
| 16 |
def test_open_embedded_document(self): |
| 17 |
with self.ui_test.load_file(get_url_for_data_file("embedded.pptx")): |
| 18 |
|
| 19 |
xImpressDoc = self.xUITest.getTopFocusWindow() |
| 20 |
xEditWin = xImpressDoc.getChild("impress_win") |
| 21 |
|
| 22 |
xEditWin.executeAction("SELECT", mkPropertyValues({"OBJECT":"Object 2"})) |
| 23 |
|
| 24 |
xEditWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) |
| 25 |
|
| 26 |
document = self.ui_test.get_component() |
| 27 |
self.assertEqual("Name", get_cell_by_position(document, 0, 0, 0).getString()) |
| 28 |
self.assertEqual("NWell", get_cell_by_position(document, 0, 0, 1).getString()) |
| 29 |
self.assertEqual("PWell", get_cell_by_position(document, 0, 0, 2).getString()) |
| 30 |
self.assertEqual("Active", get_cell_by_position(document, 0, 0, 3).getString()) |
| 31 |
self.assertEqual("NoPoly", get_cell_by_position(document, 0, 0, 4).getString()) |
| 32 |
self.assertEqual("Poly", get_cell_by_position(document, 0, 0, 5).getString()) |
| 33 |
self.assertEqual("Sized", get_cell_by_position(document, 0, 0, 6).getString()) |
| 34 |
|
| 35 |
self.xUITest.executeCommand(".uno:CloseDoc") |
| 36 |
|
| 37 |
# vim: set shiftwidth=4 softtabstop=4 expandtab: |