uitest/math_tests/start.py |   55 ++++++++++-----------------------------------
 1 file changed, 13 insertions(+), 42 deletions(-)

New commits:
commit addd7c3d63f8d6c6c45c91436170f37a3e3b2609
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Mar 10 11:41:25 2022 +0100
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Jun 5 07:55:10 2022 +0200

    uitest: math: at least execute the test on linux
    
    besides, fix it and remove duplicated tests
    
    Change-Id: I15c6696c6cdd1c7e03647e105d8caf268555018a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131310
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135420
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/uitest/math_tests/start.py b/uitest/math_tests/start.py
index 4645dff920da..215d97b68bdb 100644
--- a/uitest/math_tests/start.py
+++ b/uitest/math_tests/start.py
@@ -13,52 +13,23 @@ from uitest.framework import UITestCase
 from uitest.uihelper.common import type_text, select_pos
 
 import unittest
+import platform
 
 class SimpleMathTest(UITestCase):
 
-    def test_start_math(self):
-
-        with self.ui_test.create_doc_in_start_center("math"):
-
-            xMathDoc = self.xUITest.getTopFocusWindow()
-
-
-    def test_docking_window_listbox(self):
-
-        with self.ui_test.create_doc_in_start_center("math"):
-
-            xMathDoc = self.xUITest.getTopFocusWindow()
-
-            xList = xMathDoc.getChild("listbox")
-            state = get_state_as_dict(xList)
-            self.assertEqual(state["SelectEntryText"], "Unary/Binary 
Operators")
-            select_pos(xList, "1")
-            state = get_state_as_dict(xList)
-            self.assertEqual(state["SelectEntryText"], "Relations")
-
-
     def test_math_edit(self):
         with self.ui_test.create_doc_in_start_center("math"):
 
             xMathDoc = self.xUITest.getTopFocusWindow()
 
-            xMathEdit = xMathDoc.getChild("math_edit")
-
-            type_text(xMathEdit, "E=mc^2")
-
-
-    def test_math_selector(self):
-        with self.ui_test.create_doc_in_start_center("math"):
-
-            xMathDoc = self.xUITest.getTopFocusWindow()
-
-            xMathSelector = xMathDoc.getChild("element_selector")
+            xEditView = xMathDoc.getChild("editview")
 
-            xElement = xMathSelector.getChild("1")
-            xElement.executeAction("SELECT", tuple())
+            type_text(xEditView, "E=mc^2")
+            xMathEdit = xMathDoc.getChild("editview")
 
+            self.assertEqual("E=mc^2", get_state_as_dict(xEditView)["Text"])
 
-    @unittest.skip("on windows the f4 does not always work")
+    @unittest.skipIf(platform.system() == "Windows", "on windows the f4 does 
not always work")
     def test_complete_math(self):
         with self.ui_test.create_doc_in_start_center("math"):
 
@@ -68,19 +39,19 @@ class SimpleMathTest(UITestCase):
             state = get_state_as_dict(xList)
             self.assertEqual(state["SelectEntryText"], "Unary/Binary 
Operators")
             select_pos(xList, "1")
+            state = get_state_as_dict(xList)
+            self.assertEqual(state["SelectEntryText"], "Relations")
 
             xMathSelector = xMathDoc.getChild("element_selector")
 
             xElement = xMathSelector.getChild("1")
             xElement.executeAction("SELECT", tuple())
 
-            xMathEdit = xMathDoc.getChild("math_edit")
-            type_text(xMathEdit, "1")
-            xMathEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE":"F4"}))
-            type_text(xMathEdit, "2")
-
-            edit_state = get_state_as_dict(xMathEdit)
-            self.assertEqual("1 <> 2 ", edit_state["Text"])
+            xEditView = xMathDoc.getChild("editview")
+            type_text(xEditView, "1")
+            xEditView.executeAction("TYPE", mkPropertyValues({"KEYCODE":"F4"}))
+            type_text(xEditView, "2")
 
+            self.assertEqual("1 <> 2 ", get_state_as_dict(xEditView)["Text"])
 
 # vim: set shiftwidth=4 softtabstop=4 expandtab:

Reply via email to