| 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 select_pos |
| 12 |
from com.sun.star.awt.GradientStyle import LINEAR |
| 13 |
|
| 14 |
class tdf125449(UITestCase): |
| 15 |
|
| 16 |
def test_tdf125449(self): |
| 17 |
|
| 18 |
with self.ui_test.create_doc_in_start_center("impress") as document: |
| 19 |
|
| 20 |
xTemplateDlg = self.xUITest.getTopFocusWindow() |
| 21 |
xCancelBtn = xTemplateDlg.getChild("close") |
| 22 |
self.ui_test.close_dialog_through_button(xCancelBtn) |
| 23 |
|
| 24 |
with self.ui_test.execute_dialog_through_command(".uno:PageSetup") as xPageSetupDlg: |
| 25 |
|
| 26 |
tabcontrol = xPageSetupDlg.getChild("tabcontrol") |
| 27 |
select_pos(tabcontrol, "1") |
| 28 |
|
| 29 |
xBtn = xPageSetupDlg.getChild('btngradient') |
| 30 |
xBtn.executeAction("CLICK", tuple()) |
| 31 |
|
| 32 |
xAngle = xPageSetupDlg.getChild('anglemtr') |
| 33 |
xAngle.executeAction("UP", tuple()) |
| 34 |
|
| 35 |
|
| 36 |
self.assertEqual( |
| 37 |
document.DrawPages[0].Background.FillGradient.Style, LINEAR) |
| 38 |
self.assertEqual( |
| 39 |
hex(document.DrawPages[0].Background.FillGradient.StartColor), '0xdde8cb') |
| 40 |
self.assertEqual( |
| 41 |
document.DrawPages[0].Background.FillGradient.Angle, 450) |
| 42 |
self.assertEqual( |
| 43 |
document.DrawPages[0].Background.FillGradient.Border, 0) |
| 44 |
self.assertEqual( |
| 45 |
document.DrawPages[0].Background.FillGradient.XOffset, 0) |
| 46 |
self.assertEqual( |
| 47 |
document.DrawPages[0].Background.FillGradient.YOffset, 0) |
| 48 |
self.assertEqual( |
| 49 |
document.DrawPages[0].Background.FillGradient.StartIntensity, 100) |
| 50 |
self.assertEqual( |
| 51 |
document.DrawPages[0].Background.FillGradient.EndIntensity, 100) |
| 52 |
|
| 53 |
# Without the patch in place, this test would have failed with |
| 54 |
# AssertionError: '' != 'gradient' |
| 55 |
self.assertEqual( |
| 56 |
document.DrawPages[0].Background.FillGradientName, 'gradient') |
| 57 |
|
| 58 |
|
| 59 |
# vim: set shiftwidth=4 softtabstop=4 expandtab: |