Update git submodules
[LibreOffice.git] / sw / qa / uitest / writer_tests2 / tdf133299.py
blobca32f251bfbb1fa34cfe57a1ab003032ce643406
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_url_for_data_file
14 class tdf133299(UITestCase):
16 def test_tdf133299(self):
17 with self.ui_test.create_doc_in_start_center("writer") as document:
18 text = document.getText()
19 cursor = text.createTextCursor()
20 textGraphic = document.createInstance('com.sun.star.text.TextGraphicObject')
21 provider = self.xContext.ServiceManager.createInstance('com.sun.star.graphic.GraphicProvider')
22 graphic = provider.queryGraphic( mkPropertyValues({"URL": get_url_for_data_file("LibreOffice.jpg")}))
23 textGraphic.Graphic = graphic
24 text.insertTextContent(cursor, textGraphic, False)
25 #select image
26 document.getCurrentController().select(document.getDrawPage()[0])
28 self.xUITest.executeCommand(".uno:Copy")
30 with self.ui_test.load_empty_file("calc") as calc_document:
32 self.xUITest.executeCommand(".uno:Paste")
34 xShape = calc_document.Sheets[0].DrawPage[0]
36 # Without the fix in place, this test would have failed with
37 # AssertionError: 'ScCellObj' != 'ScTableSheetObj'
38 self.assertEqual("ScCellObj", xShape.Anchor.ImplementationName)
40 # vim: set shiftwidth=4 softtabstop=4 expandtab: