summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-03-10 11:41:25 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-03-10 13:10:04 +0100
commit5a348c9881c1574604d0e6dcb9ea4fbfebcc7e21 (patch)
tree3d9d70d09474ed2d64160bb1ab06b58d99d7cbbf /uitest
parentb8e3c05261b0658fcb27c3cc12c7c0646e5aa983 (diff)
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/math_tests/start.py55
1 files changed, 13 insertions, 42 deletions
diff --git a/uitest/math_tests/start.py b/uitest/math_tests/start.py
index 13d26641b0a6..08914f9954eb 100644
--- a/uitest/math_tests/start.py
+++ b/uitest/math_tests/start.py
@@ -15,52 +15,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"):
@@ -70,19 +41,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: