diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-26 20:05:24 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-27 00:32:58 +0100 |
commit | f27c4ec5c864395f4cdaec32d7e95ff24e4f43c8 (patch) | |
tree | 032e27b19235f1bd5f8e514bd555ce8b764e5959 /uitest | |
parent | 879f847d9d6ef5a165f660c55f2070f4b207512b (diff) |
uitest: sw: forgot to move this file
Change-Id: I429e6ff82cb28bea0c700a7d382509a524aad57d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104827
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/writer_tests1/pageDialog.py | 239 |
1 files changed, 0 insertions, 239 deletions
diff --git a/uitest/writer_tests1/pageDialog.py b/uitest/writer_tests1/pageDialog.py deleted file mode 100644 index 73e523444c6e..000000000000 --- a/uitest/writer_tests1/pageDialog.py +++ /dev/null @@ -1,239 +0,0 @@ -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -from uitest.framework import UITestCase -from uitest.uihelper.common import select_pos, get_state_as_dict -from com.sun.star.uno import RuntimeException -from com.sun.star.awt.GradientStyle import LINEAR -from com.sun.star.drawing.HatchStyle import SINGLE -from com.sun.star.drawing.BitmapMode import REPEAT -from com.sun.star.drawing.RectanglePoint import MIDDLE_MIDDLE - -from libreoffice.uno.propertyvalue import mkPropertyValues - -class WriterPageDialog(UITestCase): - - def launch_dialog_and_select_tab(self, tab): - self.ui_test.execute_dialog_through_command(".uno:PageDialog") - - xDialog = self.xUITest.getTopFocusWindow() - tabcontrol = xDialog.getChild("tabcontrol") - select_pos(tabcontrol, str(tab)) - - return xDialog - - def click_button(self, dialog, button): - xButton = dialog.getChild(button) - xButton.executeAction("CLICK", tuple()) - - def check_default_area(self, btn): - document = self.ui_test.get_component() - if btn == 'btnnone': - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.BackColor, -1) - elif btn == 'btncolor': - self.assertEqual( - hex(document.StyleFamilies.PageStyles.Standard.BackColor), '0x729fcf') - self.assertEqual( - hex(document.StyleFamilies.PageStyles.Standard.FillColor), '0x729fcf') - self.assertEqual( - hex(document.StyleFamilies.PageStyles.Standard.FillColor), '0x729fcf') - elif btn == 'btngradient': - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillGradient.Style, LINEAR) - self.assertEqual( - hex(document.StyleFamilies.PageStyles.Standard.FillGradient.StartColor), '0xdde8cb') - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillGradient.Angle, 300) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillGradient.Border, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillGradient.XOffset, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillGradient.YOffset, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillGradient.StartIntensity, 100) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillGradient.EndIntensity, 100) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillGradientName, 'Pastel Bouquet') - elif btn == 'btnhatch': - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillHatch.Style, SINGLE ) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillHatch.Color, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillHatch.Distance, 102) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillHatch.Angle, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillHatchName, 'Black 0 Degrees') - elif btn == 'btnbitmap': - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapMode, REPEAT) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapPositionOffsetX, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapPositionOffsetY, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapRectanglePoint, MIDDLE_MIDDLE) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapStretch, False) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapTile, True) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapOffsetX, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapOffsetY, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapLogicalSize, True) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapSizeX, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapSizeY, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapName, 'Painted White') - elif btn == 'btnpattern': - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapMode, REPEAT) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapPositionOffsetX, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapPositionOffsetY, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapRectanglePoint, MIDDLE_MIDDLE) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapStretch, False) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapTile, True) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapOffsetX, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapOffsetY, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapLogicalSize, True) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapSizeX, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapSizeY, 0) - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.FillBitmapName, '5 Percent') - - def test_area_tab(self): - - self.ui_test.create_doc_in_start_center("writer") - - buttons = ['btnbitmap', 'btncolor', 'btngradient', 'btnhatch', 'btnpattern'] - for index, button in enumerate(buttons): - - xDialog = self.launch_dialog_and_select_tab(2) - - self.click_button(xDialog, button) - - self.click_button(xDialog, 'ok') - - self.check_default_area(button) - - xDialog = self.launch_dialog_and_select_tab(2) - - self.click_button(xDialog, 'btnnone') - - self.click_button(xDialog, 'ok') - - self.check_default_area('btnnone') - - self.ui_test.close_doc() - - def test_paper_format(self): - - lPaperFormat = ["A6", "A5", "A4", "A3", "B6 (ISO)", "B5 (ISO)", "B4 (ISO)", "Letter", - "Legal", "Long Bond", "Tabloid", "B6 (JIS)", "B5 (JIS)", "B4 (JIS)", "16 Kai", - "32 Kai", "Big 32 Kai", "User", "DL Envelope", "C6 Envelope", "C6/5 Envelope", - "C5 Envelope", "C4 Envelope", "#6¾ Envelope", "#7¾ (Monarch) Envelope", - "#9 Envelope", "#10 Envelope", "#11 Envelope", "#12 Envelope", "Japanese Postcard"] - - self.ui_test.create_doc_in_start_center("writer") - - for i in range(30): - with self.subTest(i=i): - xDialog = self.launch_dialog_and_select_tab(1) - - xFormatList = xDialog.getChild("comboPageFormat") - select_pos(xFormatList, str(i)) - - self.assertEqual( - get_state_as_dict(xFormatList)["SelectEntryText"], lPaperFormat[i]) - - self.click_button(xDialog, 'ok') - - self.ui_test.close_doc() - - def test_orientation(self): - - self.ui_test.create_doc_in_start_center("writer") - - document = self.ui_test.get_component() - - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.IsLandscape, False) - - xDialog = self.launch_dialog_and_select_tab(1) - - self.click_button(xDialog, 'radiobuttonLandscape') - - self.click_button(xDialog, 'ok') - - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.IsLandscape, True) - - xDialog = self.launch_dialog_and_select_tab(1) - - self.click_button(xDialog, 'radiobuttonPortrait') - - self.click_button(xDialog, 'ok') - - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.IsLandscape, False) - - self.ui_test.close_doc() - - def test_text_direction(self): - - lTextDirection = ['Left-to-right (horizontal)', 'Right-to-left (horizontal)', - 'Right-to-left (vertical)', 'Left-to-right (vertical)'] - - self.ui_test.create_doc_in_start_center("writer") - - document = self.ui_test.get_component() - - for i in range(4): - with self.subTest(i=i): - xDialog = self.launch_dialog_and_select_tab(1) - - xTextDirectionList = xDialog.getChild("comboTextFlowBox") - select_pos(xTextDirectionList, str(i)) - - self.assertEqual( - get_state_as_dict(xTextDirectionList)["SelectEntryText"], lTextDirection[i]) - - self.click_button(xDialog, 'ok') - - self.assertEqual( - document.StyleFamilies.PageStyles.Standard.WritingMode, i) - - self.ui_test.close_doc() - - def test_cancel_button_page_dialog(self): - self.ui_test.create_doc_in_start_center("writer") - - self.ui_test.execute_dialog_through_command(".uno:PageDialog") - xDialog = self.xUITest.getTopFocusWindow() - xCancelBtn = xDialog.getChild("cancel") - self.ui_test.close_dialog_through_button(xCancelBtn) - - self.ui_test.close_doc() - -# vim: set shiftwidth=4 softtabstop=4 expandtab: |