| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
from uitest.framework import UITestCase |
| 10 |
from uitest.uihelper.common import get_url_for_data_file |
| 11 |
from uitest.uihelper.common import select_pos |
| 12 |
|
| 13 |
class tdf142785(UITestCase): |
| 14 |
def test_tdf142785(self): |
| 15 |
|
| 16 |
with self.ui_test.load_file(get_url_for_data_file("tdf142785.docx")) as document: |
| 17 |
|
| 18 |
sHeader = "ODD ODD ODD ODD ODD header" |
| 19 |
sFooter = "ODD ODD ODD ODD ODD footer" |
| 20 |
|
| 21 |
xStandardStyle = document.StyleFamilies.PageStyles.Standard |
| 22 |
self.assertEqual(sHeader, xStandardStyle.HeaderText.String) |
| 23 |
self.assertEqual(sHeader, xStandardStyle.HeaderTextFirst.String) |
| 24 |
self.assertEqual(sHeader, xStandardStyle.HeaderTextLeft.String) |
| 25 |
self.assertEqual(sHeader, xStandardStyle.HeaderTextRight.String) |
| 26 |
|
| 27 |
self.assertEqual(sFooter, xStandardStyle.FooterText.String) |
| 28 |
self.assertEqual(sFooter, xStandardStyle.FooterTextFirst.String) |
| 29 |
self.assertEqual(sFooter, xStandardStyle.FooterTextLeft.String) |
| 30 |
self.assertEqual(sFooter, xStandardStyle.FooterTextRight.String) |
| 31 |
|
| 32 |
with self.ui_test.execute_dialog_through_command(".uno:PageStyleName") as xDialog: |
| 33 |
xTabs = xDialog.getChild("tabcontrol") |
| 34 |
select_pos(xTabs, "4") |
| 35 |
checkSameLR = xDialog.getChild("checkSameLR-header") |
| 36 |
checkSameLR.executeAction("CLICK",tuple()) |
| 37 |
|
| 38 |
self.assertEqual(sHeader, xStandardStyle.HeaderText.String) |
| 39 |
self.assertEqual(sHeader, xStandardStyle.HeaderTextFirst.String) |
| 40 |
self.assertEqual("EVEN EVEN EVEN EVEN EVEN header", xStandardStyle.HeaderTextLeft.String) |
| 41 |
self.assertEqual(sHeader, xStandardStyle.HeaderTextRight.String) |
| 42 |
|
| 43 |
self.assertEqual(sFooter, xStandardStyle.FooterText.String) |
| 44 |
self.assertEqual(sFooter, xStandardStyle.FooterTextFirst.String) |
| 45 |
self.assertEqual(sFooter, xStandardStyle.FooterTextLeft.String) |
| 46 |
self.assertEqual(sFooter, xStandardStyle.FooterTextRight.String) |
| 47 |
|
| 48 |
with self.ui_test.execute_dialog_through_command(".uno:PageStyleName") as xDialog: |
| 49 |
xTabs = xDialog.getChild("tabcontrol") |
| 50 |
select_pos(xTabs, "5") |
| 51 |
checkSameLR = xDialog.getChild("checkSameLR-footer") |
| 52 |
checkSameLR.executeAction("CLICK",tuple()) |
| 53 |
|
| 54 |
self.assertEqual(sHeader, xStandardStyle.HeaderText.String) |
| 55 |
self.assertEqual(sHeader, xStandardStyle.HeaderTextFirst.String) |
| 56 |
self.assertEqual("EVEN EVEN EVEN EVEN EVEN header", xStandardStyle.HeaderTextLeft.String) |
| 57 |
self.assertEqual(sHeader, xStandardStyle.HeaderTextRight.String) |
| 58 |
|
| 59 |
self.assertEqual(sFooter, xStandardStyle.FooterText.String) |
| 60 |
self.assertEqual(sFooter, xStandardStyle.FooterTextFirst.String) |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
self.assertEqual("EVEN EVEN EVEN EVEN EVEN footer", xStandardStyle.FooterTextLeft.String) |
| 65 |
self.assertEqual(sFooter, xStandardStyle.FooterTextRight.String) |
| 66 |
|
| 67 |
|