[Libreoffice-commits] core.git: uitest/writer_tests

Xisco Fauli anistenis at gmail.com
Thu Jun 15 18:01:40 UTC 2017


 uitest/writer_tests/pageDialog.py |   35 +++++++++++++++++++++++++++++++----
 1 file changed, 31 insertions(+), 4 deletions(-)

New commits:
commit 134effd2494132495d0adb5453b8ddd9f803704e
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Thu Jun 15 17:32:58 2017 +0200

    uitest: test page orientation
    
    Change-Id: I265730664cf7dfb1d4a105023ae1e3b4c1fca4f5
    Reviewed-on: https://gerrit.libreoffice.org/38838
    Reviewed-by: Xisco FaulĂ­ <xiscofauli at libreoffice.org>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/uitest/writer_tests/pageDialog.py b/uitest/writer_tests/pageDialog.py
index 88145e7a1b23..0845778d54a7 100644
--- a/uitest/writer_tests/pageDialog.py
+++ b/uitest/writer_tests/pageDialog.py
@@ -5,7 +5,7 @@
 #
 
 from uitest.framework import UITestCase
-from uitest.uihelper.common import select_pos
+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
@@ -14,8 +14,6 @@ from com.sun.star.drawing.RectanglePoint import MIDDLE_MIDDLE
 
 from libreoffice.uno.propertyvalue import mkPropertyValues
 
-from uitest.uihelper.common import get_state_as_dict
-
 class WriterPageDialog(UITestCase):
 
     def launch_dialog_and_select_tab(self, tab):
@@ -149,7 +147,7 @@ class WriterPageDialog(UITestCase):
 
         self.ui_test.close_doc()
 
-    def test_page_tab(self):
+    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",
@@ -173,4 +171,33 @@ class WriterPageDialog(UITestCase):
 
         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()
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list